diff options
| author | Miles Bader | 2006-02-22 06:54:10 +0000 |
|---|---|---|
| committer | Miles Bader | 2006-02-22 06:54:10 +0000 |
| commit | b434f199dbbc2694a69538ee95e5e583f6357f71 (patch) | |
| tree | ea87d2540063659d9cfdb24462bb4c0336a6ec47 /lisp | |
| parent | 9d826e0eaf8a4e2f1cf5aac74d6b02ccc393af8d (diff) | |
| parent | a1b24e137f75b9f5fdbd5526947a70c462c5e5bf (diff) | |
| download | emacs-b434f199dbbc2694a69538ee95e5e583f6357f71.tar.gz emacs-b434f199dbbc2694a69538ee95e5e583f6357f71.zip | |
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-21
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 97-112)
- Update from CVS
- Merge from erc--emacs--0
- Update from CVS: src/regex.c (extend_range_table_work_area): Fix typo.
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 37)
- Update from CVS
Diffstat (limited to 'lisp')
52 files changed, 2135 insertions, 1374 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0b7945e007..6b91115cd67 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,8 +1,388 @@ | |||
| 1 | 2006-02-21 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/sh-script.el (sh-mode): Set shell type based on file name | ||
| 4 | if there's no other specific basis. | ||
| 5 | |||
| 6 | * emacs-lisp/unsafep.el (unsafep): Don't treat &rest or &optional | ||
| 7 | as variables at all. | ||
| 8 | (unsafep-variable): Rename arg; doc fix. | ||
| 9 | |||
| 10 | * abbrevlist.el (list-one-abbrev-table): Add autoload. | ||
| 11 | |||
| 12 | * calendar/appt.el (diary-selective-display): Add defvar. | ||
| 13 | |||
| 14 | * sort.el (sort-columns): Use Posix arg syntax for `sort'. | ||
| 15 | |||
| 16 | * isearch.el (search-whitespace-regexp): Fix custom type. | ||
| 17 | |||
| 18 | * help.el (describe-key-briefly): Compute interactive args | ||
| 19 | in same was as before previous change. | ||
| 20 | |||
| 21 | * files.el (enable-local-variables): Doc fix. | ||
| 22 | |||
| 23 | 2006-02-21 Kim F. Storm <storm@cua.dk> | ||
| 24 | |||
| 25 | * fringe.el: Cleanup as file is now pre-loaded. | ||
| 26 | (fringe-bitmaps): Initialize unconditionally. | ||
| 27 | (fringe-mode, set-fringe-style): Remove autoload cookies. | ||
| 28 | |||
| 29 | 2006-02-21 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) | ||
| 30 | |||
| 31 | * fringe.el (fringe-bitmaps): Rename `horisontal-bar' to | ||
| 32 | `horizontal-bar'. | ||
| 33 | (fringe-cursor-alist): Use `horizontal-bar'. | ||
| 34 | |||
| 35 | 2006-02-20 Kim F. Storm <storm@cua.dk> | ||
| 36 | |||
| 37 | * fringe.el (fringe-bitmaps): Update to new bitmap names. | ||
| 38 | (fringe-indicator-alist, fringe-cursor-alist): Initialize. | ||
| 39 | |||
| 40 | * loadup.el: Load "fringe" on window systems. | ||
| 41 | |||
| 42 | 2006-02-20 Nick Roberts <nickrob@snap.net.nz> | ||
| 43 | |||
| 44 | * progmodes/gud.el (gud-speedbar-buttons): Use shadow face for all | ||
| 45 | out of scope components. | ||
| 46 | |||
| 47 | * progmodes/gdb-ui.el (gdb-speedbar-auto-raise): Don't enable by | ||
| 48 | default. | ||
| 49 | |||
| 50 | 2006-02-20 Chong Yidong <cyd@stupidchicken.com> | ||
| 51 | |||
| 52 | * custom.el (customize-mark-to-save, customize-mark-as-set): Load | ||
| 53 | the symbol first. | ||
| 54 | |||
| 55 | 2006-02-20 Juanma Barranquero <lekktu@gmail.com> | ||
| 56 | |||
| 57 | * buff-menu.el (list-buffers-noselect): Turn also "\n" into a | ||
| 58 | strech spec so it doesn't display as "^J" on the header line | ||
| 59 | when `Buffer-menu-use-header-line' is t. | ||
| 60 | |||
| 61 | 2006-02-20 Nick Roberts <nickrob@snap.net.nz> | ||
| 62 | |||
| 63 | * speedbar.el (speedbar-make-button): Keep text properties | ||
| 64 | of string arguments if desired. | ||
| 65 | |||
| 66 | * progmodes/gud.el (gud-speedbar-buttons): Fontify watch | ||
| 67 | expessions. | ||
| 68 | |||
| 69 | * progmodes/gdb-ui.el (gdb-speedbar-expand-node): Force update | ||
| 70 | of speedbar. | ||
| 71 | |||
| 72 | 2006-02-19 Ryan Yeske <rcyeske@gmail.com> | ||
| 73 | |||
| 74 | * ffap.el (ffap-read-file-or-url): Bind `completion-ignore-case' | ||
| 75 | to value of `read-file-name-completion-ignore-case'. | ||
| 76 | |||
| 77 | 2006-02-19 Chong Yidong <cyd@stupidchicken.com> | ||
| 78 | |||
| 79 | * custom.el (customize-mark-as-set): Push to `user' theme. | ||
| 80 | |||
| 81 | * cus-edit.el (custom-save-variables): Allow unthemed values. | ||
| 82 | (customize-set-variable): Push setting to `user' theme. | ||
| 83 | |||
| 84 | 2006-02-19 Nick Roberts <nickrob@snap.net.nz> | ||
| 85 | |||
| 86 | * progmodes/gud.el: Don't require font-lock as it's now | ||
| 87 | automatically loaded. | ||
| 88 | (gud-speedbar-buttons): Replace gdb-var-changed with | ||
| 89 | gdb-force-update. | ||
| 90 | |||
| 91 | * progmodes/gdb-ui.el (gdb-force-update): Rename from | ||
| 92 | gdb-var-changed. | ||
| 93 | (gdb-post-prompt): Use it. | ||
| 94 | (gdb-var-create-handler, gdb-var-evaluate-expression-handler) | ||
| 95 | (gdb-var-update-handler, gdb-var-delete) | ||
| 96 | (gdb-speedbar-expand-node, gdb-var-list-children-handler-1) | ||
| 97 | (gdb-var-update-handler-1): Don't set gdb-var-changed, just set | ||
| 98 | gdb-force-update in gdb-post-prompt. | ||
| 99 | (gdb-reset): Clear watch expressions from speedbar when quitting. | ||
| 100 | |||
| 101 | 2006-02-19 Michael Kifer <kifer@cs.stonybrook.edu> | ||
| 102 | |||
| 103 | * viper-cmd.el (viper-insert-state-post-command-sentinel) | ||
| 104 | (viper-change-state-to-vi, viper-change-state-to-emacs): | ||
| 105 | Make aware of cursor coloring in the Emacs state. | ||
| 106 | (viper-special-read-and-insert-char): Use read-char-exclusive. | ||
| 107 | (viper-minibuffer-trim-tail): Workaround for fields in minibuffer. | ||
| 108 | |||
| 109 | * viper-init.el (viper-emacs-state-cursor-color): New variable. | ||
| 110 | |||
| 111 | * viper-util.el (viper-save-cursor-color) | ||
| 112 | (viper-get-saved-cursor-color-in-replace-mode) | ||
| 113 | (viper-get-saved-cursor-color-in-insert-mode) | ||
| 114 | (viper-restore-cursor-color): Make aware of the cursor color in Emacs | ||
| 115 | state. | ||
| 116 | (viper-get-saved-cursor-color-in-emacs-mode): New function. | ||
| 117 | |||
| 118 | * ediff-diff.el (ediff-ignore-case, ediff-ignore-case-option) | ||
| 119 | (ediff-ignore-case-option3, ediff-actual-diff-options) | ||
| 120 | (ediff-actual-diff3-options): New variables to control case sensitivity. | ||
| 121 | (ediff-make-diff2-buffer, ediff-setup-fine-diff-regions) | ||
| 122 | (ediff-setup-diff-regions3): Make aware of case-sensitivity. | ||
| 123 | (ediff-toggle-ignore-case): New function. | ||
| 124 | (ediff-extract-diffs, ediff-extract-diffs3): Preserve point in buffers. | ||
| 125 | |||
| 126 | * ediff-help.el (ediff-long-help-message-narrow2) | ||
| 127 | (ediff-long-help-message-compare2, ediff-long-help-message-compare3) | ||
| 128 | (ediff-long-help-message-word-mode): Add ignore-case command. | ||
| 129 | (ediff-help-for-quick-help): Add ignore-case command. | ||
| 130 | |||
| 131 | * ediff-merg.el: Move provide to the end. | ||
| 132 | |||
| 133 | * ediff-ptch.el: Move provide to the end. | ||
| 134 | |||
| 135 | * ediff-wind.el: Move provide to the end. | ||
| 136 | |||
| 137 | * ediff-mult.el: Move provide to the end. | ||
| 138 | (ediff-set-meta-overlay): Enable follow-link. | ||
| 139 | |||
| 140 | * ediff.el: Move provide to the end. | ||
| 141 | Break recursive load cycle in eval-when-compile. | ||
| 142 | (ediff-patch-buffer): Better heuristics. | ||
| 143 | |||
| 144 | * ediff-util.el: Move provide to the end. | ||
| 145 | Break recursive load cycle in eval-when-compile. | ||
| 146 | (ediff-setup-keymap): Add binding for #c. Replace some defsubsts with | ||
| 147 | defuns. | ||
| 148 | (ediff-submit-report): Pass the values of ediff-diff3-program, | ||
| 149 | ediff-diff3-options. | ||
| 150 | |||
| 151 | 2006-02-19 Juanma Barranquero <lekktu@gmail.com> | ||
| 152 | |||
| 153 | * help-fns.el (help-do-arg-highlight): Recognize also ARG- followed by | ||
| 154 | the opening bracket of the following bracketing pairs: {}, [], (), <>, | ||
| 155 | `' (for example, in the docstring of `windmove-default-keybindings'). | ||
| 156 | |||
| 157 | 2006-02-19 Nick Roberts <nickrob@snap.net.nz> | ||
| 158 | |||
| 159 | * progmodes/gud.el (gud-speedbar-buttons): Update properly for | ||
| 160 | shadow face. Don't provide binding to edit variable when it is | ||
| 161 | out of scope. | ||
| 162 | |||
| 163 | * progmodes/gdb-ui.el (gdb-var-evaluate-expression-handler) | ||
| 164 | (gdb-var-update-handler): Detect out of scope variables with pre | ||
| 165 | GDB 6.4 too. | ||
| 166 | (gdb-post-prompt): Revert changet 2006-02-17 (force update). | ||
| 167 | Reset status of variable objects to nil in update handlers. | ||
| 168 | (gdb-var-update-handler-1): Detect when a variable object comes | ||
| 169 | in scope. setcar on var changes gdb-var-list directly. | ||
| 170 | |||
| 171 | 2006-02-17 Juri Linkov <juri@jurta.org> | ||
| 172 | |||
| 173 | * ffap.el (ffap) <defface>: Add explicit face declaration. | ||
| 174 | (ffap-highlight): Use face `ffap' directly instead of checking | ||
| 175 | for its existence. | ||
| 176 | |||
| 177 | * icomplete.el (icomplete-get-keys): Use `t' for the second arg | ||
| 178 | `visible-ok' of `other-buffer' to find the right original buffer. | ||
| 179 | |||
| 180 | * info.el (Info-search): Skip `Local Variables' node. | ||
| 181 | |||
| 182 | 2006-02-17 Juri Linkov <juri@jurta.org> | ||
| 183 | |||
| 184 | * info.el (Info-find-file): Check for symbols `apropos', `history', | ||
| 185 | `toc' in the input filename, and return these symbols as is. | ||
| 186 | (Info-find-node-2): Set Info-current-file to symbols `apropos', | ||
| 187 | `history', `toc' instead of strings. | ||
| 188 | (Info-set-mode-line): For non-string Info-current-file use the | ||
| 189 | symbol's name inside **. | ||
| 190 | (Info-isearch-push-state): Add quote before Info-current-file and | ||
| 191 | Info-current-node. | ||
| 192 | (Info-isearch-pop-state): Use `equal' instead of `string='. | ||
| 193 | (Info-extract-pointer, Info-following-node-name): Use | ||
| 194 | `match-string-no-properties' instead of `match-string'. | ||
| 195 | (Info-up): Check `old-file' for `stringp'. | ||
| 196 | (Info-history): Use `equal' instead of `string-equal'. | ||
| 197 | Check `file' for `stringp'. | ||
| 198 | (Info-history): Use symbol `history' instead of string as first arg | ||
| 199 | of `Info-find-node'. | ||
| 200 | (Info-toc): Check `Info-current-file' for `stringp'. Use symbol | ||
| 201 | `toc' instead of string. | ||
| 202 | (Info-extract-menu-node-name): Use `buffer-substring-no-properties' | ||
| 203 | instead of `buffer-substring', and `match-string-no-properties' | ||
| 204 | instead of `match-string'. | ||
| 205 | (Info-index-nodes): Check for symbols `apropos', `history', `toc' | ||
| 206 | instead of strings. | ||
| 207 | (info-apropos): Use `Info-find-node' instead of `Info-goto-node'. | ||
| 208 | Use symbol `apropos' instead of string. | ||
| 209 | (Info-copy-current-node-name): Check `Info-current-file' for | ||
| 210 | `stringp' and construct a command with `Info-find-node' from it. | ||
| 211 | (Info-fontify-node): Use `match-string-no-properties' instead of | ||
| 212 | `match-string' and check file names for `stringp'. | ||
| 213 | (Info-desktop-buffer-misc-data): Check for symbols `apropos', | ||
| 214 | `history', `toc' instead of strings. | ||
| 215 | |||
| 216 | 2006-02-17 Chong Yidong <cyd@stupidchicken.com> | ||
| 217 | |||
| 218 | * files.el: Rearrange functions and variables in the file local | ||
| 219 | variables section. | ||
| 220 | |||
| 221 | 2006-02-17 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 222 | |||
| 223 | * files.el: Add truncate-lines, ispell-check-comments and | ||
| 224 | ispell-local-dictionary as safe local variables. | ||
| 225 | |||
| 226 | 2006-02-18 Nick Roberts <nickrob@snap.net.nz> | ||
| 227 | |||
| 228 | * progmodes/gud.el (gud-speedbar-buttons): Use shadow face for | ||
| 229 | out of scope variables. | ||
| 230 | (gud-speedbar-buttons): Use unless. | ||
| 231 | |||
| 232 | * progmodes/gdb-ui.el (gdb-var-list): Update doc string. | ||
| 233 | (gdb-init-1, gdb-var-changed): Set gdb-var-changed to t initially. | ||
| 234 | (gdb-show-changed-values): Also use for out of scope variables. | ||
| 235 | (gdb-var-update-handler-1): Note if variable goes out of scope. | ||
| 236 | |||
| 237 | 2006-02-17 Ryan Yeske <rcyeske@gmail.com> | ||
| 238 | |||
| 239 | * net/rcirc.el (rcirc-connect): Make all arguments optional, and | ||
| 240 | default to global variable values for unsupplied args. | ||
| 241 | (rcirc-get-buffer-create): Fix bug with setting the target. | ||
| 242 | (rcirc-any-buffer): Rename from rcirc-get-any-buffer, and include | ||
| 243 | test for rcirc-always-use-server-buffer-flag here. | ||
| 244 | (rcirc-response-formats): Add %N, which is a facified nick. %n | ||
| 245 | uses the default face. Change the ACTION format string. If the | ||
| 246 | "nick" is the server, don't print anything for that field. | ||
| 247 | Comment fixes. | ||
| 248 | (rcirc-target-buffer): Don't test | ||
| 249 | rcirc-always-use-server-buffer-flag here. | ||
| 250 | (rcirc-print): Squeeze extra spaces out of the text before message. | ||
| 251 | (rcirc-put-nick-channel): Strip potential "@" char from nick | ||
| 252 | before adding them to nick table. | ||
| 253 | (rcirc-url-regexp): Improve to match address like "foo.com". | ||
| 254 | |||
| 255 | 2006-02-17 Eli Zaretskii <eliz@gnu.org> | ||
| 256 | |||
| 257 | * allout.el (allout-hidden-p): Move this defsubst before | ||
| 258 | allout-overlay-interior-modification-handler, where it is first | ||
| 259 | used. | ||
| 260 | |||
| 261 | 2006-02-17 Ken Manheimer <ken.manheimer@gmail.com> | ||
| 262 | |||
| 263 | * allout.el: Use allout invisible-text overlays instead of | ||
| 264 | selective display for concealed text. Also, lots of general | ||
| 265 | cleanup, and improved compatibility code. | ||
| 266 | |||
| 267 | (allout-version) Incremented, corrected, revised, and refined | ||
| 268 | module commentary. | ||
| 269 | |||
| 270 | (provide 'allout): Moved to the bottom, added a require of overlay. | ||
| 271 | |||
| 272 | (allout-encrypt-unencrypted-on-saves): Defaults to t instead of | ||
| 273 | `except-current'. | ||
| 274 | (allout-write-file-hook-handler): Minimize delay. | ||
| 275 | (count-trailing-whitespace-region): New function so | ||
| 276 | auto-encryption of current topic can resituate cursor exactly. | ||
| 277 | PGP/GPG encryption trims trailing whitespace from lines, which | ||
| 278 | must be accounted for across encryption then decryption. | ||
| 279 | |||
| 280 | (allout-command-prefix): Now defaults to "\C-c<space>" rather than | ||
| 281 | just plain "\C-c", to avoid intruding on user's keybinding space. | ||
| 282 | |||
| 283 | (allout-toggle-current-subtree-encryption): Pass along fetch-pass | ||
| 284 | parameter, so user request to provide a new password is done. | ||
| 285 | |||
| 286 | (allout-outside-normal-auto-fill-function, allout-auto-fill): | ||
| 287 | Refined mechanism for auto-filling behavior while in allout mode. | ||
| 288 | |||
| 289 | (allout-mode): Explicitly specify the mode map in the docstring. | ||
| 290 | Clarify provision for various write-file hook var names. | ||
| 291 | Adjusted for invisible-text overlays instead of selective-display. | ||
| 292 | |||
| 293 | (allout-depth): Really return 0 if not within any topic. This | ||
| 294 | rectifies `allout-beginning-of-level' and sequence numbering | ||
| 295 | errors that occur when cutting and pasting numbered topics. | ||
| 296 | Changed from a in-line subst to a regular function, as well. | ||
| 297 | |||
| 298 | (allout-pre-next-prefix): Renamed from allout-pre-next-preface. | ||
| 299 | |||
| 300 | (allout-end-of-subtree, allout-end-of-subtree) | ||
| 301 | (allout-end-of-entry, allout-end-of-current-heading) | ||
| 302 | (allout-next-visible-heading, allout-open-topic, allout-show-entry) | ||
| 303 | (allout-show-children, allout-show-to-offshoot) | ||
| 304 | (allout-hide-current-entry, allout-show-current-entry): Rectified | ||
| 305 | handling of trailing blank lines between items. | ||
| 306 | |||
| 307 | (allout-line-boundary-regexp, set-allout-regexp, allout-depth) | ||
| 308 | (allout-current-depth, allout-unprotected, allout-hidden-p) | ||
| 309 | (allout-on-current-heading-p, allout-listify-exposed) | ||
| 310 | (allout-chart-subtree, allout-goto-prefix) | ||
| 311 | (allout-back-to-current-heading, allout-get-body-text) | ||
| 312 | (allout-snug-back, allout-flag-current-subtree, allout-show-all) | ||
| 313 | (allout-hide-region-body, allout-toggle-subtree-encryption) | ||
| 314 | (allout-encrypt-string, allout-encrypted-key-info) | ||
| 315 | (allout-next-topic-pending-encryption, allout-encrypt-decrypted) | ||
| 316 | (allout-file-vars-section-data): Adjusted for use with | ||
| 317 | invisible-text overlays instead of selective-display. | ||
| 318 | |||
| 319 | (allout-kill-line, allout-kill-topic, allout-yank-processing): | ||
| 320 | Reworked for use with invisible text overlays. | ||
| 321 | |||
| 322 | (allout-current-topic-collapsed-p): New function. | ||
| 323 | |||
| 324 | (allout-hide-current-subtree): Use allout-current-topic-collapsed-p | ||
| 325 | to know when to close the containing topic. | ||
| 326 | |||
| 327 | (allout-pre-command-business, allout-post-command-business): | ||
| 328 | Simplify undo-batching and dynamic isearch exposure. | ||
| 329 | |||
| 330 | (allout-set-overlay-category): New for invisible-text overlays. | ||
| 331 | Sets properties of allout-overlay-category, used by | ||
| 332 | allout-flag-region to set invisible-text overlay properties. | ||
| 333 | (allout-get-invisibility-overlay): Get the first qualifying | ||
| 334 | invisibility overlay, so we can find the extent of it. | ||
| 335 | (allout-back-to-visible-text): Get to just before the beginnining | ||
| 336 | of the current invisibility overlay, if any. | ||
| 337 | |||
| 338 | (allout-overlay-insert-in-front-handler) | ||
| 339 | (allout-overlay-interior-modification-handler) | ||
| 340 | (allout-before-change-handler, allout-isearch-end-handler): New | ||
| 341 | functions to handle extraordinary actions affecting concealed | ||
| 342 | text. | ||
| 343 | |||
| 344 | (allout-flag-region): Use overlays instead of selective-display | ||
| 345 | for invisible text - by inheritence from the properties of | ||
| 346 | allout-overlay-category in mainline Emacs, and applied | ||
| 347 | property-by-property in XEmacs, some recent versions of which | ||
| 348 | don't inherit the properties from the category. Provisions to | ||
| 349 | respond to concealed-text edits simplified drastically. | ||
| 350 | |||
| 351 | (allout-isearch-rectification, allout-isearch-was-font-lock) | ||
| 352 | (allout-isearch-expose, allout-enwrap-isearch) | ||
| 353 | (allout-isearch-abort, allout-pre-was-isearching) | ||
| 354 | (allout-isearch-prior-pos, allout-isearch-did-quit) | ||
| 355 | (allout-isearch-dynamic-expose) | ||
| 356 | (allout-hide-current-entry-completely): Functions deleted. | ||
| 357 | |||
| 358 | (allout-undo-aggregation): Explicit undo aggregation no longer | ||
| 359 | necessary due to transition away from selective-display. | ||
| 360 | |||
| 361 | (set-allout-regexp, allout-up-current-level) | ||
| 362 | (allout-next-visible-heading, allout-forward-current-level) | ||
| 363 | (allout-open-topic, allout-reindent-body, allout-rebullet-topic) | ||
| 364 | (allout-kill-line, allout-yank-processing, allout-show-children) | ||
| 365 | (allout-expose-topic, allout-old-expose-topic) | ||
| 366 | (allout-listify-exposed, allout-insert-latex-header) | ||
| 367 | (allout-toggle-subtree-encryption, allout-encrypt-string) | ||
| 368 | (remove-from-invisibility-spec, allout-hide-current-subtree): | ||
| 369 | Ditched unused variables. | ||
| 370 | |||
| 371 | 2006-02-17 Agustin Martin <agustin.martin@hispalinux.es> | ||
| 372 | |||
| 373 | * textmodes/ispell.el (ispell-change-dictionary): Call | ||
| 374 | ispell-buffer-local-dict instead of | ||
| 375 | ispell-accept-buffer-local-defs. | ||
| 376 | (ispell-local-dictionary-alist): Accept as valid any coding-system | ||
| 377 | supported by Emacs. | ||
| 378 | (ispell-dictionary-alist-3): Esperanto dictionary's coding system | ||
| 379 | changed to iso-8859-3. | ||
| 380 | |||
| 1 | 2006-02-17 Nick Roberts <nickrob@snap.net.nz> | 381 | 2006-02-17 Nick Roberts <nickrob@snap.net.nz> |
| 2 | 382 | ||
| 3 | * speedbar.el (speedbar-frame-width): Make an inline function | 383 | * speedbar.el (speedbar-frame-width): Make an inline function |
| 4 | instead of a macro. Use frame-width. | 384 | instead of a macro. Use frame-width. |
| 5 | (speedbar-try-completion, speedbar-update-contents) | 385 | (speedbar-try-completion, speedbar-update-contents) |
| 6 | (speedbar-timer-fn): Use consp. | 386 | (speedbar-timer-fn): Use consp. |
| 7 | (speedbar-update-localized-contents): Try to preserve point. | 387 | (speedbar-update-localized-contents): Try to preserve point. |
| 8 | 388 | ||
diff --git a/lisp/abbrevlist.el b/lisp/abbrevlist.el index bd3482f974b..d52ccffeb3c 100644 --- a/lisp/abbrevlist.el +++ b/lisp/abbrevlist.el | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | ;;; Code: | 29 | ;;; Code: |
| 30 | 30 | ||
| 31 | ;;;###autoload | ||
| 31 | (defun list-one-abbrev-table (abbrev-table output-buffer) | 32 | (defun list-one-abbrev-table (abbrev-table output-buffer) |
| 32 | "Display alphabetical listing of ABBREV-TABLE in buffer OUTPUT-BUFFER." | 33 | "Display alphabetical listing of ABBREV-TABLE in buffer OUTPUT-BUFFER." |
| 33 | (with-output-to-temp-buffer output-buffer | 34 | (with-output-to-temp-buffer output-buffer |
diff --git a/lisp/allout.el b/lisp/allout.el index 78e61dacde2..69d72506fce 100644 --- a/lisp/allout.el +++ b/lisp/allout.el | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | ;;; allout.el --- extensive outline mode for use alone and with other modes | 1 | ;;; allout.el --- extensive outline mode for use alone and with other modes |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1992, 1993, 1994, 2001, 2002, 2003, 2004, | 3 | ;; Copyright (C) 1992, 1993, 1994, 2001, 2002, 2003, 2004, |
| 4 | ;; 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2005 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Ken Manheimer <ken dot manheimer at gmail dot com> | 6 | ;; Author: Ken Manheimer <ken dot manheimer at gmail dot com> |
| 7 | ;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com> | 7 | ;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com> |
| 8 | ;; Created: Dec 1991 - first release to usenet | 8 | ;; Created: Dec 1991 - first release to usenet |
| 9 | ;; Version: 2.1 | 9 | ;; Version: 2.2 |
| 10 | ;; Keywords: outlines wp languages | 10 | ;; Keywords: outlines wp languages |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | 12 | ;; This file is part of GNU Emacs. |
| @@ -28,36 +28,39 @@ | |||
| 28 | 28 | ||
| 29 | ;;; Commentary: | 29 | ;;; Commentary: |
| 30 | 30 | ||
| 31 | ;; Allout outline mode provides extensive outline formatting and | 31 | ;; Allout outline minor mode provides extensive outline formatting and |
| 32 | ;; and manipulation beyond standard emacs outline mode. It provides | 32 | ;; and manipulation beyond standard emacs outline mode. Some features: |
| 33 | ;; for structured editing of outlines, as well as navigation and | ||
| 34 | ;; exposure. It also provides for syntax-sensitive text like | ||
| 35 | ;; programming languages. (For an example, see the allout code | ||
| 36 | ;; itself, which is organized in ;; an outline framework.) | ||
| 37 | ;; | 33 | ;; |
| 38 | ;; Some features: | 34 | ;; - Classic outline-mode topic-oriented navigation and exposure adjustment |
| 39 | ;; | 35 | ;; - Topic-oriented editing including coherent topic and subtopic |
| 40 | ;; - classic outline-mode topic-oriented navigation and exposure adjustment | 36 | ;; creation, promotion, demotion, cut/paste across depths, etc. |
| 41 | ;; - topic-oriented editing including coherent topic and subtopic | 37 | ;; - Incremental search with dynamic exposure and reconcealment of text |
| 42 | ;; creation, promotion, demotion, cut/paste across depths, etc | 38 | ;; - Customizable bullet format - enables programming-language specific |
| 43 | ;; - incremental search with dynamic exposure and reconcealment of text | 39 | ;; outlining, for code-folding editing. (Allout code itself is to try it; |
| 44 | ;; - customizable bullet format enbles programming-language specific | 40 | ;; formatted as an outline - do ESC-x eval-current-buffer in allout.el; but |
| 45 | ;; outlining, for ultimate code-folding editing. (allout code itself is | 41 | ;; emacs local file variables need to be enabled when the |
| 46 | ;; formatted as an outline - do ESC-x eval-current-buffer in allout.el | 42 | ;; file was visited - see `enable-local-variables'.) |
| 47 | ;; to try it out.) | 43 | ;; - Configurable per-file initial exposure settings |
| 48 | ;; - configurable per-file initial exposure settings | 44 | ;; - Symmetric-key and key-pair topic encryption, plus symmetric passphrase |
| 49 | ;; - symmetric-key and key-pair topic encryption, plus symmetric passphrase | ||
| 50 | ;; mnemonic support, with verification against an established passphrase | 45 | ;; mnemonic support, with verification against an established passphrase |
| 51 | ;; (using a stashed encrypted dummy string) and user-supplied hint | 46 | ;; (using a stashed encrypted dummy string) and user-supplied hint |
| 52 | ;; maintenance. (see allout-toggle-current-subtree-encryption docstring.) | 47 | ;; maintenance. (See allout-toggle-current-subtree-encryption docstring.) |
| 53 | ;; - automatic topic-number maintenance | 48 | ;; - Automatic topic-number maintenance |
| 54 | ;; - "hot-spot" operation, for single-keystroke maneuvering and | 49 | ;; - "Hot-spot" operation, for single-keystroke maneuvering and |
| 55 | ;; exposure control (see the allout-mode docstring) | 50 | ;; exposure control (see the allout-mode docstring) |
| 56 | ;; - easy rendering of exposed portions into numbered, latex, indented, etc | 51 | ;; - Easy rendering of exposed portions into numbered, latex, indented, etc |
| 57 | ;; outline styles | 52 | ;; outline styles |
| 53 | ;; - Careful attention to whitespace - enabling blank lines between items | ||
| 54 | ;; and maintenance of hanging indentation (in paragraph auto-fill and | ||
| 55 | ;; across topic promotion and demotion) of topic bodies consistent with | ||
| 56 | ;; indentation of their topic header. | ||
| 58 | ;; | 57 | ;; |
| 59 | ;; and more. | 58 | ;; and more. |
| 60 | ;; | 59 | ;; |
| 60 | ;; See the `allout-mode' function's docstring for an introduction to the | ||
| 61 | ;; mode. The development version and helpful notes are available at | ||
| 62 | ;; http://myriadicity.net/Sundry/EmacsAllout . | ||
| 63 | ;; | ||
| 61 | ;; The outline menubar additions provide quick reference to many of | 64 | ;; The outline menubar additions provide quick reference to many of |
| 62 | ;; the features, and see the docstring of the variable `allout-init' | 65 | ;; the features, and see the docstring of the variable `allout-init' |
| 63 | ;; for instructions on priming your emacs session for automatic | 66 | ;; for instructions on priming your emacs session for automatic |
| @@ -75,20 +78,18 @@ | |||
| 75 | 78 | ||
| 76 | ;;; Code: | 79 | ;;; Code: |
| 77 | 80 | ||
| 78 | ;;;_* Provide | ||
| 79 | ;(provide 'outline) | ||
| 80 | (provide 'allout) | ||
| 81 | |||
| 82 | ;;;_* Dependency autoloads | 81 | ;;;_* Dependency autoloads |
| 82 | (require 'overlay) | ||
| 83 | (eval-when-compile (progn (require 'pgg) | 83 | (eval-when-compile (progn (require 'pgg) |
| 84 | (require 'pgg-gpg) | 84 | (require 'pgg-gpg) |
| 85 | (fset 'allout-real-isearch-abort | 85 | (require 'overlay) |
| 86 | (symbol-function 'isearch-abort)) | ||
| 87 | )) | 86 | )) |
| 88 | (autoload 'pgg-gpg-symmetric-key-p "pgg-gpg" | 87 | (autoload 'pgg-gpg-symmetric-key-p "pgg-gpg" |
| 89 | "True if decoded armor MESSAGE-KEYS has symmetric encryption indicator.") | 88 | "True if decoded armor MESSAGE-KEYS has symmetric encryption indicator.") |
| 90 | 89 | ||
| 91 | ;;;_* USER CUSTOMIZATION VARIABLES: | 90 | ;;;_* USER CUSTOMIZATION VARIABLES: |
| 91 | |||
| 92 | ;;;_ > defgroup allout | ||
| 92 | (defgroup allout nil | 93 | (defgroup allout nil |
| 93 | "Extensive outline mode for use alone and with other modes." | 94 | "Extensive outline mode for use alone and with other modes." |
| 94 | :prefix "allout-" | 95 | :prefix "allout-" |
| @@ -151,7 +152,7 @@ lines at the bottom of an Emacs Lisp file: | |||
| 151 | will, modulo the above-mentioned conditions, cause the mode to be | 152 | will, modulo the above-mentioned conditions, cause the mode to be |
| 152 | activated when the file is visited, followed by the equivalent of | 153 | activated when the file is visited, followed by the equivalent of |
| 153 | `\(allout-expose-topic 0 : -1 -1 0)'. \(This is the layout used for | 154 | `\(allout-expose-topic 0 : -1 -1 0)'. \(This is the layout used for |
| 154 | the allout.el, itself.) | 155 | the allout.el source file.) |
| 155 | 156 | ||
| 156 | Also, allout's mode-specific provisions will make topic prefixes default | 157 | Also, allout's mode-specific provisions will make topic prefixes default |
| 157 | to the comment-start string, if any, of the language of the file. This | 158 | to the comment-start string, if any, of the language of the file. This |
| @@ -450,7 +451,7 @@ variable for details about allout ajustment of file variables." | |||
| 450 | :group 'allout) | 451 | :group 'allout) |
| 451 | (make-variable-buffer-local 'allout-passphrase-hint-handling) | 452 | (make-variable-buffer-local 'allout-passphrase-hint-handling) |
| 452 | ;;;_ = allout-encrypt-unencrypted-on-saves | 453 | ;;;_ = allout-encrypt-unencrypted-on-saves |
| 453 | (defcustom allout-encrypt-unencrypted-on-saves 'except-current | 454 | (defcustom allout-encrypt-unencrypted-on-saves t |
| 454 | "*When saving, should topics pending encryption be encrypted? | 455 | "*When saving, should topics pending encryption be encrypted? |
| 455 | 456 | ||
| 456 | The idea is to prevent file-system exposure of any un-encrypted stuff, and | 457 | The idea is to prevent file-system exposure of any un-encrypted stuff, and |
| @@ -485,8 +486,11 @@ disable auto-saves for that file." | |||
| 485 | ;;;_ + Miscellaneous customization | 486 | ;;;_ + Miscellaneous customization |
| 486 | 487 | ||
| 487 | ;;;_ = allout-command-prefix | 488 | ;;;_ = allout-command-prefix |
| 488 | (defcustom allout-command-prefix "\C-c" | 489 | (defcustom allout-command-prefix "\C-c " |
| 489 | "*Key sequence to be used as prefix for outline mode command key bindings." | 490 | "*Key sequence to be used as prefix for outline mode command key bindings. |
| 491 | |||
| 492 | Default is '\C-c<space>'; just '\C-c' is more short-and-sweet, if you're | ||
| 493 | willing to let allout use a bunch of \C-c keybindings." | ||
| 490 | :type 'string | 494 | :type 'string |
| 491 | :group 'allout) | 495 | :group 'allout) |
| 492 | 496 | ||
| @@ -538,23 +542,12 @@ unless optional third, non-nil element is present.") | |||
| 538 | ("=t" allout-latexify-exposed) | 542 | ("=t" allout-latexify-exposed) |
| 539 | ("=p" allout-flatten-exposed-to-buffer))) | 543 | ("=p" allout-flatten-exposed-to-buffer))) |
| 540 | 544 | ||
| 541 | ;;;_ = allout-isearch-dynamic-expose | ||
| 542 | (defcustom allout-isearch-dynamic-expose t | ||
| 543 | "*Non-nil enable dynamic exposure of hidden incremental-search | ||
| 544 | targets as they're encountered." | ||
| 545 | :type 'boolean | ||
| 546 | :group 'allout) | ||
| 547 | (make-variable-buffer-local 'allout-isearch-dynamic-expose) | ||
| 548 | |||
| 549 | ;;;_ = allout-use-hanging-indents | 545 | ;;;_ = allout-use-hanging-indents |
| 550 | (defcustom allout-use-hanging-indents t | 546 | (defcustom allout-use-hanging-indents t |
| 551 | "*If non-nil, topic body text auto-indent defaults to indent of the header. | 547 | "*If non-nil, topic body text auto-indent defaults to indent of the header. |
| 552 | Ie, it is indented to be just past the header prefix. This is | 548 | Ie, it is indented to be just past the header prefix. This is |
| 553 | relevant mostly for use with indented-text-mode, or other situations | 549 | relevant mostly for use with indented-text-mode, or other situations |
| 554 | where auto-fill occurs. | 550 | where auto-fill occurs." |
| 555 | |||
| 556 | \[This feature no longer depends in any way on the `filladapt.el' | ||
| 557 | lisp-archive package.\]" | ||
| 558 | :type 'boolean | 551 | :type 'boolean |
| 559 | :group 'allout) | 552 | :group 'allout) |
| 560 | (make-variable-buffer-local 'allout-use-hanging-indents) | 553 | (make-variable-buffer-local 'allout-use-hanging-indents) |
| @@ -597,7 +590,7 @@ For details, see `allout-toggle-current-subtree-encryption's docstring." | |||
| 597 | ;;;_ #1 Internal Outline Formatting and Configuration | 590 | ;;;_ #1 Internal Outline Formatting and Configuration |
| 598 | ;;;_ : Version | 591 | ;;;_ : Version |
| 599 | ;;;_ = allout-version | 592 | ;;;_ = allout-version |
| 600 | (defvar allout-version "2.1" | 593 | (defvar allout-version "2.2" |
| 601 | "Version of currently loaded outline package. \(allout.el)") | 594 | "Version of currently loaded outline package. \(allout.el)") |
| 602 | ;;;_ > allout-version | 595 | ;;;_ > allout-version |
| 603 | (defun allout-version (&optional here) | 596 | (defun allout-version (&optional here) |
| @@ -636,9 +629,9 @@ and `allout-distinctive-bullets-string'.") | |||
| 636 | (defvar allout-line-boundary-regexp () | 629 | (defvar allout-line-boundary-regexp () |
| 637 | "`allout-regexp' with outline style beginning-of-line anchor. | 630 | "`allout-regexp' with outline style beginning-of-line anchor. |
| 638 | 631 | ||
| 639 | \(Ie, C-j, *or* C-m, for prefixes of hidden topics). This is properly | 632 | This is properly set when `allout-regexp' is produced by |
| 640 | set when `allout-regexp' is produced by `set-allout-regexp', so | 633 | `set-allout-regexp', so that (match-beginning 2) and (match-end |
| 641 | that (match-beginning 2) and (match-end 2) delimit the prefix.") | 634 | 2) delimit the prefix.") |
| 642 | (make-variable-buffer-local 'allout-line-boundary-regexp) | 635 | (make-variable-buffer-local 'allout-line-boundary-regexp) |
| 643 | ;;;_ = allout-bob-regexp | 636 | ;;;_ = allout-bob-regexp |
| 644 | (defvar allout-bob-regexp () | 637 | (defvar allout-bob-regexp () |
| @@ -753,11 +746,9 @@ Works with respect to `allout-plain-bullets-string' and | |||
| 753 | cur-string | 746 | cur-string |
| 754 | cur-len | 747 | cur-len |
| 755 | cur-char | 748 | cur-char |
| 756 | cur-char-string | 749 | index) |
| 757 | index | ||
| 758 | new-string) | ||
| 759 | (while strings | 750 | (while strings |
| 760 | (setq new-string "") (setq index 0) | 751 | (setq index 0) |
| 761 | (setq cur-len (length (setq cur-string (symbol-value (car strings))))) | 752 | (setq cur-len (length (setq cur-string (symbol-value (car strings))))) |
| 762 | (while (< index cur-len) | 753 | (while (< index cur-len) |
| 763 | (setq cur-char (aref cur-string index)) | 754 | (setq cur-char (aref cur-string index)) |
| @@ -788,7 +779,7 @@ Works with respect to `allout-plain-bullets-string' and | |||
| 788 | allout-primary-bullet | 779 | allout-primary-bullet |
| 789 | "+\\|\^l")) | 780 | "+\\|\^l")) |
| 790 | (setq allout-line-boundary-regexp | 781 | (setq allout-line-boundary-regexp |
| 791 | (concat "\\([\n\r]\\)\\(" allout-regexp "\\)")) | 782 | (concat "\\(\n\\)\\(" allout-regexp "\\)")) |
| 792 | (setq allout-bob-regexp | 783 | (setq allout-bob-regexp |
| 793 | (concat "\\(\\`\\)\\(" allout-regexp "\\)")) | 784 | (concat "\\(\\`\\)\\(" allout-regexp "\\)")) |
| 794 | ) | 785 | ) |
| @@ -955,42 +946,28 @@ from the list." | |||
| 955 | (setq allout-mode-prior-settings rebuild))))) | 946 | (setq allout-mode-prior-settings rebuild))))) |
| 956 | ) | 947 | ) |
| 957 | ;;;_ : Mode-specific incidentals | 948 | ;;;_ : Mode-specific incidentals |
| 958 | ;;;_ = allout-pre-was-isearching nil | ||
| 959 | (defvar allout-pre-was-isearching nil | ||
| 960 | "Cue for isearch-dynamic-exposure mechanism, implemented in | ||
| 961 | allout-pre- and -post-command-hooks.") | ||
| 962 | (make-variable-buffer-local 'allout-pre-was-isearching) | ||
| 963 | ;;;_ = allout-isearch-prior-pos nil | ||
| 964 | (defvar allout-isearch-prior-pos nil | ||
| 965 | "Cue for isearch-dynamic-exposure tracking, used by | ||
| 966 | `allout-isearch-expose'.") | ||
| 967 | (make-variable-buffer-local 'allout-isearch-prior-pos) | ||
| 968 | ;;;_ = allout-isearch-did-quit | ||
| 969 | (defvar allout-isearch-did-quit nil | ||
| 970 | "Distinguishes isearch conclusion and cancellation. | ||
| 971 | |||
| 972 | Maintained by allout-isearch-abort \(which is wrapped around the real | ||
| 973 | isearch-abort), and monitored by allout-isearch-expose for action.") | ||
| 974 | (make-variable-buffer-local 'allout-isearch-did-quit) | ||
| 975 | ;;;_ > allout-unprotected (expr) | 949 | ;;;_ > allout-unprotected (expr) |
| 976 | (defmacro allout-unprotected (expr) | 950 | (defmacro allout-unprotected (expr) |
| 977 | "Enable internal outline operations to alter read-only text." | 951 | "Enable internal outline operations to alter invisible text." |
| 978 | `(let ((was-inhibit-r-o inhibit-read-only)) | 952 | `(let ((inhibit-read-only t)) |
| 979 | (unwind-protect | 953 | ,expr)) |
| 980 | (progn | 954 | ;;;_ = allout-mode-hook |
| 981 | (setq inhibit-read-only t) | 955 | (defvar allout-mode-hook nil |
| 982 | ,expr) | 956 | "*Hook that's run when allout mode starts.") |
| 983 | (setq inhibit-read-only was-inhibit-r-o) | 957 | ;;;_ = allout-overlay-category |
| 984 | ) | 958 | (defvar allout-overlay-category nil |
| 985 | ) | 959 | "Symbol for use in allout invisible-text overlays as the category.") |
| 986 | ) | 960 | ;;;_ = allout-view-change-hook |
| 987 | ;;;_ = allout-undo-aggregation | 961 | (defvar allout-view-change-hook nil |
| 988 | (defvar allout-undo-aggregation 30 | 962 | "*Hook that's run after allout outline visibility changes.") |
| 989 | "Amount of successive self-insert actions to bunch together per undo. | 963 | |
| 990 | 964 | ;;;_ = allout-outside-normal-auto-fill-function | |
| 991 | This is purely a kludge variable, regulating the compensation for a bug in | 965 | (defvar allout-outside-normal-auto-fill-function nil |
| 992 | the way that `before-change-functions' and undo interact.") | 966 | "Value of normal-auto-fill-function outside of allout mode. |
| 993 | (make-variable-buffer-local 'allout-undo-aggregation) | 967 | |
| 968 | Used by allout-auto-fill to do the mandated normal-auto-fill-function | ||
| 969 | wrapped within allout's automatic fill-prefix setting.") | ||
| 970 | (make-variable-buffer-local 'allout-outside-normal-auto-fill-function) | ||
| 994 | ;;;_ = file-var-bug hack | 971 | ;;;_ = file-var-bug hack |
| 995 | (defvar allout-v18/19-file-var-hack nil | 972 | (defvar allout-v18/19-file-var-hack nil |
| 996 | "Horrible hack used to prevent invalid multiple triggering of outline | 973 | "Horrible hack used to prevent invalid multiple triggering of outline |
| @@ -1059,7 +1036,7 @@ was encrypted automatically as part of a file write or autosave.") | |||
| 1059 | (allout-next-topic-pending-encryption except-mark)) | 1036 | (allout-next-topic-pending-encryption except-mark)) |
| 1060 | (progn | 1037 | (progn |
| 1061 | (message "auto-encrypting pending topics") | 1038 | (message "auto-encrypting pending topics") |
| 1062 | (sit-for 2) | 1039 | (sit-for 0) |
| 1063 | (condition-case failure | 1040 | (condition-case failure |
| 1064 | (setq allout-after-save-decrypt | 1041 | (setq allout-after-save-decrypt |
| 1065 | (allout-encrypt-decrypted except-mark)) | 1042 | (allout-encrypt-decrypted except-mark)) |
| @@ -1184,7 +1161,6 @@ the following two lines in your Emacs init file: | |||
| 1184 | ((message | 1161 | ((message |
| 1185 | "Outline mode auto-activation and -layout enabled.") | 1162 | "Outline mode auto-activation and -layout enabled.") |
| 1186 | 'full))))))) | 1163 | 'full))))))) |
| 1187 | |||
| 1188 | ;;;_ > allout-setup-menubar () | 1164 | ;;;_ > allout-setup-menubar () |
| 1189 | (defun allout-setup-menubar () | 1165 | (defun allout-setup-menubar () |
| 1190 | "Populate the current buffer's menubar with `allout-mode' stuff." | 1166 | "Populate the current buffer's menubar with `allout-mode' stuff." |
| @@ -1197,12 +1173,37 @@ the following two lines in your Emacs init file: | |||
| 1197 | (setq cur (car menus) | 1173 | (setq cur (car menus) |
| 1198 | menus (cdr menus)) | 1174 | menus (cdr menus)) |
| 1199 | (easy-menu-add cur)))) | 1175 | (easy-menu-add cur)))) |
| 1176 | ;;;_ > allout-set-overlay-category | ||
| 1177 | (defun allout-set-overlay-category () | ||
| 1178 | "Set the properties of the allout invisible-text overlay." | ||
| 1179 | (setplist 'allout-overlay-category nil) | ||
| 1180 | (put 'allout-overlay-category 'invisible 'allout) | ||
| 1181 | (put 'allout-overlay-category 'evaporate t) | ||
| 1182 | ;; XXX We use isearch-open-invisible *and* isearch-mode-end-hook. The | ||
| 1183 | ;; latter would be sufficient, but it seems that a separate behavior - | ||
| 1184 | ;; the _transient_ opening of invisible text during isearch - is keyed to | ||
| 1185 | ;; presence of the isearch-open-invisible property - even though this | ||
| 1186 | ;; property controls the isearch _arrival_ behavior. This is the case at | ||
| 1187 | ;; least in emacs 21, 22.0, and xemacs 21.4. | ||
| 1188 | (put 'allout-overlay-category 'isearch-open-invisible | ||
| 1189 | 'allout-isearch-end-handler) | ||
| 1190 | (if (featurep 'xemacs) | ||
| 1191 | (put 'allout-overlay-category 'start-open t) | ||
| 1192 | (put 'allout-overlay-category 'insert-in-front-hooks | ||
| 1193 | '(allout-overlay-insert-in-front-handler))) | ||
| 1194 | (if (featurep 'xemacs) | ||
| 1195 | (progn (make-variable-buffer-local 'before-change-functions) | ||
| 1196 | (add-hook 'before-change-functions | ||
| 1197 | 'allout-before-change-handler)) | ||
| 1198 | (put 'allout-overlay-category 'modification-hooks | ||
| 1199 | '(allout-overlay-interior-modification-handler)))) | ||
| 1200 | ;;;_ > allout-mode (&optional toggle) | 1200 | ;;;_ > allout-mode (&optional toggle) |
| 1201 | ;;;_ : Defun: | 1201 | ;;;_ : Defun: |
| 1202 | ;;;###autoload | 1202 | ;;;###autoload |
| 1203 | (defun allout-mode (&optional toggle) | 1203 | (defun allout-mode (&optional toggle) |
| 1204 | ;;;_ . Doc string: | 1204 | ;;;_ . Doc string: |
| 1205 | "Toggle minor mode for controlling exposure and editing of text outlines. | 1205 | "Toggle minor mode for controlling exposure and editing of text outlines. |
| 1206 | \\<allout-mode-map> | ||
| 1206 | 1207 | ||
| 1207 | Optional arg forces mode to re-initialize iff arg is positive num or | 1208 | Optional arg forces mode to re-initialize iff arg is positive num or |
| 1208 | symbol. Allout outline mode always runs as a minor mode. | 1209 | symbol. Allout outline mode always runs as a minor mode. |
| @@ -1244,62 +1245,69 @@ The bindings are dictated by the `allout-keybindings-list' and | |||
| 1244 | \\[allout-forward-current-level] allout-forward-current-level | \\[allout-show-current-entry] allout-show-current-entry | 1245 | \\[allout-forward-current-level] allout-forward-current-level | \\[allout-show-current-entry] allout-show-current-entry |
| 1245 | \\[allout-backward-current-level] allout-backward-current-level | \\[allout-show-all] allout-show-all | 1246 | \\[allout-backward-current-level] allout-backward-current-level | \\[allout-show-all] allout-show-all |
| 1246 | \\[allout-end-of-entry] allout-end-of-entry | 1247 | \\[allout-end-of-entry] allout-end-of-entry |
| 1247 | \\[allout-beginning-of-current-entry,] allout-beginning-of-current-entry, alternately, goes to hot-spot | 1248 | \\[allout-beginning-of-current-entry] allout-beginning-of-current-entry, alternately, goes to hot-spot |
| 1248 | 1249 | ||
| 1249 | Topic Header Production: | 1250 | Topic Header Production: |
| 1250 | ----------------------- | 1251 | ----------------------- |
| 1251 | \\[allout-open-sibtopic] allout-open-sibtopic Create a new sibling after current topic. | 1252 | \\[allout-open-sibtopic] allout-open-sibtopic Create a new sibling after current topic. |
| 1252 | \\[allout-open-subtopic] allout-open-subtopic ... an offspring of current topic. | 1253 | \\[allout-open-subtopic] allout-open-subtopic ... an offspring of current topic. |
| 1253 | \\[allout-open-supertopic] allout-open-supertopic ... a sibling of the current topic's parent. | 1254 | \\[allout-open-supertopic] allout-open-supertopic ... a sibling of the current topic's parent. |
| 1254 | 1255 | ||
| 1255 | Topic Level and Prefix Adjustment: | 1256 | Topic Level and Prefix Adjustment: |
| 1256 | --------------------------------- | 1257 | --------------------------------- |
| 1257 | \\[allout-shift-in] allout-shift-in Shift current topic and all offspring deeper. | 1258 | \\[allout-shift-in] allout-shift-in Shift current topic and all offspring deeper. |
| 1258 | \\[allout-shift-out] allout-shift-out ... less deep. | 1259 | \\[allout-shift-out] allout-shift-out ... less deep. |
| 1259 | \\[allout-rebullet-current-heading] allout-rebullet-current-heading Prompt for alternate bullet for | 1260 | \\[allout-rebullet-current-heading] allout-rebullet-current-heading Prompt for alternate bullet for |
| 1260 | current topic. | 1261 | current topic. |
| 1261 | \\[allout-rebullet-topic] allout-rebullet-topic Reconcile bullets of topic and its offspring | 1262 | \\[allout-rebullet-topic] allout-rebullet-topic Reconcile bullets of topic and its offspring |
| 1262 | - distinctive bullets are not changed, others | 1263 | - distinctive bullets are not changed, others |
| 1263 | alternated according to nesting depth. | 1264 | alternated according to nesting depth. |
| 1264 | \\[allout-number-siblings] allout-number-siblings Number bullets of topic and siblings - the | 1265 | \\[allout-number-siblings] allout-number-siblings Number bullets of topic and siblings - the |
| 1265 | offspring are not affected. With repeat | 1266 | offspring are not affected. With repeat |
| 1266 | count, revoke numbering. | 1267 | count, revoke numbering. |
| 1267 | 1268 | ||
| 1268 | Topic-oriented Killing and Yanking: | 1269 | Topic-oriented Killing and Yanking: |
| 1269 | ---------------------------------- | 1270 | ---------------------------------- |
| 1270 | \\[allout-kill-topic] allout-kill-topic Kill current topic, including offspring. | 1271 | \\[allout-kill-topic] allout-kill-topic Kill current topic, including offspring. |
| 1271 | \\[allout-kill-line] allout-kill-line Like kill-line, but reconciles numbering, etc. | 1272 | \\[allout-kill-line] allout-kill-line Like kill-line, but reconciles numbering, etc. |
| 1272 | \\[allout-yank] allout-yank Yank, adjusting depth of yanked topic to | 1273 | \\[allout-yank] allout-yank Yank, adjusting depth of yanked topic to |
| 1273 | depth of heading if yanking into bare topic | 1274 | depth of heading if yanking into bare topic |
| 1274 | heading (ie, prefix sans text). | 1275 | heading (ie, prefix sans text). |
| 1275 | \\[allout-yank-pop] allout-yank-pop Is to allout-yank as yank-pop is to yank | 1276 | \\[allout-yank-pop] allout-yank-pop Is to allout-yank as yank-pop is to yank |
| 1277 | |||
| 1278 | Topic-oriented Encryption: | ||
| 1279 | ------------------------- | ||
| 1280 | \\[allout-toggle-current-subtree-encryption] allout-toggle-current-subtree-encryption Encrypt/Decrypt topic content | ||
| 1276 | 1281 | ||
| 1277 | Misc commands: | 1282 | Misc commands: |
| 1278 | ------------- | 1283 | ------------- |
| 1279 | M-x outlineify-sticky Activate outline mode for current buffer, | 1284 | M-x outlineify-sticky Activate outline mode for current buffer, |
| 1280 | and establish a default file-var setting | 1285 | and establish a default file-var setting |
| 1281 | for `allout-layout'. | 1286 | for `allout-layout'. |
| 1282 | \\[allout-mark-topic] allout-mark-topic | 1287 | \\[allout-mark-topic] allout-mark-topic |
| 1283 | \\[allout-copy-exposed-to-buffer] allout-copy-exposed-to-buffer | 1288 | \\[allout-copy-exposed-to-buffer] allout-copy-exposed-to-buffer |
| 1284 | Duplicate outline, sans concealed text, to | 1289 | Duplicate outline, sans concealed text, to |
| 1285 | buffer with name derived from derived from that | 1290 | buffer with name derived from derived from that |
| 1286 | of current buffer - \"*BUFFERNAME exposed*\". | 1291 | of current buffer - \"*BUFFERNAME exposed*\". |
| 1287 | \\[allout-flatten-exposed-to-buffer] allout-flatten-exposed-to-buffer | 1292 | \\[allout-flatten-exposed-to-buffer] allout-flatten-exposed-to-buffer |
| 1288 | Like above 'copy-exposed', but convert topic | 1293 | Like above 'copy-exposed', but convert topic |
| 1289 | prefixes to section.subsection... numeric | 1294 | prefixes to section.subsection... numeric |
| 1290 | format. | 1295 | format. |
| 1291 | ESC ESC (allout-init t) Setup Emacs session for outline mode | 1296 | \\[eval-expression] (allout-init t) Setup Emacs session for outline mode |
| 1292 | auto-activation. | 1297 | auto-activation. |
| 1293 | 1298 | ||
| 1294 | Encrypted Entries | 1299 | Topic Encryption |
| 1295 | 1300 | ||
| 1296 | Outline mode supports easily togglable gpg encryption of topics, with | 1301 | Outline mode supports gpg encryption of topics, with support for |
| 1297 | niceties like support for symmetric and key-pair modes, passphrase timeout, | 1302 | symmetric and key-pair modes, passphrase timeout, passphrase |
| 1298 | passphrase consistency checking, user-provided hinting for symmetric key | 1303 | consistency checking, user-provided hinting for symmetric key |
| 1299 | mode, and auto-encryption of topics pending encryption on save. The aim is | 1304 | mode, and auto-encryption of topics pending encryption on save. |
| 1300 | to enable reliable topic privacy while preventing accidents like neglected | 1305 | \(Topics pending encryption are, by default, automatically |
| 1301 | encryption, encryption with a mistaken passphrase, forgetting which | 1306 | encrypted during file saves; if you're editing the contents of |
| 1302 | passphrase was used, and other practical pitfalls. | 1307 | such a topic, it is automatically decrypted for continued |
| 1308 | editing.) The aim is reliable topic privacy while preventing | ||
| 1309 | accidents like neglected encryption before saves, forgetting | ||
| 1310 | which passphrase was used, and other practical pitfalls. | ||
| 1303 | 1311 | ||
| 1304 | See `allout-toggle-current-subtree-encryption' function docstring and | 1312 | See `allout-toggle-current-subtree-encryption' function docstring and |
| 1305 | `allout-encrypt-unencrypted-on-saves' customization variable for details. | 1313 | `allout-encrypt-unencrypted-on-saves' customization variable for details. |
| @@ -1309,22 +1317,21 @@ See `allout-toggle-current-subtree-encryption' function docstring and | |||
| 1309 | Hot-spot operation provides a means for easy, single-keystroke outline | 1317 | Hot-spot operation provides a means for easy, single-keystroke outline |
| 1310 | navigation and exposure control. | 1318 | navigation and exposure control. |
| 1311 | 1319 | ||
| 1312 | \\<allout-mode-map> | ||
| 1313 | When the text cursor is positioned directly on the bullet character of | 1320 | When the text cursor is positioned directly on the bullet character of |
| 1314 | a topic, regular characters (a to z) invoke the commands of the | 1321 | a topic, regular characters (a to z) invoke the commands of the |
| 1315 | corresponding allout-mode keymap control chars. For example, \"f\" | 1322 | corresponding allout-mode keymap control chars. For example, \"f\" |
| 1316 | would invoke the command typically bound to \"C-c C-f\" | 1323 | would invoke the command typically bound to \"C-c<space>C-f\" |
| 1317 | \(\\[allout-forward-current-level] `allout-forward-current-level'). | 1324 | \(\\[allout-forward-current-level] `allout-forward-current-level'). |
| 1318 | 1325 | ||
| 1319 | Thus, by positioning the cursor on a topic bullet, you can execute | 1326 | Thus, by positioning the cursor on a topic bullet, you can |
| 1320 | the outline navigation and manipulation commands with a single | 1327 | execute the outline navigation and manipulation commands with a |
| 1321 | keystroke. Non-literal chars never get this special translation, so | 1328 | single keystroke. Regular navigation keys (eg, \\[forward-char], \\[next-line]) never get |
| 1322 | you can use them to get away from the hot-spot, and back to normal | 1329 | this special translation, so you can use them to get out of the |
| 1323 | operation. | 1330 | hot-spot and back to normal operation. |
| 1324 | 1331 | ||
| 1325 | Note that the command `allout-beginning-of-current-entry' \(\\[allout-beginning-of-current-entry]\) | 1332 | Note that the command `allout-beginning-of-current-entry' \(\\[allout-beginning-of-current-entry]\) |
| 1326 | will move to the hot-spot when the cursor is already located at the | 1333 | will move to the hot-spot when the cursor is already located at the |
| 1327 | beginning of the current entry, so you can simply hit \\[allout-beginning-of-current-entry] | 1334 | beginning of the current entry, so you usually can hit \\[allout-beginning-of-current-entry] |
| 1328 | twice in a row to get to the hot-spot. | 1335 | twice in a row to get to the hot-spot. |
| 1329 | 1336 | ||
| 1330 | Terminology | 1337 | Terminology |
| @@ -1332,7 +1339,7 @@ twice in a row to get to the hot-spot. | |||
| 1332 | Topic hierarchy constituents - TOPICS and SUBTOPICS: | 1339 | Topic hierarchy constituents - TOPICS and SUBTOPICS: |
| 1333 | 1340 | ||
| 1334 | TOPIC: A basic, coherent component of an Emacs outline. It can | 1341 | TOPIC: A basic, coherent component of an Emacs outline. It can |
| 1335 | contain other topics, and it can be subsumed by other topics, | 1342 | contain and be contained by other topics. |
| 1336 | CURRENT topic: | 1343 | CURRENT topic: |
| 1337 | The visible topic most immediately containing the cursor. | 1344 | The visible topic most immediately containing the cursor. |
| 1338 | DEPTH: The degree of nesting of a topic; it increases with | 1345 | DEPTH: The degree of nesting of a topic; it increases with |
| @@ -1376,13 +1383,13 @@ PREFIX-LEAD: | |||
| 1376 | docstring for more detail. | 1383 | docstring for more detail. |
| 1377 | PREFIX-PADDING: | 1384 | PREFIX-PADDING: |
| 1378 | Spaces or asterisks which separate the prefix-lead and the | 1385 | Spaces or asterisks which separate the prefix-lead and the |
| 1379 | bullet, according to the depth of the topic. | 1386 | bullet, determining the depth of the topic. |
| 1380 | BULLET: A character at the end of the topic prefix, it must be one of | 1387 | BULLET: A character at the end of the topic prefix, it must be one of |
| 1381 | the characters listed on `allout-plain-bullets-string' or | 1388 | the characters listed on `allout-plain-bullets-string' or |
| 1382 | `allout-distinctive-bullets-string'. (See the documentation | 1389 | `allout-distinctive-bullets-string'. (See the documentation |
| 1383 | for these variables for more details.) The default choice of | 1390 | for these variables for more details.) The default choice of |
| 1384 | bullet when generating varies in a cycle with the depth of the | 1391 | bullet when generating topics varies in a cycle with the depth of |
| 1385 | topic. | 1392 | the topic. |
| 1386 | ENTRY: The text contained in a topic before any offspring. | 1393 | ENTRY: The text contained in a topic before any offspring. |
| 1387 | BODY: Same as ENTRY. | 1394 | BODY: Same as ENTRY. |
| 1388 | 1395 | ||
| @@ -1393,7 +1400,6 @@ EXPOSURE: | |||
| 1393 | CONCEALED: | 1400 | CONCEALED: |
| 1394 | Topics and entry text whose display is inhibited. Contiguous | 1401 | Topics and entry text whose display is inhibited. Contiguous |
| 1395 | units of concealed text is represented by `...' ellipses. | 1402 | units of concealed text is represented by `...' ellipses. |
| 1396 | (Ref the `selective-display' var.) | ||
| 1397 | 1403 | ||
| 1398 | Concealed topics are effectively collapsed within an ancestor. | 1404 | Concealed topics are effectively collapsed within an ancestor. |
| 1399 | CLOSED: A topic whose immediate offspring and body-text is concealed. | 1405 | CLOSED: A topic whose immediate offspring and body-text is concealed. |
| @@ -1415,9 +1421,11 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1415 | ;; allout-mode already called once during this complex command? | 1421 | ;; allout-mode already called once during this complex command? |
| 1416 | (same-complex-command (eq allout-v18/19-file-var-hack | 1422 | (same-complex-command (eq allout-v18/19-file-var-hack |
| 1417 | (car command-history))) | 1423 | (car command-history))) |
| 1418 | (write-file-hook-var-name (if (boundp 'write-file-functions) | 1424 | (write-file-hook-var-name (cond ((boundp 'write-file-functions) |
| 1419 | 'write-file-functions | 1425 | 'write-file-functions) |
| 1420 | 'local-write-file-hooks)) | 1426 | ((boundp 'write-file-hooks) |
| 1427 | 'write-file-hooks) | ||
| 1428 | (t 'local-write-file-hooks))) | ||
| 1421 | do-layout | 1429 | do-layout |
| 1422 | ) | 1430 | ) |
| 1423 | 1431 | ||
| @@ -1465,9 +1473,8 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1465 | (progn | 1473 | (progn |
| 1466 | (allout-resumptions 'allout-primary-bullet) | 1474 | (allout-resumptions 'allout-primary-bullet) |
| 1467 | (allout-resumptions 'allout-old-style-prefixes))) | 1475 | (allout-resumptions 'allout-old-style-prefixes))) |
| 1468 | (allout-resumptions 'selective-display) | 1476 | ;;(allout-resumptions 'selective-display) |
| 1469 | (if (and (boundp 'before-change-functions) before-change-functions) | 1477 | (remove-from-invisibility-spec '(allout . t)) |
| 1470 | (allout-resumptions 'before-change-functions)) | ||
| 1471 | (set write-file-hook-var-name | 1478 | (set write-file-hook-var-name |
| 1472 | (delq 'allout-write-file-hook-handler | 1479 | (delq 'allout-write-file-hook-handler |
| 1473 | (symbol-value write-file-hook-var-name))) | 1480 | (symbol-value write-file-hook-var-name))) |
| @@ -1476,9 +1483,8 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1476 | auto-save-hook)) | 1483 | auto-save-hook)) |
| 1477 | (allout-resumptions 'paragraph-start) | 1484 | (allout-resumptions 'paragraph-start) |
| 1478 | (allout-resumptions 'paragraph-separate) | 1485 | (allout-resumptions 'paragraph-separate) |
| 1479 | (allout-resumptions (if (string-match "^18" emacs-version) | 1486 | (allout-resumptions 'auto-fill-function) |
| 1480 | 'auto-fill-hook | 1487 | (allout-resumptions 'normal-auto-fill-function) |
| 1481 | 'auto-fill-function)) | ||
| 1482 | (allout-resumptions 'allout-former-auto-filler) | 1488 | (allout-resumptions 'allout-former-auto-filler) |
| 1483 | (setq allout-mode nil)) | 1489 | (setq allout-mode nil)) |
| 1484 | 1490 | ||
| @@ -1490,6 +1496,8 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1490 | (allout-resumptions 'allout-primary-bullet '("*")) | 1496 | (allout-resumptions 'allout-primary-bullet '("*")) |
| 1491 | (allout-resumptions 'allout-old-style-prefixes '(())))) | 1497 | (allout-resumptions 'allout-old-style-prefixes '(())))) |
| 1492 | 1498 | ||
| 1499 | (allout-set-overlay-category) ; Doesn't hurt to redo this. | ||
| 1500 | |||
| 1493 | (allout-infer-header-lead) | 1501 | (allout-infer-header-lead) |
| 1494 | (allout-infer-body-reindent) | 1502 | (allout-infer-body-reindent) |
| 1495 | 1503 | ||
| @@ -1525,25 +1533,24 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1525 | (current-local-map))) | 1533 | (current-local-map))) |
| 1526 | ) | 1534 | ) |
| 1527 | 1535 | ||
| 1528 | ; selective-display is the | 1536 | (add-to-invisibility-spec '(allout . t)) |
| 1529 | ; emacs conditional exposure | 1537 | (make-local-variable 'line-move-ignore-invisible) |
| 1530 | ; mechanism: | 1538 | (setq line-move-ignore-invisible t) |
| 1531 | (allout-resumptions 'selective-display '(t)) | ||
| 1532 | (add-hook 'pre-command-hook 'allout-pre-command-business) | 1539 | (add-hook 'pre-command-hook 'allout-pre-command-business) |
| 1533 | (add-hook 'post-command-hook 'allout-post-command-business) | 1540 | (add-hook 'post-command-hook 'allout-post-command-business) |
| 1541 | (add-hook 'isearch-mode-end-hook 'allout-isearch-end-handler) | ||
| 1534 | (add-hook write-file-hook-var-name 'allout-write-file-hook-handler) | 1542 | (add-hook write-file-hook-var-name 'allout-write-file-hook-handler) |
| 1535 | (add-hook 'auto-save-hook 'allout-auto-save-hook-handler) | 1543 | (add-hook 'auto-save-hook 'allout-auto-save-hook-handler) |
| 1536 | ; Custom auto-fill func, to support | 1544 | ; Custom auto-fill func, to support |
| 1537 | ; respect for topic headline, | 1545 | ; respect for topic headline, |
| 1538 | ; hanging-indents, etc: | 1546 | ; hanging-indents, etc: |
| 1539 | (let* ((fill-func-var (if (string-match "^18" emacs-version) | 1547 | ;; Register prevailing fill func for use by allout-auto-fill: |
| 1540 | 'auto-fill-hook | 1548 | (allout-resumptions 'allout-former-auto-filler (list auto-fill-function)) |
| 1541 | 'auto-fill-function)) | 1549 | ;; Register allout-auto-fill to be used if filling is active: |
| 1542 | (fill-func (symbol-value fill-func-var))) | 1550 | (allout-resumptions 'auto-fill-function '(allout-auto-fill)) |
| 1543 | ;; Register prevailing fill func for use by allout-auto-fill: | 1551 | (allout-resumptions 'allout-outside-normal-auto-fill-function |
| 1544 | (allout-resumptions 'allout-former-auto-filler (list fill-func)) | 1552 | (list normal-auto-fill-function)) |
| 1545 | ;; Register allout-auto-fill to be used if filling is active: | 1553 | (allout-resumptions 'normal-auto-fill-function '(allout-auto-fill)) |
| 1546 | (allout-resumptions fill-func-var '(allout-auto-fill))) | ||
| 1547 | ;; Paragraphs are broken by topic headlines. | 1554 | ;; Paragraphs are broken by topic headlines. |
| 1548 | (make-local-variable 'paragraph-start) | 1555 | (make-local-variable 'paragraph-start) |
| 1549 | (allout-resumptions 'paragraph-start | 1556 | (allout-resumptions 'paragraph-start |
| @@ -1563,10 +1570,6 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1563 | (if allout-layout | 1570 | (if allout-layout |
| 1564 | (setq do-layout t)) | 1571 | (setq do-layout t)) |
| 1565 | 1572 | ||
| 1566 | (if (and allout-isearch-dynamic-expose | ||
| 1567 | (not (fboundp 'allout-real-isearch-abort))) | ||
| 1568 | (allout-enwrap-isearch)) | ||
| 1569 | |||
| 1570 | (run-hooks 'allout-mode-hook) | 1573 | (run-hooks 'allout-mode-hook) |
| 1571 | (setq allout-mode t)) | 1574 | (setq allout-mode t)) |
| 1572 | 1575 | ||
| @@ -1602,9 +1605,92 @@ OPEN: A topic that is not closed, though its offspring or body may be." | |||
| 1602 | allout-mode | 1605 | allout-mode |
| 1603 | ) ; let* | 1606 | ) ; let* |
| 1604 | ) ; defun | 1607 | ) ; defun |
| 1608 | |||
| 1609 | ;;;_ - Position Assessment | ||
| 1610 | ;;;_ > allout-hidden-p (&optional pos) | ||
| 1611 | (defsubst allout-hidden-p (&optional pos) | ||
| 1612 | "Non-nil if the character after point is invisible." | ||
| 1613 | (get-char-property (or pos (point)) 'invisible)) | ||
| 1614 | |||
| 1605 | ;;;_ > allout-minor-mode | 1615 | ;;;_ > allout-minor-mode |
| 1606 | (defalias 'allout-minor-mode 'allout-mode) | 1616 | (defalias 'allout-minor-mode 'allout-mode) |
| 1607 | 1617 | ||
| 1618 | ;;;_ > allout-overlay-insert-in-front-handler (ol after beg end | ||
| 1619 | ;;; &optional prelen) | ||
| 1620 | (defun allout-overlay-insert-in-front-handler (ol after beg end | ||
| 1621 | &optional prelen) | ||
| 1622 | "Shift the overlay so stuff inserted in front of it are excluded." | ||
| 1623 | (if after | ||
| 1624 | (move-overlay ol (1+ beg) (overlay-end ol)))) | ||
| 1625 | ;;;_ > allout-overlay-interior-modification-handler (ol after beg end | ||
| 1626 | ;;; &optional prelen) | ||
| 1627 | (defun allout-overlay-interior-modification-handler (ol after beg end | ||
| 1628 | &optional prelen) | ||
| 1629 | "Get confirmation before making arbitrary changes to invisible text. | ||
| 1630 | |||
| 1631 | We expose the invisible text and ask for confirmation. Refusal or | ||
| 1632 | keyboard-quit abandons the changes, with keyboard-quit additionally | ||
| 1633 | reclosing the opened text. | ||
| 1634 | |||
| 1635 | No confirmation is necessary when inhibit-read-only is set - eg, allout | ||
| 1636 | internal functions use this feature cohesively bunch changes." | ||
| 1637 | |||
| 1638 | (when (and (not inhibit-read-only) (not after)) | ||
| 1639 | (let ((start (point)) | ||
| 1640 | (ol-start (overlay-start ol)) | ||
| 1641 | (ol-end (overlay-end ol)) | ||
| 1642 | (msg "Change within concealed text disallowed.") | ||
| 1643 | opened | ||
| 1644 | first) | ||
| 1645 | (goto-char beg) | ||
| 1646 | (while (< (point) end) | ||
| 1647 | (when (allout-hidden-p) | ||
| 1648 | (allout-show-to-offshoot) | ||
| 1649 | (if (allout-hidden-p) | ||
| 1650 | (save-excursion (forward-char 1) | ||
| 1651 | (allout-show-to-offshoot))) | ||
| 1652 | (when (not first) | ||
| 1653 | (setq opened t) | ||
| 1654 | (setq first (point)))) | ||
| 1655 | (goto-char (if (featurep 'xemacs) | ||
| 1656 | (next-property-change (1+ (point)) nil end) | ||
| 1657 | (next-char-property-change (1+ (point)) end)))) | ||
| 1658 | (when first | ||
| 1659 | (goto-char first) | ||
| 1660 | (condition-case nil | ||
| 1661 | (if (not | ||
| 1662 | (yes-or-no-p | ||
| 1663 | (substitute-command-keys | ||
| 1664 | (concat "Modify this concealed text? (\"no\" aborts," | ||
| 1665 | " \\[keyboard-quit] also reconceals) ")))) | ||
| 1666 | (progn (goto-char start) | ||
| 1667 | (error "Concealed-text change refused."))) | ||
| 1668 | (quit (allout-flag-region ol-start ol-end nil) | ||
| 1669 | (allout-flag-region ol-start ol-end t) | ||
| 1670 | (error "Concealed-text change abandoned, text reconcealed.")))) | ||
| 1671 | (goto-char start)))) | ||
| 1672 | ;;;_ > allout-before-change-handler (beg end) | ||
| 1673 | (defun allout-before-change-handler (beg end) | ||
| 1674 | "Protect against changes to invisible text. | ||
| 1675 | |||
| 1676 | See allout-overlay-interior-modification-handler for details. | ||
| 1677 | |||
| 1678 | This before-change handler is used only where modification-hooks | ||
| 1679 | overlay property is not supported." | ||
| 1680 | (if (not allout-mode) | ||
| 1681 | nil | ||
| 1682 | (allout-overlay-interior-modification-handler nil nil beg end nil))) | ||
| 1683 | ;;;_ > allout-isearch-end-handler (&optional overlay) | ||
| 1684 | (defun allout-isearch-end-handler (&optional overlay) | ||
| 1685 | "Reconcile allout outline exposure on arriving in hidden text after isearch. | ||
| 1686 | |||
| 1687 | Optional OVERLAY parameter is for when this function is used by | ||
| 1688 | `isearch-open-invisible' overlay property. It is otherwise unused, so this | ||
| 1689 | function can also be used as an `isearch-mode-end-hook'." | ||
| 1690 | |||
| 1691 | (if (and (allout-mode-p) (allout-hidden-p)) | ||
| 1692 | (allout-show-to-offshoot))) | ||
| 1693 | |||
| 1608 | ;;;_ #3 Internal Position State-Tracking - "allout-recent-*" funcs | 1694 | ;;;_ #3 Internal Position State-Tracking - "allout-recent-*" funcs |
| 1609 | ;;; All the basic outline functions that directly do string matches to | 1695 | ;;; All the basic outline functions that directly do string matches to |
| 1610 | ;;; evaluate heading prefix location set the variables | 1696 | ;;; evaluate heading prefix location set the variables |
| @@ -1667,7 +1753,6 @@ to return the current depth of the most recently matched topic." | |||
| 1667 | 1753 | ||
| 1668 | ;;;_ #4 Navigation | 1754 | ;;;_ #4 Navigation |
| 1669 | 1755 | ||
| 1670 | ;;;_ - Position Assessment | ||
| 1671 | ;;;_ : Location Predicates | 1756 | ;;;_ : Location Predicates |
| 1672 | ;;;_ > allout-on-current-heading-p () | 1757 | ;;;_ > allout-on-current-heading-p () |
| 1673 | (defun allout-on-current-heading-p () | 1758 | (defun allout-on-current-heading-p () |
| @@ -1675,7 +1760,7 @@ to return the current depth of the most recently matched topic." | |||
| 1675 | 1760 | ||
| 1676 | Actually, returns prefix beginning point." | 1761 | Actually, returns prefix beginning point." |
| 1677 | (save-excursion | 1762 | (save-excursion |
| 1678 | (beginning-of-line) | 1763 | (allout-beginning-of-current-line) |
| 1679 | (and (looking-at allout-regexp) | 1764 | (and (looking-at allout-regexp) |
| 1680 | (allout-prefix-data (match-beginning 0) (match-end 0))))) | 1765 | (allout-prefix-data (match-beginning 0) (match-end 0))))) |
| 1681 | ;;;_ > allout-on-heading-p () | 1766 | ;;;_ > allout-on-heading-p () |
| @@ -1686,39 +1771,36 @@ Actually, returns prefix beginning point." | |||
| 1686 | (and (save-excursion (beginning-of-line) | 1771 | (and (save-excursion (beginning-of-line) |
| 1687 | (looking-at allout-regexp)) | 1772 | (looking-at allout-regexp)) |
| 1688 | (= (point)(save-excursion (allout-end-of-prefix)(point))))) | 1773 | (= (point)(save-excursion (allout-end-of-prefix)(point))))) |
| 1689 | ;;;_ > allout-hidden-p () | ||
| 1690 | (defmacro allout-hidden-p () | ||
| 1691 | "True if point is in hidden text." | ||
| 1692 | '(save-excursion | ||
| 1693 | (and (re-search-backward "[\n\r]" () t) | ||
| 1694 | (= ?\r (following-char))))) | ||
| 1695 | ;;;_ > allout-visible-p () | ||
| 1696 | (defmacro allout-visible-p () | ||
| 1697 | "True if point is not in hidden text." | ||
| 1698 | (interactive) | ||
| 1699 | '(not (allout-hidden-p))) | ||
| 1700 | ;;;_ : Location attributes | 1774 | ;;;_ : Location attributes |
| 1701 | ;;;_ > allout-depth () | 1775 | ;;;_ > allout-depth () |
| 1702 | (defsubst allout-depth () | 1776 | (defun allout-depth () |
| 1703 | "Like `allout-current-depth', but respects hidden as well as visible topics." | 1777 | "Return depth of topic most immediately containing point. |
| 1778 | |||
| 1779 | Return zero if point is not within any topic. | ||
| 1780 | |||
| 1781 | Like `allout-current-depth', but respects hidden as well as visible topics." | ||
| 1704 | (save-excursion | 1782 | (save-excursion |
| 1705 | (if (allout-goto-prefix) | 1783 | (let ((start-point (point))) |
| 1706 | (allout-recent-depth) | 1784 | (if (and (allout-goto-prefix) |
| 1707 | (progn | 1785 | (not (< start-point (point)))) |
| 1708 | ;; Oops, no prefix, zero prefix data: | 1786 | (allout-recent-depth) |
| 1709 | (allout-prefix-data (point)(point)) | 1787 | (progn |
| 1710 | ;; ... and return 0: | 1788 | ;; Oops, no prefix, zero prefix data: |
| 1711 | 0)))) | 1789 | (allout-prefix-data (point)(point)) |
| 1790 | ;; ... and return 0: | ||
| 1791 | 0))))) | ||
| 1712 | ;;;_ > allout-current-depth () | 1792 | ;;;_ > allout-current-depth () |
| 1713 | (defmacro allout-current-depth () | 1793 | (defun allout-current-depth () |
| 1714 | "Return nesting depth of visible topic most immediately containing point." | 1794 | "Return depth of visible topic most immediately containing point. |
| 1715 | '(save-excursion | 1795 | |
| 1716 | (if (allout-back-to-current-heading) | 1796 | Return zero if point is not within any topic." |
| 1717 | (max 1 | 1797 | (save-excursion |
| 1718 | (- allout-recent-prefix-end | 1798 | (if (allout-back-to-current-heading) |
| 1719 | allout-recent-prefix-beginning | 1799 | (max 1 |
| 1720 | allout-header-subtraction)) | 1800 | (- allout-recent-prefix-end |
| 1721 | 0))) | 1801 | allout-recent-prefix-beginning |
| 1802 | allout-header-subtraction)) | ||
| 1803 | 0))) | ||
| 1722 | ;;;_ > allout-get-current-prefix () | 1804 | ;;;_ > allout-get-current-prefix () |
| 1723 | (defun allout-get-current-prefix () | 1805 | (defun allout-get-current-prefix () |
| 1724 | "Topic prefix of the current topic." | 1806 | "Topic prefix of the current topic." |
| @@ -1734,7 +1816,7 @@ Actually, returns prefix beginning point." | |||
| 1734 | ;;;_ > allout-current-bullet () | 1816 | ;;;_ > allout-current-bullet () |
| 1735 | (defun allout-current-bullet () | 1817 | (defun allout-current-bullet () |
| 1736 | "Return bullet of current (visible) topic heading, or none if none found." | 1818 | "Return bullet of current (visible) topic heading, or none if none found." |
| 1737 | (condition-case err | 1819 | (condition-case nil |
| 1738 | (save-excursion | 1820 | (save-excursion |
| 1739 | (allout-back-to-current-heading) | 1821 | (allout-back-to-current-heading) |
| 1740 | (buffer-substring (- allout-recent-prefix-end 1) | 1822 | (buffer-substring (- allout-recent-prefix-end 1) |
| @@ -1783,7 +1865,31 @@ Outermost is first." | |||
| 1783 | rev-sibls) | 1865 | rev-sibls) |
| 1784 | ) | 1866 | ) |
| 1785 | 1867 | ||
| 1786 | ;;;_ - Navigation macros | 1868 | ;;;_ - Navigation routines |
| 1869 | ;;;_ > allout-beginning-of-current-line () | ||
| 1870 | (defun allout-beginning-of-current-line () | ||
| 1871 | "Like beginning of line, but to visible text." | ||
| 1872 | |||
| 1873 | ;; XXX We would use `(move-beginning-of-line 1)', but it gets | ||
| 1874 | ;; stuck on some hidden newlines, eg at column 80, as of GNU Emacs 22.0.50. | ||
| 1875 | ;; Conversely, `beginning-of-line' can make no progress in other | ||
| 1876 | ;; situations. Both are necessary, in the order used below. | ||
| 1877 | (move-beginning-of-line 1) | ||
| 1878 | (beginning-of-line) | ||
| 1879 | (while (or (not (bolp)) (allout-hidden-p)) | ||
| 1880 | (beginning-of-line) | ||
| 1881 | (if (or (allout-hidden-p) (not (bolp))) | ||
| 1882 | (forward-char -1)))) | ||
| 1883 | ;;;_ > allout-end-of-current-line () | ||
| 1884 | (defun allout-end-of-current-line () | ||
| 1885 | "Move to the end of line, past concealed text if any." | ||
| 1886 | ;; XXX This is for symmetry with `allout-beginning-of-current-line' - | ||
| 1887 | ;; `move-end-of-line' doesn't suffer the same problem as | ||
| 1888 | ;; `move-beginning-of-line'. | ||
| 1889 | (end-of-line) | ||
| 1890 | (while (allout-hidden-p) | ||
| 1891 | (end-of-line) | ||
| 1892 | (if (allout-hidden-p) (forward-char 1)))) | ||
| 1787 | ;;;_ > allout-next-heading () | 1893 | ;;;_ > allout-next-heading () |
| 1788 | (defsubst allout-next-heading () | 1894 | (defsubst allout-next-heading () |
| 1789 | "Move to the heading for the topic \(possibly invisible) before this one. | 1895 | "Move to the heading for the topic \(possibly invisible) before this one. |
| @@ -1798,7 +1904,7 @@ Returns the location of the heading, or nil if none found." | |||
| 1798 | (goto-char (or (match-beginning 2) | 1904 | (goto-char (or (match-beginning 2) |
| 1799 | allout-recent-prefix-beginning)) | 1905 | allout-recent-prefix-beginning)) |
| 1800 | (or (match-end 2) allout-recent-prefix-end)))) | 1906 | (or (match-end 2) allout-recent-prefix-end)))) |
| 1801 | ;;;_ : allout-this-or-next-heading | 1907 | ;;;_ > allout-this-or-next-heading |
| 1802 | (defun allout-this-or-next-heading () | 1908 | (defun allout-this-or-next-heading () |
| 1803 | "Position cursor on current or next heading." | 1909 | "Position cursor on current or next heading." |
| 1804 | ;; A throwaway non-macro that is defined after allout-next-heading | 1910 | ;; A throwaway non-macro that is defined after allout-next-heading |
| @@ -1822,6 +1928,21 @@ Return the location of the beginning of the heading, or nil if not found." | |||
| 1822 | (goto-char (or (match-beginning 2) | 1928 | (goto-char (or (match-beginning 2) |
| 1823 | allout-recent-prefix-beginning)) | 1929 | allout-recent-prefix-beginning)) |
| 1824 | (or (match-end 2) allout-recent-prefix-end)))))) | 1930 | (or (match-end 2) allout-recent-prefix-end)))))) |
| 1931 | ;;;_ > allout-get-invisibility-overlay () | ||
| 1932 | (defun allout-get-invisibility-overlay () | ||
| 1933 | "Return the overlay at point that dictates allout invisibility." | ||
| 1934 | (let ((overlays (overlays-at (point))) | ||
| 1935 | got) | ||
| 1936 | (while (and overlays (not got)) | ||
| 1937 | (if (equal (overlay-get (car overlays) 'invisible) 'allout) | ||
| 1938 | (setq got (car overlays)))) | ||
| 1939 | got)) | ||
| 1940 | ;;;_ > allout-back-to-visible-text () | ||
| 1941 | (defun allout-back-to-visible-text () | ||
| 1942 | "Move to most recent prior character that is visible, and return point." | ||
| 1943 | (if (allout-hidden-p) | ||
| 1944 | (goto-char (overlay-start (allout-get-invisibility-overlay)))) | ||
| 1945 | (point)) | ||
| 1825 | 1946 | ||
| 1826 | ;;;_ - Subtree Charting | 1947 | ;;;_ - Subtree Charting |
| 1827 | ;;;_ " These routines either produce or assess charts, which are | 1948 | ;;;_ " These routines either produce or assess charts, which are |
| @@ -1912,11 +2033,11 @@ starting point, and PREV-DEPTH is depth of prior topic." | |||
| 1912 | ; the original level. Position | 2033 | ; the original level. Position |
| 1913 | ; to the end of it: | 2034 | ; to the end of it: |
| 1914 | (progn (and (not (eobp)) (forward-char -1)) | 2035 | (progn (and (not (eobp)) (forward-char -1)) |
| 1915 | (and (memq (preceding-char) '(?\n ?\r)) | 2036 | (and (= (preceding-char) ?\n) |
| 1916 | (memq (aref (buffer-substring (max 1 (- (point) 3)) | 2037 | (= (aref (buffer-substring (max 1 (- (point) 3)) |
| 1917 | (point)) | 2038 | (point)) |
| 1918 | 1) | 2039 | 1) |
| 1919 | '(?\n ?\r)) | 2040 | ?\n) |
| 1920 | (forward-char -1)) | 2041 | (forward-char -1)) |
| 1921 | (setq allout-recent-end-of-subtree (point)))) | 2042 | (setq allout-recent-end-of-subtree (point)))) |
| 1922 | 2043 | ||
| @@ -1954,7 +2075,7 @@ start point." | |||
| 1954 | (if further (setq result (append further result))) | 2075 | (if further (setq result (append further result))) |
| 1955 | (setq chart (cdr chart))) | 2076 | (setq chart (cdr chart))) |
| 1956 | (goto-char here) | 2077 | (goto-char here) |
| 1957 | (if (= (preceding-char) ?\r) | 2078 | (if (allout-hidden-p) |
| 1958 | (setq result (cons here result))) | 2079 | (setq result (cons here result))) |
| 1959 | (setq chart (cdr chart)))) | 2080 | (setq chart (cdr chart)))) |
| 1960 | result)) | 2081 | result)) |
| @@ -2003,7 +2124,7 @@ Returns the point at the beginning of the prefix, or nil if none." | |||
| 2003 | 2124 | ||
| 2004 | (let (done) | 2125 | (let (done) |
| 2005 | (while (and (not done) | 2126 | (while (and (not done) |
| 2006 | (re-search-backward "[\n\r]" nil 1)) | 2127 | (search-backward "\n" nil 1)) |
| 2007 | (forward-char 1) | 2128 | (forward-char 1) |
| 2008 | (if (looking-at allout-regexp) | 2129 | (if (looking-at allout-regexp) |
| 2009 | (setq done (allout-prefix-data (match-beginning 0) | 2130 | (setq done (allout-prefix-data (match-beginning 0) |
| @@ -2042,19 +2163,30 @@ otherwise skip white space between bullet and ensuing text." | |||
| 2042 | (1- (match-end 0)))) | 2163 | (1- (match-end 0)))) |
| 2043 | ;;;_ > allout-back-to-current-heading () | 2164 | ;;;_ > allout-back-to-current-heading () |
| 2044 | (defun allout-back-to-current-heading () | 2165 | (defun allout-back-to-current-heading () |
| 2045 | "Move to heading line of current topic, or beginning if already on the line." | 2166 | "Move to heading line of current topic, or beginning if already on the line. |
| 2046 | 2167 | ||
| 2047 | (beginning-of-line) | 2168 | Return value of point, unless we started outside of (before any) topics, |
| 2048 | (prog1 (or (allout-on-current-heading-p) | 2169 | in which case we return nil." |
| 2049 | (and (re-search-backward (concat "^\\(" allout-regexp "\\)") | 2170 | |
| 2050 | nil | 2171 | (allout-beginning-of-current-line) |
| 2051 | 'move) | 2172 | (if (or (allout-on-current-heading-p) |
| 2052 | (allout-prefix-data (match-beginning 1)(match-end 1)))) | 2173 | (and (re-search-backward (concat "^\\(" allout-regexp "\\)") |
| 2053 | (if (interactive-p) (allout-end-of-prefix)))) | 2174 | nil 'move) |
| 2175 | (progn (while (allout-hidden-p) | ||
| 2176 | (allout-beginning-of-current-line) | ||
| 2177 | (if (not (looking-at allout-regexp)) | ||
| 2178 | (re-search-backward (concat | ||
| 2179 | "^\\(" allout-regexp "\\)") | ||
| 2180 | nil 'move))) | ||
| 2181 | (allout-prefix-data (match-beginning 1) | ||
| 2182 | (match-end 1))))) | ||
| 2183 | (if (interactive-p) | ||
| 2184 | (allout-end-of-prefix) | ||
| 2185 | (point)))) | ||
| 2054 | ;;;_ > allout-back-to-heading () | 2186 | ;;;_ > allout-back-to-heading () |
| 2055 | (defalias 'allout-back-to-heading 'allout-back-to-current-heading) | 2187 | (defalias 'allout-back-to-heading 'allout-back-to-current-heading) |
| 2056 | ;;;_ > allout-pre-next-preface () | 2188 | ;;;_ > allout-pre-next-prefix () |
| 2057 | (defun allout-pre-next-preface () | 2189 | (defun allout-pre-next-prefix () |
| 2058 | "Skip forward to just before the next heading line. | 2190 | "Skip forward to just before the next heading line. |
| 2059 | 2191 | ||
| 2060 | Returns that character position." | 2192 | Returns that character position." |
| @@ -2062,12 +2194,16 @@ Returns that character position." | |||
| 2062 | (if (re-search-forward allout-line-boundary-regexp nil 'move) | 2194 | (if (re-search-forward allout-line-boundary-regexp nil 'move) |
| 2063 | (prog1 (goto-char (match-beginning 0)) | 2195 | (prog1 (goto-char (match-beginning 0)) |
| 2064 | (allout-prefix-data (match-beginning 2)(match-end 2))))) | 2196 | (allout-prefix-data (match-beginning 2)(match-end 2))))) |
| 2065 | ;;;_ > allout-end-of-subtree (&optional current) | 2197 | ;;;_ > allout-end-of-subtree (&optional current include-trailing-blank) |
| 2066 | (defun allout-end-of-subtree (&optional current) | 2198 | (defun allout-end-of-subtree (&optional current include-trailing-blank) |
| 2067 | "Put point at the end of the last leaf in the containing topic. | 2199 | "Put point at the end of the last leaf in the containing topic. |
| 2068 | 2200 | ||
| 2069 | If optional CURRENT is true (default false), then put point at the end of | 2201 | Optional CURRENT means put point at the end of the containing |
| 2070 | the containing visible topic. | 2202 | visible topic. |
| 2203 | |||
| 2204 | Optional INCLUDE-TRAILING-BLANK means include a trailing blank line, if | ||
| 2205 | any, as part of the subtree. Otherwise, that trailing blank will be | ||
| 2206 | excluded as delimiting whitespace between topics. | ||
| 2071 | 2207 | ||
| 2072 | Returns the value of point." | 2208 | Returns the value of point." |
| 2073 | (interactive "P") | 2209 | (interactive "P") |
| @@ -2080,18 +2216,21 @@ Returns the value of point." | |||
| 2080 | (> (allout-recent-depth) level)) | 2216 | (> (allout-recent-depth) level)) |
| 2081 | (allout-next-heading)) | 2217 | (allout-next-heading)) |
| 2082 | (and (not (eobp)) (forward-char -1)) | 2218 | (and (not (eobp)) (forward-char -1)) |
| 2083 | (and (memq (preceding-char) '(?\n ?\r)) | 2219 | (if (and (not include-trailing-blank) (= ?\n (preceding-char))) |
| 2084 | (memq (aref (buffer-substring (max 1 (- (point) 3)) (point)) 1) | ||
| 2085 | '(?\n ?\r)) | ||
| 2086 | (forward-char -1)) | 2220 | (forward-char -1)) |
| 2087 | (setq allout-recent-end-of-subtree (point)))) | 2221 | (setq allout-recent-end-of-subtree (point)))) |
| 2088 | ;;;_ > allout-end-of-current-subtree () | 2222 | ;;;_ > allout-end-of-current-subtree (&optional include-trailing-blank) |
| 2089 | (defun allout-end-of-current-subtree () | 2223 | (defun allout-end-of-current-subtree (&optional include-trailing-blank) |
| 2224 | |||
| 2090 | "Put point at end of last leaf in currently visible containing topic. | 2225 | "Put point at end of last leaf in currently visible containing topic. |
| 2091 | 2226 | ||
| 2227 | Optional INCLUDE-TRAILING-BLANK means include a trailing blank line, if | ||
| 2228 | any, as part of the subtree. Otherwise, that trailing blank will be | ||
| 2229 | excluded as delimiting whitespace between topics. | ||
| 2230 | |||
| 2092 | Returns the value of point." | 2231 | Returns the value of point." |
| 2093 | (interactive) | 2232 | (interactive) |
| 2094 | (allout-end-of-subtree t)) | 2233 | (allout-end-of-subtree t include-trailing-blank)) |
| 2095 | ;;;_ > allout-beginning-of-current-entry () | 2234 | ;;;_ > allout-beginning-of-current-entry () |
| 2096 | (defun allout-beginning-of-current-entry () | 2235 | (defun allout-beginning-of-current-entry () |
| 2097 | "When not already there, position point at beginning of current topic header. | 2236 | "When not already there, position point at beginning of current topic header. |
| @@ -2104,18 +2243,23 @@ If already there, move cursor to bullet for hot-spot operation. | |||
| 2104 | (if (and (interactive-p) | 2243 | (if (and (interactive-p) |
| 2105 | (= (point) start-point)) | 2244 | (= (point) start-point)) |
| 2106 | (goto-char (allout-current-bullet-pos))))) | 2245 | (goto-char (allout-current-bullet-pos))))) |
| 2107 | ;;;_ > allout-end-of-entry () | 2246 | ;;;_ > allout-end-of-entry (&optional inclusive) |
| 2108 | (defun allout-end-of-entry () | 2247 | (defun allout-end-of-entry (&optional inclusive) |
| 2109 | "Position the point at the end of the current topics' entry." | 2248 | "Position the point at the end of the current topics' entry. |
| 2249 | |||
| 2250 | Optional INCLUSIVE means also include trailing empty line, if any. When | ||
| 2251 | unset, whitespace between items separates them even when the items are | ||
| 2252 | collapsed." | ||
| 2110 | (interactive) | 2253 | (interactive) |
| 2111 | (prog1 (allout-pre-next-preface) | 2254 | (allout-pre-next-prefix) |
| 2112 | (if (and (not (bobp))(looking-at "^$")) | 2255 | (if (and (not inclusive) (not (bobp)) (= ?\n (preceding-char))) |
| 2113 | (forward-char -1)))) | 2256 | (forward-char -1)) |
| 2257 | (point)) | ||
| 2114 | ;;;_ > allout-end-of-current-heading () | 2258 | ;;;_ > allout-end-of-current-heading () |
| 2115 | (defun allout-end-of-current-heading () | 2259 | (defun allout-end-of-current-heading () |
| 2116 | (interactive) | 2260 | (interactive) |
| 2117 | (allout-beginning-of-current-entry) | 2261 | (allout-beginning-of-current-entry) |
| 2118 | (re-search-forward "[\n\r]" nil t) | 2262 | (search-forward "\n" nil t) |
| 2119 | (forward-char -1)) | 2263 | (forward-char -1)) |
| 2120 | (defalias 'allout-end-of-heading 'allout-end-of-current-heading) | 2264 | (defalias 'allout-end-of-heading 'allout-end-of-current-heading) |
| 2121 | ;;;_ > allout-get-body-text () | 2265 | ;;;_ > allout-get-body-text () |
| @@ -2123,13 +2267,13 @@ If already there, move cursor to bullet for hot-spot operation. | |||
| 2123 | "Return the unmangled body text of the topic immediately containing point." | 2267 | "Return the unmangled body text of the topic immediately containing point." |
| 2124 | (save-excursion | 2268 | (save-excursion |
| 2125 | (allout-end-of-prefix) | 2269 | (allout-end-of-prefix) |
| 2126 | (if (not (re-search-forward "[\n\r]" nil t)) | 2270 | (if (not (search-forward "\n" nil t)) |
| 2127 | nil | 2271 | nil |
| 2128 | (backward-char 1) | 2272 | (backward-char 1) |
| 2129 | (let ((pre-body (point))) | 2273 | (let ((pre-body (point))) |
| 2130 | (if (not pre-body) | 2274 | (if (not pre-body) |
| 2131 | nil | 2275 | nil |
| 2132 | (allout-end-of-entry) | 2276 | (allout-end-of-entry t) |
| 2133 | (if (not (= pre-body (point))) | 2277 | (if (not (= pre-body (point))) |
| 2134 | (buffer-substring-no-properties (1+ pre-body) (point)))) | 2278 | (buffer-substring-no-properties (1+ pre-body) (point)))) |
| 2135 | ) | 2279 | ) |
| @@ -2189,8 +2333,7 @@ DONT-COMPLAIN is non-nil." | |||
| 2189 | (allout-back-to-current-heading) | 2333 | (allout-back-to-current-heading) |
| 2190 | (let ((present-level (allout-recent-depth)) | 2334 | (let ((present-level (allout-recent-depth)) |
| 2191 | (last-good (point)) | 2335 | (last-good (point)) |
| 2192 | failed | 2336 | failed) |
| 2193 | return) | ||
| 2194 | ;; Loop for iterating arg: | 2337 | ;; Loop for iterating arg: |
| 2195 | (while (and (> (allout-recent-depth) 1) | 2338 | (while (and (> (allout-recent-depth) 1) |
| 2196 | (> arg 0) | 2339 | (> arg 0) |
| @@ -2260,11 +2403,9 @@ Presumes point is at the start of a topic prefix." | |||
| 2260 | (if (or (bobp) (eobp)) | 2403 | (if (or (bobp) (eobp)) |
| 2261 | nil | 2404 | nil |
| 2262 | (forward-char -1)) | 2405 | (forward-char -1)) |
| 2263 | (if (or (bobp) (not (memq (preceding-char) '(?\n ?\r)))) | 2406 | (if (or (bobp) (not (= ?\n (preceding-char)))) |
| 2264 | nil | 2407 | nil |
| 2265 | (forward-char -1) | 2408 | (forward-char -1)) |
| 2266 | (if (or (bobp) (not (memq (preceding-char) '(?\n ?\r)))) | ||
| 2267 | (forward-char -1))) | ||
| 2268 | (point)) | 2409 | (point)) |
| 2269 | ;;;_ > allout-beginning-of-level () | 2410 | ;;;_ > allout-beginning-of-level () |
| 2270 | (defun allout-beginning-of-level () | 2411 | (defun allout-beginning-of-level () |
| @@ -2282,19 +2423,19 @@ Presumes point is at the start of a topic prefix." | |||
| 2282 | (defun allout-next-visible-heading (arg) | 2423 | (defun allout-next-visible-heading (arg) |
| 2283 | "Move to the next ARG'th visible heading line, backward if arg is negative. | 2424 | "Move to the next ARG'th visible heading line, backward if arg is negative. |
| 2284 | 2425 | ||
| 2285 | Move as far as possible in indicated direction \(beginning or end of | 2426 | Move to buffer limit in indicated direction if headings are exhausted." |
| 2286 | buffer) if headings are exhausted." | ||
| 2287 | 2427 | ||
| 2288 | (interactive "p") | 2428 | (interactive "p") |
| 2289 | (let* ((backward (if (< arg 0) (setq arg (* -1 arg)))) | 2429 | (let* ((backward (if (< arg 0) (setq arg (* -1 arg)))) |
| 2290 | (step (if backward -1 1)) | 2430 | (step (if backward -1 1)) |
| 2291 | (start-point (point)) | ||
| 2292 | prev got) | 2431 | prev got) |
| 2293 | 2432 | ||
| 2294 | (while (> arg 0) ; limit condition | 2433 | (while (> arg 0) ; limit condition |
| 2295 | (while (and (not (if backward (bobp)(eobp))) ; boundary condition | 2434 | (while (and (not (if backward (bobp)(eobp))) ; boundary condition |
| 2296 | ;; Move, skipping over all those concealed lines: | 2435 | ;; Move, skipping over all those concealed lines: |
| 2297 | (< -1 (forward-line step)) | 2436 | (prog1 (condition-case nil (or (line-move step) t) |
| 2437 | (error nil)) | ||
| 2438 | (allout-beginning-of-current-line)) | ||
| 2298 | (not (setq got (looking-at allout-regexp))))) | 2439 | (not (setq got (looking-at allout-regexp))))) |
| 2299 | ;; Register this got, it may be the last: | 2440 | ;; Register this got, it may be the last: |
| 2300 | (if got (setq prev got)) | 2441 | (if got (setq prev got)) |
| @@ -2323,7 +2464,6 @@ Takes optional repeat-count, goes backward if count is negative. | |||
| 2323 | Returns resulting position, else nil if none found." | 2464 | Returns resulting position, else nil if none found." |
| 2324 | (interactive "p") | 2465 | (interactive "p") |
| 2325 | (let ((start-depth (allout-current-depth)) | 2466 | (let ((start-depth (allout-current-depth)) |
| 2326 | (start-point (point)) | ||
| 2327 | (start-arg arg) | 2467 | (start-arg arg) |
| 2328 | (backward (> 0 arg)) | 2468 | (backward (> 0 arg)) |
| 2329 | last-depth | 2469 | last-depth |
| @@ -2386,51 +2526,17 @@ are mapped to the command of the corresponding control-key on the | |||
| 2386 | - Implement (and clear) `allout-post-goto-bullet', for hot-spot | 2526 | - Implement (and clear) `allout-post-goto-bullet', for hot-spot |
| 2387 | outline commands. | 2527 | outline commands. |
| 2388 | 2528 | ||
| 2389 | - Decrypt topic currently being edited if it was encrypted for a save. | 2529 | - Decrypt topic currently being edited if it was encrypted for a save." |
| 2390 | |||
| 2391 | - Massage buffer-undo-list so successive, standard character self-inserts are | ||
| 2392 | aggregated. This kludge compensates for lack of undo bunching when | ||
| 2393 | before-change-functions is used." | ||
| 2394 | 2530 | ||
| 2395 | ; Apply any external change func: | 2531 | ; Apply any external change func: |
| 2396 | (if (not (allout-mode-p)) ; In allout-mode. | 2532 | (if (not (allout-mode-p)) ; In allout-mode. |
| 2397 | nil | 2533 | nil |
| 2398 | (if allout-isearch-dynamic-expose | ||
| 2399 | (allout-isearch-rectification)) | ||
| 2400 | ;; Undo bunching business: | ||
| 2401 | (if (and (listp buffer-undo-list) ; Undo history being kept. | ||
| 2402 | (equal this-command 'self-insert-command) | ||
| 2403 | (equal last-command 'self-insert-command)) | ||
| 2404 | (let* ((prev-stuff (cdr buffer-undo-list)) | ||
| 2405 | (before-prev-stuff (cdr (cdr prev-stuff))) | ||
| 2406 | cur-cell cur-from cur-to | ||
| 2407 | prev-cell prev-from prev-to) | ||
| 2408 | (if (and before-prev-stuff ; Goes back far enough to bother, | ||
| 2409 | (not (car prev-stuff)) ; and break before current, | ||
| 2410 | (not (car before-prev-stuff)) ; !and break before prev! | ||
| 2411 | (setq prev-cell (car (cdr prev-stuff))) ; contents now, | ||
| 2412 | (setq cur-cell (car buffer-undo-list)) ; contents prev. | ||
| 2413 | |||
| 2414 | ;; cur contents denote a single char insertion: | ||
| 2415 | (numberp (setq cur-from (car cur-cell))) | ||
| 2416 | (numberp (setq cur-to (cdr cur-cell))) | ||
| 2417 | (= 1 (- cur-to cur-from)) | ||
| 2418 | |||
| 2419 | ;; prev contents denote fewer than aggregate-limit | ||
| 2420 | ;; insertions: | ||
| 2421 | (numberp (setq prev-from (car prev-cell))) | ||
| 2422 | (numberp (setq prev-to (cdr prev-cell))) | ||
| 2423 | ; Below threshold: | ||
| 2424 | (> allout-undo-aggregation (- prev-to prev-from))) | ||
| 2425 | (setq buffer-undo-list | ||
| 2426 | (cons (cons prev-from cur-to) | ||
| 2427 | (cdr (cdr (cdr buffer-undo-list)))))))) | ||
| 2428 | 2534 | ||
| 2429 | (if (and (boundp 'allout-after-save-decrypt) | 2535 | (if (and (boundp 'allout-after-save-decrypt) |
| 2430 | allout-after-save-decrypt) | 2536 | allout-after-save-decrypt) |
| 2431 | (allout-after-saves-handler)) | 2537 | (allout-after-saves-handler)) |
| 2432 | 2538 | ||
| 2433 | ;; Implement -post-goto-bullet, if set: (must be after undo business) | 2539 | ;; Implement -post-goto-bullet, if set: |
| 2434 | (if (and allout-post-goto-bullet | 2540 | (if (and allout-post-goto-bullet |
| 2435 | (allout-current-bullet-pos)) | 2541 | (allout-current-bullet-pos)) |
| 2436 | (progn (goto-char (allout-current-bullet-pos)) | 2542 | (progn (goto-char (allout-current-bullet-pos)) |
| @@ -2456,10 +2562,6 @@ return to regular interpretation of self-insert characters." | |||
| 2456 | (if (not (allout-mode-p)) | 2562 | (if (not (allout-mode-p)) |
| 2457 | ;; Shouldn't be invoked if not in allout-mode, but just in case: | 2563 | ;; Shouldn't be invoked if not in allout-mode, but just in case: |
| 2458 | nil | 2564 | nil |
| 2459 | ;; Register isearch status: | ||
| 2460 | (if (and (boundp 'isearch-mode) isearch-mode) | ||
| 2461 | (setq allout-pre-was-isearching t) | ||
| 2462 | (setq allout-pre-was-isearching nil)) | ||
| 2463 | ;; Hot-spot navigation provisions: | 2565 | ;; Hot-spot navigation provisions: |
| 2464 | (if (and (eq this-command 'self-insert-command) | 2566 | (if (and (eq this-command 'self-insert-command) |
| 2465 | (eq (point)(allout-current-bullet-pos))) | 2567 | (eq (point)(allout-current-bullet-pos))) |
| @@ -2499,110 +2601,6 @@ See `allout-init' for setup instructions." | |||
| 2499 | (not (allout-mode-p)) | 2601 | (not (allout-mode-p)) |
| 2500 | allout-layout) | 2602 | allout-layout) |
| 2501 | (allout-mode t))) | 2603 | (allout-mode t))) |
| 2502 | ;;;_ > allout-isearch-rectification | ||
| 2503 | (defun allout-isearch-rectification () | ||
| 2504 | "Rectify outline exposure before, during, or after isearch. | ||
| 2505 | |||
| 2506 | Called as part of `allout-post-command-business'." | ||
| 2507 | |||
| 2508 | (let ((isearching (and (boundp 'isearch-mode) isearch-mode))) | ||
| 2509 | (cond ((and isearching (not allout-pre-was-isearching)) | ||
| 2510 | (allout-isearch-expose 'start)) | ||
| 2511 | ((and isearching allout-pre-was-isearching) | ||
| 2512 | (allout-isearch-expose 'continue)) | ||
| 2513 | ((and (not isearching) allout-pre-was-isearching) | ||
| 2514 | (allout-isearch-expose 'final)) | ||
| 2515 | ;; Not and wasn't isearching: | ||
| 2516 | (t (setq allout-isearch-prior-pos nil) | ||
| 2517 | (setq allout-isearch-did-quit nil))))) | ||
| 2518 | ;;;_ = allout-isearch-was-font-lock | ||
| 2519 | (defvar allout-isearch-was-font-lock | ||
| 2520 | (and (boundp 'font-lock-mode) font-lock-mode)) | ||
| 2521 | ;;;_ > allout-isearch-expose (mode) | ||
| 2522 | (defun allout-isearch-expose (mode) | ||
| 2523 | "MODE is either 'clear, 'start, 'continue, or 'final." | ||
| 2524 | ;; allout-isearch-prior-pos encodes exposure status of prior pos: | ||
| 2525 | ;; (pos was-vis header-pos end-pos) | ||
| 2526 | ;; pos - point of concern | ||
| 2527 | ;; was-vis - t, else 'topic if entire topic was exposed, 'entry otherwise | ||
| 2528 | ;; Do reclosure or prior pos, as necessary: | ||
| 2529 | (if (eq mode 'start) | ||
| 2530 | (setq allout-isearch-was-font-lock (and (boundp 'font-lock-mode) | ||
| 2531 | font-lock-mode) | ||
| 2532 | font-lock-mode nil) | ||
| 2533 | (if (eq mode 'final) | ||
| 2534 | (setq font-lock-mode allout-isearch-was-font-lock)) | ||
| 2535 | (if (and allout-isearch-prior-pos | ||
| 2536 | (listp allout-isearch-prior-pos)) | ||
| 2537 | ;; Conceal prior peek: | ||
| 2538 | (allout-flag-region (car (cdr allout-isearch-prior-pos)) | ||
| 2539 | (car (cdr (cdr allout-isearch-prior-pos))) | ||
| 2540 | ?\r))) | ||
| 2541 | (if (allout-visible-p) | ||
| 2542 | (setq allout-isearch-prior-pos nil) | ||
| 2543 | (if (not (eq mode 'final)) | ||
| 2544 | (setq allout-isearch-prior-pos (cons (point) (allout-show-entry))) | ||
| 2545 | (if allout-isearch-did-quit | ||
| 2546 | nil | ||
| 2547 | (setq allout-isearch-prior-pos nil) | ||
| 2548 | (allout-show-children)))) | ||
| 2549 | (setq allout-isearch-did-quit nil)) | ||
| 2550 | ;;;_ > allout-enwrap-isearch () | ||
| 2551 | (defun allout-enwrap-isearch () | ||
| 2552 | "Impose `allout-mode' isearch-abort wrapper for dynamic exposure in isearch. | ||
| 2553 | |||
| 2554 | The function checks to ensure that the rebinding is done only once." | ||
| 2555 | |||
| 2556 | (add-hook 'isearch-mode-end-hook 'allout-isearch-rectification) | ||
| 2557 | (if (fboundp 'allout-real-isearch-abort) | ||
| 2558 | ;; | ||
| 2559 | nil | ||
| 2560 | ; Ensure load of isearch-mode: | ||
| 2561 | (if (or (and (fboundp 'isearch-mode) | ||
| 2562 | (fboundp 'isearch-abort)) | ||
| 2563 | (condition-case error | ||
| 2564 | (load-library "isearch-mode") | ||
| 2565 | ('file-error (message | ||
| 2566 | "Skipping isearch-mode provisions - %s '%s'" | ||
| 2567 | (car (cdr error)) | ||
| 2568 | (car (cdr (cdr error)))) | ||
| 2569 | (sit-for 1) | ||
| 2570 | ;; Inhibit subsequent tries and return nil: | ||
| 2571 | (setq allout-isearch-dynamic-expose nil)))) | ||
| 2572 | ;; Isearch-mode loaded, encapsulate specific entry points for | ||
| 2573 | ;; outline dynamic-exposure business: | ||
| 2574 | (progn | ||
| 2575 | ;; stash crucial isearch-mode funcs under known, private | ||
| 2576 | ;; names, then register wrapper functions under the old | ||
| 2577 | ;; names, in their stead: | ||
| 2578 | (fset 'allout-real-isearch-abort (symbol-function 'isearch-abort)) | ||
| 2579 | (fset 'isearch-abort 'allout-isearch-abort))))) | ||
| 2580 | ;;;_ > allout-isearch-abort () | ||
| 2581 | (defun allout-isearch-abort () | ||
| 2582 | "Wrapper for allout-real-isearch-abort \(which see), to register | ||
| 2583 | actual quits." | ||
| 2584 | (interactive) | ||
| 2585 | (setq allout-isearch-did-quit nil) | ||
| 2586 | (condition-case what | ||
| 2587 | (allout-real-isearch-abort) | ||
| 2588 | ('quit (setq allout-isearch-did-quit t) | ||
| 2589 | (signal 'quit nil)))) | ||
| 2590 | |||
| 2591 | ;;; Prevent unnecessary font-lock while isearching! | ||
| 2592 | (defvar isearch-was-font-locking nil) | ||
| 2593 | (defun isearch-inhibit-font-lock () | ||
| 2594 | "Inhibit `font-lock' while isearching - for use on `isearch-mode-hook'." | ||
| 2595 | (if (and (allout-mode-p) (boundp 'font-lock-mode) font-lock-mode) | ||
| 2596 | (setq isearch-was-font-locking t | ||
| 2597 | font-lock-mode nil))) | ||
| 2598 | (add-hook 'isearch-mode-hook 'isearch-inhibit-font-lock) | ||
| 2599 | (defun isearch-reenable-font-lock () | ||
| 2600 | "Reenable font-lock after isearching - for use on `isearch-mode-end-hook'." | ||
| 2601 | (if (and (boundp 'font-lock-mode) font-lock-mode) | ||
| 2602 | (if (and (allout-mode-p) isearch-was-font-locking) | ||
| 2603 | (setq isearch-was-font-locking nil | ||
| 2604 | font-lock-mode t)))) | ||
| 2605 | (add-hook 'isearch-mode-end-hook 'isearch-reenable-font-lock) | ||
| 2606 | 2604 | ||
| 2607 | ;;;_ - Topic Format Assessment | 2605 | ;;;_ - Topic Format Assessment |
| 2608 | ;;;_ > allout-solicit-alternate-bullet (depth &optional current-bullet) | 2606 | ;;;_ > allout-solicit-alternate-bullet (depth &optional current-bullet) |
| @@ -2807,15 +2805,20 @@ index for each successive sibling)." | |||
| 2807 | ((allout-sibling-index)))))) | 2805 | ((allout-sibling-index)))))) |
| 2808 | ) | 2806 | ) |
| 2809 | ) | 2807 | ) |
| 2810 | ;;;_ > allout-open-topic (relative-depth &optional before use_recent_bullet) | 2808 | ;;;_ > allout-open-topic (relative-depth &optional before offer-recent-bullet) |
| 2811 | (defun allout-open-topic (relative-depth &optional before use_recent_bullet) | 2809 | (defun allout-open-topic (relative-depth &optional before offer-recent-bullet) |
| 2812 | "Open a new topic at depth DEPTH. | 2810 | "Open a new topic at depth DEPTH. |
| 2813 | 2811 | ||
| 2814 | New topic is situated after current one, unless optional flag BEFORE | 2812 | New topic is situated after current one, unless optional flag BEFORE |
| 2815 | is non-nil, or unless current line is complete empty (not even | 2813 | is non-nil, or unless current line is completely empty - lacking even |
| 2816 | whitespace), in which case open is done on current line. | 2814 | whitespace - in which case open is done on the current line. |
| 2817 | 2815 | ||
| 2818 | If USE_RECENT_BULLET is true, offer to use the bullet of the prior sibling. | 2816 | When adding an offspring, it will be added immediately after the parent if |
| 2817 | the other offspring are exposed, or after the last child if the offspring | ||
| 2818 | are hidden. \(The intervening offspring will be exposed in the latter | ||
| 2819 | case.) | ||
| 2820 | |||
| 2821 | If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling. | ||
| 2819 | 2822 | ||
| 2820 | Nuances: | 2823 | Nuances: |
| 2821 | 2824 | ||
| @@ -2839,12 +2842,12 @@ Nuances: | |||
| 2839 | having to go to its preceding sibling, and then open forward | 2842 | having to go to its preceding sibling, and then open forward |
| 2840 | from there." | 2843 | from there." |
| 2841 | 2844 | ||
| 2845 | (allout-beginning-of-current-line) | ||
| 2842 | (let* ((depth (+ (allout-current-depth) relative-depth)) | 2846 | (let* ((depth (+ (allout-current-depth) relative-depth)) |
| 2843 | (opening-on-blank (if (looking-at "^\$") | 2847 | (opening-on-blank (if (looking-at "^\$") |
| 2844 | (not (setq before nil)))) | 2848 | (not (setq before nil)))) |
| 2845 | ;; bunch o vars set while computing ref-topic | 2849 | ;; bunch o vars set while computing ref-topic |
| 2846 | opening-numbered | 2850 | opening-numbered |
| 2847 | opening-encrypted | ||
| 2848 | ref-depth | 2851 | ref-depth |
| 2849 | ref-bullet | 2852 | ref-bullet |
| 2850 | (ref-topic (save-excursion | 2853 | (ref-topic (save-excursion |
| @@ -2864,13 +2867,6 @@ Nuances: | |||
| 2864 | (allout-descend-to-depth depth)) | 2867 | (allout-descend-to-depth depth)) |
| 2865 | (if (allout-numbered-type-prefix) | 2868 | (if (allout-numbered-type-prefix) |
| 2866 | allout-numbered-bullet)))) | 2869 | allout-numbered-bullet)))) |
| 2867 | (setq opening-encrypted | ||
| 2868 | (save-excursion | ||
| 2869 | (and allout-topic-encryption-bullet | ||
| 2870 | (or (<= relative-depth 0) | ||
| 2871 | (allout-descend-to-depth depth)) | ||
| 2872 | (if (allout-numbered-type-prefix) | ||
| 2873 | allout-numbered-bullet)))) | ||
| 2874 | (point))) | 2870 | (point))) |
| 2875 | dbl-space | 2871 | dbl-space |
| 2876 | doing-beginning) | 2872 | doing-beginning) |
| @@ -2891,122 +2887,98 @@ Nuances: | |||
| 2891 | (save-excursion | 2887 | (save-excursion |
| 2892 | ;; succeeded by a blank line? | 2888 | ;; succeeded by a blank line? |
| 2893 | (allout-end-of-current-subtree) | 2889 | (allout-end-of-current-subtree) |
| 2894 | (bolp))) | 2890 | (looking-at "\n\n"))) |
| 2895 | (and (= ref-depth 1) | 2891 | (and (= ref-depth 1) |
| 2896 | (or before | 2892 | (or before |
| 2897 | (= depth 1) | 2893 | (= depth 1) |
| 2898 | (save-excursion | 2894 | (save-excursion |
| 2899 | ;; Don't already have following | 2895 | ;; Don't already have following |
| 2900 | ;; vertical padding: | 2896 | ;; vertical padding: |
| 2901 | (not (allout-pre-next-preface))))))) | 2897 | (not (allout-pre-next-prefix))))))) |
| 2902 | 2898 | ||
| 2903 | ; Position to prior heading, | 2899 | ;; Position to prior heading, if inserting backwards, and not |
| 2904 | ; if inserting backwards, and | 2900 | ;; going outwards: |
| 2905 | ; not going outwards: | ||
| 2906 | (if (and before (>= relative-depth 0)) | 2901 | (if (and before (>= relative-depth 0)) |
| 2907 | (progn (allout-back-to-current-heading) | 2902 | (progn (allout-back-to-current-heading) |
| 2908 | (setq doing-beginning (bobp)) | 2903 | (setq doing-beginning (bobp)) |
| 2909 | (if (not (bobp)) | 2904 | (if (not (bobp)) |
| 2910 | (allout-previous-heading))) | 2905 | (allout-previous-heading))) |
| 2911 | (if (and before (bobp)) | 2906 | (if (and before (bobp)) |
| 2912 | (allout-unprotected (allout-open-line-not-read-only)))) | 2907 | (open-line 1))) |
| 2913 | 2908 | ||
| 2914 | (if (<= relative-depth 0) | 2909 | (if (<= relative-depth 0) |
| 2915 | ;; Not going inwards, don't snug up: | 2910 | ;; Not going inwards, don't snug up: |
| 2916 | (if doing-beginning | 2911 | (if doing-beginning |
| 2917 | (allout-unprotected | 2912 | (if (not dbl-space) |
| 2918 | (if (not dbl-space) | 2913 | (open-line 1) |
| 2919 | (allout-open-line-not-read-only) | 2914 | (open-line 2)) |
| 2920 | (allout-open-line-not-read-only) | ||
| 2921 | (allout-open-line-not-read-only))) | ||
| 2922 | (if before | 2915 | (if before |
| 2923 | (progn (end-of-line) | 2916 | (progn (end-of-line) |
| 2924 | (allout-pre-next-preface) | 2917 | (allout-pre-next-prefix) |
| 2925 | (while (= ?\r (following-char)) | 2918 | (while (and (= ?\n (following-char)) |
| 2919 | (save-excursion | ||
| 2920 | (forward-char 1) | ||
| 2921 | (allout-hidden-p))) | ||
| 2926 | (forward-char 1)) | 2922 | (forward-char 1)) |
| 2927 | (if (not (looking-at "^$")) | 2923 | (if (not (looking-at "^$")) |
| 2928 | (allout-unprotected | 2924 | (open-line 1))) |
| 2929 | (allout-open-line-not-read-only)))) | 2925 | (allout-end-of-current-subtree) |
| 2930 | (allout-end-of-current-subtree))) | 2926 | (if (looking-at "\n\n") (forward-char 1)))) |
| 2931 | ;; Going inwards - double-space if first offspring is, | 2927 | ;; Going inwards - double-space if first offspring is |
| 2932 | ;; otherwise snug up. | 2928 | ;; double-spaced, otherwise snug up. |
| 2933 | (end-of-line) ; So we skip any concealed progeny. | 2929 | (allout-end-of-entry) |
| 2934 | (allout-pre-next-preface) | 2930 | (line-move 1) |
| 2931 | (allout-beginning-of-current-line) | ||
| 2932 | (backward-char 1) | ||
| 2935 | (if (bolp) | 2933 | (if (bolp) |
| 2936 | ;; Blank lines between current header body and next | 2934 | ;; Blank lines between current header body and next |
| 2937 | ;; header - get to last substantive (non-white-space) | 2935 | ;; header - get to last substantive (non-white-space) |
| 2938 | ;; line in body: | 2936 | ;; line in body: |
| 2939 | (re-search-backward "[^ \t\n]" nil t)) | 2937 | (progn (setq dbl-space t) |
| 2938 | (re-search-backward "[^ \t\n]" nil t))) | ||
| 2939 | (if (looking-at "\n\n") | ||
| 2940 | (setq dbl-space t)) | ||
| 2940 | (if (save-excursion | 2941 | (if (save-excursion |
| 2941 | (allout-next-heading) | 2942 | (allout-next-heading) |
| 2942 | (if (> (allout-recent-depth) ref-depth) | 2943 | (when (> (allout-recent-depth) ref-depth) |
| 2943 | ;; This is an offspring. | 2944 | ;; This is an offspring. |
| 2944 | (progn (forward-line -1) | 2945 | (forward-line -1) |
| 2945 | (looking-at "^\\s-*$")))) | 2946 | (looking-at "^\\s-*$"))) |
| 2946 | (progn (forward-line 1) | 2947 | (progn (forward-line 1) |
| 2947 | (allout-unprotected | 2948 | (open-line 1) |
| 2948 | (allout-open-line-not-read-only)) | ||
| 2949 | (forward-line 1))) | 2949 | (forward-line 1))) |
| 2950 | (end-of-line)) | 2950 | (allout-end-of-current-line)) |
| 2951 | |||
| 2951 | ;;(if doing-beginning (goto-char doing-beginning)) | 2952 | ;;(if doing-beginning (goto-char doing-beginning)) |
| 2952 | (if (not (bobp)) | 2953 | (if (not (bobp)) |
| 2953 | ;; We insert a newline char rather than using open-line to | 2954 | ;; We insert a newline char rather than using open-line to |
| 2954 | ;; avoid rear-stickiness inheritence of read-only property. | 2955 | ;; avoid rear-stickiness inheritence of read-only property. |
| 2955 | (progn (if (and (not (> depth ref-depth)) | 2956 | (progn (if (and (not (> depth ref-depth)) |
| 2956 | (not before)) | 2957 | (not before)) |
| 2957 | (allout-unprotected | 2958 | (open-line 1) |
| 2958 | (allout-open-line-not-read-only)) | 2959 | (if (and (not dbl-space) (> depth ref-depth)) |
| 2959 | (if (> depth ref-depth) | 2960 | (newline 1) |
| 2960 | (allout-unprotected | ||
| 2961 | (allout-open-line-not-read-only)) | ||
| 2962 | (if dbl-space | 2961 | (if dbl-space |
| 2963 | (allout-unprotected | 2962 | (open-line 1) |
| 2964 | (allout-open-line-not-read-only)) | ||
| 2965 | (if (not before) | 2963 | (if (not before) |
| 2966 | (allout-unprotected (newline 1)))))) | 2964 | (newline 1))))) |
| 2967 | (if dbl-space | 2965 | (if (and dbl-space (not (> relative-depth 0))) |
| 2968 | (allout-unprotected (newline 1))) | 2966 | (newline 1)) |
| 2969 | (if (and (not (eobp)) | 2967 | (if (and (not (eobp)) |
| 2970 | (not (bolp))) | 2968 | (not (bolp))) |
| 2971 | (forward-char 1)))) | 2969 | (forward-char 1)))) |
| 2972 | )) | 2970 | )) |
| 2973 | (insert (concat (allout-make-topic-prefix opening-numbered | 2971 | (insert (concat (allout-make-topic-prefix opening-numbered t depth) |
| 2974 | t | 2972 | " ")) |
| 2975 | depth) | 2973 | |
| 2976 | " ")) | 2974 | (allout-rebullet-heading (and offer-recent-bullet ref-bullet) |
| 2977 | 2975 | depth nil nil t) | |
| 2978 | ;;(if doing-beginning (save-excursion (newline (if dbl-space 2 1)))) | 2976 | (if (> relative-depth 0) |
| 2979 | 2977 | (save-excursion (goto-char ref-topic) | |
| 2980 | 2978 | (allout-show-children))) | |
| 2981 | (allout-rebullet-heading (and use_recent_bullet ;;; solicit | ||
| 2982 | ref-bullet) | ||
| 2983 | depth ;;; depth | ||
| 2984 | nil ;;; number-control | ||
| 2985 | nil ;;; index | ||
| 2986 | t) | ||
| 2987 | (end-of-line) | 2979 | (end-of-line) |
| 2988 | ) | 2980 | ) |
| 2989 | ) | 2981 | ) |
| 2990 | ;;;_ . open-topic contingencies | ||
| 2991 | ;;;_ ; base topic - one from which open was issued | ||
| 2992 | ;;;_ , beginning char | ||
| 2993 | ;;;_ , amount of space before will be used, unless opening in place | ||
| 2994 | ;;;_ , end char will be used, unless opening before (and it still may) | ||
| 2995 | ;;;_ ; absolute depth of new topic | ||
| 2996 | ;;;_ ! insert in place - overrides most stuff | ||
| 2997 | ;;;_ ; relative depth of new re base | ||
| 2998 | ;;;_ ; before or after base topic | ||
| 2999 | ;;;_ ; spacing around topic, if any, prior to new topic and at same depth | ||
| 3000 | ;;;_ ; buffer boundaries - special provisions for beginning and end ob | ||
| 3001 | ;;;_ ; level 1 topics have special provisions also - double space. | ||
| 3002 | ;;;_ ; location of new topic | ||
| 3003 | ;;;_ > allout-open-line-not-read-only () | ||
| 3004 | (defun allout-open-line-not-read-only () | ||
| 3005 | "Open line and remove inherited read-only text prop from new char, if any." | ||
| 3006 | (open-line 1) | ||
| 3007 | (if (plist-get (text-properties-at (point)) 'read-only) | ||
| 3008 | (allout-unprotected | ||
| 3009 | (remove-text-properties (point) (+ 1 (point)) '(read-only nil))))) | ||
| 3010 | ;;;_ > allout-open-subtopic (arg) | 2982 | ;;;_ > allout-open-subtopic (arg) |
| 3011 | (defun allout-open-subtopic (arg) | 2983 | (defun allout-open-subtopic (arg) |
| 3012 | "Open new topic header at deeper level than the current one. | 2984 | "Open new topic header at deeper level than the current one. |
| @@ -3055,9 +3027,12 @@ Maintains outline hanging topic indentation if | |||
| 3055 | ;; length of topic prefix: | 3027 | ;; length of topic prefix: |
| 3056 | (make-string (progn (allout-end-of-prefix) | 3028 | (make-string (progn (allout-end-of-prefix) |
| 3057 | (current-column)) | 3029 | (current-column)) |
| 3058 | ?\ )))))) | 3030 | ?\ ))))) |
| 3031 | (use-auto-fill-function (or allout-outside-normal-auto-fill-function | ||
| 3032 | auto-fill-function | ||
| 3033 | 'do-auto-fill))) | ||
| 3059 | (if (or allout-former-auto-filler allout-use-hanging-indents) | 3034 | (if (or allout-former-auto-filler allout-use-hanging-indents) |
| 3060 | (do-auto-fill)))) | 3035 | (funcall use-auto-fill-function)))) |
| 3061 | ;;;_ > allout-reindent-body (old-depth new-depth &optional number) | 3036 | ;;;_ > allout-reindent-body (old-depth new-depth &optional number) |
| 3062 | (defun allout-reindent-body (old-depth new-depth &optional number) | 3037 | (defun allout-reindent-body (old-depth new-depth &optional number) |
| 3063 | "Reindent body lines which were indented at OLD-DEPTH to NEW-DEPTH. | 3038 | "Reindent body lines which were indented at OLD-DEPTH to NEW-DEPTH. |
| @@ -3071,7 +3046,6 @@ Note that refill of indented paragraphs is not done." | |||
| 3071 | (allout-end-of-prefix) | 3046 | (allout-end-of-prefix) |
| 3072 | (let* ((new-margin (current-column)) | 3047 | (let* ((new-margin (current-column)) |
| 3073 | excess old-indent-begin old-indent-end | 3048 | excess old-indent-begin old-indent-end |
| 3074 | curr-ind | ||
| 3075 | ;; We want the column where the header-prefix text started | 3049 | ;; We want the column where the header-prefix text started |
| 3076 | ;; *before* the prefix was changed, so we infer it relative | 3050 | ;; *before* the prefix was changed, so we infer it relative |
| 3077 | ;; to the new margin and the shift in depth: | 3051 | ;; to the new margin and the shift in depth: |
| @@ -3081,7 +3055,7 @@ Note that refill of indented paragraphs is not done." | |||
| 3081 | (allout-unprotected | 3055 | (allout-unprotected |
| 3082 | (save-match-data | 3056 | (save-match-data |
| 3083 | (while | 3057 | (while |
| 3084 | (and (re-search-forward "[\n\r]\\(\\s-*\\)" | 3058 | (and (re-search-forward "\n\\(\\s-*\\)" |
| 3085 | nil | 3059 | nil |
| 3086 | t) | 3060 | t) |
| 3087 | ;; Register the indent data, before we reset the | 3061 | ;; Register the indent data, before we reset the |
| @@ -3231,8 +3205,7 @@ Descends into invisible as well as visible topics, however. | |||
| 3231 | 3205 | ||
| 3232 | With repeat count, shift topic depth by that amount." | 3206 | With repeat count, shift topic depth by that amount." |
| 3233 | (interactive "P") | 3207 | (interactive "P") |
| 3234 | (let ((start-col (current-column)) | 3208 | (let ((start-col (current-column))) |
| 3235 | (was-eol (eolp))) | ||
| 3236 | (save-excursion | 3209 | (save-excursion |
| 3237 | ;; Normalize arg: | 3210 | ;; Normalize arg: |
| 3238 | (cond ((null arg) (setq arg 0)) | 3211 | (cond ((null arg) (setq arg 0)) |
| @@ -3414,8 +3387,8 @@ depth, however." | |||
| 3414 | (if (and (> predecessor-depth 0) | 3387 | (if (and (> predecessor-depth 0) |
| 3415 | (> (+ current-depth arg) | 3388 | (> (+ current-depth arg) |
| 3416 | (1+ predecessor-depth))) | 3389 | (1+ predecessor-depth))) |
| 3417 | (error (concat "May not shift deeper than offspring depth" | 3390 | (error (concat "Disallowed shift deeper than" |
| 3418 | " of previous topic"))))))) | 3391 | " containing topic's children."))))))) |
| 3419 | (allout-rebullet-topic arg)) | 3392 | (allout-rebullet-topic arg)) |
| 3420 | ;;;_ > allout-shift-out (arg) | 3393 | ;;;_ > allout-shift-out (arg) |
| 3421 | (defun allout-shift-out (arg) | 3394 | (defun allout-shift-out (arg) |
| @@ -3436,84 +3409,72 @@ depth, however." | |||
| 3436 | 3409 | ||
| 3437 | (interactive "*P") | 3410 | (interactive "*P") |
| 3438 | 3411 | ||
| 3439 | (let ((start-point (point)) | 3412 | (if (or (not (allout-mode-p)) |
| 3440 | (leading-kill-ring-entry (car kill-ring)) | 3413 | (not (bolp)) |
| 3441 | binding) | 3414 | (not (looking-at allout-regexp))) |
| 3442 | 3415 | ;; Above conditions do not obtain - just do a regular kill: | |
| 3443 | (condition-case err | 3416 | (kill-line arg) |
| 3444 | 3417 | ;; Ah, have to watch out for adjustments: | |
| 3445 | (if (not (and (allout-mode-p) ; active outline mode, | 3418 | (let* ((beg (point)) |
| 3446 | allout-numbered-bullet ; numbers may need adjustment, | 3419 | (beg-hidden (allout-hidden-p)) |
| 3447 | (bolp) ; may be clipping topic head, | 3420 | (end-hidden (save-excursion (allout-end-of-current-line) |
| 3448 | (looking-at allout-regexp))) ; are clipping topic head. | 3421 | (allout-hidden-p))) |
| 3449 | ;; Above conditions do not obtain - just do a regular kill: | 3422 | (depth (allout-depth)) |
| 3450 | (kill-line arg) | 3423 | (collapsed (allout-current-topic-collapsed-p))) |
| 3451 | ;; Ah, have to watch out for adjustments: | 3424 | |
| 3452 | (let* ((depth (allout-depth)) | 3425 | (if collapsed |
| 3453 | (start-point (point)) | 3426 | (put-text-property beg (1+ beg) 'allout-was-collapsed t) |
| 3454 | binding) | 3427 | (remove-text-properties beg (1+ beg) '(allout-was-collapsed t))) |
| 3455 | ; Do the kill, presenting option | 3428 | |
| 3456 | ; for read-only text: | 3429 | (if (and (not beg-hidden) (not end-hidden)) |
| 3457 | (kill-line arg) | 3430 | (allout-unprotected (kill-line arg)) |
| 3431 | (kill-line arg)) | ||
| 3458 | ; Provide some feedback: | 3432 | ; Provide some feedback: |
| 3459 | (sit-for 0) | 3433 | (sit-for 0) |
| 3460 | (save-excursion | 3434 | (if allout-numbered-bullet |
| 3461 | ; Start with the topic | 3435 | (save-excursion ; Renumber subsequent topics if needed: |
| 3462 | ; following killed line: | ||
| 3463 | (if (not (looking-at allout-regexp)) | 3436 | (if (not (looking-at allout-regexp)) |
| 3464 | (allout-next-heading)) | 3437 | (allout-next-heading)) |
| 3465 | (allout-renumber-to-depth depth)))) | 3438 | (allout-renumber-to-depth depth)))))) |
| 3466 | ;; condition case handler: | ||
| 3467 | (text-read-only | ||
| 3468 | (goto-char start-point) | ||
| 3469 | (setq binding (where-is-internal 'allout-kill-topic nil t)) | ||
| 3470 | (cond ((not binding) (setq binding "")) | ||
| 3471 | ((arrayp binding) | ||
| 3472 | (setq binding (mapconcat 'key-description (list binding) ", "))) | ||
| 3473 | (t (setq binding (format "%s" binding)))) | ||
| 3474 | ;; ensure prior kill-ring leader is properly restored: | ||
| 3475 | (if (eq leading-kill-ring-entry (cadr kill-ring)) | ||
| 3476 | ;; Aborted kill got pushed on front - ditch it: | ||
| 3477 | (let ((got (car kill-ring))) | ||
| 3478 | (setq kill-ring (cdr kill-ring)) | ||
| 3479 | got) | ||
| 3480 | ;; Aborted kill got appended to prior - resurrect prior: | ||
| 3481 | (setcar kill-ring leading-kill-ring-entry)) | ||
| 3482 | ;; make last-command skip this failed command, so kill-appending | ||
| 3483 | ;; conditions track: | ||
| 3484 | (setq this-command last-command) | ||
| 3485 | (error (concat "read-only text hit - use %s allout-kill-topic to" | ||
| 3486 | " discard collapsed stuff") | ||
| 3487 | binding))) | ||
| 3488 | ) | ||
| 3489 | ) | ||
| 3490 | ;;;_ > allout-kill-topic () | 3439 | ;;;_ > allout-kill-topic () |
| 3491 | (defun allout-kill-topic () | 3440 | (defun allout-kill-topic () |
| 3492 | "Kill topic together with subtopics. | 3441 | "Kill topic together with subtopics. |
| 3493 | 3442 | ||
| 3494 | Leaves primary topic's trailing vertical whitespace, if any." | 3443 | Trailing whitespace is killed with a topic if that whitespace: |
| 3444 | |||
| 3445 | - would separate the topic from a subsequent sibling | ||
| 3446 | - would separate the topic from the end of buffer | ||
| 3447 | - would not be added to whitespace already separating the topic from the | ||
| 3448 | previous one. | ||
| 3449 | |||
| 3450 | Completely collapsed topics are marked as such, for re-collapse | ||
| 3451 | when yank with allout-yank into an outline as a heading." | ||
| 3495 | 3452 | ||
| 3496 | ;; Some finagling is done to make complex topic kills appear faster | 3453 | ;; Some finagling is done to make complex topic kills appear faster |
| 3497 | ;; than they actually are. A redisplay is performed immediately | 3454 | ;; than they actually are. A redisplay is performed immediately |
| 3498 | ;; after the region is disposed of, though the renumbering process | 3455 | ;; after the region is deleted, though the renumbering process |
| 3499 | ;; has yet to be performed. This means that there may appear to be | 3456 | ;; has yet to be performed. This means that there may appear to be |
| 3500 | ;; a lag *after* the kill has been performed. | 3457 | ;; a lag *after* a kill has been performed. |
| 3501 | 3458 | ||
| 3502 | (interactive) | 3459 | (interactive) |
| 3503 | (let* ((beg (prog1 (allout-back-to-current-heading)(beginning-of-line))) | 3460 | (let* ((collapsed (allout-current-topic-collapsed-p)) |
| 3461 | (beg (prog1 (allout-back-to-current-heading) (beginning-of-line))) | ||
| 3504 | (depth (allout-recent-depth))) | 3462 | (depth (allout-recent-depth))) |
| 3505 | (allout-end-of-current-subtree) | 3463 | (allout-end-of-current-subtree) |
| 3464 | (if (and (/= (current-column) 0) (not (eobp))) | ||
| 3465 | (forward-char 1)) | ||
| 3506 | (if (not (eobp)) | 3466 | (if (not (eobp)) |
| 3507 | (if (or (not (looking-at "^$")) | 3467 | (if (and (looking-at "\n") |
| 3508 | ;; A blank line - cut it with this topic *unless* this | 3468 | (or (save-excursion |
| 3509 | ;; is the last topic at this level, in which case | 3469 | (or (not (allout-next-heading)) |
| 3510 | ;; we'll leave the blank line as part of the | 3470 | (= depth (allout-recent-depth)))) |
| 3511 | ;; containing topic: | 3471 | (and (> (- beg (point-min)) 3) |
| 3512 | (save-excursion | 3472 | (string= (buffer-substring (- beg 2) beg) "\n\n")))) |
| 3513 | (and (allout-next-heading) | ||
| 3514 | (>= (allout-recent-depth) depth)))) | ||
| 3515 | (forward-char 1))) | 3473 | (forward-char 1))) |
| 3516 | 3474 | ||
| 3475 | (if collapsed | ||
| 3476 | (put-text-property beg (1+ beg) 'allout-was-collapsed t) | ||
| 3477 | (remove-text-properties beg (1+ beg) '(allout-was-collapsed t))) | ||
| 3517 | (allout-unprotected (kill-region beg (point))) | 3478 | (allout-unprotected (kill-region beg (point))) |
| 3518 | (sit-for 0) | 3479 | (sit-for 0) |
| 3519 | (save-excursion | 3480 | (save-excursion |
| @@ -3521,7 +3482,7 @@ Leaves primary topic's trailing vertical whitespace, if any." | |||
| 3521 | ;;;_ > allout-yank-processing () | 3482 | ;;;_ > allout-yank-processing () |
| 3522 | (defun allout-yank-processing (&optional arg) | 3483 | (defun allout-yank-processing (&optional arg) |
| 3523 | 3484 | ||
| 3524 | "Incidental outline-specific business to be done just after text yanks. | 3485 | "Incidental allout-specific business to be done just after text yanks. |
| 3525 | 3486 | ||
| 3526 | Does depth adjustment of yanked topics, when: | 3487 | Does depth adjustment of yanked topics, when: |
| 3527 | 3488 | ||
| @@ -3542,10 +3503,12 @@ however, are left exactly like normal, non-allout-specific yanks." | |||
| 3542 | (interactive "*P") | 3503 | (interactive "*P") |
| 3543 | ; Get to beginning, leaving | 3504 | ; Get to beginning, leaving |
| 3544 | ; region around subject: | 3505 | ; region around subject: |
| 3545 | (if (< (my-mark-marker t) (point)) | 3506 | (if (< (allout-mark-marker t) (point)) |
| 3546 | (exchange-point-and-mark)) | 3507 | (exchange-point-and-mark)) |
| 3547 | (let* ((subj-beg (point)) | 3508 | (let* ((subj-beg (point)) |
| 3548 | (subj-end (my-mark-marker t)) | 3509 | (into-bol (bolp)) |
| 3510 | (subj-end (allout-mark-marker t)) | ||
| 3511 | (was-collapsed (get-text-property subj-beg 'allout-was-collapsed)) | ||
| 3549 | ;; 'resituate' if yanking an entire topic into topic header: | 3512 | ;; 'resituate' if yanking an entire topic into topic header: |
| 3550 | (resituate (and (allout-e-o-prefix-p) | 3513 | (resituate (and (allout-e-o-prefix-p) |
| 3551 | (looking-at (concat "\\(" allout-regexp "\\)")) | 3514 | (looking-at (concat "\\(" allout-regexp "\\)")) |
| @@ -3554,7 +3517,7 @@ however, are left exactly like normal, non-allout-specific yanks." | |||
| 3554 | ;; `rectify-numbering' if resituating (where several topics may | 3517 | ;; `rectify-numbering' if resituating (where several topics may |
| 3555 | ;; be resituating) or yanking a topic into a topic slot (bol): | 3518 | ;; be resituating) or yanking a topic into a topic slot (bol): |
| 3556 | (rectify-numbering (or resituate | 3519 | (rectify-numbering (or resituate |
| 3557 | (and (bolp) (looking-at allout-regexp))))) | 3520 | (and into-bol (looking-at allout-regexp))))) |
| 3558 | (if resituate | 3521 | (if resituate |
| 3559 | ; The yanked stuff is a topic: | 3522 | ; The yanked stuff is a topic: |
| 3560 | (let* ((prefix-len (- (match-end 1) subj-beg)) | 3523 | (let* ((prefix-len (- (match-end 1) subj-beg)) |
| @@ -3575,7 +3538,6 @@ however, are left exactly like normal, non-allout-specific yanks." | |||
| 3575 | (allout-prefix-data (match-beginning 0) | 3538 | (allout-prefix-data (match-beginning 0) |
| 3576 | (match-end 0))) | 3539 | (match-end 0))) |
| 3577 | (allout-recent-depth)))) | 3540 | (allout-recent-depth)))) |
| 3578 | done | ||
| 3579 | (more t)) | 3541 | (more t)) |
| 3580 | (setq rectify-numbering allout-numbered-bullet) | 3542 | (setq rectify-numbering allout-numbered-bullet) |
| 3581 | (if adjust-to-depth | 3543 | (if adjust-to-depth |
| @@ -3616,7 +3578,7 @@ however, are left exactly like normal, non-allout-specific yanks." | |||
| 3616 | (progn | 3578 | (progn |
| 3617 | (beginning-of-line) | 3579 | (beginning-of-line) |
| 3618 | (delete-region (point) subj-beg) | 3580 | (delete-region (point) subj-beg) |
| 3619 | (set-marker (my-mark-marker t) subj-end) | 3581 | (set-marker (allout-mark-marker t) subj-end) |
| 3620 | (goto-char subj-beg) | 3582 | (goto-char subj-beg) |
| 3621 | (allout-end-of-prefix)) | 3583 | (allout-end-of-prefix)) |
| 3622 | ; Delete base subj prefix, | 3584 | ; Delete base subj prefix, |
| @@ -3643,6 +3605,9 @@ however, are left exactly like normal, non-allout-specific yanks." | |||
| 3643 | nil ;;; index | 3605 | nil ;;; index |
| 3644 | t)) | 3606 | t)) |
| 3645 | (message "")))) | 3607 | (message "")))) |
| 3608 | (when (and (or into-bol resituate) was-collapsed) | ||
| 3609 | (remove-text-properties subj-beg (1+ subj-beg) '(allout-was-collapsed)) | ||
| 3610 | (allout-hide-current-subtree)) | ||
| 3646 | (if (not resituate) | 3611 | (if (not resituate) |
| 3647 | (exchange-point-and-mark)))) | 3612 | (exchange-point-and-mark)))) |
| 3648 | ;;;_ > allout-yank (&optional arg) | 3613 | ;;;_ > allout-yank (&optional arg) |
| @@ -3678,7 +3643,8 @@ works with normal `yank' in non-outline buffers." | |||
| 3678 | (setq this-command 'yank) | 3643 | (setq this-command 'yank) |
| 3679 | (yank arg) | 3644 | (yank arg) |
| 3680 | (if (allout-mode-p) | 3645 | (if (allout-mode-p) |
| 3681 | (allout-yank-processing))) | 3646 | (allout-yank-processing)) |
| 3647 | ) | ||
| 3682 | ;;;_ > allout-yank-pop (&optional arg) | 3648 | ;;;_ > allout-yank-pop (&optional arg) |
| 3683 | (defun allout-yank-pop (&optional arg) | 3649 | (defun allout-yank-pop (&optional arg) |
| 3684 | "Yank-pop like `allout-yank' when popping to bare outline prefixes. | 3650 | "Yank-pop like `allout-yank' when popping to bare outline prefixes. |
| @@ -3736,93 +3702,51 @@ by pops to non-distinctive yanks. Bug..." | |||
| 3736 | ;;;_ - Fundamental | 3702 | ;;;_ - Fundamental |
| 3737 | ;;;_ > allout-flag-region (from to flag) | 3703 | ;;;_ > allout-flag-region (from to flag) |
| 3738 | (defun allout-flag-region (from to flag) | 3704 | (defun allout-flag-region (from to flag) |
| 3739 | "Hide or show lines from FROM to TO, via Emacs selective-display FLAG char. | 3705 | "Conceal text from FROM to TO if FLAG is non-nil, else reveal it. |
| 3740 | Ie, text following flag C-m \(carriage-return) is hidden until the | 3706 | |
| 3741 | next C-j (newline) char. | 3707 | Text is shown if flag is nil and hidden otherwise." |
| 3742 | 3708 | ;; We use outline invisibility spec. | |
| 3743 | Returns the endpoint of the region." | 3709 | (remove-overlays from to 'category 'allout-overlay-category) |
| 3744 | ;; "OFR-" prefixes to avoid collisions with vars in code calling the macro. | 3710 | (when flag |
| 3745 | ;; ie, elisp macro vars are not 'hygenic', so distinct names are necessary. | 3711 | (let ((o (make-overlay from to))) |
| 3746 | (let ((was-inhibit-r-o inhibit-read-only) | 3712 | (overlay-put o 'category 'allout-overlay-category) |
| 3747 | (was-undo-list buffer-undo-list) | 3713 | (when (featurep 'xemacs) |
| 3748 | (was-modified (buffer-modified-p)) | 3714 | (let ((props (symbol-plist 'allout-overlay-category))) |
| 3749 | trans) | 3715 | (while props |
| 3750 | (unwind-protect | 3716 | (overlay-put o (pop props) (pop props))))))) |
| 3751 | (save-excursion | 3717 | (run-hooks 'allout-view-change-hook)) |
| 3752 | (setq inhibit-read-only t) | ||
| 3753 | (setq buffer-undo-list t) | ||
| 3754 | (if (> from to) | ||
| 3755 | (setq trans from from to to trans)) | ||
| 3756 | (subst-char-in-region from to | ||
| 3757 | (if (= flag ?\n) ?\r ?\n) | ||
| 3758 | flag t) | ||
| 3759 | ;; adjust character read-protection on all the affected lines. | ||
| 3760 | ;; we handle the region line-by-line. | ||
| 3761 | (goto-char to) | ||
| 3762 | (end-of-line) | ||
| 3763 | (setq to (min (+ 2 (point)) (point-max))) | ||
| 3764 | (goto-char from) | ||
| 3765 | (beginning-of-line) | ||
| 3766 | (while (< (point) to) | ||
| 3767 | ;; handle from start of exposed to beginning of hidden, or eol: | ||
| 3768 | (remove-text-properties (point) | ||
| 3769 | (progn (if (re-search-forward "[\r\n]" | ||
| 3770 | nil t) | ||
| 3771 | (forward-char -1)) | ||
| 3772 | (point)) | ||
| 3773 | '(read-only nil)) | ||
| 3774 | ;; handle from start of hidden, if any, to eol: | ||
| 3775 | (if (and (not (eobp)) (= (char-after (point)) ?\r)) | ||
| 3776 | (put-text-property (point) (progn (end-of-line) (point)) | ||
| 3777 | 'read-only t)) | ||
| 3778 | ;; Handle the end-of-line to beginning of next line: | ||
| 3779 | (if (not (eobp)) | ||
| 3780 | (progn (forward-char 1) | ||
| 3781 | (remove-text-properties (1- (point)) (point) | ||
| 3782 | '(read-only nil))))) | ||
| 3783 | ) | ||
| 3784 | (if (not was-modified) | ||
| 3785 | (set-buffer-modified-p nil)) | ||
| 3786 | (setq inhibit-read-only was-inhibit-r-o) | ||
| 3787 | (setq buffer-undo-list was-undo-list) | ||
| 3788 | ) | ||
| 3789 | ) | ||
| 3790 | ) | ||
| 3791 | ;;;_ > allout-flag-current-subtree (flag) | 3718 | ;;;_ > allout-flag-current-subtree (flag) |
| 3792 | (defun allout-flag-current-subtree (flag) | 3719 | (defun allout-flag-current-subtree (flag) |
| 3793 | "Hide or show subtree of currently-visible topic. | 3720 | "Conceal currently-visible topic's subtree if FLAG non-nil, else reveal it." |
| 3794 | |||
| 3795 | See `allout-flag-region' for more details." | ||
| 3796 | 3721 | ||
| 3797 | (save-excursion | 3722 | (save-excursion |
| 3798 | (allout-back-to-current-heading) | 3723 | (allout-back-to-current-heading) |
| 3799 | (let ((from (point)) | 3724 | (end-of-line) |
| 3800 | (to (progn (allout-end-of-current-subtree) (1- (point))))) | 3725 | (allout-flag-region (point) |
| 3801 | (allout-flag-region from to flag)))) | 3726 | ;; Exposing must not leave trailing blanks hidden, |
| 3727 | ;; but can leave them exposed when hiding, so we | ||
| 3728 | ;; can use flag's inverse as the | ||
| 3729 | ;; include-trailing-blank cue: | ||
| 3730 | (allout-end-of-current-subtree (not flag)) | ||
| 3731 | flag))) | ||
| 3802 | 3732 | ||
| 3803 | ;;;_ - Topic-specific | 3733 | ;;;_ - Topic-specific |
| 3804 | ;;;_ > allout-show-entry () | 3734 | ;;;_ > allout-show-entry (&optional inclusive) |
| 3805 | (defun allout-show-entry () | 3735 | (defun allout-show-entry (&optional inclusive) |
| 3806 | "Like `allout-show-current-entry', reveals entries nested in hidden topics. | 3736 | "Like `allout-show-current-entry', reveals entries nested in hidden topics. |
| 3807 | 3737 | ||
| 3808 | This is a way to give restricted peek at a concealed locality without the | 3738 | This is a way to give restricted peek at a concealed locality without the |
| 3809 | expense of exposing its context, but can leave the outline with aberrant | 3739 | expense of exposing its context, but can leave the outline with aberrant |
| 3810 | exposure. `allout-hide-current-entry-completely' or `allout-show-offshoot' | 3740 | exposure. `allout-show-offshoot' should be used after the peek to rectify |
| 3811 | should be used after the peek to rectify the exposure." | 3741 | the exposure." |
| 3812 | 3742 | ||
| 3813 | (interactive) | 3743 | (interactive) |
| 3814 | (save-excursion | 3744 | (save-excursion |
| 3815 | (let ((at (point)) | 3745 | (let (beg end) |
| 3816 | beg end) | ||
| 3817 | (allout-goto-prefix) | 3746 | (allout-goto-prefix) |
| 3818 | (setq beg (if (= (preceding-char) ?\r) (1- (point)) (point))) | 3747 | (setq beg (if (allout-hidden-p) (1- (point)) (point))) |
| 3819 | (re-search-forward "[\n\r]" nil t) | 3748 | (setq end (allout-pre-next-prefix)) |
| 3820 | (setq end (1- (if (< at (point)) | 3749 | (allout-flag-region beg end nil) |
| 3821 | ;; We're on topic head line - show only it: | ||
| 3822 | (point) | ||
| 3823 | ;; or we're in body - include it: | ||
| 3824 | (max beg (or (allout-pre-next-preface) (point)))))) | ||
| 3825 | (allout-flag-region beg end ?\n) | ||
| 3826 | (list beg end)))) | 3750 | (list beg end)))) |
| 3827 | ;;;_ > allout-show-children (&optional level strict) | 3751 | ;;;_ > allout-show-children (&optional level strict) |
| 3828 | (defun allout-show-children (&optional level strict) | 3752 | (defun allout-show-children (&optional level strict) |
| @@ -3843,67 +3767,59 @@ Returns point at end of subtree that was opened, if any. (May get a | |||
| 3843 | point of non-opened subtree?)" | 3767 | point of non-opened subtree?)" |
| 3844 | 3768 | ||
| 3845 | (interactive "p") | 3769 | (interactive "p") |
| 3846 | (let (max-pos) | 3770 | (let ((start-point (point))) |
| 3847 | (if (and (not strict) | 3771 | (if (and (not strict) |
| 3848 | (allout-hidden-p)) | 3772 | (allout-hidden-p)) |
| 3849 | 3773 | ||
| 3850 | (progn (allout-show-to-offshoot) ; Point's concealed, open to | 3774 | (progn (allout-show-to-offshoot) ; Point's concealed, open to |
| 3851 | ; expose it. | 3775 | ; expose it. |
| 3852 | ;; Then recurse, but with "strict" set so we don't | 3776 | ;; Then recurse, but with "strict" set so we don't |
| 3853 | ;; infinite regress: | 3777 | ;; infinite regress: |
| 3854 | (setq max-pos (allout-show-children level t))) | 3778 | (allout-show-children level t)) |
| 3855 | 3779 | ||
| 3856 | (save-excursion | 3780 | (save-excursion |
| 3857 | (save-restriction | 3781 | (allout-beginning-of-current-line) |
| 3858 | (let* ((start-pt (point)) | 3782 | (save-restriction |
| 3859 | (chart (allout-chart-subtree (or level 1))) | 3783 | (let* ((chart (allout-chart-subtree (or level 1))) |
| 3860 | (to-reveal (allout-chart-to-reveal chart (or level 1)))) | 3784 | (to-reveal (allout-chart-to-reveal chart (or level 1)))) |
| 3861 | (goto-char start-pt) | 3785 | (goto-char start-point) |
| 3862 | (if (and strict (= (preceding-char) ?\r)) | 3786 | (when (and strict (allout-hidden-p)) |
| 3863 | ;; Concealed root would already have been taken care of, | 3787 | ;; Concealed root would already have been taken care of, |
| 3864 | ;; unless strict was set. | 3788 | ;; unless strict was set. |
| 3865 | (progn | 3789 | (allout-flag-region (point) (allout-snug-back) nil) |
| 3866 | (allout-flag-region (point) (allout-snug-back) ?\n) | 3790 | (when allout-show-bodies |
| 3867 | (if allout-show-bodies | 3791 | (goto-char (car to-reveal)) |
| 3868 | (progn (goto-char (car to-reveal)) | 3792 | (allout-show-current-entry))) |
| 3869 | (allout-show-current-entry))))) | 3793 | (while to-reveal |
| 3870 | (while to-reveal | 3794 | (goto-char (car to-reveal)) |
| 3871 | (goto-char (car to-reveal)) | 3795 | (allout-flag-region (save-excursion (allout-snug-back) (point)) |
| 3872 | (allout-flag-region (point) (allout-snug-back) ?\n) | 3796 | (progn (search-forward "\n" nil t) |
| 3873 | (if allout-show-bodies | 3797 | (1- (point))) |
| 3874 | (progn (goto-char (car to-reveal)) | 3798 | nil) |
| 3875 | (allout-show-current-entry))) | 3799 | (when allout-show-bodies |
| 3876 | (setq to-reveal (cdr to-reveal))))))))) | 3800 | (goto-char (car to-reveal)) |
| 3877 | ;;;_ > allout-hide-point-reconcile () | 3801 | (allout-show-current-entry)) |
| 3878 | (defun allout-hide-reconcile () | 3802 | (setq to-reveal (cdr to-reveal))))))) |
| 3879 | "Like `allout-hide-current-entry'; hides completely if within hidden region. | 3803 | ;; Compensate for `save-excursion's maintenance of point |
| 3880 | 3804 | ;; within invisible text: | |
| 3881 | Specifically intended for aberrant exposure states, like entries that were | 3805 | (goto-char start-point))) |
| 3882 | exposed by `allout-show-entry' but are within otherwise concealed regions." | ||
| 3883 | (interactive) | ||
| 3884 | (save-excursion | ||
| 3885 | (allout-goto-prefix) | ||
| 3886 | (allout-flag-region (if (not (bobp)) (1- (point)) (point)) | ||
| 3887 | (progn (allout-pre-next-preface) | ||
| 3888 | (if (= ?\r (following-char)) | ||
| 3889 | (point) | ||
| 3890 | (1- (point)))) | ||
| 3891 | ?\r))) | ||
| 3892 | ;;;_ > allout-show-to-offshoot () | 3806 | ;;;_ > allout-show-to-offshoot () |
| 3893 | (defun allout-show-to-offshoot () | 3807 | (defun allout-show-to-offshoot () |
| 3894 | "Like `allout-show-entry', but reveals all concealed ancestors, as well. | 3808 | "Like `allout-show-entry', but reveals all concealed ancestors, as well. |
| 3895 | 3809 | ||
| 3896 | As with `allout-hide-current-entry-completely', useful for rectifying | 3810 | Useful for coherently exposing to a random point in a hidden region." |
| 3897 | aberrant exposure states produced by `allout-show-entry'." | ||
| 3898 | |||
| 3899 | (interactive) | 3811 | (interactive) |
| 3900 | (save-excursion | 3812 | (save-excursion |
| 3901 | (let ((orig-pt (point)) | 3813 | (let ((orig-pt (point)) |
| 3902 | (orig-pref (allout-goto-prefix)) | 3814 | (orig-pref (allout-goto-prefix)) |
| 3903 | (last-at (point)) | 3815 | (last-at (point)) |
| 3904 | bag-it) | 3816 | bag-it) |
| 3905 | (while (or bag-it (= (preceding-char) ?\r)) | 3817 | (while (or bag-it (allout-hidden-p)) |
| 3906 | (beginning-of-line) | 3818 | (while (allout-hidden-p) |
| 3819 | ;; XXX We would use `(move-beginning-of-line 1)', but it gets | ||
| 3820 | ;; stuck on hidden newlines at column 80, as of GNU Emacs 22.0.50. | ||
| 3821 | (beginning-of-line) | ||
| 3822 | (if (allout-hidden-p) (forward-char -1))) | ||
| 3907 | (if (= last-at (setq last-at (point))) | 3823 | (if (= last-at (setq last-at (point))) |
| 3908 | ;; Oops, we're not making any progress! Show the current | 3824 | ;; Oops, we're not making any progress! Show the current |
| 3909 | ;; topic completely, and bag this try. | 3825 | ;; topic completely, and bag this try. |
| @@ -3926,38 +3842,24 @@ aberrant exposure states produced by `allout-show-entry'." | |||
| 3926 | (interactive) | 3842 | (interactive) |
| 3927 | (allout-back-to-current-heading) | 3843 | (allout-back-to-current-heading) |
| 3928 | (save-excursion | 3844 | (save-excursion |
| 3929 | (allout-flag-region (point) | 3845 | (end-of-line) |
| 3846 | (allout-flag-region (point) | ||
| 3930 | (progn (allout-end-of-entry) (point)) | 3847 | (progn (allout-end-of-entry) (point)) |
| 3931 | ?\r))) | 3848 | t))) |
| 3932 | ;;;_ > allout-show-current-entry (&optional arg) | 3849 | ;;;_ > allout-show-current-entry (&optional arg) |
| 3933 | (defun allout-show-current-entry (&optional arg) | 3850 | (defun allout-show-current-entry (&optional arg) |
| 3934 | 3851 | ||
| 3935 | "Show body following current heading, or hide the entry if repeat count." | 3852 | "Show body following current heading, or hide entry with universal argument." |
| 3936 | 3853 | ||
| 3937 | (interactive "P") | 3854 | (interactive "P") |
| 3938 | (if arg | 3855 | (if arg |
| 3939 | (allout-hide-current-entry) | 3856 | (allout-hide-current-entry) |
| 3857 | (save-excursion (allout-show-to-offshoot)) | ||
| 3940 | (save-excursion | 3858 | (save-excursion |
| 3941 | (allout-flag-region (point) | 3859 | (allout-flag-region (point) |
| 3942 | (progn (allout-end-of-entry) (point)) | 3860 | (progn (allout-end-of-entry t) (point)) |
| 3943 | ?\n) | 3861 | nil) |
| 3944 | ))) | 3862 | ))) |
| 3945 | ;;;_ > allout-hide-current-entry-completely () | ||
| 3946 | ; ... allout-hide-current-entry-completely also for isearch dynamic exposure: | ||
| 3947 | (defun allout-hide-current-entry-completely () | ||
| 3948 | "Like `allout-hide-current-entry', but conceal topic completely. | ||
| 3949 | |||
| 3950 | Specifically intended for aberrant exposure states, like entries that were | ||
| 3951 | exposed by `allout-show-entry' but are within otherwise concealed regions." | ||
| 3952 | (interactive) | ||
| 3953 | (save-excursion | ||
| 3954 | (allout-goto-prefix) | ||
| 3955 | (allout-flag-region (if (not (bobp)) (1- (point)) (point)) | ||
| 3956 | (progn (allout-pre-next-preface) | ||
| 3957 | (if (= ?\r (following-char)) | ||
| 3958 | (point) | ||
| 3959 | (1- (point)))) | ||
| 3960 | ?\r))) | ||
| 3961 | ;;;_ > allout-show-current-subtree (&optional arg) | 3863 | ;;;_ > allout-show-current-subtree (&optional arg) |
| 3962 | (defun allout-show-current-subtree (&optional arg) | 3864 | (defun allout-show-current-subtree (&optional arg) |
| 3963 | "Show everything within the current topic. With a repeat-count, | 3865 | "Show everything within the current topic. With a repeat-count, |
| @@ -3970,11 +3872,27 @@ expose this topic and its siblings." | |||
| 3970 | (error "No topics") | 3872 | (error "No topics") |
| 3971 | ;; got to first, outermost topic - set to expose it and siblings: | 3873 | ;; got to first, outermost topic - set to expose it and siblings: |
| 3972 | (message "Above outermost topic - exposing all.") | 3874 | (message "Above outermost topic - exposing all.") |
| 3973 | (allout-flag-region (point-min)(point-max) ?\n)) | 3875 | (allout-flag-region (point-min)(point-max) nil)) |
| 3876 | (allout-beginning-of-current-line) | ||
| 3974 | (if (not arg) | 3877 | (if (not arg) |
| 3975 | (allout-flag-current-subtree ?\n) | 3878 | (allout-flag-current-subtree nil) |
| 3976 | (allout-beginning-of-level) | 3879 | (allout-beginning-of-level) |
| 3977 | (allout-expose-topic '(* :)))))) | 3880 | (allout-expose-topic '(* :)))))) |
| 3881 | ;;;_ > allout-current-topic-collapsed-p (&optional include-single-liners) | ||
| 3882 | (defun allout-current-topic-collapsed-p (&optional include-single-liners) | ||
| 3883 | "True if the currently visible containing topic is already collapsed. | ||
| 3884 | |||
| 3885 | If optional INCLUDE-SINGLE-LINERS is true, then include single-line | ||
| 3886 | topics \(which intrinsically can be considered both collapsed and | ||
| 3887 | not\), as collapsed. Otherwise they are considered uncollapsed." | ||
| 3888 | (save-excursion | ||
| 3889 | (and | ||
| 3890 | (= (progn (allout-back-to-current-heading) | ||
| 3891 | (move-end-of-line 1) | ||
| 3892 | (point)) | ||
| 3893 | (allout-end-of-current-subtree)) | ||
| 3894 | (or include-single-liners | ||
| 3895 | (progn (backward-char 1) (allout-hidden-p)))))) | ||
| 3978 | ;;;_ > allout-hide-current-subtree (&optional just-close) | 3896 | ;;;_ > allout-hide-current-subtree (&optional just-close) |
| 3979 | (defun allout-hide-current-subtree (&optional just-close) | 3897 | (defun allout-hide-current-subtree (&optional just-close) |
| 3980 | "Close the current topic, or containing topic if this one is already closed. | 3898 | "Close the current topic, or containing topic if this one is already closed. |
| @@ -3982,35 +3900,21 @@ expose this topic and its siblings." | |||
| 3982 | If this topic is closed and it's a top level topic, close this topic | 3900 | If this topic is closed and it's a top level topic, close this topic |
| 3983 | and its siblings. | 3901 | and its siblings. |
| 3984 | 3902 | ||
| 3985 | If optional arg JUST-CLOSE is non-nil, do not treat the parent or | 3903 | If optional arg JUST-CLOSE is non-nil, do not close the parent or |
| 3986 | siblings, even if the target topic is already closed." | 3904 | siblings, even if the target topic is already closed." |
| 3987 | 3905 | ||
| 3988 | (interactive) | 3906 | (interactive) |
| 3989 | (let ((from (point)) | 3907 | (let* ((from (point)) |
| 3990 | (orig-eol (progn (end-of-line) | 3908 | (sibs-msg "Top-level topic already closed - closing siblings...") |
| 3991 | (if (not (allout-goto-prefix)) | 3909 | (current-exposed (not (allout-current-topic-collapsed-p t)))) |
| 3992 | (error "No topics found") | 3910 | (cond (current-exposed (allout-flag-current-subtree t)) |
| 3993 | (end-of-line)(point))))) | 3911 | (just-close nil) |
| 3994 | (allout-flag-current-subtree ?\r) | 3912 | ((allout-up-current-level 1 t) (allout-hide-current-subtree)) |
| 3995 | (goto-char from) | 3913 | (t (goto-char 0) |
| 3996 | (if (and (= orig-eol (progn (goto-char orig-eol) | 3914 | (message sibs-msg) |
| 3997 | (end-of-line) | 3915 | (allout-expose-topic '(0 :)) |
| 3998 | (point))) | 3916 | (message (concat sibs-msg " Done.")))) |
| 3999 | (not just-close) | 3917 | (goto-char from))) |
| 4000 | ;; Structure didn't change - try hiding current level: | ||
| 4001 | (goto-char from) | ||
| 4002 | (if (allout-up-current-level 1 t) | ||
| 4003 | t | ||
| 4004 | (goto-char 0) | ||
| 4005 | (let ((msg | ||
| 4006 | "Top-level topic already closed - closing siblings...")) | ||
| 4007 | (message msg) | ||
| 4008 | (allout-expose-topic '(0 :)) | ||
| 4009 | (message (concat msg " Done."))) | ||
| 4010 | nil) | ||
| 4011 | (/= (allout-recent-depth) 0)) | ||
| 4012 | (allout-hide-current-subtree)) | ||
| 4013 | (goto-char from))) | ||
| 4014 | ;;;_ > allout-show-current-branches () | 3918 | ;;;_ > allout-show-current-branches () |
| 4015 | (defun allout-show-current-branches () | 3919 | (defun allout-show-current-branches () |
| 4016 | "Show all subheadings of this heading, but not their bodies." | 3920 | "Show all subheadings of this heading, but not their bodies." |
| @@ -4031,7 +3935,7 @@ siblings, even if the target topic is already closed." | |||
| 4031 | "Show all of the text in the buffer." | 3935 | "Show all of the text in the buffer." |
| 4032 | (interactive) | 3936 | (interactive) |
| 4033 | (message "Exposing entire buffer...") | 3937 | (message "Exposing entire buffer...") |
| 4034 | (allout-flag-region (point-min) (point-max) ?\n) | 3938 | (allout-flag-region (point-min) (point-max) nil) |
| 4035 | (message "Exposing entire buffer... Done.")) | 3939 | (message "Exposing entire buffer... Done.")) |
| 4036 | ;;;_ > allout-hide-bodies () | 3940 | ;;;_ > allout-hide-bodies () |
| 4037 | (defun allout-hide-bodies () | 3941 | (defun allout-hide-bodies () |
| @@ -4046,11 +3950,11 @@ siblings, even if the target topic is already closed." | |||
| 4046 | (narrow-to-region start end) | 3950 | (narrow-to-region start end) |
| 4047 | (goto-char (point-min)) | 3951 | (goto-char (point-min)) |
| 4048 | (while (not (eobp)) | 3952 | (while (not (eobp)) |
| 4049 | (allout-flag-region (point) | 3953 | (end-of-line) |
| 4050 | (progn (allout-pre-next-preface) (point)) ?\r) | 3954 | (allout-flag-region (point) (allout-end-of-entry) t) |
| 4051 | (if (not (eobp)) | 3955 | (if (not (eobp)) |
| 4052 | (forward-char | 3956 | (forward-char |
| 4053 | (if (looking-at "[\n\r][\n\r]") | 3957 | (if (looking-at "\n\n") |
| 4054 | 2 1))))))) | 3958 | 2 1))))))) |
| 4055 | 3959 | ||
| 4056 | ;;;_ > allout-expose-topic (spec) | 3960 | ;;;_ > allout-expose-topic (spec) |
| @@ -4117,9 +4021,7 @@ Examples: | |||
| 4117 | (let ((depth (allout-depth)) | 4021 | (let ((depth (allout-depth)) |
| 4118 | (max-pos 0) | 4022 | (max-pos 0) |
| 4119 | prev-elem curr-elem | 4023 | prev-elem curr-elem |
| 4120 | stay done | 4024 | stay) |
| 4121 | snug-back | ||
| 4122 | ) | ||
| 4123 | (while spec | 4025 | (while spec |
| 4124 | (setq prev-elem curr-elem | 4026 | (setq prev-elem curr-elem |
| 4125 | curr-elem (car spec) | 4027 | curr-elem (car spec) |
| @@ -4147,7 +4049,7 @@ Examples: | |||
| 4147 | (setq spec (append (make-list residue prev-elem) | 4049 | (setq spec (append (make-list residue prev-elem) |
| 4148 | spec))))))) | 4050 | spec))))))) |
| 4149 | ((numberp curr-elem) | 4051 | ((numberp curr-elem) |
| 4150 | (if (and (>= 0 curr-elem) (allout-visible-p)) | 4052 | (if (and (>= 0 curr-elem) (not (allout-hidden-p))) |
| 4151 | (save-excursion (allout-hide-current-subtree t) | 4053 | (save-excursion (allout-hide-current-subtree t) |
| 4152 | (if (> 0 curr-elem) | 4054 | (if (> 0 curr-elem) |
| 4153 | nil | 4055 | nil |
| @@ -4207,7 +4109,6 @@ Optional FOLLOWERS arguments dictate exposure for succeeding siblings." | |||
| 4207 | 4109 | ||
| 4208 | (interactive "xExposure spec: ") | 4110 | (interactive "xExposure spec: ") |
| 4209 | (let ((depth (allout-current-depth)) | 4111 | (let ((depth (allout-current-depth)) |
| 4210 | done | ||
| 4211 | max-pos) | 4112 | max-pos) |
| 4212 | (cond ((null spec) nil) | 4113 | (cond ((null spec) nil) |
| 4213 | ((symbolp spec) | 4114 | ((symbolp spec) |
| @@ -4387,7 +4288,7 @@ header and body. The elements of that list are: | |||
| 4387 | (save-excursion | 4288 | (save-excursion |
| 4388 | (let* | 4289 | (let* |
| 4389 | ;; state vars: | 4290 | ;; state vars: |
| 4390 | (strings prefix pad result depth new-depth out gone-out bullet beg | 4291 | (strings prefix result depth new-depth out gone-out bullet beg |
| 4391 | next done) | 4292 | next done) |
| 4392 | 4293 | ||
| 4393 | (goto-char start) | 4294 | (goto-char start) |
| @@ -4419,16 +4320,11 @@ header and body. The elements of that list are: | |||
| 4419 | beg | 4320 | beg |
| 4420 | ;To hidden text or end of line: | 4321 | ;To hidden text or end of line: |
| 4421 | (progn | 4322 | (progn |
| 4422 | (search-forward "\r" | 4323 | (end-of-line) |
| 4423 | (save-excursion (end-of-line) | 4324 | (allout-back-to-visible-text))) |
| 4424 | (point)) | ||
| 4425 | 1) | ||
| 4426 | (if (= (preceding-char) ?\r) | ||
| 4427 | (1- (point)) | ||
| 4428 | (point)))) | ||
| 4429 | strings)) | 4325 | strings)) |
| 4430 | (if (< (point) next) ; Resume from after hid text, if any. | 4326 | (when (< (point) next) ; Resume from after hid text, if any. |
| 4431 | (forward-line 1)) | 4327 | (line-move 1)) |
| 4432 | (setq beg (point))) | 4328 | (setq beg (point))) |
| 4433 | ;; Accumulate list for this topic: | 4329 | ;; Accumulate list for this topic: |
| 4434 | (setq strings (nreverse strings)) | 4330 | (setq strings (nreverse strings)) |
| @@ -4488,7 +4384,7 @@ header and body. The elements of that list are: | |||
| 4488 | ;;;_ > allout-process-exposed (&optional func from to frombuf | 4384 | ;;;_ > allout-process-exposed (&optional func from to frombuf |
| 4489 | ;;; tobuf format) | 4385 | ;;; tobuf format) |
| 4490 | (defun allout-process-exposed (&optional func from to frombuf tobuf | 4386 | (defun allout-process-exposed (&optional func from to frombuf tobuf |
| 4491 | format &optional start-num) | 4387 | format start-num) |
| 4492 | "Map function on exposed parts of current topic; results to another buffer. | 4388 | "Map function on exposed parts of current topic; results to another buffer. |
| 4493 | 4389 | ||
| 4494 | All args are options; default values itemized below. | 4390 | All args are options; default values itemized below. |
| @@ -4694,13 +4590,6 @@ environment. Leaves point at the end of the line." | |||
| 4694 | (page-numbering (if allout-number-pages | 4590 | (page-numbering (if allout-number-pages |
| 4695 | "\\pagestyle{empty}\n" | 4591 | "\\pagestyle{empty}\n" |
| 4696 | "")) | 4592 | "")) |
| 4697 | (linesdef (concat "\\def\\beginlines{" | ||
| 4698 | "\\par\\begingroup\\nobreak\\medskip" | ||
| 4699 | "\\parindent=0pt\n" | ||
| 4700 | " \\kern1pt\\nobreak \\obeylines \\obeyspaces " | ||
| 4701 | "\\everypar{\\strut}}\n" | ||
| 4702 | "\\def\\endlines{" | ||
| 4703 | "\\kern1pt\\endgroup\\medbreak\\noindent}\n")) | ||
| 4704 | (titlecmd (format "\\newcommand{\\titlecmd}[1]{{%s #1}}\n" | 4593 | (titlecmd (format "\\newcommand{\\titlecmd}[1]{{%s #1}}\n" |
| 4705 | allout-title-style)) | 4594 | allout-title-style)) |
| 4706 | (labelcmd (format "\\newcommand{\\labelcmd}[1]{{%s #1}}\n" | 4595 | (labelcmd (format "\\newcommand{\\labelcmd}[1]{{%s #1}}\n" |
| @@ -4733,7 +4622,7 @@ environment. Leaves point at the end of the line." | |||
| 4733 | (title (format "%s%s%s%s" | 4622 | (title (format "%s%s%s%s" |
| 4734 | "\\titlecmd{" | 4623 | "\\titlecmd{" |
| 4735 | (allout-latex-verb-quote (if allout-title | 4624 | (allout-latex-verb-quote (if allout-title |
| 4736 | (condition-case err | 4625 | (condition-case nil |
| 4737 | (eval allout-title) | 4626 | (eval allout-title) |
| 4738 | ('error "<unnamed buffer>")) | 4627 | ('error "<unnamed buffer>")) |
| 4739 | "Unnamed Outline")) | 4628 | "Unnamed Outline")) |
| @@ -4913,7 +4802,7 @@ solicited whenever the passphrase is changed." | |||
| 4913 | (interactive "P") | 4802 | (interactive "P") |
| 4914 | (save-excursion | 4803 | (save-excursion |
| 4915 | (allout-back-to-current-heading) | 4804 | (allout-back-to-current-heading) |
| 4916 | (allout-toggle-subtree-encryption) | 4805 | (allout-toggle-subtree-encryption fetch-pass) |
| 4917 | ) | 4806 | ) |
| 4918 | ) | 4807 | ) |
| 4919 | ;;;_ > allout-toggle-subtree-encryption (&optional fetch-pass) | 4808 | ;;;_ > allout-toggle-subtree-encryption (&optional fetch-pass) |
| @@ -4948,20 +4837,23 @@ See `allout-toggle-current-subtree-encryption' for more details." | |||
| 4948 | (progn (if (= (point-max) after-bullet-pos) | 4837 | (progn (if (= (point-max) after-bullet-pos) |
| 4949 | (error "no body to encrypt")) | 4838 | (error "no body to encrypt")) |
| 4950 | (allout-encrypted-topic-p))) | 4839 | (allout-encrypted-topic-p))) |
| 4951 | (was-collapsed (if (not (re-search-forward "[\n\r]" nil t)) | 4840 | (was-collapsed (if (not (search-forward "\n" nil t)) |
| 4952 | nil | 4841 | nil |
| 4953 | (backward-char 1) | 4842 | (backward-char 1) |
| 4954 | (looking-at "\r"))) | 4843 | (allout-hidden-p))) |
| 4955 | (subtree-beg (1+ (point))) | 4844 | (subtree-beg (1+ (point))) |
| 4956 | (subtree-end (allout-end-of-subtree)) | 4845 | (subtree-end (allout-end-of-subtree)) |
| 4957 | (subject-text (buffer-substring-no-properties subtree-beg | 4846 | (subject-text (buffer-substring-no-properties subtree-beg |
| 4958 | subtree-end)) | 4847 | subtree-end)) |
| 4959 | (subtree-end-char (char-after (1- subtree-end))) | 4848 | (subtree-end-char (char-after (1- subtree-end))) |
| 4960 | (subtree-trailling-char (char-after subtree-end)) | 4849 | (subtree-trailing-char (char-after subtree-end)) |
| 4961 | (place-holder (if (or (string= "" subject-text) | 4850 | ;; kluge - result-text needs to be nil, but we also want to |
| 4962 | (string= "\n" subject-text)) | 4851 | ;; check for the error condition |
| 4963 | (error "No topic contents to %scrypt" | 4852 | (result-text (if (or (string= "" subject-text) |
| 4964 | (if was-encrypted "de" "en")))) | 4853 | (string= "\n" subject-text)) |
| 4854 | (error "No topic contents to %scrypt" | ||
| 4855 | (if was-encrypted "de" "en")) | ||
| 4856 | nil)) | ||
| 4965 | ;; Assess key parameters: | 4857 | ;; Assess key parameters: |
| 4966 | (key-info (or | 4858 | (key-info (or |
| 4967 | ;; detect the type by which it is already encrypted | 4859 | ;; detect the type by which it is already encrypted |
| @@ -4972,8 +4864,7 @@ See `allout-toggle-current-subtree-encryption' for more details." | |||
| 4972 | '(symmetric nil))) | 4864 | '(symmetric nil))) |
| 4973 | (for-key-type (car key-info)) | 4865 | (for-key-type (car key-info)) |
| 4974 | (for-key-identity (cadr key-info)) | 4866 | (for-key-identity (cadr key-info)) |
| 4975 | (fetch-pass (and fetch-pass (member fetch-pass '(16 (16))))) | 4867 | (fetch-pass (and fetch-pass (member fetch-pass '(16 (16)))))) |
| 4976 | result-text) | ||
| 4977 | 4868 | ||
| 4978 | (setq result-text | 4869 | (setq result-text |
| 4979 | (allout-encrypt-string subject-text was-encrypted | 4870 | (allout-encrypt-string subject-text was-encrypted |
| @@ -4987,12 +4878,12 @@ See `allout-toggle-current-subtree-encryption' for more details." | |||
| 4987 | (delete-region subtree-beg subtree-end) | 4878 | (delete-region subtree-beg subtree-end) |
| 4988 | (insert result-text) | 4879 | (insert result-text) |
| 4989 | (if was-collapsed | 4880 | (if was-collapsed |
| 4990 | (allout-flag-region subtree-beg (1- (point)) ?\r)) | 4881 | (allout-flag-region (1- subtree-beg) (point) t)) |
| 4991 | ;; adjust trailling-blank-lines to preserve topic spacing: | 4882 | ;; adjust trailing-blank-lines to preserve topic spacing: |
| 4992 | (if (not was-encrypted) | 4883 | (if (not was-encrypted) |
| 4993 | (if (and (member subtree-end-char '(?\r ?\n)) | 4884 | (if (and (= subtree-end-char ?\n) |
| 4994 | (member subtree-trailling-char '(?\r ?\n))) | 4885 | (= subtree-trailing-char ?\n)) |
| 4995 | (insert subtree-trailling-char))) | 4886 | (insert subtree-trailing-char))) |
| 4996 | ;; Ensure that the item has an encrypted-entry bullet: | 4887 | ;; Ensure that the item has an encrypted-entry bullet: |
| 4997 | (if (not (string= (buffer-substring-no-properties | 4888 | (if (not (string= (buffer-substring-no-properties |
| 4998 | (1- after-bullet-pos) after-bullet-pos) | 4889 | (1- after-bullet-pos) after-bullet-pos) |
| @@ -5060,8 +4951,7 @@ Returns the resulting string, or nil if the transformation fails." | |||
| 5060 | target-prompt-id | 4951 | target-prompt-id |
| 5061 | (or (buffer-file-name allout-buffer) | 4952 | (or (buffer-file-name allout-buffer) |
| 5062 | target-prompt-id)))) | 4953 | target-prompt-id)))) |
| 5063 | (comment "Processed by allout driving pgg") | 4954 | result-text status) |
| 5064 | work-buffer result result-text status) | ||
| 5065 | 4955 | ||
| 5066 | (if (and fetch-pass (not passphrase)) | 4956 | (if (and fetch-pass (not passphrase)) |
| 5067 | ;; Force later fetch by evicting passphrase from the cache. | 4957 | ;; Force later fetch by evicting passphrase from the cache. |
| @@ -5083,7 +4973,7 @@ Returns the resulting string, or nil if the transformation fails." | |||
| 5083 | retried fetch-pass))) | 4973 | retried fetch-pass))) |
| 5084 | (with-temp-buffer | 4974 | (with-temp-buffer |
| 5085 | 4975 | ||
| 5086 | (insert (subst-char-in-string ?\r ?\n text)) | 4976 | (insert text) |
| 5087 | 4977 | ||
| 5088 | (cond | 4978 | (cond |
| 5089 | 4979 | ||
| @@ -5319,7 +5209,7 @@ An error is raised if the text is not encrypted." | |||
| 5319 | (require 'pgg-parse) | 5209 | (require 'pgg-parse) |
| 5320 | (save-excursion | 5210 | (save-excursion |
| 5321 | (with-temp-buffer | 5211 | (with-temp-buffer |
| 5322 | (insert (subst-char-in-string ?\r ?\n text)) | 5212 | (insert text) |
| 5323 | (let* ((parsed-armor (pgg-parse-armor-region (point-min) (point-max))) | 5213 | (let* ((parsed-armor (pgg-parse-armor-region (point-min) (point-max))) |
| 5324 | (type (if (pgg-gpg-symmetric-key-p parsed-armor) | 5214 | (type (if (pgg-gpg-symmetric-key-p parsed-armor) |
| 5325 | 'symmetric | 5215 | 'symmetric |
| @@ -5442,21 +5332,21 @@ must also have content." | |||
| 5442 | (while (not done) | 5332 | (while (not done) |
| 5443 | 5333 | ||
| 5444 | (if (not (re-search-forward | 5334 | (if (not (re-search-forward |
| 5445 | (format "\\(\\`\\|[\n\r]\\)%s *%s[^*]" | 5335 | (format "\\(\\`\\|\n\\)%s *%s[^*]" |
| 5446 | (regexp-quote allout-header-prefix) | 5336 | (regexp-quote allout-header-prefix) |
| 5447 | (regexp-quote allout-topic-encryption-bullet)) | 5337 | (regexp-quote allout-topic-encryption-bullet)) |
| 5448 | nil t)) | 5338 | nil t)) |
| 5449 | (setq got nil | 5339 | (setq got nil |
| 5450 | done t) | 5340 | done t) |
| 5451 | (goto-char (setq got (match-beginning 0))) | 5341 | (goto-char (setq got (match-beginning 0))) |
| 5452 | (if (looking-at "[\n\r]") | 5342 | (if (looking-at "\n") |
| 5453 | (forward-char 1)) | 5343 | (forward-char 1)) |
| 5454 | (setq got (point))) | 5344 | (setq got (point))) |
| 5455 | 5345 | ||
| 5456 | (cond ((not got) | 5346 | (cond ((not got) |
| 5457 | (setq done t)) | 5347 | (setq done t)) |
| 5458 | 5348 | ||
| 5459 | ((not (re-search-forward "[\n\r]")) | 5349 | ((not (search-forward "\n")) |
| 5460 | (setq got nil | 5350 | (setq got nil |
| 5461 | done t)) | 5351 | done t)) |
| 5462 | 5352 | ||
| @@ -5498,26 +5388,28 @@ save. See `allout-encrypt-unencrypted-on-saves' for more info." | |||
| 5498 | 5388 | ||
| 5499 | (interactive "p") | 5389 | (interactive "p") |
| 5500 | (save-excursion | 5390 | (save-excursion |
| 5501 | (let ((current-mark (point-marker)) | 5391 | (let* ((current-mark (point-marker)) |
| 5502 | was-modified | 5392 | (current-mark-position (marker-position current-mark)) |
| 5503 | bo-subtree | 5393 | was-modified |
| 5504 | editing-topic editing-point) | 5394 | bo-subtree |
| 5395 | editing-topic editing-point) | ||
| 5505 | (goto-char (point-min)) | 5396 | (goto-char (point-min)) |
| 5506 | (while (allout-next-topic-pending-encryption except-mark) | 5397 | (while (allout-next-topic-pending-encryption except-mark) |
| 5507 | (setq was-modified (buffer-modified-p)) | 5398 | (setq was-modified (buffer-modified-p)) |
| 5508 | (if (save-excursion | 5399 | (when (save-excursion |
| 5509 | (and (boundp 'allout-encrypt-unencrypted-on-saves) | 5400 | (and (boundp 'allout-encrypt-unencrypted-on-saves) |
| 5510 | allout-encrypt-unencrypted-on-saves | 5401 | allout-encrypt-unencrypted-on-saves |
| 5511 | (setq bo-subtree (re-search-forward "[\n\r]")) | 5402 | (setq bo-subtree (re-search-forward "$")) |
| 5512 | ;; Not collapsed: | 5403 | (not (allout-hidden-p)) |
| 5513 | (string= (match-string 0) "\n") | 5404 | (>= current-mark (point)) |
| 5514 | (>= current-mark (point)) | 5405 | (allout-end-of-current-subtree) |
| 5515 | (allout-end-of-current-subtree) | 5406 | (<= current-mark (point)))) |
| 5516 | (<= current-mark (point)))) | ||
| 5517 | (setq editing-topic (point) | 5407 | (setq editing-topic (point) |
| 5518 | ;; we had to wait for this 'til now so prior topics are | 5408 | ;; we had to wait for this 'til now so prior topics are |
| 5519 | ;; encrypted, any relevant text shifts are in place: | 5409 | ;; encrypted, any relevant text shifts are in place: |
| 5520 | editing-point (marker-position current-mark))) | 5410 | editing-point (- current-mark-position |
| 5411 | (count-trailing-whitespace-region | ||
| 5412 | bo-subtree current-mark-position)))) | ||
| 5521 | (allout-toggle-subtree-encryption) | 5413 | (allout-toggle-subtree-encryption) |
| 5522 | (if (not was-modified) | 5414 | (if (not was-modified) |
| 5523 | (set-buffer-modified-p nil)) | 5415 | (set-buffer-modified-p nil)) |
| @@ -5579,11 +5471,11 @@ Returns list `(beginning-point prefix-string suffix-string)'." | |||
| 5579 | (setq beg (- (point) 16)) | 5471 | (setq beg (- (point) 16)) |
| 5580 | (setq suffix (buffer-substring-no-properties | 5472 | (setq suffix (buffer-substring-no-properties |
| 5581 | (point) | 5473 | (point) |
| 5582 | (progn (if (re-search-forward "[\n\r]" nil t) | 5474 | (progn (if (search-forward "\n" nil t) |
| 5583 | (forward-char -1)) | 5475 | (forward-char -1)) |
| 5584 | (point)))) | 5476 | (point)))) |
| 5585 | (setq prefix (buffer-substring-no-properties | 5477 | (setq prefix (buffer-substring-no-properties |
| 5586 | (progn (if (re-search-backward "[\n\r]" nil t) | 5478 | (progn (if (search-backward "\n" nil t) |
| 5587 | (forward-char 1)) | 5479 | (forward-char 1)) |
| 5588 | (point)) | 5480 | (point)) |
| 5589 | beg)) | 5481 | beg)) |
| @@ -5639,7 +5531,7 @@ enable-local-variables must be true for any of this to happen." | |||
| 5639 | (allout-show-to-offshoot) | 5531 | (allout-show-to-offshoot) |
| 5640 | (if (search-forward (concat "\n" prefix varname ":") nil t) | 5532 | (if (search-forward (concat "\n" prefix varname ":") nil t) |
| 5641 | (let* ((value-beg (point)) | 5533 | (let* ((value-beg (point)) |
| 5642 | (line-end (progn (if (re-search-forward "[\n\r]" nil t) | 5534 | (line-end (progn (if (search-forward "\n" nil t) |
| 5643 | (forward-char -1)) | 5535 | (forward-char -1)) |
| 5644 | (point))) | 5536 | (point))) |
| 5645 | (value-end (- line-end (length suffix)))) | 5537 | (value-end (- line-end (length suffix)))) |
| @@ -5710,26 +5602,29 @@ Optional arg SUCCESSIVE-BACKSLASHES is used internally for recursion." | |||
| 5710 | (regexp-sans-escapes (substring regexp 1))) | 5602 | (regexp-sans-escapes (substring regexp 1))) |
| 5711 | ;; Exclude first char, but maintain count: | 5603 | ;; Exclude first char, but maintain count: |
| 5712 | (regexp-sans-escapes (substring regexp 1) successive-backslashes)))) | 5604 | (regexp-sans-escapes (substring regexp 1) successive-backslashes)))) |
| 5713 | ;;;_ - add-hook definition for divergent emacsen | 5605 | ;;;_ > count-trailing-whitespace-region (beg end) |
| 5714 | ;;;_ > add-hook (hook function &optional append) | 5606 | (defun count-trailing-whitespace-region (beg end) |
| 5715 | (if (not (fboundp 'add-hook)) | 5607 | "Return number of trailing whitespace chars between BEG and END. |
| 5716 | (defun add-hook (hook function &optional append) | 5608 | |
| 5717 | "Add to the value of HOOK the function FUNCTION unless already present. | 5609 | If BEG is bigger than END we return 0." |
| 5718 | \(It becomes the first hook on the list unless optional APPEND is non-nil, in | 5610 | (if (> beg end) |
| 5719 | which case it becomes the last). HOOK should be a symbol, and FUNCTION may be | 5611 | 0 |
| 5720 | any valid function. HOOK's value should be a list of functions, not a single | 5612 | (save-excursion |
| 5721 | function. If HOOK is void, it is first set to nil." | 5613 | (goto-char beg) |
| 5722 | (or (boundp hook) (set hook nil)) | 5614 | (let ((count 0)) |
| 5723 | (or (if (consp function) | 5615 | (while (re-search-forward "[ ][ ]*$" end t) |
| 5724 | ;; Clever way to tell whether a given lambda-expression | 5616 | (goto-char (1+ (match-beginning 0))) |
| 5725 | ;; is equal to anything in the hook. | 5617 | (setq count (1+ count))) |
| 5726 | (let ((tail (assoc (cdr function) (symbol-value hook)))) | 5618 | count)))) |
| 5727 | (equal function tail)) | 5619 | ;;;_ > allout-mark-marker to accommodate divergent emacsen: |
| 5728 | (memq function (symbol-value hook))) | 5620 | (defun allout-mark-marker (&optional force buffer) |
| 5729 | (set hook | 5621 | "Accommodate the different signature for `mark-marker' across Emacsen. |
| 5730 | (if append | 5622 | |
| 5731 | (nconc (symbol-value hook) (list function)) | 5623 | XEmacs takes two optional args, while mainline GNU Emacs does not, |
| 5732 | (cons function (symbol-value hook))))))) | 5624 | so pass them along when appropriate." |
| 5625 | (if (featurep 'xemacs) | ||
| 5626 | (apply 'mark-marker force buffer) | ||
| 5627 | (mark-marker))) | ||
| 5733 | ;;;_ > subst-char-in-string if necessary | 5628 | ;;;_ > subst-char-in-string if necessary |
| 5734 | (if (not (fboundp 'subst-char-in-string)) | 5629 | (if (not (fboundp 'subst-char-in-string)) |
| 5735 | (defun subst-char-in-string (fromchar tochar string &optional inplace) | 5630 | (defun subst-char-in-string (fromchar tochar string &optional inplace) |
| @@ -5742,17 +5637,159 @@ Unless optional argument INPLACE is non-nil, return a new string." | |||
| 5742 | (if (eq (aref newstr i) fromchar) | 5637 | (if (eq (aref newstr i) fromchar) |
| 5743 | (aset newstr i tochar))) | 5638 | (aset newstr i tochar))) |
| 5744 | newstr))) | 5639 | newstr))) |
| 5745 | ;;;_ : my-mark-marker to accommodate divergent emacsen: | 5640 | ;;;_ > wholenump if necessary |
| 5746 | (defun my-mark-marker (&optional force buffer) | 5641 | (if (not (fboundp 'wholenump)) |
| 5747 | "Accommodate the different signature for `mark-marker' across Emacsen. | 5642 | (defalias 'wholenump 'natnump)) |
| 5748 | 5643 | ;;;_ > remove-overlays if necessary | |
| 5749 | XEmacs takes two optional args, while mainline GNU Emacs does not, | 5644 | (if (not (fboundp 'remove-overlays)) |
| 5750 | so pass them along when appropriate." | 5645 | (defun remove-overlays (&optional beg end name val) |
| 5751 | (if (featurep 'xemacs) | 5646 | "Clear BEG and END of overlays whose property NAME has value VAL. |
| 5752 | (apply 'mark-marker force buffer) | 5647 | Overlays might be moved and/or split. |
| 5753 | (mark-marker))) | 5648 | BEG and END default respectively to the beginning and end of buffer." |
| 5754 | 5649 | (unless beg (setq beg (point-min))) | |
| 5755 | ;;;_ #10 Under development | 5650 | (unless end (setq end (point-max))) |
| 5651 | (if (< end beg) | ||
| 5652 | (setq beg (prog1 end (setq end beg)))) | ||
| 5653 | (save-excursion | ||
| 5654 | (dolist (o (overlays-in beg end)) | ||
| 5655 | (when (eq (overlay-get o name) val) | ||
| 5656 | ;; Either push this overlay outside beg...end | ||
| 5657 | ;; or split it to exclude beg...end | ||
| 5658 | ;; or delete it entirely (if it is contained in beg...end). | ||
| 5659 | (if (< (overlay-start o) beg) | ||
| 5660 | (if (> (overlay-end o) end) | ||
| 5661 | (progn | ||
| 5662 | (move-overlay (copy-overlay o) | ||
| 5663 | (overlay-start o) beg) | ||
| 5664 | (move-overlay o end (overlay-end o))) | ||
| 5665 | (move-overlay o (overlay-start o) beg)) | ||
| 5666 | (if (> (overlay-end o) end) | ||
| 5667 | (move-overlay o end (overlay-end o)) | ||
| 5668 | (delete-overlay o))))))) | ||
| 5669 | ) | ||
| 5670 | ;;;_ > copy-overlay if necessary - xemacs ~ 21.4 | ||
| 5671 | (if (not (fboundp 'copy-overlay)) | ||
| 5672 | (defun copy-overlay (o) | ||
| 5673 | "Return a copy of overlay O." | ||
| 5674 | (let ((o1 (make-overlay (overlay-start o) (overlay-end o) | ||
| 5675 | ;; FIXME: there's no easy way to find the | ||
| 5676 | ;; insertion-type of the two markers. | ||
| 5677 | (overlay-buffer o))) | ||
| 5678 | (props (overlay-properties o))) | ||
| 5679 | (while props | ||
| 5680 | (overlay-put o1 (pop props) (pop props))) | ||
| 5681 | o1))) | ||
| 5682 | ;;;_ > add-to-invisibility-spec if necessary - xemacs ~ 21.4 | ||
| 5683 | (if (not (fboundp 'add-to-invisibility-spec)) | ||
| 5684 | (defun add-to-invisibility-spec (element) | ||
| 5685 | "Add ELEMENT to `buffer-invisibility-spec'. | ||
| 5686 | See documentation for `buffer-invisibility-spec' for the kind of elements | ||
| 5687 | that can be added." | ||
| 5688 | (if (eq buffer-invisibility-spec t) | ||
| 5689 | (setq buffer-invisibility-spec (list t))) | ||
| 5690 | (setq buffer-invisibility-spec | ||
| 5691 | (cons element buffer-invisibility-spec)))) | ||
| 5692 | ;;;_ > remove-from-invisibility-spec if necessary - xemacs ~ 21.4 | ||
| 5693 | (if (not (fboundp 'remove-from-invisibility-spec)) | ||
| 5694 | (defun remove-from-invisibility-spec (element) | ||
| 5695 | "Remove ELEMENT from `buffer-invisibility-spec'." | ||
| 5696 | (if (consp buffer-invisibility-spec) | ||
| 5697 | (setq buffer-invisibility-spec (delete element | ||
| 5698 | buffer-invisibility-spec))))) | ||
| 5699 | ;;;_ > move-beginning-of-line if necessary - older emacs, xemacs | ||
| 5700 | (if (not (fboundp 'move-beginning-of-line)) | ||
| 5701 | (defun move-beginning-of-line (arg) | ||
| 5702 | "Move point to beginning of current line as displayed. | ||
| 5703 | \(This disregards invisible newlines such as those | ||
| 5704 | which are part of the text that an image rests on.) | ||
| 5705 | |||
| 5706 | With argument ARG not nil or 1, move forward ARG - 1 lines first. | ||
| 5707 | If point reaches the beginning or end of buffer, it stops there. | ||
| 5708 | To ignore intangibility, bind `inhibit-point-motion-hooks' to t. | ||
| 5709 | |||
| 5710 | This function does not move point across a field boundary unless that | ||
| 5711 | would move point to a different line than the original, unconstrained | ||
| 5712 | result. If N is nil or 1, and a front-sticky field starts at point, | ||
| 5713 | the point does not move. To ignore field boundaries bind | ||
| 5714 | `inhibit-field-text-motion' to t." | ||
| 5715 | (interactive "p") | ||
| 5716 | (or arg (setq arg 1)) | ||
| 5717 | (if (/= arg 1) | ||
| 5718 | (condition-case nil (line-move (1- arg)) (error nil))) | ||
| 5719 | |||
| 5720 | (let ((orig (point))) | ||
| 5721 | ;; Move to beginning-of-line, ignoring fields and invisibles. | ||
| 5722 | (skip-chars-backward "^\n") | ||
| 5723 | (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) | ||
| 5724 | (goto-char (if (featurep 'xemacs) | ||
| 5725 | (previous-property-change (point)) | ||
| 5726 | (previous-char-property-change (point)))) | ||
| 5727 | (skip-chars-backward "^\n")) | ||
| 5728 | (vertical-motion 0) | ||
| 5729 | (if (/= orig (point)) | ||
| 5730 | (goto-char (constrain-to-field (point) orig (/= arg 1) t nil))))) | ||
| 5731 | ) | ||
| 5732 | ;;;_ > move-end-of-line if necessary - older emacs, xemacs | ||
| 5733 | (if (not (fboundp 'move-end-of-line)) | ||
| 5734 | (defun move-end-of-line (arg) | ||
| 5735 | "Move point to end of current line as displayed. | ||
| 5736 | \(This disregards invisible newlines such as those | ||
| 5737 | which are part of the text that an image rests on.) | ||
| 5738 | |||
| 5739 | With argument ARG not nil or 1, move forward ARG - 1 lines first. | ||
| 5740 | If point reaches the beginning or end of buffer, it stops there. | ||
| 5741 | To ignore intangibility, bind `inhibit-point-motion-hooks' to t. | ||
| 5742 | |||
| 5743 | This function does not move point across a field boundary unless that | ||
| 5744 | would move point to a different line than the original, unconstrained | ||
| 5745 | result. If N is nil or 1, and a rear-sticky field ends at point, | ||
| 5746 | the point does not move. To ignore field boundaries bind | ||
| 5747 | `inhibit-field-text-motion' to t." | ||
| 5748 | (interactive "p") | ||
| 5749 | (or arg (setq arg 1)) | ||
| 5750 | (let ((orig (point)) | ||
| 5751 | done) | ||
| 5752 | (while (not done) | ||
| 5753 | (let ((newpos | ||
| 5754 | (save-excursion | ||
| 5755 | (let ((goal-column 0)) | ||
| 5756 | (and (condition-case nil | ||
| 5757 | (or (line-move arg) t) | ||
| 5758 | (error nil)) | ||
| 5759 | (not (bobp)) | ||
| 5760 | (progn | ||
| 5761 | (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) | ||
| 5762 | (goto-char (previous-char-property-change (point)))) | ||
| 5763 | (backward-char 1))) | ||
| 5764 | (point))))) | ||
| 5765 | (goto-char newpos) | ||
| 5766 | (if (and (> (point) newpos) | ||
| 5767 | (eq (preceding-char) ?\n)) | ||
| 5768 | (backward-char 1) | ||
| 5769 | (if (and (> (point) newpos) (not (eobp)) | ||
| 5770 | (not (eq (following-char) ?\n))) | ||
| 5771 | ;; If we skipped something intangible | ||
| 5772 | ;; and now we're not really at eol, | ||
| 5773 | ;; keep going. | ||
| 5774 | (setq arg 1) | ||
| 5775 | (setq done t))))) | ||
| 5776 | (if (/= orig (point)) | ||
| 5777 | (goto-char (constrain-to-field (point) orig (/= arg 1) t | ||
| 5778 | nil))))) | ||
| 5779 | ) | ||
| 5780 | ;;;_ > line-move-invisible-p if necessary | ||
| 5781 | (if (not (fboundp 'line-move-invisible-p)) | ||
| 5782 | (defun line-move-invisible-p (pos) | ||
| 5783 | "Return non-nil if the character after POS is currently invisible." | ||
| 5784 | (let ((prop | ||
| 5785 | (get-char-property pos 'invisible))) | ||
| 5786 | (if (eq buffer-invisibility-spec t) | ||
| 5787 | prop | ||
| 5788 | (or (memq prop buffer-invisibility-spec) | ||
| 5789 | (assq prop buffer-invisibility-spec)))))) | ||
| 5790 | |||
| 5791 | |||
| 5792 | ;;;_ #10 Unfinished | ||
| 5756 | ;;;_ > allout-bullet-isearch (&optional bullet) | 5793 | ;;;_ > allout-bullet-isearch (&optional bullet) |
| 5757 | (defun allout-bullet-isearch (&optional bullet) | 5794 | (defun allout-bullet-isearch (&optional bullet) |
| 5758 | "Isearch \(regexp) for topic with bullet BULLET." | 5795 | "Isearch \(regexp) for topic with bullet BULLET." |
| @@ -5769,8 +5806,9 @@ so pass them along when appropriate." | |||
| 5769 | bullet))) | 5806 | bullet))) |
| 5770 | (isearch-repeat 'forward) | 5807 | (isearch-repeat 'forward) |
| 5771 | (isearch-mode t))) | 5808 | (isearch-mode t))) |
| 5772 | ;;;_ ? Re hooking up with isearch - use isearch-op-fun rather than | 5809 | |
| 5773 | ;;; wrapping the isearch functions. | 5810 | ;;;_ #11 Provide |
| 5811 | (provide 'allout) | ||
| 5774 | 5812 | ||
| 5775 | ;;;_* Local emacs vars. | 5813 | ;;;_* Local emacs vars. |
| 5776 | ;;; The following `allout-layout' local variable setting: | 5814 | ;;; The following `allout-layout' local variable setting: |
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 5388ff9863d..3094da3bfe8 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el | |||
| @@ -706,9 +706,9 @@ For more information, see the function `buffer-menu'." | |||
| 706 | list desired-point) | 706 | list desired-point) |
| 707 | (when Buffer-menu-use-header-line | 707 | (when Buffer-menu-use-header-line |
| 708 | (let ((pos 0)) | 708 | (let ((pos 0)) |
| 709 | ;; Turn spaces in the header into stretch specs so they work | 709 | ;; Turn whitespace chars in the header into stretch specs so |
| 710 | ;; regardless of the header-line face. | 710 | ;; they work regardless of the header-line face. |
| 711 | (while (string-match "[ \t]+" header pos) | 711 | (while (string-match "[ \t\n]+" header pos) |
| 712 | (setq pos (match-end 0)) | 712 | (setq pos (match-end 0)) |
| 713 | (put-text-property (match-beginning 0) pos 'display | 713 | (put-text-property (match-beginning 0) pos 'display |
| 714 | ;; Assume fixed-size chars in the buffer. | 714 | ;; Assume fixed-size chars in the buffer. |
| @@ -726,6 +726,7 @@ For more information, see the function `buffer-menu'." | |||
| 726 | (erase-buffer) | 726 | (erase-buffer) |
| 727 | (setq standard-output (current-buffer)) | 727 | (setq standard-output (current-buffer)) |
| 728 | (unless Buffer-menu-use-header-line | 728 | (unless Buffer-menu-use-header-line |
| 729 | ;; Use U+2014 (EM DASH) to underline if possible, else U+002D (HYPHEN-MINUS) | ||
| 729 | (let ((underline (if (char-displayable-p ?—) ?— ?-))) | 730 | (let ((underline (if (char-displayable-p ?—) ?— ?-))) |
| 730 | (insert header | 731 | (insert header |
| 731 | (apply 'string | 732 | (apply 'string |
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index 571b4ec132a..bce30a1de20 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el | |||
| @@ -78,6 +78,7 @@ | |||
| 78 | ;; Make sure calendar is loaded when we compile this. | 78 | ;; Make sure calendar is loaded when we compile this. |
| 79 | (require 'calendar) | 79 | (require 'calendar) |
| 80 | 80 | ||
| 81 | (defvar diary-selective-display) | ||
| 81 | 82 | ||
| 82 | ;;;###autoload | 83 | ;;;###autoload |
| 83 | (defcustom appt-issue-message t | 84 | (defcustom appt-issue-message t |
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 3d06bd0fcae..feacc9adf0d 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -932,6 +932,7 @@ If given a prefix (or a COMMENT argument), also prompt for a comment." | |||
| 932 | "Set customized value for %s to: " | 932 | "Set customized value for %s to: " |
| 933 | current-prefix-arg)) | 933 | current-prefix-arg)) |
| 934 | (custom-load-symbol variable) | 934 | (custom-load-symbol variable) |
| 935 | (custom-push-theme 'theme-value variable 'user 'set (custom-quote value)) | ||
| 935 | (funcall (or (get variable 'custom-set) 'set-default) variable value) | 936 | (funcall (or (get variable 'custom-set) 'set-default) variable value) |
| 936 | (put variable 'customized-value (list (custom-quote value))) | 937 | (put variable 'customized-value (list (custom-quote value))) |
| 937 | (cond ((string= comment "") | 938 | (cond ((string= comment "") |
| @@ -4166,7 +4167,9 @@ This function does not save the buffer." | |||
| 4166 | (mapatoms | 4167 | (mapatoms |
| 4167 | (lambda (symbol) | 4168 | (lambda (symbol) |
| 4168 | (if (and (get symbol 'saved-value) | 4169 | (if (and (get symbol 'saved-value) |
| 4169 | (eq 'user (car (car-safe (get symbol 'theme-value))))) | 4170 | ;; ignore theme values |
| 4171 | (or (null (get symbol 'theme-value)) | ||
| 4172 | (eq 'user (caar (get symbol 'theme-value))))) | ||
| 4170 | (nconc saved-list (list symbol))))) | 4173 | (nconc saved-list (list symbol))))) |
| 4171 | (setq saved-list (sort (cdr saved-list) 'string<)) | 4174 | (setq saved-list (sort (cdr saved-list) 'string<)) |
| 4172 | (unless (bolp) | 4175 | (unless (bolp) |
diff --git a/lisp/custom.el b/lisp/custom.el index 0f95e3bab73..15b5b4a815c 100644 --- a/lisp/custom.el +++ b/lisp/custom.el | |||
| @@ -653,6 +653,7 @@ default value. Otherwise, set it to nil. | |||
| 653 | To actually save the value, call `custom-save-all'. | 653 | To actually save the value, call `custom-save-all'. |
| 654 | 654 | ||
| 655 | Return non-nil iff the `saved-value' property actually changed." | 655 | Return non-nil iff the `saved-value' property actually changed." |
| 656 | (custom-load-symbol symbol) | ||
| 656 | (let* ((get (or (get symbol 'custom-get) 'default-value)) | 657 | (let* ((get (or (get symbol 'custom-get) 'default-value)) |
| 657 | (value (funcall get symbol)) | 658 | (value (funcall get symbol)) |
| 658 | (saved (get symbol 'saved-value)) | 659 | (saved (get symbol 'saved-value)) |
| @@ -681,6 +682,7 @@ or else if it is different from the standard value, set the | |||
| 681 | default value. Otherwise, set it to nil. | 682 | default value. Otherwise, set it to nil. |
| 682 | 683 | ||
| 683 | Return non-nil iff the `customized-value' property actually changed." | 684 | Return non-nil iff the `customized-value' property actually changed." |
| 685 | (custom-load-symbol symbol) | ||
| 684 | (let* ((get (or (get symbol 'custom-get) 'default-value)) | 686 | (let* ((get (or (get symbol 'custom-get) 'default-value)) |
| 685 | (value (funcall get symbol)) | 687 | (value (funcall get symbol)) |
| 686 | (customized (get symbol 'customized-value)) | 688 | (customized (get symbol 'customized-value)) |
| @@ -690,7 +692,9 @@ Return non-nil iff the `customized-value' property actually changed." | |||
| 690 | (not (equal value (condition-case nil | 692 | (not (equal value (condition-case nil |
| 691 | (eval (car old)) | 693 | (eval (car old)) |
| 692 | (error nil))))) | 694 | (error nil))))) |
| 693 | (put symbol 'customized-value (list (custom-quote value))) | 695 | (progn (put symbol 'customized-value (list (custom-quote value))) |
| 696 | (custom-push-theme 'theme-value symbol 'user 'set | ||
| 697 | (custom-quote value))) | ||
| 694 | (put symbol 'customized-value nil)) | 698 | (put symbol 'customized-value nil)) |
| 695 | ;; Changed? | 699 | ;; Changed? |
| 696 | (not (equal customized (get symbol 'customized-value))))) | 700 | (not (equal customized (get symbol 'customized-value))))) |
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el index 67da6eae25d..62a6386584e 100644 --- a/lisp/ediff-diff.el +++ b/lisp/ediff-diff.el | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | ;;; Code: | 27 | ;;; Code: |
| 28 | 28 | ||
| 29 | (provide 'ediff-diff) | ||
| 30 | 29 | ||
| 31 | ;; compiler pacifier | 30 | ;; compiler pacifier |
| 32 | (defvar ediff-default-variant) | 31 | (defvar ediff-default-variant) |
| @@ -129,13 +128,33 @@ are `-I REGEXP', to ignore changes whose lines match the REGEXP." | |||
| 129 | 128 | ||
| 130 | (defcustom ediff-diff-options "" | 129 | (defcustom ediff-diff-options "" |
| 131 | "*Options to pass to `ediff-diff-program'. | 130 | "*Options to pass to `ediff-diff-program'. |
| 132 | If Unix diff is used as `ediff-diff-program', then the most useful options are | 131 | If Unix diff is used as `ediff-diff-program', then a useful option is |
| 133 | `-w', to ignore space, and `-i', to ignore case of letters. | 132 | `-w', to ignore space, and `-i', to ignore case of letters. |
| 134 | At present, the option `-c' is not allowed." | 133 | Options `-c' and `-i' are not allowed. Case sensitivity can be toggled |
| 134 | interactively using [ediff-toggle-ignore-case]" | ||
| 135 | :set 'ediff-reset-diff-options | 135 | :set 'ediff-reset-diff-options |
| 136 | :type 'string | 136 | :type 'string |
| 137 | :group 'ediff-diff) | 137 | :group 'ediff-diff) |
| 138 | 138 | ||
| 139 | (ediff-defvar-local ediff-ignore-case nil | ||
| 140 | "*If t, skip over difference regions that differ only in letter case. | ||
| 141 | This variable can be set either in .emacs or toggled interactively. | ||
| 142 | Use `setq-default' if setting it in .emacs") | ||
| 143 | |||
| 144 | (defcustom ediff-ignore-case-option "-i" | ||
| 145 | "*Option that causes the diff program to ignore case of letters." | ||
| 146 | :type 'string | ||
| 147 | :group 'ediff-diff) | ||
| 148 | |||
| 149 | (defcustom ediff-ignore-case-option3 "" | ||
| 150 | "*Option that causes the diff3 program to ignore case of letters. | ||
| 151 | GNU diff3 doesn't have such an option." | ||
| 152 | :type 'string | ||
| 153 | :group 'ediff-diff) | ||
| 154 | |||
| 155 | ;; the actual options used in comparison | ||
| 156 | (ediff-defvar-local ediff-actual-diff-options "" "") | ||
| 157 | |||
| 139 | (defcustom ediff-custom-diff-program ediff-diff-program | 158 | (defcustom ediff-custom-diff-program ediff-diff-program |
| 140 | "*Program to use for generating custom diff output for saving it in a file. | 159 | "*Program to use for generating custom diff output for saving it in a file. |
| 141 | This output is not used by Ediff internally." | 160 | This output is not used by Ediff internally." |
| @@ -155,6 +174,10 @@ This output is not used by Ediff internally." | |||
| 155 | :set 'ediff-reset-diff-options | 174 | :set 'ediff-reset-diff-options |
| 156 | :type 'string | 175 | :type 'string |
| 157 | :group 'ediff-diff) | 176 | :group 'ediff-diff) |
| 177 | |||
| 178 | ;; the actual options used in comparison | ||
| 179 | (ediff-defvar-local ediff-actual-diff3-options "" "") | ||
| 180 | |||
| 158 | (defcustom ediff-diff3-ok-lines-regexp | 181 | (defcustom ediff-diff3-ok-lines-regexp |
| 159 | "^\\([1-3]:\\|====\\| \\|.*Warning *:\\|.*No newline\\|.*missing newline\\|^\C-m$\\)" | 182 | "^\\([1-3]:\\|====\\| \\|.*Warning *:\\|.*No newline\\|.*missing newline\\|^\C-m$\\)" |
| 160 | "*Regexp that matches normal output lines from `ediff-diff3-program'. | 183 | "*Regexp that matches normal output lines from `ediff-diff3-program'. |
| @@ -182,7 +205,7 @@ Use `setq-default' if setting it in .emacs") | |||
| 182 | This variable can be set either in .emacs or toggled interactively. | 205 | This variable can be set either in .emacs or toggled interactively. |
| 183 | Use `setq-default' if setting it in .emacs") | 206 | Use `setq-default' if setting it in .emacs") |
| 184 | 207 | ||
| 185 | (ediff-defvar-local ediff-auto-refine-limit 1400 | 208 | (ediff-defvar-local ediff-auto-refine-limit 14000 |
| 186 | "*Auto-refine only the regions of this size \(in bytes\) or less.") | 209 | "*Auto-refine only the regions of this size \(in bytes\) or less.") |
| 187 | 210 | ||
| 188 | ;;; General | 211 | ;;; General |
| @@ -227,9 +250,9 @@ one optional arguments, diff-number to refine.") | |||
| 227 | ;; ediff-setup-diff-regions-function, which can also have the value | 250 | ;; ediff-setup-diff-regions-function, which can also have the value |
| 228 | ;; ediff-setup-diff-regions3, which takes 4 arguments. | 251 | ;; ediff-setup-diff-regions3, which takes 4 arguments. |
| 229 | (defun ediff-setup-diff-regions (file-A file-B file-C) | 252 | (defun ediff-setup-diff-regions (file-A file-B file-C) |
| 230 | ;; looking either for '-c' or a 'c' in a set of clustered non-long options | 253 | ;; looking for '-c', '-i', or a 'c', 'i' among clustered non-long options |
| 231 | (if (string-match "^-c\\| -c\\|-[^- ]+c" ediff-diff-options) | 254 | (if (string-match "^-[ci]\\| -[ci]\\|-[^- ]+[ci]" ediff-diff-options) |
| 232 | (error "Option `-c' is not allowed in `ediff-diff-options'")) | 255 | (error "Options `-c' and `-i' are not allowed in `ediff-diff-options'")) |
| 233 | 256 | ||
| 234 | ;; create, if it doesn't exist | 257 | ;; create, if it doesn't exist |
| 235 | (or (ediff-buffer-live-p ediff-diff-buffer) | 258 | (or (ediff-buffer-live-p ediff-diff-buffer) |
| @@ -266,7 +289,7 @@ one optional arguments, diff-number to refine.") | |||
| 266 | (ediff-exec-process ediff-diff-program | 289 | (ediff-exec-process ediff-diff-program |
| 267 | diff-buffer | 290 | diff-buffer |
| 268 | 'synchronize | 291 | 'synchronize |
| 269 | ediff-diff-options file1 file2) | 292 | ediff-actual-diff-options file1 file2) |
| 270 | (message "") | 293 | (message "") |
| 271 | (ediff-with-current-buffer diff-buffer | 294 | (ediff-with-current-buffer diff-buffer |
| 272 | (buffer-size)))))) | 295 | (buffer-size)))))) |
| @@ -284,7 +307,9 @@ one optional arguments, diff-number to refine.") | |||
| 284 | (let (diff3-job diff-program diff-options ok-regexp diff-list) | 307 | (let (diff3-job diff-program diff-options ok-regexp diff-list) |
| 285 | (setq diff3-job ediff-3way-job | 308 | (setq diff3-job ediff-3way-job |
| 286 | diff-program (if diff3-job ediff-diff3-program ediff-diff-program) | 309 | diff-program (if diff3-job ediff-diff3-program ediff-diff-program) |
| 287 | diff-options (if diff3-job ediff-diff3-options ediff-diff-options) | 310 | diff-options (if diff3-job |
| 311 | ediff-actual-diff3-options | ||
| 312 | ediff-actual-diff-options) | ||
| 288 | ok-regexp (if diff3-job | 313 | ok-regexp (if diff3-job |
| 289 | ediff-diff3-ok-lines-regexp | 314 | ediff-diff3-ok-lines-regexp |
| 290 | ediff-diff-ok-lines-regexp)) | 315 | ediff-diff-ok-lines-regexp)) |
| @@ -366,11 +391,14 @@ one optional arguments, diff-number to refine.") | |||
| 366 | (B-buffer ediff-buffer-B) | 391 | (B-buffer ediff-buffer-B) |
| 367 | (C-buffer ediff-buffer-C) | 392 | (C-buffer ediff-buffer-C) |
| 368 | (a-prev 1) ; this is needed to set the first diff line correctly | 393 | (a-prev 1) ; this is needed to set the first diff line correctly |
| 394 | (a-prev-pt nil) | ||
| 369 | (b-prev 1) | 395 | (b-prev 1) |
| 396 | (b-prev-pt nil) | ||
| 370 | (c-prev 1) | 397 | (c-prev 1) |
| 398 | (c-prev-pt nil) | ||
| 371 | diff-list shift-A shift-B | 399 | diff-list shift-A shift-B |
| 372 | ) | 400 | ) |
| 373 | 401 | ||
| 374 | ;; diff list contains word numbers, unless changed later | 402 | ;; diff list contains word numbers, unless changed later |
| 375 | (setq diff-list (cons (if word-mode 'words 'points) | 403 | (setq diff-list (cons (if word-mode 'words 'points) |
| 376 | diff-list)) | 404 | diff-list)) |
| @@ -382,7 +410,7 @@ one optional arguments, diff-number to refine.") | |||
| 382 | shift-B | 410 | shift-B |
| 383 | (ediff-overlay-start | 411 | (ediff-overlay-start |
| 384 | (ediff-get-value-according-to-buffer-type 'B bounds)))) | 412 | (ediff-get-value-according-to-buffer-type 'B bounds)))) |
| 385 | 413 | ||
| 386 | ;; reset point in buffers A/B/C | 414 | ;; reset point in buffers A/B/C |
| 387 | (ediff-with-current-buffer A-buffer | 415 | (ediff-with-current-buffer A-buffer |
| 388 | (goto-char (if shift-A shift-A (point-min)))) | 416 | (goto-char (if shift-A shift-A (point-min)))) |
| @@ -466,11 +494,13 @@ one optional arguments, diff-number to refine.") | |||
| 466 | ;; we must disable and then restore longlines-mode | 494 | ;; we must disable and then restore longlines-mode |
| 467 | (if (eq longlines-mode-val 1) | 495 | (if (eq longlines-mode-val 1) |
| 468 | (longlines-mode 0)) | 496 | (longlines-mode 0)) |
| 497 | (goto-char (or a-prev-pt shift-A (point-min))) | ||
| 469 | (forward-line (- a-begin a-prev)) | 498 | (forward-line (- a-begin a-prev)) |
| 470 | (setq a-begin-pt (point)) | 499 | (setq a-begin-pt (point)) |
| 471 | (forward-line (- a-end a-begin)) | 500 | (forward-line (- a-end a-begin)) |
| 472 | (setq a-end-pt (point) | 501 | (setq a-end-pt (point) |
| 473 | a-prev a-end) | 502 | a-prev a-end |
| 503 | a-prev-pt a-end-pt) | ||
| 474 | (if (eq longlines-mode-val 1) | 504 | (if (eq longlines-mode-val 1) |
| 475 | (longlines-mode longlines-mode-val)) | 505 | (longlines-mode longlines-mode-val)) |
| 476 | )) | 506 | )) |
| @@ -479,11 +509,13 @@ one optional arguments, diff-number to refine.") | |||
| 479 | (if (and (boundp 'longlines-mode) longlines-mode) 1 0))) | 509 | (if (and (boundp 'longlines-mode) longlines-mode) 1 0))) |
| 480 | (if (eq longlines-mode-val 1) | 510 | (if (eq longlines-mode-val 1) |
| 481 | (longlines-mode 0)) | 511 | (longlines-mode 0)) |
| 512 | (goto-char (or b-prev-pt shift-B (point-min))) | ||
| 482 | (forward-line (- b-begin b-prev)) | 513 | (forward-line (- b-begin b-prev)) |
| 483 | (setq b-begin-pt (point)) | 514 | (setq b-begin-pt (point)) |
| 484 | (forward-line (- b-end b-begin)) | 515 | (forward-line (- b-end b-begin)) |
| 485 | (setq b-end-pt (point) | 516 | (setq b-end-pt (point) |
| 486 | b-prev b-end) | 517 | b-prev b-end |
| 518 | b-prev-pt b-end-pt) | ||
| 487 | (if (eq longlines-mode-val 1) | 519 | (if (eq longlines-mode-val 1) |
| 488 | (longlines-mode longlines-mode-val)) | 520 | (longlines-mode longlines-mode-val)) |
| 489 | )) | 521 | )) |
| @@ -493,11 +525,13 @@ one optional arguments, diff-number to refine.") | |||
| 493 | (if (and (boundp 'longlines-mode) longlines-mode) 1 0))) | 525 | (if (and (boundp 'longlines-mode) longlines-mode) 1 0))) |
| 494 | (if (eq longlines-mode-val 1) | 526 | (if (eq longlines-mode-val 1) |
| 495 | (longlines-mode 0)) | 527 | (longlines-mode 0)) |
| 528 | (goto-char (or c-prev-pt (point-min))) | ||
| 496 | (forward-line (- c-begin c-prev)) | 529 | (forward-line (- c-begin c-prev)) |
| 497 | (setq c-begin-pt (point)) | 530 | (setq c-begin-pt (point)) |
| 498 | (forward-line (- c-end c-begin)) | 531 | (forward-line (- c-end c-begin)) |
| 499 | (setq c-end-pt (point) | 532 | (setq c-end-pt (point) |
| 500 | c-prev c-end) | 533 | c-prev c-end |
| 534 | c-prev-pt c-end-pt) | ||
| 501 | (if (eq longlines-mode-val 1) | 535 | (if (eq longlines-mode-val 1) |
| 502 | (longlines-mode longlines-mode-val)) | 536 | (longlines-mode longlines-mode-val)) |
| 503 | ))) | 537 | ))) |
| @@ -987,8 +1021,11 @@ delimiter regions")) | |||
| 987 | (C-buffer ediff-buffer-C) | 1021 | (C-buffer ediff-buffer-C) |
| 988 | (anc-buffer ediff-ancestor-buffer) | 1022 | (anc-buffer ediff-ancestor-buffer) |
| 989 | (a-prev 1) ; needed to set the first diff line correctly | 1023 | (a-prev 1) ; needed to set the first diff line correctly |
| 1024 | (a-prev-pt nil) | ||
| 990 | (b-prev 1) | 1025 | (b-prev 1) |
| 1026 | (b-prev-pt nil) | ||
| 991 | (c-prev 1) | 1027 | (c-prev 1) |
| 1028 | (c-prev-pt nil) | ||
| 992 | (anc-prev 1) | 1029 | (anc-prev 1) |
| 993 | diff-list shift-A shift-B shift-C | 1030 | diff-list shift-A shift-B shift-C |
| 994 | ) | 1031 | ) |
| @@ -1089,11 +1126,13 @@ delimiter regions")) | |||
| 1089 | ;; we must disable and then restore longlines-mode | 1126 | ;; we must disable and then restore longlines-mode |
| 1090 | (if (eq longlines-mode-val 1) | 1127 | (if (eq longlines-mode-val 1) |
| 1091 | (longlines-mode 0)) | 1128 | (longlines-mode 0)) |
| 1129 | (goto-char (or a-prev-pt shift-A (point-min))) | ||
| 1092 | (forward-line (- a-begin a-prev)) | 1130 | (forward-line (- a-begin a-prev)) |
| 1093 | (setq a-begin-pt (point)) | 1131 | (setq a-begin-pt (point)) |
| 1094 | (forward-line (- a-end a-begin)) | 1132 | (forward-line (- a-end a-begin)) |
| 1095 | (setq a-end-pt (point) | 1133 | (setq a-end-pt (point) |
| 1096 | a-prev a-end) | 1134 | a-prev a-end |
| 1135 | a-prev-pt a-end-pt) | ||
| 1097 | (if (eq longlines-mode-val 1) | 1136 | (if (eq longlines-mode-val 1) |
| 1098 | (longlines-mode longlines-mode-val)) | 1137 | (longlines-mode longlines-mode-val)) |
| 1099 | )) | 1138 | )) |
| @@ -1102,11 +1141,13 @@ delimiter regions")) | |||
| 1102 | (if (and (boundp 'longlines-mode) longlines-mode) 1 0))) | 1141 | (if (and (boundp 'longlines-mode) longlines-mode) 1 0))) |
| 1103 | (if (eq longlines-mode-val 1) | 1142 | (if (eq longlines-mode-val 1) |
| 1104 | (longlines-mode 0)) | 1143 | (longlines-mode 0)) |
| 1144 | (goto-char (or b-prev-pt shift-B (point-min))) | ||
| 1105 | (forward-line (- b-begin b-prev)) | 1145 | (forward-line (- b-begin b-prev)) |
| 1106 | (setq b-begin-pt (point)) | 1146 | (setq b-begin-pt (point)) |
| 1107 | (forward-line (- b-end b-begin)) | 1147 | (forward-line (- b-end b-begin)) |
| 1108 | (setq b-end-pt (point) | 1148 | (setq b-end-pt (point) |
| 1109 | b-prev b-end) | 1149 | b-prev b-end |
| 1150 | b-prev-pt b-end-pt) | ||
| 1110 | (if (eq longlines-mode-val 1) | 1151 | (if (eq longlines-mode-val 1) |
| 1111 | (longlines-mode longlines-mode-val)) | 1152 | (longlines-mode longlines-mode-val)) |
| 1112 | )) | 1153 | )) |
| @@ -1115,11 +1156,13 @@ delimiter regions")) | |||
| 1115 | (if (and (boundp 'longlines-mode) longlines-mode) 1 0))) | 1156 | (if (and (boundp 'longlines-mode) longlines-mode) 1 0))) |
| 1116 | (if (eq longlines-mode-val 1) | 1157 | (if (eq longlines-mode-val 1) |
| 1117 | (longlines-mode 0)) | 1158 | (longlines-mode 0)) |
| 1159 | (goto-char (or c-prev-pt shift-C (point-min))) | ||
| 1118 | (forward-line (- c-begin c-prev)) | 1160 | (forward-line (- c-begin c-prev)) |
| 1119 | (setq c-begin-pt (point)) | 1161 | (setq c-begin-pt (point)) |
| 1120 | (forward-line (- c-end c-begin)) | 1162 | (forward-line (- c-end c-begin)) |
| 1121 | (setq c-end-pt (point) | 1163 | (setq c-end-pt (point) |
| 1122 | c-prev c-end) | 1164 | c-prev c-end |
| 1165 | c-prev-pt c-end-pt) | ||
| 1123 | (if (eq longlines-mode-val 1) | 1166 | (if (eq longlines-mode-val 1) |
| 1124 | (longlines-mode longlines-mode-val)) | 1167 | (longlines-mode longlines-mode-val)) |
| 1125 | )) | 1168 | )) |
| @@ -1171,13 +1214,17 @@ delimiter regions")) | |||
| 1171 | ;; File-C is either the third file to compare (in case of 3-way comparison) | 1214 | ;; File-C is either the third file to compare (in case of 3-way comparison) |
| 1172 | ;; or it is the ancestor file. | 1215 | ;; or it is the ancestor file. |
| 1173 | (defun ediff-setup-diff-regions3 (file-A file-B file-C) | 1216 | (defun ediff-setup-diff-regions3 (file-A file-B file-C) |
| 1217 | ;; looking for '-i' or a 'i' among clustered non-long options | ||
| 1218 | (if (string-match "^-i\\| -i\\|-[^- ]+i" ediff-diff-options) | ||
| 1219 | (error "Option `-i' is not allowed in `ediff-diff3-options'")) | ||
| 1220 | |||
| 1174 | (or (ediff-buffer-live-p ediff-diff-buffer) | 1221 | (or (ediff-buffer-live-p ediff-diff-buffer) |
| 1175 | (setq ediff-diff-buffer | 1222 | (setq ediff-diff-buffer |
| 1176 | (get-buffer-create (ediff-unique-buffer-name "*ediff-diff" "*")))) | 1223 | (get-buffer-create (ediff-unique-buffer-name "*ediff-diff" "*")))) |
| 1177 | 1224 | ||
| 1178 | (message "Computing differences ...") | 1225 | (message "Computing differences ...") |
| 1179 | (ediff-exec-process ediff-diff3-program ediff-diff-buffer 'synchronize | 1226 | (ediff-exec-process ediff-diff3-program ediff-diff-buffer 'synchronize |
| 1180 | ediff-diff3-options file-A file-B file-C) | 1227 | ediff-actual-diff3-options file-A file-B file-C) |
| 1181 | 1228 | ||
| 1182 | (ediff-prepare-error-list ediff-diff3-ok-lines-regexp ediff-diff-buffer) | 1229 | (ediff-prepare-error-list ediff-diff3-ok-lines-regexp ediff-diff-buffer) |
| 1183 | ;;(message "Computing differences ... done") | 1230 | ;;(message "Computing differences ... done") |
| @@ -1471,6 +1518,35 @@ affects only files whose names match the expression." | |||
| 1471 | (setq file-list-list (cdr file-list-list))) | 1518 | (setq file-list-list (cdr file-list-list))) |
| 1472 | (reverse result))) | 1519 | (reverse result))) |
| 1473 | 1520 | ||
| 1521 | ;; Ignore case handling - some ideas from drew.adams@@oracle.com | ||
| 1522 | (defun ediff-toggle-ignore-case () | ||
| 1523 | (interactive) | ||
| 1524 | (ediff-barf-if-not-control-buffer) | ||
| 1525 | (setq ediff-ignore-case (not ediff-ignore-case)) | ||
| 1526 | (cond (ediff-ignore-case | ||
| 1527 | (setq ediff-actual-diff-options | ||
| 1528 | (concat ediff-diff-options " " ediff-ignore-case-option) | ||
| 1529 | ediff-actual-diff3-options | ||
| 1530 | (concat ediff-diff3-options " " ediff-ignore-case-option3)) | ||
| 1531 | (message "Ignoring regions that differ only in case")) | ||
| 1532 | (t | ||
| 1533 | (setq ediff-actual-diff-options ediff-diff-options | ||
| 1534 | ediff-actual-diff3-options ediff-diff3-options) | ||
| 1535 | (message "Ignoring case differences turned OFF"))) | ||
| 1536 | (cond (ediff-merge-job | ||
| 1537 | (message "Ignoring letter case is too dangerous in merge jobs")) | ||
| 1538 | ((and ediff-diff3-job (string= ediff-ignore-case-option3 "")) | ||
| 1539 | (message "Ignoring letter case is not supported by this diff3 program")) | ||
| 1540 | ((and (not ediff-3way-job) (string= ediff-ignore-case-option "")) | ||
| 1541 | (message "Ignoring letter case is not supported by this diff program")) | ||
| 1542 | (t | ||
| 1543 | (sit-for 1) | ||
| 1544 | (ediff-update-diffs))) | ||
| 1545 | ) | ||
| 1546 | |||
| 1547 | |||
| 1548 | (provide 'ediff-diff) | ||
| 1549 | |||
| 1474 | 1550 | ||
| 1475 | ;;; Local Variables: | 1551 | ;;; Local Variables: |
| 1476 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | 1552 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
diff --git a/lisp/ediff-help.el b/lisp/ediff-help.el index cc266e3c8a3..d5f505c7de3 100644 --- a/lisp/ediff-help.el +++ b/lisp/ediff-help.el | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | ;;; Code: | 27 | ;;; Code: |
| 28 | 28 | ||
| 29 | (provide 'ediff-help) | ||
| 30 | 29 | ||
| 31 | ;; Compiler pacifier start | 30 | ;; Compiler pacifier start |
| 32 | (defvar ediff-multiframe) | 31 | (defvar ediff-multiframe) |
| @@ -61,8 +60,8 @@ For help on a specific command: Click Button 2 over it; or | |||
| 61 | p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y | 60 | p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y |
| 62 | n,SPC -next diff | h -hilighting | rx -restore buf X's old diff | 61 | n,SPC -next diff | h -hilighting | rx -restore buf X's old diff |
| 63 | j -jump to diff | @ -auto-refinement | * -refine current region | 62 | j -jump to diff | @ -auto-refinement | * -refine current region |
| 64 | gx -goto X's point| | ! -update diff regions | 63 | gx -goto X's point| ## -ignore whitespace | ! -update diff regions |
| 65 | C-l -recenter | ## -ignore whitespace | | 64 | C-l -recenter | #c -ignore case | |
| 66 | v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 65 | v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
| 67 | </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 66 | </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
| 68 | ~ -rotate buffers| m -wide display | | 67 | ~ -rotate buffers| m -wide display | |
| @@ -75,8 +74,8 @@ Normally, not a user option. See `ediff-help-message' for details.") | |||
| 75 | p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A | 74 | p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A |
| 76 | n,SPC -next diff | h -hilighting | rx -restore buf X's old diff | 75 | n,SPC -next diff | h -hilighting | rx -restore buf X's old diff |
| 77 | j -jump to diff | @ -auto-refinement | * -refine current region | 76 | j -jump to diff | @ -auto-refinement | * -refine current region |
| 78 | gx -goto X's point| | ! -update diff regions | 77 | gx -goto X's point| ## -ignore whitespace | ! -update diff regions |
| 79 | C-l -recenter | ## -ignore whitespace | | 78 | C-l -recenter | #c -ignore case | |
| 80 | v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 79 | v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
| 81 | </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 80 | </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
| 82 | ~ -swap variants | m -wide display | | 81 | ~ -swap variants | m -wide display | |
| @@ -89,8 +88,8 @@ Normally, not a user option. See `ediff-help-message' for details.") | |||
| 89 | p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A | 88 | p,DEL -previous diff | | -vert/horiz split |a/b -copy A/B's region to B/A |
| 90 | n,SPC -next diff | h -hilighting | rx -restore buf X's old diff | 89 | n,SPC -next diff | h -hilighting | rx -restore buf X's old diff |
| 91 | j -jump to diff | @ -auto-refinement | * -refine current region | 90 | j -jump to diff | @ -auto-refinement | * -refine current region |
| 92 | gx -goto X's point| % -narrow/widen buffs | ! -update diff regions | 91 | gx -goto X's point| ## -ignore whitespace | ! -update diff regions |
| 93 | C-l -recenter | ## -ignore whitespace | | 92 | C-l -recenter | #c -ignore case | % -narrow/widen buffs |
| 94 | v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 93 | v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
| 95 | </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 94 | </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
| 96 | ~ -swap variants | m -wide display | | 95 | ~ -swap variants | m -wide display | |
| @@ -103,8 +102,8 @@ Normally, not a user option. See `ediff-help-message' for details.") | |||
| 103 | p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y | 102 | p,DEL -previous diff | | -vert/horiz split | xy -copy buf X's region to Y |
| 104 | n,SPC -next diff | h -hilighting | rx -restore buf X's old diff | 103 | n,SPC -next diff | h -hilighting | rx -restore buf X's old diff |
| 105 | j -jump to diff | | | 104 | j -jump to diff | | |
| 106 | gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs | 105 | gx -goto X's point| % -narrow/widen buffs | ! -recompute diffs |
| 107 | C-l -recenter | | | 106 | C-l -recenter | #c -ignore case | |
| 108 | v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X | 107 | v/V -scroll up/dn | #f/#h -focus/hide regions | wx -save buf X |
| 109 | </> -scroll lt/rt | X -read-only in buf X | wd -save diff output | 108 | </> -scroll lt/rt | X -read-only in buf X | wd -save diff output |
| 110 | ~ -swap variants | m -wide display | | 109 | ~ -swap variants | m -wide display | |
| @@ -228,6 +227,7 @@ the value of this variable and the variables `ediff-help-message-*' in | |||
| 228 | ((string= cmd "r") (re-search-forward "^`r'")) | 227 | ((string= cmd "r") (re-search-forward "^`r'")) |
| 229 | ((string= cmd "rx") (re-search-forward "^`ra'")) | 228 | ((string= cmd "rx") (re-search-forward "^`ra'")) |
| 230 | ((string= cmd "##") (re-search-forward "^`##'")) | 229 | ((string= cmd "##") (re-search-forward "^`##'")) |
| 230 | ((string= cmd "#c") (re-search-forward "^`#c'")) | ||
| 231 | ((string= cmd "#f/#h") (re-search-forward "^`#f'")) | 231 | ((string= cmd "#f/#h") (re-search-forward "^`#f'")) |
| 232 | ((string= cmd "X") (re-search-forward "^`A'")) | 232 | ((string= cmd "X") (re-search-forward "^`A'")) |
| 233 | ((string= cmd "v/V") (re-search-forward "^`v'")) | 233 | ((string= cmd "v/V") (re-search-forward "^`v'")) |
| @@ -325,5 +325,8 @@ the value of this variable and the variables `ediff-help-message-*' in | |||
| 325 | (customize-group "ediff")) | 325 | (customize-group "ediff")) |
| 326 | 326 | ||
| 327 | 327 | ||
| 328 | (provide 'ediff-help) | ||
| 329 | |||
| 330 | |||
| 328 | ;;; arch-tag: 05659813-7fcf-4274-964f-d2f577431a9d | 331 | ;;; arch-tag: 05659813-7fcf-4274-964f-d2f577431a9d |
| 329 | ;;; ediff-help.el ends here | 332 | ;;; ediff-help.el ends here |
diff --git a/lisp/ediff-hook.el b/lisp/ediff-hook.el index 1b86e2f8f62..fcf261efd06 100644 --- a/lisp/ediff-hook.el +++ b/lisp/ediff-hook.el | |||
| @@ -371,5 +371,6 @@ | |||
| 371 | 371 | ||
| 372 | (provide 'ediff-hook) | 372 | (provide 'ediff-hook) |
| 373 | 373 | ||
| 374 | |||
| 374 | ;;; arch-tag: 512f8656-8a4b-4789-af5d-5c6144498df3 | 375 | ;;; arch-tag: 512f8656-8a4b-4789-af5d-5c6144498df3 |
| 375 | ;;; ediff-hook.el ends here | 376 | ;;; ediff-hook.el ends here |
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el index 4897ffd2e59..2fc0ceefe4d 100644 --- a/lisp/ediff-init.el +++ b/lisp/ediff-init.el | |||
| @@ -1867,6 +1867,7 @@ Unless optional argument INPLACE is non-nil, return a new string." | |||
| 1867 | (set-buffer ,old-buffer) | 1867 | (set-buffer ,old-buffer) |
| 1868 | (set-syntax-table ,old-table))))))) | 1868 | (set-syntax-table ,old-table))))))) |
| 1869 | 1869 | ||
| 1870 | |||
| 1870 | (provide 'ediff-init) | 1871 | (provide 'ediff-init) |
| 1871 | 1872 | ||
| 1872 | 1873 | ||
diff --git a/lisp/ediff-merg.el b/lisp/ediff-merg.el index 7f0eea2cf09..92f462c0181 100644 --- a/lisp/ediff-merg.el +++ b/lisp/ediff-merg.el | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | ;;; Code: | 27 | ;;; Code: |
| 28 | 28 | ||
| 29 | (provide 'ediff-merg) | ||
| 30 | 29 | ||
| 31 | ;; compiler pacifier | 30 | ;; compiler pacifier |
| 32 | (defvar ediff-window-A) | 31 | (defvar ediff-window-A) |
| @@ -390,6 +389,9 @@ Combining is done according to the specifications in variable | |||
| 390 | ))) | 389 | ))) |
| 391 | 390 | ||
| 392 | 391 | ||
| 392 | (provide 'ediff-merg) | ||
| 393 | |||
| 394 | |||
| 393 | ;;; Local Variables: | 395 | ;;; Local Variables: |
| 394 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | 396 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
| 395 | ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) | 397 | ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) |
diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el index c24e32a2124..0bbd3298c7a 100644 --- a/lisp/ediff-mult.el +++ b/lisp/ediff-mult.el | |||
| @@ -104,7 +104,6 @@ | |||
| 104 | 104 | ||
| 105 | ;;; Code: | 105 | ;;; Code: |
| 106 | 106 | ||
| 107 | (provide 'ediff-mult) | ||
| 108 | 107 | ||
| 109 | (defgroup ediff-mult nil | 108 | (defgroup ediff-mult nil |
| 110 | "Multi-file and multi-buffer processing in Ediff." | 109 | "Multi-file and multi-buffer processing in Ediff." |
| @@ -123,7 +122,6 @@ | |||
| 123 | ;; end pacifier | 122 | ;; end pacifier |
| 124 | 123 | ||
| 125 | (require 'ediff-init) | 124 | (require 'ediff-init) |
| 126 | (require 'ediff-util) | ||
| 127 | 125 | ||
| 128 | ;; meta-buffer | 126 | ;; meta-buffer |
| 129 | (ediff-defvar-local ediff-meta-buffer nil "") | 127 | (ediff-defvar-local ediff-meta-buffer nil "") |
| @@ -1473,6 +1471,7 @@ Useful commands: | |||
| 1473 | (ediff-overlay-put overl 'highlight t)) | 1471 | (ediff-overlay-put overl 'highlight t)) |
| 1474 | (ediff-overlay-put overl 'ediff-meta-info prop) | 1472 | (ediff-overlay-put overl 'ediff-meta-info prop) |
| 1475 | (ediff-overlay-put overl 'invisible hidden) | 1473 | (ediff-overlay-put overl 'invisible hidden) |
| 1474 | (ediff-overlay-put overl 'follow-link t) | ||
| 1476 | (if (numberp session-number) | 1475 | (if (numberp session-number) |
| 1477 | (ediff-overlay-put overl 'ediff-meta-session-number session-number)))) | 1476 | (ediff-overlay-put overl 'ediff-meta-session-number session-number)))) |
| 1478 | 1477 | ||
| @@ -2384,6 +2383,8 @@ for operation, or simply indicate which are equal files. If it is nil, then | |||
| 2384 | )) | 2383 | )) |
| 2385 | 2384 | ||
| 2386 | 2385 | ||
| 2386 | (provide 'ediff-mult) | ||
| 2387 | |||
| 2387 | 2388 | ||
| 2388 | ;;; Local Variables: | 2389 | ;;; Local Variables: |
| 2389 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | 2390 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
diff --git a/lisp/ediff-ptch.el b/lisp/ediff-ptch.el index 9c5c75d847c..b911c33f0fb 100644 --- a/lisp/ediff-ptch.el +++ b/lisp/ediff-ptch.el | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | ;;; Code: | 27 | ;;; Code: |
| 28 | 28 | ||
| 29 | (provide 'ediff-ptch) | ||
| 30 | 29 | ||
| 31 | (defgroup ediff-ptch nil | 30 | (defgroup ediff-ptch nil |
| 32 | "Ediff patch support." | 31 | "Ediff patch support." |
| @@ -844,6 +843,8 @@ you can still examine the changes via M-x ediff-files" | |||
| 844 | 843 | ||
| 845 | 844 | ||
| 846 | 845 | ||
| 846 | (provide 'ediff-ptch) | ||
| 847 | |||
| 847 | 848 | ||
| 848 | ;;; Local Variables: | 849 | ;;; Local Variables: |
| 849 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | 850 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el index feb7b69d7b6..dff3c6bee61 100644 --- a/lisp/ediff-util.el +++ b/lisp/ediff-util.el | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | ;;; Code: | 27 | ;;; Code: |
| 28 | 28 | ||
| 29 | (provide 'ediff-util) | ||
| 30 | 29 | ||
| 31 | ;; Compiler pacifier | 30 | ;; Compiler pacifier |
| 32 | (defvar ediff-patch-diagnostics) | 31 | (defvar ediff-patch-diagnostics) |
| @@ -49,6 +48,7 @@ | |||
| 49 | 48 | ||
| 50 | (eval-when-compile | 49 | (eval-when-compile |
| 51 | (let ((load-path (cons (expand-file-name ".") load-path))) | 50 | (let ((load-path (cons (expand-file-name ".") load-path))) |
| 51 | (provide 'ediff-util) ; to break recursive load cycle | ||
| 52 | (or (featurep 'ediff-init) | 52 | (or (featurep 'ediff-init) |
| 53 | (load "ediff-init.el" nil nil 'nosuffix)) | 53 | (load "ediff-init.el" nil nil 'nosuffix)) |
| 54 | (or (featurep 'ediff-help) | 54 | (or (featurep 'ediff-help) |
| @@ -234,6 +234,7 @@ to invocation.") | |||
| 234 | (define-key ediff-mode-map "#" nil) | 234 | (define-key ediff-mode-map "#" nil) |
| 235 | (define-key ediff-mode-map "#h" 'ediff-toggle-regexp-match) | 235 | (define-key ediff-mode-map "#h" 'ediff-toggle-regexp-match) |
| 236 | (define-key ediff-mode-map "#f" 'ediff-toggle-regexp-match) | 236 | (define-key ediff-mode-map "#f" 'ediff-toggle-regexp-match) |
| 237 | (define-key ediff-mode-map "#c" 'ediff-toggle-ignore-case) | ||
| 237 | (or ediff-word-mode | 238 | (or ediff-word-mode |
| 238 | (define-key ediff-mode-map "##" 'ediff-toggle-skip-similar)) | 239 | (define-key ediff-mode-map "##" 'ediff-toggle-skip-similar)) |
| 239 | (define-key ediff-mode-map "o" nil) | 240 | (define-key ediff-mode-map "o" nil) |
| @@ -1133,7 +1134,7 @@ of the current buffer." | |||
| 1133 | ;; )) | 1134 | ;; )) |
| 1134 | 1135 | ||
| 1135 | 1136 | ||
| 1136 | (defsubst ediff-file-checked-out-p (file) | 1137 | (defun ediff-file-checked-out-p (file) |
| 1137 | (or (not (featurep 'vc-hooks)) | 1138 | (or (not (featurep 'vc-hooks)) |
| 1138 | (and (vc-backend file) | 1139 | (and (vc-backend file) |
| 1139 | (if (fboundp 'vc-state) | 1140 | (if (fboundp 'vc-state) |
| @@ -1143,7 +1144,7 @@ of the current buffer." | |||
| 1143 | (vc-locking-user file)) | 1144 | (vc-locking-user file)) |
| 1144 | ))) | 1145 | ))) |
| 1145 | 1146 | ||
| 1146 | (defsubst ediff-file-checked-in-p (file) | 1147 | (defun ediff-file-checked-in-p (file) |
| 1147 | (and (featurep 'vc-hooks) | 1148 | (and (featurep 'vc-hooks) |
| 1148 | ;; CVS files are considered not checked in | 1149 | ;; CVS files are considered not checked in |
| 1149 | (not (memq (vc-backend file) '(nil CVS))) | 1150 | (not (memq (vc-backend file) '(nil CVS))) |
| @@ -3079,7 +3080,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." | |||
| 3079 | ))) | 3080 | ))) |
| 3080 | 3081 | ||
| 3081 | 3082 | ||
| 3082 | (defsubst ediff-highlight-diff (n) | 3083 | (defun ediff-highlight-diff (n) |
| 3083 | "Put face on diff N. Invoked for X displays only." | 3084 | "Put face on diff N. Invoked for X displays only." |
| 3084 | (ediff-highlight-diff-in-one-buffer n 'A) | 3085 | (ediff-highlight-diff-in-one-buffer n 'A) |
| 3085 | (ediff-highlight-diff-in-one-buffer n 'B) | 3086 | (ediff-highlight-diff-in-one-buffer n 'B) |
| @@ -3088,7 +3089,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." | |||
| 3088 | ) | 3089 | ) |
| 3089 | 3090 | ||
| 3090 | 3091 | ||
| 3091 | (defsubst ediff-unhighlight-diff () | 3092 | (defun ediff-unhighlight-diff () |
| 3092 | "Remove overlays from buffers A, B, and C." | 3093 | "Remove overlays from buffers A, B, and C." |
| 3093 | (ediff-unhighlight-diff-in-one-buffer 'A) | 3094 | (ediff-unhighlight-diff-in-one-buffer 'A) |
| 3094 | (ediff-unhighlight-diff-in-one-buffer 'B) | 3095 | (ediff-unhighlight-diff-in-one-buffer 'B) |
| @@ -3097,7 +3098,7 @@ Hit \\[ediff-recenter] to reset the windows afterward." | |||
| 3097 | ) | 3098 | ) |
| 3098 | 3099 | ||
| 3099 | ;; delete highlighting overlays, restore faces to their original form | 3100 | ;; delete highlighting overlays, restore faces to their original form |
| 3100 | (defsubst ediff-unhighlight-diffs-totally () | 3101 | (defun ediff-unhighlight-diffs-totally () |
| 3101 | (ediff-unhighlight-diffs-totally-in-one-buffer 'A) | 3102 | (ediff-unhighlight-diffs-totally-in-one-buffer 'A) |
| 3102 | (ediff-unhighlight-diffs-totally-in-one-buffer 'B) | 3103 | (ediff-unhighlight-diffs-totally-in-one-buffer 'B) |
| 3103 | (ediff-unhighlight-diffs-totally-in-one-buffer 'C) | 3104 | (ediff-unhighlight-diffs-totally-in-one-buffer 'C) |
| @@ -3686,7 +3687,7 @@ Ediff Control Panel to restore highlighting." | |||
| 3686 | (>= (point) end)))))) | 3687 | (>= (point) end)))))) |
| 3687 | 3688 | ||
| 3688 | 3689 | ||
| 3689 | (defsubst ediff-get-region-contents (n buf-type ctrl-buf &optional start end) | 3690 | (defun ediff-get-region-contents (n buf-type ctrl-buf &optional start end) |
| 3690 | (ediff-with-current-buffer | 3691 | (ediff-with-current-buffer |
| 3691 | (ediff-with-current-buffer ctrl-buf (ediff-get-buffer buf-type)) | 3692 | (ediff-with-current-buffer ctrl-buf (ediff-get-buffer buf-type)) |
| 3692 | (buffer-substring | 3693 | (buffer-substring |
| @@ -3945,6 +3946,7 @@ Ediff Control Panel to restore highlighting." | |||
| 3945 | (ediff-device-type (ediff-device-type)) | 3946 | (ediff-device-type (ediff-device-type)) |
| 3946 | varlist salutation buffer-name) | 3947 | varlist salutation buffer-name) |
| 3947 | (setq varlist '(ediff-diff-program ediff-diff-options | 3948 | (setq varlist '(ediff-diff-program ediff-diff-options |
| 3949 | ediff-diff3-program ediff-diff3-options | ||
| 3948 | ediff-patch-program ediff-patch-options | 3950 | ediff-patch-program ediff-patch-options |
| 3949 | ediff-shell | 3951 | ediff-shell |
| 3950 | ediff-use-faces | 3952 | ediff-use-faces |
| @@ -4300,6 +4302,8 @@ Mail anyway? (y or n) ") | |||
| 4300 | 4302 | ||
| 4301 | (run-hooks 'ediff-load-hook) | 4303 | (run-hooks 'ediff-load-hook) |
| 4302 | 4304 | ||
| 4305 | (provide 'ediff-util) | ||
| 4306 | |||
| 4303 | 4307 | ||
| 4304 | ;;; Local Variables: | 4308 | ;;; Local Variables: |
| 4305 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | 4309 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
diff --git a/lisp/ediff-vers.el b/lisp/ediff-vers.el index 4c9dc4dd9c8..3e8b1c37572 100644 --- a/lisp/ediff-vers.el +++ b/lisp/ediff-vers.el | |||
| @@ -311,6 +311,7 @@ | |||
| 311 | 311 | ||
| 312 | (provide 'ediff-vers) | 312 | (provide 'ediff-vers) |
| 313 | 313 | ||
| 314 | |||
| 314 | ;;; Local Variables: | 315 | ;;; Local Variables: |
| 315 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | 316 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
| 316 | ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) | 317 | ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) |
diff --git a/lisp/ediff-wind.el b/lisp/ediff-wind.el index 648a80b6156..28369f9f6bd 100644 --- a/lisp/ediff-wind.el +++ b/lisp/ediff-wind.el | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | 26 | ||
| 27 | ;;; Code: | 27 | ;;; Code: |
| 28 | 28 | ||
| 29 | (provide 'ediff-wind) | ||
| 30 | 29 | ||
| 31 | ;; Compiler pacifier | 30 | ;; Compiler pacifier |
| 32 | (defvar icon-title-format) | 31 | (defvar icon-title-format) |
| @@ -1314,6 +1313,9 @@ It assumes that it is called from within the control buffer." | |||
| 1314 | ediff-wide-display-p))))))) | 1313 | ediff-wide-display-p))))))) |
| 1315 | 1314 | ||
| 1316 | 1315 | ||
| 1316 | (provide 'ediff-wind) | ||
| 1317 | |||
| 1318 | |||
| 1317 | ;;; Local Variables: | 1319 | ;;; Local Variables: |
| 1318 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | 1320 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
| 1319 | ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) | 1321 | ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) |
diff --git a/lisp/ediff.el b/lisp/ediff.el index abb0f22b047..bb6cfc6b72e 100644 --- a/lisp/ediff.el +++ b/lisp/ediff.el | |||
| @@ -7,8 +7,8 @@ | |||
| 7 | ;; Created: February 2, 1994 | 7 | ;; Created: February 2, 1994 |
| 8 | ;; Keywords: comparing, merging, patching, tools, unix | 8 | ;; Keywords: comparing, merging, patching, tools, unix |
| 9 | 9 | ||
| 10 | (defconst ediff-version "2.80.1" "The current version of Ediff") | 10 | (defconst ediff-version "2.81" "The current version of Ediff") |
| 11 | (defconst ediff-date "November 25, 2005" "Date of last update") | 11 | (defconst ediff-date "February 18, 2006" "Date of last update") |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | ;; This file is part of GNU Emacs. | 14 | ;; This file is part of GNU Emacs. |
| @@ -107,7 +107,6 @@ | |||
| 107 | 107 | ||
| 108 | ;;; Code: | 108 | ;;; Code: |
| 109 | 109 | ||
| 110 | (provide 'ediff) | ||
| 111 | 110 | ||
| 112 | ;; Compiler pacifier | 111 | ;; Compiler pacifier |
| 113 | (defvar cvs-cookie-handle) | 112 | (defvar cvs-cookie-handle) |
| @@ -121,6 +120,7 @@ | |||
| 121 | (load "pcl-cvs" 'noerror))) | 120 | (load "pcl-cvs" 'noerror))) |
| 122 | (eval-when-compile | 121 | (eval-when-compile |
| 123 | (let ((load-path (cons (expand-file-name ".") load-path))) | 122 | (let ((load-path (cons (expand-file-name ".") load-path))) |
| 123 | (provide 'ediff) ; to break recursive load cycle | ||
| 124 | (or (featurep 'ediff-init) | 124 | (or (featurep 'ediff-init) |
| 125 | (load "ediff-init.el" nil nil 'nosuffix)) | 125 | (load "ediff-init.el" nil nil 'nosuffix)) |
| 126 | (or (featurep 'ediff-mult) | 126 | (or (featurep 'ediff-mult) |
| @@ -1374,7 +1374,7 @@ patch. If not given, the user is prompted according to the prefix argument." | |||
| 1374 | patch-buf | 1374 | patch-buf |
| 1375 | (read-buffer | 1375 | (read-buffer |
| 1376 | "Which buffer to patch? " | 1376 | "Which buffer to patch? " |
| 1377 | (current-buffer)))) | 1377 | (ediff-other-buffer patch-buf)))) |
| 1378 | 1378 | ||
| 1379 | 1379 | ||
| 1380 | ;;;###autoload | 1380 | ;;;###autoload |
| @@ -1533,6 +1533,9 @@ With optional NODE, goes to that node." | |||
| 1533 | 1533 | ||
| 1534 | (run-hooks 'ediff-load-hook) | 1534 | (run-hooks 'ediff-load-hook) |
| 1535 | 1535 | ||
| 1536 | (provide 'ediff) | ||
| 1537 | |||
| 1538 | |||
| 1536 | ;;; Local Variables: | 1539 | ;;; Local Variables: |
| 1537 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) | 1540 | ;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) |
| 1538 | ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) | 1541 | ;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) |
diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index 41e98694c71..aeaf653aef6 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el | |||
| @@ -148,10 +148,10 @@ of symbols with local bindings." | |||
| 148 | ((eq fun 'lambda) | 148 | ((eq fun 'lambda) |
| 149 | ;;First arg is temporary bindings | 149 | ;;First arg is temporary bindings |
| 150 | (mapc #'(lambda (x) | 150 | (mapc #'(lambda (x) |
| 151 | (let ((y (unsafep-variable x t))) | ||
| 152 | (if y (throw 'unsafep y))) | ||
| 153 | (or (memq x '(&optional &rest)) | 151 | (or (memq x '(&optional &rest)) |
| 154 | (push x unsafep-vars))) | 152 | (let ((y (unsafep-variable x t))) |
| 153 | (if y (throw 'unsafep y)) | ||
| 154 | (push x unsafep-vars)))) | ||
| 155 | (cadr form)) | 155 | (cadr form)) |
| 156 | (unsafep-progn (cddr form))) | 156 | (unsafep-progn (cddr form))) |
| 157 | ((eq fun 'let) | 157 | ((eq fun 'let) |
| @@ -247,17 +247,16 @@ and throws a reason to `unsafep' if unsafe. Returns SYM." | |||
| 247 | (if reason (throw 'unsafep reason)) | 247 | (if reason (throw 'unsafep reason)) |
| 248 | sym)) | 248 | sym)) |
| 249 | 249 | ||
| 250 | (defun unsafep-variable (sym global-okay) | 250 | (defun unsafep-variable (sym to-bind) |
| 251 | "Return nil if SYM is safe as a let-binding sym | 251 | "Return nil if SYM is safe to set or bind, or a reason why not. |
| 252 | \(because it already has a temporary binding or is a non-risky buffer-local | 252 | If TO-BIND is nil, check whether SYM is safe to set. |
| 253 | variable), otherwise a reason why it is unsafe. Failing to be locally bound | 253 | If TO-BIND is t, check whether SYM is safe to bind." |
| 254 | is okay if GLOBAL-OKAY is non-nil." | ||
| 255 | (cond | 254 | (cond |
| 256 | ((not (symbolp sym)) | 255 | ((not (symbolp sym)) |
| 257 | `(variable ,sym)) | 256 | `(variable ,sym)) |
| 258 | ((risky-local-variable-p sym nil) | 257 | ((risky-local-variable-p sym nil) |
| 259 | `(risky-local-variable ,sym)) | 258 | `(risky-local-variable ,sym)) |
| 260 | ((not (or global-okay | 259 | ((not (or to-bind |
| 261 | (memq sym unsafep-vars) | 260 | (memq sym unsafep-vars) |
| 262 | (local-variable-p sym))) | 261 | (local-variable-p sym))) |
| 263 | `(global-variable ,sym)))) | 262 | `(global-variable ,sym)))) |
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index db82952a6ef..645f4f26eaf 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -196,6 +196,15 @@ | |||
| 196 | (viper-save-cursor-color 'before-insert-mode)) | 196 | (viper-save-cursor-color 'before-insert-mode)) |
| 197 | ;; set insert mode cursor color | 197 | ;; set insert mode cursor color |
| 198 | (viper-change-cursor-color viper-insert-state-cursor-color))) | 198 | (viper-change-cursor-color viper-insert-state-cursor-color))) |
| 199 | (if (eq viper-current-state 'emacs-state) | ||
| 200 | (let ((has-saved-cursor-color-in-emacs-mode | ||
| 201 | (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) | ||
| 202 | (or has-saved-cursor-color-in-emacs-mode | ||
| 203 | (string= (viper-get-cursor-color) viper-emacs-state-cursor-color) | ||
| 204 | ;; save current color, if not already saved | ||
| 205 | (viper-save-cursor-color 'before-emacs-mode)) | ||
| 206 | ;; set emacs mode cursor color | ||
| 207 | (viper-change-cursor-color viper-emacs-state-cursor-color))) | ||
| 199 | 208 | ||
| 200 | (if (and (memq this-command '(dabbrev-expand hippie-expand)) | 209 | (if (and (memq this-command '(dabbrev-expand hippie-expand)) |
| 201 | (integerp viper-pre-command-point) | 210 | (integerp viper-pre-command-point) |
| @@ -643,9 +652,12 @@ | |||
| 643 | (indent-to-left-margin)) | 652 | (indent-to-left-margin)) |
| 644 | (viper-add-newline-at-eob-if-necessary) | 653 | (viper-add-newline-at-eob-if-necessary) |
| 645 | (viper-adjust-undo) | 654 | (viper-adjust-undo) |
| 646 | (viper-change-state 'vi-state) | ||
| 647 | 655 | ||
| 648 | (viper-restore-cursor-color 'after-insert-mode) | 656 | (if (eq viper-current-state 'emacs-state) |
| 657 | (viper-restore-cursor-color 'after-emacs-mode) | ||
| 658 | (viper-restore-cursor-color 'after-insert-mode)) | ||
| 659 | |||
| 660 | (viper-change-state 'vi-state) | ||
| 649 | 661 | ||
| 650 | ;; Protect against user errors in hooks | 662 | ;; Protect against user errors in hooks |
| 651 | (condition-case conds | 663 | (condition-case conds |
| @@ -709,9 +721,17 @@ | |||
| 709 | (or (viper-overlay-p viper-replace-overlay) | 721 | (or (viper-overlay-p viper-replace-overlay) |
| 710 | (viper-set-replace-overlay (point-min) (point-min))) | 722 | (viper-set-replace-overlay (point-min) (point-min))) |
| 711 | (viper-hide-replace-overlay) | 723 | (viper-hide-replace-overlay) |
| 724 | |||
| 725 | (let ((has-saved-cursor-color-in-emacs-mode | ||
| 726 | (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) | ||
| 727 | (or has-saved-cursor-color-in-emacs-mode | ||
| 728 | (string= (viper-get-cursor-color) viper-emacs-state-cursor-color) | ||
| 729 | (viper-save-cursor-color 'before-emacs-mode)) | ||
| 730 | (viper-change-cursor-color viper-emacs-state-cursor-color)) | ||
| 731 | |||
| 712 | (viper-change-state 'emacs-state) | 732 | (viper-change-state 'emacs-state) |
| 713 | 733 | ||
| 714 | ;; Protect agains user errors in hooks | 734 | ;; Protect against user errors in hooks |
| 715 | (condition-case conds | 735 | (condition-case conds |
| 716 | (run-hooks 'viper-emacs-state-hook) | 736 | (run-hooks 'viper-emacs-state-hook) |
| 717 | (error | 737 | (error |
| @@ -820,12 +840,12 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to | |||
| 820 | ;; The next cmd and viper-set-unread-command-events | 840 | ;; The next cmd and viper-set-unread-command-events |
| 821 | ;; are intended to prevent the input method | 841 | ;; are intended to prevent the input method |
| 822 | ;; from swallowing ^M, ^Q and other special characters | 842 | ;; from swallowing ^M, ^Q and other special characters |
| 823 | (setq ch (read-char)) | 843 | (setq ch (read-char-exclusive)) |
| 824 | ;; replace ^M with the newline | 844 | ;; replace ^M with the newline |
| 825 | (if (eq ch ?\C-m) (setq ch ?\n)) | 845 | (if (eq ch ?\C-m) (setq ch ?\n)) |
| 826 | ;; Make sure ^V and ^Q work as quotation chars | 846 | ;; Make sure ^V and ^Q work as quotation chars |
| 827 | (if (memq ch '(?\C-v ?\C-q)) | 847 | (if (memq ch '(?\C-v ?\C-q)) |
| 828 | (setq ch (read-char))) | 848 | (setq ch (read-char-exclusive))) |
| 829 | (viper-set-unread-command-events ch) | 849 | (viper-set-unread-command-events ch) |
| 830 | (quail-input-method nil) | 850 | (quail-input-method nil) |
| 831 | 851 | ||
| @@ -842,12 +862,12 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to | |||
| 842 | ;; same as above but for XEmacs, which doesn't have | 862 | ;; same as above but for XEmacs, which doesn't have |
| 843 | ;; quail-input-method | 863 | ;; quail-input-method |
| 844 | (let (unread-command-events) | 864 | (let (unread-command-events) |
| 845 | (setq ch (read-char)) | 865 | (setq ch (read-char-exclusive)) |
| 846 | ;; replace ^M with the newline | 866 | ;; replace ^M with the newline |
| 847 | (if (eq ch ?\C-m) (setq ch ?\n)) | 867 | (if (eq ch ?\C-m) (setq ch ?\n)) |
| 848 | ;; Make sure ^V and ^Q work as quotation chars | 868 | ;; Make sure ^V and ^Q work as quotation chars |
| 849 | (if (memq ch '(?\C-v ?\C-q)) | 869 | (if (memq ch '(?\C-v ?\C-q)) |
| 850 | (setq ch (read-char))) | 870 | (setq ch (read-char-exclusive))) |
| 851 | (viper-set-unread-command-events ch) | 871 | (viper-set-unread-command-events ch) |
| 852 | (quail-start-translation nil) | 872 | (quail-start-translation nil) |
| 853 | 873 | ||
| @@ -867,12 +887,12 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to | |||
| 867 | (setq ch (aref (read-key-sequence nil) 0))) | 887 | (setq ch (aref (read-key-sequence nil) 0))) |
| 868 | (insert ch)) | 888 | (insert ch)) |
| 869 | (t | 889 | (t |
| 870 | (setq ch (read-char)) | 890 | (setq ch (read-char-exclusive)) |
| 871 | ;; replace ^M with the newline | 891 | ;; replace ^M with the newline |
| 872 | (if (eq ch ?\C-m) (setq ch ?\n)) | 892 | (if (eq ch ?\C-m) (setq ch ?\n)) |
| 873 | ;; Make sure ^V and ^Q work as quotation chars | 893 | ;; Make sure ^V and ^Q work as quotation chars |
| 874 | (if (memq ch '(?\C-v ?\C-q)) | 894 | (if (memq ch '(?\C-v ?\C-q)) |
| 875 | (setq ch (read-char))) | 895 | (setq ch (read-char-exclusive))) |
| 876 | (insert ch)) | 896 | (insert ch)) |
| 877 | ) | 897 | ) |
| 878 | (setq last-command-event | 898 | (setq last-command-event |
| @@ -2131,7 +2151,7 @@ To turn this feature off, set this variable to nil." | |||
| 2131 | Remove this function from `viper-minibuffer-exit-hook', if this causes | 2151 | Remove this function from `viper-minibuffer-exit-hook', if this causes |
| 2132 | problems." | 2152 | problems." |
| 2133 | (if (viper-is-in-minibuffer) | 2153 | (if (viper-is-in-minibuffer) |
| 2134 | (progn | 2154 | (let ((inhibit-field-text-motion t)) |
| 2135 | (goto-char (viper-minibuffer-real-start)) | 2155 | (goto-char (viper-minibuffer-real-start)) |
| 2136 | (end-of-line) | 2156 | (end-of-line) |
| 2137 | (delete-region (point) (point-max))))) | 2157 | (delete-region (point) (point-max))))) |
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index 59a78e46dee..661fc6ede7f 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el | |||
| @@ -434,6 +434,13 @@ delete the text being replaced, as in standard Vi." | |||
| 434 | (if (fboundp 'make-variable-frame-local) | 434 | (if (fboundp 'make-variable-frame-local) |
| 435 | (make-variable-frame-local 'viper-insert-state-cursor-color)) | 435 | (make-variable-frame-local 'viper-insert-state-cursor-color)) |
| 436 | 436 | ||
| 437 | (defcustom viper-emacs-state-cursor-color "Magenta" | ||
| 438 | "Cursor color when Viper is in emacs state." | ||
| 439 | :type 'string | ||
| 440 | :group 'viper) | ||
| 441 | (if (fboundp 'make-variable-frame-local) | ||
| 442 | (make-variable-frame-local 'viper-emacs-state-cursor-color)) | ||
| 443 | |||
| 437 | ;; internal var, used to remember the default cursor color of emacs frames | 444 | ;; internal var, used to remember the default cursor color of emacs frames |
| 438 | (defvar viper-vi-state-cursor-color nil) | 445 | (defvar viper-vi-state-cursor-color nil) |
| 439 | (if (fboundp 'make-variable-frame-local) | 446 | (if (fboundp 'make-variable-frame-local) |
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 8f79c0dab4a..c7fe792b5f2 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el | |||
| @@ -175,9 +175,12 @@ | |||
| 175 | (selected-frame) | 175 | (selected-frame) |
| 176 | (list | 176 | (list |
| 177 | (cons | 177 | (cons |
| 178 | (if (eq before-which-mode 'before-replace-mode) | 178 | (cond ((eq before-which-mode 'before-replace-mode) |
| 179 | 'viper-saved-cursor-color-in-replace-mode | 179 | 'viper-saved-cursor-color-in-replace-mode) |
| 180 | 'viper-saved-cursor-color-in-insert-mode) | 180 | ((eq before-which-mode 'before-emacs-mode) |
| 181 | 'viper-saved-cursor-color-in-emacs-mode) | ||
| 182 | (t | ||
| 183 | 'viper-saved-cursor-color-in-insert-mode)) | ||
| 181 | color))) | 184 | color))) |
| 182 | )))) | 185 | )))) |
| 183 | 186 | ||
| @@ -188,7 +191,9 @@ | |||
| 188 | (if viper-emacs-p 'frame-parameter 'frame-property) | 191 | (if viper-emacs-p 'frame-parameter 'frame-property) |
| 189 | (selected-frame) | 192 | (selected-frame) |
| 190 | 'viper-saved-cursor-color-in-replace-mode) | 193 | 'viper-saved-cursor-color-in-replace-mode) |
| 191 | viper-vi-state-cursor-color)) | 194 | (if (eq viper-current-state 'emacs-mode) |
| 195 | viper-emacs-state-cursor-color | ||
| 196 | viper-vi-state-cursor-color))) | ||
| 192 | 197 | ||
| 193 | (defsubst viper-get-saved-cursor-color-in-insert-mode () | 198 | (defsubst viper-get-saved-cursor-color-in-insert-mode () |
| 194 | (or | 199 | (or |
| @@ -196,15 +201,27 @@ | |||
| 196 | (if viper-emacs-p 'frame-parameter 'frame-property) | 201 | (if viper-emacs-p 'frame-parameter 'frame-property) |
| 197 | (selected-frame) | 202 | (selected-frame) |
| 198 | 'viper-saved-cursor-color-in-insert-mode) | 203 | 'viper-saved-cursor-color-in-insert-mode) |
| 204 | (if (eq viper-current-state 'emacs-mode) | ||
| 205 | viper-emacs-state-cursor-color | ||
| 206 | viper-vi-state-cursor-color))) | ||
| 207 | |||
| 208 | (defsubst viper-get-saved-cursor-color-in-emacs-mode () | ||
| 209 | (or | ||
| 210 | (funcall | ||
| 211 | (if viper-emacs-p 'frame-parameter 'frame-property) | ||
| 212 | (selected-frame) | ||
| 213 | 'viper-saved-cursor-color-in-emacs-mode) | ||
| 199 | viper-vi-state-cursor-color)) | 214 | viper-vi-state-cursor-color)) |
| 200 | 215 | ||
| 201 | ;; restore cursor color from replace overlay | 216 | ;; restore cursor color from replace overlay |
| 202 | (defun viper-restore-cursor-color(after-which-mode) | 217 | (defun viper-restore-cursor-color(after-which-mode) |
| 203 | (if (viper-overlay-p viper-replace-overlay) | 218 | (if (viper-overlay-p viper-replace-overlay) |
| 204 | (viper-change-cursor-color | 219 | (viper-change-cursor-color |
| 205 | (if (eq after-which-mode 'after-replace-mode) | 220 | (cond ((eq after-which-mode 'after-replace-mode) |
| 206 | (viper-get-saved-cursor-color-in-replace-mode) | 221 | (viper-get-saved-cursor-color-in-replace-mode)) |
| 207 | (viper-get-saved-cursor-color-in-insert-mode)) | 222 | ((eq after-which-mode 'after-emacs-mode) |
| 223 | (viper-get-saved-cursor-color-in-emacs-mode)) | ||
| 224 | (t (viper-get-saved-cursor-color-in-insert-mode))) | ||
| 208 | ))) | 225 | ))) |
| 209 | 226 | ||
| 210 | 227 | ||
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 223cff3dd99..fc55d291550 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | ;; Author: Michael Kifer <kifer@cs.stonybrook.edu> | 9 | ;; Author: Michael Kifer <kifer@cs.stonybrook.edu> |
| 10 | ;; Keywords: emulations | 10 | ;; Keywords: emulations |
| 11 | 11 | ||
| 12 | (defconst viper-version "3.11.5 of November 25, 2005" | 12 | (defconst viper-version "3.12 of February 18, 2006" |
| 13 | "The current version of Viper") | 13 | "The current version of Viper") |
| 14 | 14 | ||
| 15 | ;; This file is part of GNU Emacs. | 15 | ;; This file is part of GNU Emacs. |
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index ec2098c7bd3..92f8c401336 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,5 +1,21 @@ | |||
| 1 | 2006-02-19 Michael Olson <mwolson@gnu.org> | ||
| 2 | |||
| 3 | * erc-capab.el (erc-capab-send-identify-messages): Make sure some | ||
| 4 | parameters are strings before using them. Thanks to Alejandro | ||
| 5 | Benitez for the report. | ||
| 6 | |||
| 7 | * erc.el (erc-version-string): Release ERC 5.1.2. | ||
| 8 | |||
| 9 | 2006-02-19 Diane Murray <disumu@x3y2z1.net> | ||
| 10 | |||
| 11 | * erc-button.el (erc-button-keymap): Bind `erc-button-previous' to | ||
| 12 | <C-tab>. | ||
| 13 | (erc-button-previous): New function. | ||
| 14 | |||
| 1 | 2006-02-15 Michael Olson <mwolson@gnu.org> | 15 | 2006-02-15 Michael Olson <mwolson@gnu.org> |
| 2 | 16 | ||
| 17 | * NEWS: Add category for ERC 5.2. | ||
| 18 | |||
| 3 | * erc.el (erc): Move to the end of the buffer when a continued | 19 | * erc.el (erc): Move to the end of the buffer when a continued |
| 4 | session is detected. Thanks to e1f and indio for the report and | 20 | session is detected. Thanks to e1f and indio for the report and |
| 5 | testing a potential fix. | 21 | testing a potential fix. |
| @@ -150,7 +166,7 @@ | |||
| 150 | * erc-stamp.el: Use new arch tagline, since the other one wasn't | 166 | * erc-stamp.el: Use new arch tagline, since the other one wasn't |
| 151 | being treated properly. | 167 | being treated properly. |
| 152 | 168 | ||
| 153 | * erc.el (erc-version-string): Release ERC 5.1.1 | 169 | * erc.el (erc-version-string): Release ERC 5.1.1. |
| 154 | 170 | ||
| 155 | 2006-02-03 Zhang Wei <id.brep@gmail.com> (tiny change) | 171 | 2006-02-03 Zhang Wei <id.brep@gmail.com> (tiny change) |
| 156 | 172 | ||
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 6c6998a3afc..2ec625cc87f 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el | |||
| @@ -216,6 +216,7 @@ PAR is a number of a regexp grouping whose text will be passed to | |||
| 216 | (define-key map (kbd "<button2>") 'erc-button-click-button) | 216 | (define-key map (kbd "<button2>") 'erc-button-click-button) |
| 217 | (define-key map (kbd "<mouse-2>") 'erc-button-click-button)) | 217 | (define-key map (kbd "<mouse-2>") 'erc-button-click-button)) |
| 218 | (define-key map (kbd "TAB") 'erc-button-next) | 218 | (define-key map (kbd "TAB") 'erc-button-next) |
| 219 | (define-key map (kbd "<C-tab>") 'erc-button-previous) | ||
| 219 | (set-keymap-parent map erc-mode-map) | 220 | (set-keymap-parent map erc-mode-map) |
| 220 | map) | 221 | map) |
| 221 | "Local keymap for ERC buttons.") | 222 | "Local keymap for ERC buttons.") |
| @@ -427,6 +428,22 @@ call it with the value of the `erc-data' text property." | |||
| 427 | (error "No next button")) | 428 | (error "No next button")) |
| 428 | t))) | 429 | t))) |
| 429 | 430 | ||
| 431 | (defun erc-button-previous () | ||
| 432 | "Go to the previous button in this buffer." | ||
| 433 | (interactive) | ||
| 434 | (let ((here (point))) | ||
| 435 | (when (< here (erc-beg-of-input-line)) | ||
| 436 | (while (and (get-text-property here 'erc-callback) | ||
| 437 | (not (= here (point-min)))) | ||
| 438 | (setq here (1- here))) | ||
| 439 | (while (and (not (get-text-property here 'erc-callback)) | ||
| 440 | (not (= here (point-min)))) | ||
| 441 | (setq here (1- here))) | ||
| 442 | (if (> here (point-min)) | ||
| 443 | (goto-char here) | ||
| 444 | (error "No previous button")) | ||
| 445 | t))) | ||
| 446 | |||
| 430 | (defun erc-browse-emacswiki (thing) | 447 | (defun erc-browse-emacswiki (thing) |
| 431 | "Browse to thing in the emacs-wiki." | 448 | "Browse to thing in the emacs-wiki." |
| 432 | (browse-url (concat erc-emacswiki-url thing))) | 449 | (browse-url (concat erc-emacswiki-url thing))) |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index e1dc240901b..63ff60d762e 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -66,7 +66,7 @@ | |||
| 66 | 66 | ||
| 67 | ;;; Code: | 67 | ;;; Code: |
| 68 | 68 | ||
| 69 | (defconst erc-version-string "Version 5.1.1" | 69 | (defconst erc-version-string "Version 5.1.2" |
| 70 | "ERC version. This is used by function `erc-version'.") | 70 | "ERC version. This is used by function `erc-version'.") |
| 71 | 71 | ||
| 72 | (eval-when-compile (require 'cl)) | 72 | (eval-when-compile (require 'cl)) |
diff --git a/lisp/ffap.el b/lisp/ffap.el index 1b6665d16d5..5ff63bfdec2 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el | |||
| @@ -1255,7 +1255,8 @@ which may actually result in an url rather than a filename." | |||
| 1255 | (abbreviate-file-name (expand-file-name guess)) | 1255 | (abbreviate-file-name (expand-file-name guess)) |
| 1256 | )) | 1256 | )) |
| 1257 | (setq dir (file-name-directory guess)))) | 1257 | (setq dir (file-name-directory guess)))) |
| 1258 | (let ((minibuffer-completing-file-name t)) | 1258 | (let ((minibuffer-completing-file-name t) |
| 1259 | (completion-ignore-case read-file-name-completion-ignore-case)) | ||
| 1259 | (setq guess | 1260 | (setq guess |
| 1260 | (completing-read | 1261 | (completing-read |
| 1261 | prompt | 1262 | prompt |
| @@ -1321,6 +1322,12 @@ which may actually result in an url rather than a filename." | |||
| 1321 | (defvar ffap-highlight t | 1322 | (defvar ffap-highlight t |
| 1322 | "If non-nil, ffap highlights the current buffer substring.") | 1323 | "If non-nil, ffap highlights the current buffer substring.") |
| 1323 | 1324 | ||
| 1325 | (defface ffap | ||
| 1326 | '((t :inherit highlight)) | ||
| 1327 | "Face used to highlight the current buffer substring." | ||
| 1328 | :group 'ffap | ||
| 1329 | :version "22.1") | ||
| 1330 | |||
| 1324 | (defvar ffap-highlight-overlay nil | 1331 | (defvar ffap-highlight-overlay nil |
| 1325 | "Overlay used by `ffap-highlight'.") | 1332 | "Overlay used by `ffap-highlight'.") |
| 1326 | 1333 | ||
| @@ -1344,8 +1351,7 @@ Uses the face `ffap' if it is defined, or else `highlight'." | |||
| 1344 | (t | 1351 | (t |
| 1345 | (setq ffap-highlight-overlay | 1352 | (setq ffap-highlight-overlay |
| 1346 | (apply 'make-overlay ffap-string-at-point-region)) | 1353 | (apply 'make-overlay ffap-string-at-point-region)) |
| 1347 | (overlay-put ffap-highlight-overlay 'face | 1354 | (overlay-put ffap-highlight-overlay 'face 'ffap)))) |
| 1348 | (if (facep 'ffap) 'ffap 'highlight))))) | ||
| 1349 | 1355 | ||
| 1350 | 1356 | ||
| 1351 | ;;; Main Entrance (`find-file-at-point' == `ffap'): | 1357 | ;;; Main Entrance (`find-file-at-point' == `ffap'): |
diff --git a/lisp/files.el b/lisp/files.el index 285cd50e6af..ab69c7958a9 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -447,10 +447,11 @@ use `before-save-hook'.") | |||
| 447 | The value can be t, nil or something else. | 447 | The value can be t, nil or something else. |
| 448 | 448 | ||
| 449 | A value of t means file local variables specifications are obeyed | 449 | A value of t means file local variables specifications are obeyed |
| 450 | if all the specified variables are safe. If any variables are | 450 | if all the specified variable values are safe; if any values are |
| 451 | not safe, you will be queries before setting them. | 451 | not safe, Emacs queries you, once, whether to set them all. |
| 452 | A value of nil means file local variables are ignored. | 452 | |
| 453 | Any other value means to always query. | 453 | A value of nil means always ignore the file local variables. |
| 454 | Any other value means always query you once whether to set them all. | ||
| 454 | 455 | ||
| 455 | This variable also controls use of major modes specified in | 456 | This variable also controls use of major modes specified in |
| 456 | a -*- line. | 457 | a -*- line. |
| @@ -2218,6 +2219,129 @@ Otherwise, return nil; point may be changed." | |||
| 2218 | (setq end (point)) | 2219 | (setq end (point)) |
| 2219 | (goto-char beg) | 2220 | (goto-char beg) |
| 2220 | end)))) | 2221 | end)))) |
| 2222 | |||
| 2223 | ;;; Handling file local variables | ||
| 2224 | |||
| 2225 | (defvar ignored-local-variables | ||
| 2226 | '(ignored-local-variables safe-local-variable-values) | ||
| 2227 | "Variables to be ignored in a file's local variable spec.") | ||
| 2228 | |||
| 2229 | (defvar hack-local-variables-hook nil | ||
| 2230 | "Normal hook run after processing a file's local variables specs. | ||
| 2231 | Major modes can use this to examine user-specified local variables | ||
| 2232 | in order to initialize other data structure based on them.") | ||
| 2233 | |||
| 2234 | (defcustom safe-local-variable-values nil | ||
| 2235 | "List variable-value pairs that are considered safe. | ||
| 2236 | Each element is a cons cell (VAR . VAL), where VAR is a variable | ||
| 2237 | symbol and VAL is a value that is considered safe." | ||
| 2238 | :group 'find-file | ||
| 2239 | :type 'alist) | ||
| 2240 | |||
| 2241 | (defcustom safe-local-eval-forms nil | ||
| 2242 | "*Expressions that are considered safe in an `eval:' local variable. | ||
| 2243 | Add expressions to this list if you want Emacs to evaluate them, when | ||
| 2244 | they appear in an `eval' local variable specification, without first | ||
| 2245 | asking you for confirmation." | ||
| 2246 | :group 'find-file | ||
| 2247 | :version "22.1" | ||
| 2248 | :type '(repeat sexp)) | ||
| 2249 | |||
| 2250 | ;; Risky local variables: | ||
| 2251 | (mapc (lambda (var) (put var 'risky-local-variable t)) | ||
| 2252 | '(after-load-alist | ||
| 2253 | auto-mode-alist | ||
| 2254 | buffer-auto-save-file-name | ||
| 2255 | buffer-file-name | ||
| 2256 | buffer-file-truename | ||
| 2257 | buffer-undo-list | ||
| 2258 | dabbrev-case-fold-search | ||
| 2259 | dabbrev-case-replace | ||
| 2260 | debugger | ||
| 2261 | default-text-properties | ||
| 2262 | display-time-string | ||
| 2263 | enable-local-eval | ||
| 2264 | eval | ||
| 2265 | exec-directory | ||
| 2266 | exec-path | ||
| 2267 | file-name-handler-alist | ||
| 2268 | font-lock-defaults | ||
| 2269 | format-alist | ||
| 2270 | frame-title-format | ||
| 2271 | global-mode-string | ||
| 2272 | header-line-format | ||
| 2273 | icon-title-format | ||
| 2274 | ignored-local-variables | ||
| 2275 | imenu--index-alist | ||
| 2276 | imenu-generic-expression | ||
| 2277 | inhibit-quit | ||
| 2278 | input-method-alist | ||
| 2279 | load-path | ||
| 2280 | max-lisp-eval-depth | ||
| 2281 | max-specpdl-size | ||
| 2282 | minor-mode-alist | ||
| 2283 | minor-mode-map-alist | ||
| 2284 | minor-mode-overriding-map-alist | ||
| 2285 | mode-line-buffer-identification | ||
| 2286 | mode-line-format | ||
| 2287 | mode-line-modes | ||
| 2288 | mode-line-modified | ||
| 2289 | mode-line-mule-info | ||
| 2290 | mode-line-position | ||
| 2291 | mode-line-process | ||
| 2292 | mode-name | ||
| 2293 | outline-level | ||
| 2294 | overriding-local-map | ||
| 2295 | overriding-terminal-local-map | ||
| 2296 | parse-time-rules | ||
| 2297 | process-environment | ||
| 2298 | rmail-output-file-alist | ||
| 2299 | save-some-buffers-action-alist | ||
| 2300 | special-display-buffer-names | ||
| 2301 | standard-input | ||
| 2302 | standard-output | ||
| 2303 | unread-command-events | ||
| 2304 | vc-mode)) | ||
| 2305 | |||
| 2306 | ;; Safe local variables: | ||
| 2307 | ;; | ||
| 2308 | ;; For variables defined by minor modes, put the safety declarations | ||
| 2309 | ;; here, not in the file defining the minor mode (when Emacs visits a | ||
| 2310 | ;; file specifying that local variable, the minor mode file may not be | ||
| 2311 | ;; loaded yet). For variables defined by major modes, the safety | ||
| 2312 | ;; declarations can go into the major mode's file, since that will be | ||
| 2313 | ;; loaded before file variables are processed. | ||
| 2314 | |||
| 2315 | (let ((string-or-null (lambda (a) (or (stringp a) (null a))))) | ||
| 2316 | (eval | ||
| 2317 | `(mapc (lambda (pair) | ||
| 2318 | (put (car pair) 'safe-local-variable (cdr pair))) | ||
| 2319 | '((byte-compile-dynamic . t) | ||
| 2320 | (c-basic-offset . integerp) | ||
| 2321 | (c-file-style . stringp) | ||
| 2322 | (c-indent-level . integerp) | ||
| 2323 | (comment-column . integerp) | ||
| 2324 | (compile-command . ,string-or-null) | ||
| 2325 | (fill-column . integerp) | ||
| 2326 | (fill-prefix . ,string-or-null) | ||
| 2327 | (indent-tabs-mode . t) | ||
| 2328 | (ispell-check-comments . (lambda (a) | ||
| 2329 | (memq a '(nil t exclusive)))) | ||
| 2330 | (ispell-local-dictionary . ,string-or-null) | ||
| 2331 | (kept-new-versions . integerp) | ||
| 2332 | (no-byte-compile . t) | ||
| 2333 | (no-update-autoloads . t) | ||
| 2334 | (outline-regexp . ,string-or-null) | ||
| 2335 | (page-delimiter . ,string-or-null) | ||
| 2336 | (paragraph-start . ,string-or-null) | ||
| 2337 | (paragraph-separate . ,string-or-null) | ||
| 2338 | (sentence-end . ,string-or-null) | ||
| 2339 | (sentence-end-double-space . t) | ||
| 2340 | (tab-width . integerp) | ||
| 2341 | (truncate-lines . t) | ||
| 2342 | (version-control . t))))) | ||
| 2343 | |||
| 2344 | (put 'c-set-style 'safe-local-eval-function t) | ||
| 2221 | 2345 | ||
| 2222 | (defun hack-local-variables-confirm (vars unsafe-vars risky-vars) | 2346 | (defun hack-local-variables-confirm (vars unsafe-vars risky-vars) |
| 2223 | (if noninteractive | 2347 | (if noninteractive |
| @@ -2346,18 +2470,6 @@ and VAL is the specified value." | |||
| 2346 | mode-specified | 2470 | mode-specified |
| 2347 | result)))) | 2471 | result)))) |
| 2348 | 2472 | ||
| 2349 | (defvar hack-local-variables-hook nil | ||
| 2350 | "Normal hook run after processing a file's local variables specs. | ||
| 2351 | Major modes can use this to examine user-specified local variables | ||
| 2352 | in order to initialize other data structure based on them.") | ||
| 2353 | |||
| 2354 | (defcustom safe-local-variable-values nil | ||
| 2355 | "List variable-value pairs that are considered safe. | ||
| 2356 | Each element is a cons cell (VAR . VAL), where VAR is a variable | ||
| 2357 | symbol and VAL is a value that is considered safe." | ||
| 2358 | :group 'find-file | ||
| 2359 | :type 'alist) | ||
| 2360 | |||
| 2361 | (defun hack-local-variables (&optional mode-only) | 2473 | (defun hack-local-variables (&optional mode-only) |
| 2362 | "Parse and put into effect this buffer's local variables spec. | 2474 | "Parse and put into effect this buffer's local variables spec. |
| 2363 | If MODE-ONLY is non-nil, all we do is check whether the major mode | 2475 | If MODE-ONLY is non-nil, all we do is check whether the major mode |
| @@ -2479,92 +2591,6 @@ is specified, returning t if it is specified." | |||
| 2479 | (hack-one-local-variable (car elt) (cdr elt))))) | 2591 | (hack-one-local-variable (car elt) (cdr elt))))) |
| 2480 | (run-hooks 'hack-local-variables-hook)))))) | 2592 | (run-hooks 'hack-local-variables-hook)))))) |
| 2481 | 2593 | ||
| 2482 | (defvar ignored-local-variables | ||
| 2483 | '(ignored-local-variables safe-local-variable-values) | ||
| 2484 | "Variables to be ignored in a file's local variable spec.") | ||
| 2485 | |||
| 2486 | ;; Get confirmation before setting these variables as locals in a file. | ||
| 2487 | (put 'debugger 'risky-local-variable t) | ||
| 2488 | (put 'enable-local-eval 'risky-local-variable t) | ||
| 2489 | (put 'ignored-local-variables 'risky-local-variable t) | ||
| 2490 | (put 'ignored-local-variables 'safe-local-variable-values t) | ||
| 2491 | (put 'eval 'risky-local-variable t) | ||
| 2492 | (put 'file-name-handler-alist 'risky-local-variable t) | ||
| 2493 | (put 'inhibit-quit 'risky-local-variable t) | ||
| 2494 | (put 'minor-mode-alist 'risky-local-variable t) | ||
| 2495 | (put 'minor-mode-map-alist 'risky-local-variable t) | ||
| 2496 | (put 'minor-mode-overriding-map-alist 'risky-local-variable t) | ||
| 2497 | (put 'overriding-local-map 'risky-local-variable t) | ||
| 2498 | (put 'overriding-terminal-local-map 'risky-local-variable t) | ||
| 2499 | (put 'auto-mode-alist 'risky-local-variable t) | ||
| 2500 | (put 'after-load-alist 'risky-local-variable t) | ||
| 2501 | (put 'buffer-file-name 'risky-local-variable t) | ||
| 2502 | (put 'buffer-undo-list 'risky-local-variable t) | ||
| 2503 | (put 'buffer-auto-save-file-name 'risky-local-variable t) | ||
| 2504 | (put 'buffer-file-truename 'risky-local-variable t) | ||
| 2505 | (put 'default-text-properties 'risky-local-variable t) | ||
| 2506 | (put 'exec-path 'risky-local-variable t) | ||
| 2507 | (put 'load-path 'risky-local-variable t) | ||
| 2508 | (put 'exec-directory 'risky-local-variable t) | ||
| 2509 | (put 'process-environment 'risky-local-variable t) | ||
| 2510 | (put 'dabbrev-case-fold-search 'risky-local-variable t) | ||
| 2511 | (put 'dabbrev-case-replace 'risky-local-variable t) | ||
| 2512 | ;; Don't wait for outline.el to be loaded, for the sake of outline-minor-mode. | ||
| 2513 | (put 'outline-level 'risky-local-variable t) | ||
| 2514 | (put 'rmail-output-file-alist 'risky-local-variable t) | ||
| 2515 | (put 'font-lock-defaults 'risky-local-variable t) | ||
| 2516 | (put 'special-display-buffer-names 'risky-local-variable t) | ||
| 2517 | (put 'frame-title-format 'risky-local-variable t) | ||
| 2518 | (put 'global-mode-string 'risky-local-variable t) | ||
| 2519 | (put 'header-line-format 'risky-local-variable t) | ||
| 2520 | (put 'icon-title-format 'risky-local-variable t) | ||
| 2521 | (put 'input-method-alist 'risky-local-variable t) | ||
| 2522 | (put 'format-alist 'risky-local-variable t) | ||
| 2523 | (put 'vc-mode 'risky-local-variable t) | ||
| 2524 | (put 'imenu-generic-expression 'risky-local-variable t) | ||
| 2525 | (put 'imenu--index-alist 'risky-local-variable t) | ||
| 2526 | (put 'standard-input 'risky-local-variable t) | ||
| 2527 | (put 'standard-output 'risky-local-variable t) | ||
| 2528 | (put 'unread-command-events 'risky-local-variable t) | ||
| 2529 | (put 'max-lisp-eval-depth 'risky-local-variable t) | ||
| 2530 | (put 'max-specpdl-size 'risky-local-variable t) | ||
| 2531 | (put 'mode-line-format 'risky-local-variable t) | ||
| 2532 | (put 'mode-line-modified 'risky-local-variable t) | ||
| 2533 | (put 'mode-line-mule-info 'risky-local-variable t) | ||
| 2534 | (put 'mode-line-buffer-identification 'risky-local-variable t) | ||
| 2535 | (put 'mode-line-modes 'risky-local-variable t) | ||
| 2536 | (put 'mode-line-position 'risky-local-variable t) | ||
| 2537 | (put 'mode-line-process 'risky-local-variable t) | ||
| 2538 | (put 'mode-name 'risky-local-variable t) | ||
| 2539 | (put 'display-time-string 'risky-local-variable t) | ||
| 2540 | (put 'parse-time-rules 'risky-local-variable t) | ||
| 2541 | |||
| 2542 | ;; Commonly-encountered local variables that are safe: | ||
| 2543 | (let ((string-or-null (lambda (a) (or (stringp a) (null a))))) | ||
| 2544 | (eval | ||
| 2545 | `(mapc (lambda (pair) | ||
| 2546 | (put (car pair) 'safe-local-variable (cdr pair))) | ||
| 2547 | '((byte-compile-dynamic . t) | ||
| 2548 | (c-basic-offset . integerp) | ||
| 2549 | (c-file-style . stringp) | ||
| 2550 | (c-indent-level . integerp) | ||
| 2551 | (comment-column . integerp) | ||
| 2552 | (compile-command . ,string-or-null) | ||
| 2553 | (fill-column . integerp) | ||
| 2554 | (fill-prefix . ,string-or-null) | ||
| 2555 | (indent-tabs-mode . t) | ||
| 2556 | (kept-new-versions . integerp) | ||
| 2557 | (no-byte-compile . t) | ||
| 2558 | (no-update-autoloads . t) | ||
| 2559 | (outline-regexp . ,string-or-null) | ||
| 2560 | (page-delimiter . ,string-or-null) | ||
| 2561 | (paragraph-start . ,string-or-null) | ||
| 2562 | (paragraph-separate . ,string-or-null) | ||
| 2563 | (sentence-end . ,string-or-null) | ||
| 2564 | (sentence-end-double-space . t) | ||
| 2565 | (tab-width . integerp) | ||
| 2566 | (version-control . t))))) | ||
| 2567 | |||
| 2568 | (defun safe-local-variable-p (sym val) | 2594 | (defun safe-local-variable-p (sym val) |
| 2569 | "Non-nil if SYM is safe as a file-local variable with value VAL. | 2595 | "Non-nil if SYM is safe as a file-local variable with value VAL. |
| 2570 | It is safe if any of these conditions are met: | 2596 | It is safe if any of these conditions are met: |
| @@ -2602,17 +2628,6 @@ It is dangerous if either of these conditions are met: | |||
| 2602 | -[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|\ | 2628 | -[0-9]+$\\|font-lock-syntactic-keywords$\\|-frame-alist$\\|-mode-alist$\\|\ |
| 2603 | -map$\\|-map-alist$" (symbol-name sym)))) | 2629 | -map$\\|-map-alist$" (symbol-name sym)))) |
| 2604 | 2630 | ||
| 2605 | (defcustom safe-local-eval-forms nil | ||
| 2606 | "*Expressions that are considered \"safe\" in an `eval:' local variable. | ||
| 2607 | Add expressions to this list if you want Emacs to evaluate them, when | ||
| 2608 | they appear in an `eval' local variable specification, without first | ||
| 2609 | asking you for confirmation." | ||
| 2610 | :group 'find-file | ||
| 2611 | :version "22.1" | ||
| 2612 | :type '(repeat sexp)) | ||
| 2613 | |||
| 2614 | (put 'c-set-style 'safe-local-eval-function t) | ||
| 2615 | |||
| 2616 | (defun hack-one-local-variable-quotep (exp) | 2631 | (defun hack-one-local-variable-quotep (exp) |
| 2617 | (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp)))) | 2632 | (and (consp exp) (eq (car exp) 'quote) (consp (cdr exp)))) |
| 2618 | 2633 | ||
| @@ -3630,7 +3645,6 @@ This requires the external program `diff' to be in your `exec-path'." | |||
| 3630 | (?d diff-buffer-with-file | 3645 | (?d diff-buffer-with-file |
| 3631 | "view changes in file")) | 3646 | "view changes in file")) |
| 3632 | "ACTION-ALIST argument used in call to `map-y-or-n-p'.") | 3647 | "ACTION-ALIST argument used in call to `map-y-or-n-p'.") |
| 3633 | (put 'save-some-buffers-action-alist 'risky-local-variable t) | ||
| 3634 | 3648 | ||
| 3635 | (defvar buffer-save-without-query nil | 3649 | (defvar buffer-save-without-query nil |
| 3636 | "Non-nil means `save-some-buffers' should save this buffer without asking.") | 3650 | "Non-nil means `save-some-buffers' should save this buffer without asking.") |
diff --git a/lisp/fringe.el b/lisp/fringe.el index fd9e70b5846..317fff0973c 100644 --- a/lisp/fringe.el +++ b/lisp/fringe.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; fringe.el --- change fringes appearance in various ways | 1 | ;;; fringe.el --- fringe setup and control |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -25,8 +25,9 @@ | |||
| 25 | 25 | ||
| 26 | ;;; Commentary: | 26 | ;;; Commentary: |
| 27 | 27 | ||
| 28 | ;; This file contains helpful functions for customizing the appearance | 28 | ;; This file contains code to initialize the built-in fringe bitmaps |
| 29 | ;; of the fringe. | 29 | ;; as well as helpful functions for customizing the appearance of the |
| 30 | ;; fringe. | ||
| 30 | 31 | ||
| 31 | ;; The code is influenced by scroll-bar.el and avoid.el. The author | 32 | ;; The code is influenced by scroll-bar.el and avoid.el. The author |
| 32 | ;; gratefully acknowledge comments and suggestions made by Miles | 33 | ;; gratefully acknowledge comments and suggestions made by Miles |
| @@ -40,32 +41,52 @@ | |||
| 40 | :version "22.1" | 41 | :version "22.1" |
| 41 | :group 'frames) | 42 | :group 'frames) |
| 42 | 43 | ||
| 43 | ;; Standard fringe bitmaps | 44 | ;; Define the built-in fringe bitmaps and setup default mappings |
| 44 | 45 | ||
| 45 | (defmacro fringe-bitmap-p (symbol) | 46 | (when (boundp 'fringe-bitmaps) |
| 46 | "Return non-nil if SYMBOL is a fringe bitmap." | 47 | (let ((bitmaps '(question-mark |
| 47 | `(get ,symbol 'fringe)) | 48 | left-arrow right-arrow up-arrow down-arrow |
| 48 | 49 | left-curly-arrow right-curly-arrow | |
| 49 | (defvar fringe-bitmaps) | 50 | left-triangle right-triangle |
| 50 | |||
| 51 | (unless (or (not (boundp 'fringe-bitmaps)) | ||
| 52 | (get 'left-truncation 'fringe)) | ||
| 53 | (let ((bitmaps '(left-truncation right-truncation | ||
| 54 | up-arrow down-arrow | ||
| 55 | continued-line continuation-line | ||
| 56 | overlay-arrow | ||
| 57 | top-left-angle top-right-angle | 51 | top-left-angle top-right-angle |
| 58 | bottom-left-angle bottom-right-angle | 52 | bottom-left-angle bottom-right-angle |
| 59 | left-bracket right-bracket | 53 | left-bracket right-bracket |
| 60 | filled-box-cursor hollow-box-cursor hollow-square | 54 | filled-rectangle hollow-rectangle |
| 61 | bar-cursor hbar-cursor | 55 | filled-square hollow-square |
| 56 | vertical-bar horizontal-bar | ||
| 62 | empty-line)) | 57 | empty-line)) |
| 63 | (bn 2)) | 58 | (bn 1)) |
| 64 | (while bitmaps | 59 | (while bitmaps |
| 65 | (push (car bitmaps) fringe-bitmaps) | 60 | (push (car bitmaps) fringe-bitmaps) |
| 66 | (put (car bitmaps) 'fringe bn) | 61 | (put (car bitmaps) 'fringe bn) |
| 67 | (setq bitmaps (cdr bitmaps) | 62 | (setq bitmaps (cdr bitmaps) |
| 68 | bn (1+ bn))))) | 63 | bn (1+ bn)))) |
| 64 | |||
| 65 | (setq-default fringe-indicator-alist | ||
| 66 | '((truncation . (left-arrow right-arrow)) | ||
| 67 | (continuation . (left-curly-arrow right-curly-arrow)) | ||
| 68 | (overlay-arrow . right-triangle) | ||
| 69 | (up . up-arrow) | ||
| 70 | (down . down-arrow) | ||
| 71 | (top . (top-left-angle top-right-angle)) | ||
| 72 | (bottom . (bottom-left-angle bottom-right-angle | ||
| 73 | top-right-angle top-left-angle)) | ||
| 74 | (top-bottom . (left-bracket right-bracket | ||
| 75 | top-right-angle top-left-angle)) | ||
| 76 | (empty-line . empty-line) | ||
| 77 | (unknown . question-mark))) | ||
| 78 | |||
| 79 | (setq-default fringe-cursor-alist | ||
| 80 | '((box . filled-rectangle) | ||
| 81 | (hollow . hollow-rectangle) | ||
| 82 | (bar . vertical-bar) | ||
| 83 | (hbar . horizontal-bar) | ||
| 84 | (hollow-small . hollow-square)))) | ||
| 85 | |||
| 86 | |||
| 87 | (defmacro fringe-bitmap-p (symbol) | ||
| 88 | "Return non-nil if SYMBOL is a fringe bitmap." | ||
| 89 | `(get ,symbol 'fringe)) | ||
| 69 | 90 | ||
| 70 | 91 | ||
| 71 | ;; Control presence of fringes | 92 | ;; Control presence of fringes |
| @@ -137,7 +158,6 @@ See `fringe-mode' for possible values and their effect." | |||
| 137 | ;; Otherwise impose the user-specified value of fringe-mode. | 158 | ;; Otherwise impose the user-specified value of fringe-mode. |
| 138 | (custom-initialize-reset symbol value)))) | 159 | (custom-initialize-reset symbol value)))) |
| 139 | 160 | ||
| 140 | ;;;###autoload | ||
| 141 | (defcustom fringe-mode nil | 161 | (defcustom fringe-mode nil |
| 142 | "*Specify appearance of fringes on all frames. | 162 | "*Specify appearance of fringes on all frames. |
| 143 | This variable can be nil (the default) meaning the fringes should have | 163 | This variable can be nil (the default) meaning the fringes should have |
| @@ -195,7 +215,6 @@ frame parameter is used." | |||
| 195 | nil | 215 | nil |
| 196 | 0))))) | 216 | 0))))) |
| 197 | 217 | ||
| 198 | ;;;###autoload | ||
| 199 | (defun fringe-mode (&optional mode) | 218 | (defun fringe-mode (&optional mode) |
| 200 | "Set the default appearance of fringes on all frames. | 219 | "Set the default appearance of fringes on all frames. |
| 201 | 220 | ||
| @@ -221,7 +240,6 @@ frame only, see the command `set-fringe-style'." | |||
| 221 | (interactive (list (fringe-query-style 'all-frames))) | 240 | (interactive (list (fringe-query-style 'all-frames))) |
| 222 | (set-fringe-mode mode)) | 241 | (set-fringe-mode mode)) |
| 223 | 242 | ||
| 224 | ;;;###autoload | ||
| 225 | (defun set-fringe-style (&optional mode) | 243 | (defun set-fringe-style (&optional mode) |
| 226 | "Set the default appearance of fringes on the selected frame. | 244 | "Set the default appearance of fringes on the selected frame. |
| 227 | 245 | ||
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 903be005174..c77c92d05c7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2006-02-20 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * rfc2047.el (rfc2047-charset-to-coding-system): Don't check the | ||
| 4 | coding system which mm-charset-to-coding-system returns for a | ||
| 5 | given charset is valid. | ||
| 6 | |||
| 1 | 2006-02-16 Juanma Barranquero <lekktu@gmail.com> | 7 | 2006-02-16 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 8 | ||
| 3 | * html2text.el (html2text-remove-tag-list): | 9 | * html2text.el (html2text-remove-tag-list): |
diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el index 1167cb0a62b..501a161e83e 100644 --- a/lisp/gnus/rfc2047.el +++ b/lisp/gnus/rfc2047.el | |||
| @@ -835,7 +835,7 @@ If your Emacs implementation can't decode CHARSET, return nil." | |||
| 835 | (cond ((eq cs 'ascii) | 835 | (cond ((eq cs 'ascii) |
| 836 | (setq cs (or (mm-charset-to-coding-system mail-parse-charset) | 836 | (setq cs (or (mm-charset-to-coding-system mail-parse-charset) |
| 837 | 'raw-text))) | 837 | 'raw-text))) |
| 838 | ((setq cs (mm-coding-system-p cs))) | 838 | ((mm-coding-system-p cs)) |
| 839 | ((and charset | 839 | ((and charset |
| 840 | (listp mail-parse-ignored-charsets) | 840 | (listp mail-parse-ignored-charsets) |
| 841 | (memq 'gnus-unknown mail-parse-ignored-charsets)) | 841 | (memq 'gnus-unknown mail-parse-ignored-charsets)) |
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 32719275edd..d30fc02c409 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -252,6 +252,7 @@ face (according to `face-differs-from-default-p')." | |||
| 252 | "\\)" | 252 | "\\)" |
| 253 | "\\(?:es\\|s\\|th\\)?" ; for ARGth, ARGs | 253 | "\\(?:es\\|s\\|th\\)?" ; for ARGth, ARGs |
| 254 | "\\(?:-[a-z0-9-]+\\)?" ; for ARG-xxx, ARG-n | 254 | "\\(?:-[a-z0-9-]+\\)?" ; for ARG-xxx, ARG-n |
| 255 | "\\(?:-[{([<`\"].*?\\)?"; for ARG-{x}, (x), <x>, [x], `x' | ||
| 255 | "\\>") ; end of word | 256 | "\\>") ; end of word |
| 256 | (help-default-arg-highlight arg) | 257 | (help-default-arg-highlight arg) |
| 257 | doc t t 1))))) | 258 | doc t t 1))))) |
diff --git a/lisp/help.el b/lisp/help.el index 02045948ecb..f74293b8dd6 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -579,12 +579,8 @@ temporarily enables it to allow getting help on disabled items and buttons." | |||
| 579 | (setq key (read-key-sequence "Describe key (or click or menu item): ")) | 579 | (setq key (read-key-sequence "Describe key (or click or menu item): ")) |
| 580 | (list | 580 | (list |
| 581 | key | 581 | key |
| 582 | (prefix-numeric-value current-prefix-arg) | 582 | (if current-prefix-arg (prefix-numeric-value current-prefix-arg)) |
| 583 | ;; If KEY is a down-event, read the corresponding up-event | 583 | 1)) |
| 584 | ;; and use it as the third argument. | ||
| 585 | (if (and (consp key) (symbolp (car key)) | ||
| 586 | (memq 'down (cdr (get (car key) 'event-symbol-elements)))) | ||
| 587 | (read-event)))) | ||
| 588 | ;; Put yank-menu back as it was, if we changed it. | 584 | ;; Put yank-menu back as it was, if we changed it. |
| 589 | (when saved-yank-menu | 585 | (when saved-yank-menu |
| 590 | (setq yank-menu (copy-sequence saved-yank-menu)) | 586 | (setq yank-menu (copy-sequence saved-yank-menu)) |
diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 191f1d324e6..f53ef7c91d1 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el | |||
| @@ -146,7 +146,7 @@ is minibuffer." | |||
| 146 | (if (commandp func-name) | 146 | (if (commandp func-name) |
| 147 | (save-excursion | 147 | (save-excursion |
| 148 | (let* ((sym (intern func-name)) | 148 | (let* ((sym (intern func-name)) |
| 149 | (buf (other-buffer)) | 149 | (buf (other-buffer nil t)) |
| 150 | (map (save-excursion (set-buffer buf) (current-local-map))) | 150 | (map (save-excursion (set-buffer buf) (current-local-map))) |
| 151 | (keys (where-is-internal sym map))) | 151 | (keys (where-is-internal sym map))) |
| 152 | (if keys | 152 | (if keys |
diff --git a/lisp/info.el b/lisp/info.el index e3514fb9729..e9d7f5ca2de 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -622,12 +622,6 @@ just return nil (no error)." | |||
| 622 | (cond | 622 | (cond |
| 623 | ((string= (downcase filename) "dir") | 623 | ((string= (downcase filename) "dir") |
| 624 | (setq found t)) | 624 | (setq found t)) |
| 625 | ((string= filename "apropos") | ||
| 626 | (setq found 'apropos)) | ||
| 627 | ((string= filename "history") | ||
| 628 | (setq found 'history)) | ||
| 629 | ((string= filename "toc") | ||
| 630 | (setq found 'toc)) | ||
| 631 | (t | 625 | (t |
| 632 | (let ((dirs (if (string-match "^\\./" filename) | 626 | (let ((dirs (if (string-match "^\\./" filename) |
| 633 | ;; If specified name starts with `./' | 627 | ;; If specified name starts with `./' |
| @@ -673,7 +667,8 @@ just return nil (no error)." | |||
| 673 | (if noerror | 667 | (if noerror |
| 674 | (setq filename nil) | 668 | (setq filename nil) |
| 675 | (error "Info file %s does not exist" filename))) | 669 | (error "Info file %s does not exist" filename))) |
| 676 | filename))) | 670 | filename) |
| 671 | (and (member filename '(apropos history toc)) filename))) | ||
| 677 | 672 | ||
| 678 | (defun Info-find-node (filename nodename &optional no-going-back) | 673 | (defun Info-find-node (filename nodename &optional no-going-back) |
| 679 | "Go to an Info node specified as separate FILENAME and NODENAME. | 674 | "Go to an Info node specified as separate FILENAME and NODENAME. |
| @@ -891,9 +886,6 @@ a case-insensitive match is tried." | |||
| 891 | (setq Info-current-file | 886 | (setq Info-current-file |
| 892 | (cond | 887 | (cond |
| 893 | ((eq filename t) "dir") | 888 | ((eq filename t) "dir") |
| 894 | ((eq filename 'apropos) "apropos") | ||
| 895 | ((eq filename 'history) "history") | ||
| 896 | ((eq filename 'toc) "toc") | ||
| 897 | (t filename))) | 889 | (t filename))) |
| 898 | )) | 890 | )) |
| 899 | ;; Use string-equal, not equal, to ignore text props. | 891 | ;; Use string-equal, not equal, to ignore text props. |
| @@ -1409,7 +1401,7 @@ any double quotes or backslashes must be escaped (\\\",\\\\)." | |||
| 1409 | (if (stringp Info-current-file) | 1401 | (if (stringp Info-current-file) |
| 1410 | (replace-regexp-in-string | 1402 | (replace-regexp-in-string |
| 1411 | "%" "%%" (file-name-nondirectory Info-current-file)) | 1403 | "%" "%%" (file-name-nondirectory Info-current-file)) |
| 1412 | "") | 1404 | (format "*%S*" Info-current-file)) |
| 1413 | ") " | 1405 | ") " |
| 1414 | (if Info-current-node | 1406 | (if Info-current-node |
| 1415 | (propertize (replace-regexp-in-string | 1407 | (propertize (replace-regexp-in-string |
| @@ -1648,7 +1640,8 @@ If DIRECTION is `backward', search in the reverse direction." | |||
| 1648 | ;; Skip Tag Table node | 1640 | ;; Skip Tag Table node |
| 1649 | (save-excursion | 1641 | (save-excursion |
| 1650 | (and (search-backward "\^_" nil t) | 1642 | (and (search-backward "\^_" nil t) |
| 1651 | (looking-at "\^_\nTag Table")))))) | 1643 | (looking-at |
| 1644 | "\^_\n\\(Tag Table\\|Local Variables\\)")))))) | ||
| 1652 | (let ((search-spaces-regexp Info-search-whitespace-regexp)) | 1645 | (let ((search-spaces-regexp Info-search-whitespace-regexp)) |
| 1653 | (if (if backward | 1646 | (if (if backward |
| 1654 | (re-search-backward regexp bound t) | 1647 | (re-search-backward regexp bound t) |
| @@ -1736,7 +1729,8 @@ If DIRECTION is `backward', search in the reverse direction." | |||
| 1736 | ;; Skip Tag Table node | 1729 | ;; Skip Tag Table node |
| 1737 | (save-excursion | 1730 | (save-excursion |
| 1738 | (and (search-backward "\^_" nil t) | 1731 | (and (search-backward "\^_" nil t) |
| 1739 | (looking-at "\^_\nTag Table")))))) | 1732 | (looking-at |
| 1733 | "\^_\n\\(Tag Table\\|Local Variables\\)")))))) | ||
| 1740 | (let ((search-spaces-regexp Info-search-whitespace-regexp)) | 1734 | (let ((search-spaces-regexp Info-search-whitespace-regexp)) |
| 1741 | (if (if backward | 1735 | (if (if backward |
| 1742 | (re-search-backward regexp nil t) | 1736 | (re-search-backward regexp nil t) |
| @@ -1831,11 +1825,11 @@ If DIRECTION is `backward', search in the reverse direction." | |||
| 1831 | 1825 | ||
| 1832 | (defun Info-isearch-push-state () | 1826 | (defun Info-isearch-push-state () |
| 1833 | `(lambda (cmd) | 1827 | `(lambda (cmd) |
| 1834 | (Info-isearch-pop-state cmd ,Info-current-file ,Info-current-node))) | 1828 | (Info-isearch-pop-state cmd ',Info-current-file ',Info-current-node))) |
| 1835 | 1829 | ||
| 1836 | (defun Info-isearch-pop-state (cmd file node) | 1830 | (defun Info-isearch-pop-state (cmd file node) |
| 1837 | (or (and (string= Info-current-file file) | 1831 | (or (and (equal Info-current-file file) |
| 1838 | (string= Info-current-node node)) | 1832 | (equal Info-current-node node)) |
| 1839 | (progn (Info-find-node file node) (sit-for 0)))) | 1833 | (progn (Info-find-node file node) (sit-for 0)))) |
| 1840 | 1834 | ||
| 1841 | (defun Info-isearch-start () | 1835 | (defun Info-isearch-start () |
| @@ -1853,7 +1847,7 @@ if ERRORNAME is nil, just return nil." | |||
| 1853 | (forward-line 1) | 1847 | (forward-line 1) |
| 1854 | (cond ((re-search-backward | 1848 | (cond ((re-search-backward |
| 1855 | (concat name ":" (Info-following-node-name-re)) bound t) | 1849 | (concat name ":" (Info-following-node-name-re)) bound t) |
| 1856 | (match-string 1)) | 1850 | (match-string-no-properties 1)) |
| 1857 | ((not (eq errorname t)) | 1851 | ((not (eq errorname t)) |
| 1858 | (error "Node has no %s" | 1852 | (error "Node has no %s" |
| 1859 | (capitalize (or errorname name))))))))) | 1853 | (capitalize (or errorname name))))))))) |
| @@ -1875,7 +1869,7 @@ End of submatch 0, 1, and 3 are the same, so you can safely concat." | |||
| 1875 | ;;; For compatibility; other files have used this name. | 1869 | ;;; For compatibility; other files have used this name. |
| 1876 | (defun Info-following-node-name () | 1870 | (defun Info-following-node-name () |
| 1877 | (and (looking-at (Info-following-node-name-re)) | 1871 | (and (looking-at (Info-following-node-name-re)) |
| 1878 | (match-string 1))) | 1872 | (match-string-no-properties 1))) |
| 1879 | 1873 | ||
| 1880 | (defun Info-next () | 1874 | (defun Info-next () |
| 1881 | "Go to the next node of this node." | 1875 | "Go to the next node of this node." |
| @@ -1909,7 +1903,8 @@ If SAME-FILE is non-nil, do not move to a different Info file." | |||
| 1909 | (Info-goto-node node) | 1903 | (Info-goto-node node) |
| 1910 | (setq p (point)) | 1904 | (setq p (point)) |
| 1911 | (goto-char (point-min)) | 1905 | (goto-char (point-min)) |
| 1912 | (if (and (search-forward "\n* Menu:" nil t) | 1906 | (if (and (stringp old-file) |
| 1907 | (search-forward "\n* Menu:" nil t) | ||
| 1913 | (re-search-forward | 1908 | (re-search-forward |
| 1914 | (if (string-equal old-node "Top") | 1909 | (if (string-equal old-node "Top") |
| 1915 | (concat "\n\\*[^:]+: +(" (file-name-nondirectory old-file) ")") | 1910 | (concat "\n\\*[^:]+: +(" (file-name-nondirectory old-file) ")") |
| @@ -1977,51 +1972,53 @@ If SAME-FILE is non-nil, do not move to a different Info file." | |||
| 1977 | (while hl | 1972 | (while hl |
| 1978 | (let ((file (nth 0 (car hl))) | 1973 | (let ((file (nth 0 (car hl))) |
| 1979 | (node (nth 1 (car hl)))) | 1974 | (node (nth 1 (car hl)))) |
| 1980 | (if (and (string-equal file curr-file) | 1975 | (if (and (equal file curr-file) |
| 1981 | (string-equal node curr-node)) | 1976 | (equal node curr-node)) |
| 1982 | (setq p (point))) | 1977 | (setq p (point))) |
| 1983 | (insert "* " node ": (" | 1978 | (if (stringp file) |
| 1984 | (propertize (or (file-name-directory file) "") 'invisible t) | 1979 | (insert "* " node ": (" |
| 1985 | (file-name-nondirectory file) | 1980 | (propertize (or (file-name-directory file) "") 'invisible t) |
| 1986 | ")" node ".\n")) | 1981 | (file-name-nondirectory file) |
| 1982 | ")" node ".\n"))) | ||
| 1987 | (setq hl (cdr hl)))))) | 1983 | (setq hl (cdr hl)))))) |
| 1988 | (Info-find-node "history" "Top") | 1984 | (Info-find-node 'history "Top") |
| 1989 | (goto-char (or p (point-min))))) | 1985 | (goto-char (or p (point-min))))) |
| 1990 | 1986 | ||
| 1991 | (defun Info-toc () | 1987 | (defun Info-toc () |
| 1992 | "Go to a node with table of contents of the current Info file. | 1988 | "Go to a node with table of contents of the current Info file. |
| 1993 | Table of contents is created from the tree structure of menus." | 1989 | Table of contents is created from the tree structure of menus." |
| 1994 | (interactive) | 1990 | (interactive) |
| 1995 | (let ((curr-file (substring-no-properties Info-current-file)) | 1991 | (if (stringp Info-current-file) |
| 1996 | (curr-node (substring-no-properties Info-current-node)) | 1992 | (let ((curr-file (substring-no-properties Info-current-file)) |
| 1997 | p) | 1993 | (curr-node (substring-no-properties Info-current-node)) |
| 1998 | (with-current-buffer (get-buffer-create " *info-toc*") | 1994 | p) |
| 1999 | (let ((inhibit-read-only t) | 1995 | (with-current-buffer (get-buffer-create " *info-toc*") |
| 2000 | (node-list (Info-build-toc curr-file))) | 1996 | (let ((inhibit-read-only t) |
| 2001 | (erase-buffer) | 1997 | (node-list (Info-build-toc curr-file))) |
| 2002 | (goto-char (point-min)) | 1998 | (erase-buffer) |
| 2003 | (insert "\n\^_\nFile: toc, Node: Top, Up: (dir)\n\n") | 1999 | (goto-char (point-min)) |
| 2004 | (insert "Table of Contents\n*****************\n\n") | 2000 | (insert "\n\^_\nFile: toc, Node: Top, Up: (dir)\n\n") |
| 2005 | (insert "*Note Top: (" curr-file ")Top.\n") | 2001 | (insert "Table of Contents\n*****************\n\n") |
| 2006 | (Info-insert-toc | 2002 | (insert "*Note Top: (" curr-file ")Top.\n") |
| 2007 | (nth 2 (assoc "Top" node-list)) ; get Top nodes | 2003 | (Info-insert-toc |
| 2008 | node-list 0 curr-file)) | 2004 | (nth 2 (assoc "Top" node-list)) ; get Top nodes |
| 2009 | (if (not (bobp)) | 2005 | node-list 0 curr-file)) |
| 2010 | (let ((Info-hide-note-references 'hide) | 2006 | (if (not (bobp)) |
| 2011 | (Info-fontify-visited-nodes nil)) | 2007 | (let ((Info-hide-note-references 'hide) |
| 2012 | (Info-mode) | 2008 | (Info-fontify-visited-nodes nil)) |
| 2013 | (setq Info-current-file "toc" Info-current-node "Top") | 2009 | (Info-mode) |
| 2014 | (goto-char (point-min)) | 2010 | (setq Info-current-file 'toc Info-current-node "Top") |
| 2015 | (narrow-to-region (or (re-search-forward "\n[\^_\f]\n" nil t) | 2011 | (goto-char (point-min)) |
| 2016 | (point-min)) | 2012 | (narrow-to-region (or (re-search-forward "\n[\^_\f]\n" nil t) |
| 2017 | (point-max)) | 2013 | (point-min)) |
| 2018 | (Info-fontify-node) | 2014 | (point-max)) |
| 2019 | (widen))) | 2015 | (Info-fontify-node) |
| 2020 | (goto-char (point-min)) | 2016 | (widen))) |
| 2021 | (if (setq p (search-forward (concat "*Note " curr-node ":") nil t)) | 2017 | (goto-char (point-min)) |
| 2022 | (setq p (- p (length curr-node) 2)))) | 2018 | (if (setq p (search-forward (concat "*Note " curr-node ":") nil t)) |
| 2023 | (Info-find-node "toc" "Top") | 2019 | (setq p (- p (length curr-node) 2)))) |
| 2024 | (goto-char (or p (point-min))))) | 2020 | (Info-find-node 'toc "Top") |
| 2021 | (goto-char (or p (point-min)))))) | ||
| 2025 | 2022 | ||
| 2026 | (defun Info-insert-toc (nodes node-list level curr-file) | 2023 | (defun Info-insert-toc (nodes node-list level curr-file) |
| 2027 | "Insert table of contents with references to nodes." | 2024 | "Insert table of contents with references to nodes." |
| @@ -2221,16 +2218,18 @@ Because of ambiguities, this should be concatenated with something like | |||
| 2221 | (setq Info-point-loc | 2218 | (setq Info-point-loc |
| 2222 | (if (match-beginning 5) | 2219 | (if (match-beginning 5) |
| 2223 | (string-to-number (match-string 5)) | 2220 | (string-to-number (match-string 5)) |
| 2224 | (buffer-substring (match-beginning 0) (1- (match-beginning 1))))) | 2221 | (buffer-substring-no-properties |
| 2222 | (match-beginning 0) (1- (match-beginning 1))))) | ||
| 2225 | ;;; Uncomment next line to use names of cross-references in non-index nodes: | 2223 | ;;; Uncomment next line to use names of cross-references in non-index nodes: |
| 2226 | ;;; (setq Info-point-loc | 2224 | ;;; (setq Info-point-loc |
| 2227 | ;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1)))) | 2225 | ;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1)))) |
| 2228 | ) | 2226 | ) |
| 2229 | (replace-regexp-in-string | 2227 | (replace-regexp-in-string |
| 2230 | "[ \n]+" " " | 2228 | "[ \n]+" " " |
| 2231 | (or (match-string 2) | 2229 | (or (match-string-no-properties 2) |
| 2232 | ;; If the node name is the menu entry name (using `entry::'). | 2230 | ;; If the node name is the menu entry name (using `entry::'). |
| 2233 | (buffer-substring (match-beginning 0) (1- (match-beginning 1))))))) | 2231 | (buffer-substring-no-properties |
| 2232 | (match-beginning 0) (1- (match-beginning 1))))))) | ||
| 2234 | 2233 | ||
| 2235 | ;; No one calls this. | 2234 | ;; No one calls this. |
| 2236 | ;;(defun Info-menu-item-sequence (list) | 2235 | ;;(defun Info-menu-item-sequence (list) |
| @@ -2684,7 +2683,7 @@ following nodes whose names also contain the word \"Index\"." | |||
| 2684 | (or file (setq file Info-current-file)) | 2683 | (or file (setq file Info-current-file)) |
| 2685 | (or (assoc file Info-index-nodes) | 2684 | (or (assoc file Info-index-nodes) |
| 2686 | ;; Skip virtual Info files | 2685 | ;; Skip virtual Info files |
| 2687 | (and (member file '("dir" "history" "toc" "apropos")) | 2686 | (and (member file '("dir" apropos history toc)) |
| 2688 | (setq Info-index-nodes (cons (cons file nil) Info-index-nodes))) | 2687 | (setq Info-index-nodes (cons (cons file nil) Info-index-nodes))) |
| 2689 | (not (stringp file)) | 2688 | (not (stringp file)) |
| 2690 | (if Info-file-supports-index-cookies | 2689 | (if Info-file-supports-index-cookies |
| @@ -2926,7 +2925,7 @@ Build a menu of the possible matches." | |||
| 2926 | (message "%s" (if (eq (car-safe err) 'error) | 2925 | (message "%s" (if (eq (car-safe err) 'error) |
| 2927 | (nth 1 err) err)) | 2926 | (nth 1 err) err)) |
| 2928 | (sit-for 1 t))))) | 2927 | (sit-for 1 t))))) |
| 2929 | (Info-goto-node (concat "(" current-file ")" current-node)) | 2928 | (Info-find-node current-file current-node) |
| 2930 | (setq Info-history ohist | 2929 | (setq Info-history ohist |
| 2931 | Info-history-list ohist-list) | 2930 | Info-history-list ohist-list) |
| 2932 | (message "Searching indices...done") | 2931 | (message "Searching indices...done") |
| @@ -2945,7 +2944,7 @@ Build a menu of the possible matches." | |||
| 2945 | (if (nth 3 entry) | 2944 | (if (nth 3 entry) |
| 2946 | (concat " (line " (nth 3 entry) ")") | 2945 | (concat " (line " (nth 3 entry) ")") |
| 2947 | ""))))) | 2946 | ""))))) |
| 2948 | (Info-find-node "apropos" "Index") | 2947 | (Info-find-node 'apropos "Index") |
| 2949 | (setq Info-complete-cache nil))))) | 2948 | (setq Info-complete-cache nil))))) |
| 2950 | 2949 | ||
| 2951 | (defun Info-undefined () | 2950 | (defun Info-undefined () |
| @@ -3287,10 +3286,14 @@ With a zero prefix arg, put the name inside a function call to `info'." | |||
| 3287 | (interactive "P") | 3286 | (interactive "P") |
| 3288 | (unless Info-current-node | 3287 | (unless Info-current-node |
| 3289 | (error "No current Info node")) | 3288 | (error "No current Info node")) |
| 3290 | (let ((node (concat "(" (file-name-nondirectory Info-current-file) ")" | 3289 | (let ((node (if (stringp Info-current-file) |
| 3291 | Info-current-node))) | 3290 | (concat "(" (file-name-nondirectory Info-current-file) ")" |
| 3291 | Info-current-node)))) | ||
| 3292 | (if (zerop (prefix-numeric-value arg)) | 3292 | (if (zerop (prefix-numeric-value arg)) |
| 3293 | (setq node (concat "(info \"" node "\")"))) | 3293 | (setq node (concat "(info \"" node "\")"))) |
| 3294 | (unless (stringp Info-current-file) | ||
| 3295 | (setq node (format "(Info-find-node '%S '%S)" | ||
| 3296 | Info-current-file Info-current-node))) | ||
| 3294 | (kill-new node) | 3297 | (kill-new node) |
| 3295 | (message "%s" node))) | 3298 | (message "%s" node))) |
| 3296 | 3299 | ||
| @@ -3817,29 +3820,30 @@ the variable `Info-file-list-for-emacs'." | |||
| 3817 | "^[ \t]+" "" | 3820 | "^[ \t]+" "" |
| 3818 | (replace-regexp-in-string | 3821 | (replace-regexp-in-string |
| 3819 | "[ \t\n]+" " " | 3822 | "[ \t\n]+" " " |
| 3820 | (or (match-string 5) | 3823 | (or (match-string-no-properties 5) |
| 3821 | (and (not (equal (match-string 4) "")) | 3824 | (and (not (equal (match-string 4) "")) |
| 3822 | (match-string 4)) | 3825 | (match-string-no-properties 4)) |
| 3823 | (match-string 2))))) | 3826 | (match-string-no-properties 2))))) |
| 3824 | (external-link-p | 3827 | (external-link-p |
| 3825 | (string-match "(\\([^)]+\\))\\([^)]*\\)" node)) | 3828 | (string-match "(\\([^)]+\\))\\([^)]*\\)" node)) |
| 3826 | (file (if external-link-p | 3829 | (file (if external-link-p |
| 3827 | (file-name-nondirectory | 3830 | (file-name-nondirectory |
| 3828 | (match-string 1 node)) | 3831 | (match-string-no-properties 1 node)) |
| 3829 | Info-current-file)) | 3832 | Info-current-file)) |
| 3830 | (hl Info-history-list) | 3833 | (hl Info-history-list) |
| 3831 | res) | 3834 | res) |
| 3832 | (if external-link-p | 3835 | (if external-link-p |
| 3833 | (setq node (if (equal (match-string 2 node) "") | 3836 | (setq node (if (equal (match-string 2 node) "") |
| 3834 | "Top" | 3837 | "Top" |
| 3835 | (match-string 2 node)))) | 3838 | (match-string-no-properties 2 node)))) |
| 3836 | (while hl | 3839 | (while hl |
| 3837 | (if (and (string-equal node (nth 1 (car hl))) | 3840 | (if (and (string-equal node (nth 1 (car hl))) |
| 3838 | (string-equal | 3841 | (equal file |
| 3839 | file (if external-link-p | 3842 | (if (and external-link-p |
| 3840 | (file-name-nondirectory | 3843 | (stringp (caar hl))) |
| 3841 | (caar hl)) | 3844 | (file-name-nondirectory |
| 3842 | (caar hl)))) | 3845 | (caar hl)) |
| 3846 | (caar hl)))) | ||
| 3843 | (setq res (car hl) hl nil) | 3847 | (setq res (car hl) hl nil) |
| 3844 | (setq hl (cdr hl)))) | 3848 | (setq hl (cdr hl)))) |
| 3845 | res))) 'info-xref-visited 'info-xref)) | 3849 | res))) 'info-xref-visited 'info-xref)) |
| @@ -3932,26 +3936,28 @@ the variable `Info-file-list-for-emacs'." | |||
| 3932 | (if (and Info-fontify-visited-nodes | 3936 | (if (and Info-fontify-visited-nodes |
| 3933 | (save-match-data | 3937 | (save-match-data |
| 3934 | (let* ((node (if (equal (match-string 3) "") | 3938 | (let* ((node (if (equal (match-string 3) "") |
| 3935 | (match-string 1) | 3939 | (match-string-no-properties 1) |
| 3936 | (match-string 3))) | 3940 | (match-string-no-properties 3))) |
| 3937 | (external-link-p | 3941 | (external-link-p |
| 3938 | (string-match "(\\([^)]+\\))\\([^)]*\\)" node)) | 3942 | (string-match "(\\([^)]+\\))\\([^)]*\\)" node)) |
| 3939 | (file (if external-link-p | 3943 | (file (if external-link-p |
| 3940 | (file-name-nondirectory | 3944 | (file-name-nondirectory |
| 3941 | (match-string 1 node)) | 3945 | (match-string-no-properties 1 node)) |
| 3942 | Info-current-file)) | 3946 | Info-current-file)) |
| 3943 | (hl Info-history-list) | 3947 | (hl Info-history-list) |
| 3944 | res) | 3948 | res) |
| 3945 | (if external-link-p | 3949 | (if external-link-p |
| 3946 | (setq node (if (equal (match-string 2 node) "") | 3950 | (setq node (if (equal (match-string 2 node) "") |
| 3947 | "Top" | 3951 | "Top" |
| 3948 | (match-string 2 node)))) | 3952 | (match-string-no-properties 2 node)))) |
| 3949 | (while hl | 3953 | (while hl |
| 3950 | (if (and (string-equal node (nth 1 (car hl))) | 3954 | (if (and (string-equal node (nth 1 (car hl))) |
| 3951 | (string-equal | 3955 | (equal file |
| 3952 | file (if external-link-p | 3956 | (if (and external-link-p |
| 3953 | (file-name-nondirectory (caar hl)) | 3957 | (stringp (caar hl))) |
| 3954 | (caar hl)))) | 3958 | (file-name-nondirectory |
| 3959 | (caar hl)) | ||
| 3960 | (caar hl)))) | ||
| 3955 | (setq res (car hl) hl nil) | 3961 | (setq res (car hl) hl nil) |
| 3956 | (setq hl (cdr hl)))) | 3962 | (setq hl (cdr hl)))) |
| 3957 | res))) 'info-xref-visited 'info-xref))) | 3963 | res))) 'info-xref-visited 'info-xref))) |
| @@ -4210,8 +4216,8 @@ BUFFER is the buffer speedbar is requesting buttons for." | |||
| 4210 | 4216 | ||
| 4211 | (defun Info-desktop-buffer-misc-data (desktop-dirname) | 4217 | (defun Info-desktop-buffer-misc-data (desktop-dirname) |
| 4212 | "Auxiliary information to be saved in desktop file." | 4218 | "Auxiliary information to be saved in desktop file." |
| 4213 | (if (not (member Info-current-file '("apropos" "history" "toc"))) | 4219 | (unless (member Info-current-file '(apropos history toc nil)) |
| 4214 | (list Info-current-file Info-current-node))) | 4220 | (list Info-current-file Info-current-node))) |
| 4215 | 4221 | ||
| 4216 | (defun Info-restore-desktop-buffer (desktop-buffer-file-name | 4222 | (defun Info-restore-desktop-buffer (desktop-buffer-file-name |
| 4217 | desktop-buffer-name | 4223 | desktop-buffer-name |
diff --git a/lisp/isearch.el b/lisp/isearch.el index c97f5062c61..32228aa6eb9 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -116,8 +116,11 @@ When you put a space or spaces in the incremental regexp, it stands for | |||
| 116 | this, unless it is inside of a regexp construct such as [...] or *, + or ?. | 116 | this, unless it is inside of a regexp construct such as [...] or *, + or ?. |
| 117 | You might want to use something like \"[ \\t\\r\\n]+\" instead. | 117 | You might want to use something like \"[ \\t\\r\\n]+\" instead. |
| 118 | In the Customization buffer, that is `[' followed by a space, | 118 | In the Customization buffer, that is `[' followed by a space, |
| 119 | a tab, a carriage return (control-M), a newline, and `]+'." | 119 | a tab, a carriage return (control-M), a newline, and `]+'. |
| 120 | :type 'regexp | 120 | |
| 121 | When this is nil, each space you type matches literally, against one space." | ||
| 122 | :type '(choice (const :tag "Find Spaces Literally" nil) | ||
| 123 | regexp) | ||
| 121 | :group 'isearch) | 124 | :group 'isearch) |
| 122 | 125 | ||
| 123 | (defcustom search-invisible 'open | 126 | (defcustom search-invisible 'open |
diff --git a/lisp/loadup.el b/lisp/loadup.el index 58219104e40..00e9e35ff60 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el | |||
| @@ -163,6 +163,7 @@ | |||
| 163 | 163 | ||
| 164 | (if (fboundp 'x-create-frame) | 164 | (if (fboundp 'x-create-frame) |
| 165 | (progn | 165 | (progn |
| 166 | (load "fringe") | ||
| 166 | (load "image") | 167 | (load "image") |
| 167 | (load "international/fontset") | 168 | (load "international/fontset") |
| 168 | (load "dnd") | 169 | (load "dnd") |
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index e5262693d8a..a1043c6c6ee 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog | |||
| @@ -1,3 +1,53 @@ | |||
| 1 | 2006-02-21 Eric Ding <ericding@alum.mit.edu> | ||
| 2 | |||
| 3 | * mh-e.el (mh-invisible-header-fields-internal): Added entry | ||
| 4 | "X-Sasl-enc:" | ||
| 5 | |||
| 6 | 2006-02-20 Eric Ding <ericding@alum.mit.edu> | ||
| 7 | |||
| 8 | * mh-e.el (mh-invisible-header-fields-internal): Added entries | ||
| 9 | "X-Authenticated-Sender:", "X-Barracuda-", "X-EFL-Spamscore", | ||
| 10 | "X-IronPort-AV:", "X-Mail-from:", "X-Mailman-Approved-At:", | ||
| 11 | "X-Resolved-to:", and "X-SA-Exim". Fixed "X-Bugzilla-" and | ||
| 12 | "X-Roving-" by removing unnecessary "*" at end. | ||
| 13 | |||
| 14 | 2006-02-19 Bill Wohler <wohler@newt.com> | ||
| 15 | |||
| 16 | * mh-alias.el (mh-address-mail-regexp) | ||
| 17 | (mh-goto-address-find-address-at-point): Delete copies from | ||
| 18 | goto-addr.el. | ||
| 19 | (mh-alias-suggest-alias): Use goto-address-mail-regexp instead of | ||
| 20 | mh-address-mail-regexp. | ||
| 21 | (mh-alias-add-address-under-point): Use | ||
| 22 | goto-address-find-address-at-point instead of | ||
| 23 | mh-goto-address-find-address-at-point. | ||
| 24 | |||
| 25 | * mh-e.el (mh-show-use-goto-addr-flag): Delete. | ||
| 26 | |||
| 27 | * mh-show.el (mh-show-mode): Mention goto-address-highlight-p in | ||
| 28 | docstring. | ||
| 29 | (mh-show-addr): Call goto-address unconditionally. User should use | ||
| 30 | goto-address-highlight-p instead of mh-show-use-goto-addr-flag. | ||
| 31 | |||
| 32 | 2006-02-18 Bill Wohler <wohler@newt.com> | ||
| 33 | |||
| 34 | * mh-e.el (Version, mh-version): Add +cvs to version. | ||
| 35 | |||
| 36 | 2006-02-18 Bill Wohler <wohler@newt.com> | ||
| 37 | |||
| 38 | Release MH-E version 7.92. | ||
| 39 | |||
| 40 | * mh-e.el (Version, mh-version): Update for release 7.92. | ||
| 41 | |||
| 42 | 2006-02-17 Bill Wohler <wohler@newt.com> | ||
| 43 | |||
| 44 | * mh-e.el (mh-folder-msg-number): Use purple on low-color, light | ||
| 45 | backgrounds per Mark's suggestion. | ||
| 46 | |||
| 47 | * mh-utils.el (mh-image-load-path): Fix problem that images on | ||
| 48 | load-path or image-load-path would win over relative paths (newer | ||
| 49 | MH-E or Emacs distribution). | ||
| 50 | |||
| 1 | 2006-02-16 Bill Wohler <wohler@newt.com> | 51 | 2006-02-16 Bill Wohler <wohler@newt.com> |
| 2 | 52 | ||
| 3 | * mh-e.el (mh-inherit-face-flag): New variable. Non-nil means that | 53 | * mh-e.el (mh-inherit-face-flag): New variable. Non-nil means that |
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el index 9dc2871241f..6dba65d69df 100644 --- a/lisp/mh-e/mh-alias.el +++ b/lisp/mh-e/mh-alias.el | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | 35 | ||
| 36 | (mh-require-cl) | 36 | (mh-require-cl) |
| 37 | 37 | ||
| 38 | (require 'goto-addr) | ||
| 39 | |||
| 38 | (defvar mh-alias-alist 'not-read | 40 | (defvar mh-alias-alist 'not-read |
| 39 | "Alist of MH aliases.") | 41 | "Alist of MH aliases.") |
| 40 | (defvar mh-alias-blind-alist nil | 42 | (defvar mh-alias-blind-alist nil |
| @@ -62,11 +64,6 @@ alias files listed in your \"Aliasfile:\" MH profile component are | |||
| 62 | automatically included. You can update the alias list manually using | 64 | automatically included. You can update the alias list manually using |
| 63 | \\[mh-alias-reload].") | 65 | \\[mh-alias-reload].") |
| 64 | 66 | ||
| 65 | ;; Copy of `goto-address-mail-regexp'. | ||
| 66 | (defvar mh-address-mail-regexp | ||
| 67 | "[-a-zA-Z0-9._]+@\\([-a-zA-z0-9_]+\\.\\)+[a-zA-Z0-9]+" | ||
| 68 | "A regular expression probably matching an e-mail address.") | ||
| 69 | |||
| 70 | 67 | ||
| 71 | 68 | ||
| 72 | ;;; Alias Loading | 69 | ;;; Alias Loading |
| @@ -343,7 +340,7 @@ NO-COMMA-SWAP is non-nil." | |||
| 343 | ((string-match "^\\(.*\\) +<.*>$" string) | 340 | ((string-match "^\\(.*\\) +<.*>$" string) |
| 344 | ;; Some name <somename@foo.bar> -> recurse -> Some name | 341 | ;; Some name <somename@foo.bar> -> recurse -> Some name |
| 345 | (mh-alias-suggest-alias (match-string 1 string) no-comma-swap)) | 342 | (mh-alias-suggest-alias (match-string 1 string) no-comma-swap)) |
| 346 | ((string-match (concat mh-address-mail-regexp " +(\\(.*\\))$") string) | 343 | ((string-match (concat goto-address-mail-regexp " +(\\(.*\\))$") string) |
| 347 | ;; somename@foo.bar (Some name) -> recurse -> Some name | 344 | ;; somename@foo.bar (Some name) -> recurse -> Some name |
| 348 | (mh-alias-suggest-alias (match-string 1 string) no-comma-swap)) | 345 | (mh-alias-suggest-alias (match-string 1 string) no-comma-swap)) |
| 349 | ((string-match "^\\(Dr\\|Prof\\)\\.? +\\(.*\\)" string) | 346 | ((string-match "^\\(Dr\\|Prof\\)\\.? +\\(.*\\)" string) |
| @@ -595,24 +592,11 @@ filing messages." | |||
| 595 | (defun mh-alias-add-address-under-point () | 592 | (defun mh-alias-add-address-under-point () |
| 596 | "Insert an alias for address under point." | 593 | "Insert an alias for address under point." |
| 597 | (interactive) | 594 | (interactive) |
| 598 | (let ((address (mh-goto-address-find-address-at-point))) | 595 | (let ((address (goto-address-find-address-at-point))) |
| 599 | (if address | 596 | (if address |
| 600 | (mh-alias-add-alias nil address) | 597 | (mh-alias-add-alias nil address) |
| 601 | (message "No email address found under point")))) | 598 | (message "No email address found under point")))) |
| 602 | 599 | ||
| 603 | ;; From goto-addr.el, which we don't want to force-load on users. | ||
| 604 | (defun mh-goto-address-find-address-at-point () | ||
| 605 | "Find e-mail address around or before point. | ||
| 606 | |||
| 607 | Then search backwards to beginning of line for the start of an | ||
| 608 | e-mail address. If no e-mail address found, return nil." | ||
| 609 | (re-search-backward "[^-_A-z0-9.@]" (mh-line-beginning-position) 'lim) | ||
| 610 | (if (or (looking-at mh-address-mail-regexp) ; already at start | ||
| 611 | (and (re-search-forward mh-address-mail-regexp | ||
| 612 | (mh-line-end-position) 'lim) | ||
| 613 | (goto-char (match-beginning 0)))) | ||
| 614 | (mh-match-string-no-properties 0))) | ||
| 615 | |||
| 616 | (defun mh-alias-apropos (regexp) | 600 | (defun mh-alias-apropos (regexp) |
| 617 | "Show all aliases or addresses that match a regular expression REGEXP." | 601 | "Show all aliases or addresses that match a regular expression REGEXP." |
| 618 | (interactive "sAlias regexp: ") | 602 | (interactive "sAlias regexp: ") |
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 26b1ddd8050..5a07524aec4 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.91+cvs | 9 | ;; Version: 7.92+cvs |
| 10 | ;; Keywords: mail | 10 | ;; Keywords: mail |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | 12 | ;; This file is part of GNU Emacs. |
| @@ -121,7 +121,7 @@ | |||
| 121 | ;; Try to keep variables local to a single file. Provide accessors if | 121 | ;; Try to keep variables local to a single file. Provide accessors if |
| 122 | ;; variables are shared. Use this section as a last resort. | 122 | ;; variables are shared. Use this section as a last resort. |
| 123 | 123 | ||
| 124 | (defconst mh-version "7.91+cvs" "Version number of MH-E.") | 124 | (defconst mh-version "7.92+cvs" "Version number of MH-E.") |
| 125 | 125 | ||
| 126 | ;; Variants | 126 | ;; Variants |
| 127 | 127 | ||
| @@ -2303,17 +2303,20 @@ of citations entirely, choose \"None\"." | |||
| 2303 | "X-AntiAbuse:" ; cPanel | 2303 | "X-AntiAbuse:" ; cPanel |
| 2304 | "X-Apparently-From:" ; MS Outlook | 2304 | "X-Apparently-From:" ; MS Outlook |
| 2305 | "X-Apparently-To:" ; Egroups/yahoogroups mailing list manager | 2305 | "X-Apparently-To:" ; Egroups/yahoogroups mailing list manager |
| 2306 | "X-Authenticated-Sender:" ; AT&T Message Center (webmail) | ||
| 2306 | "X-Authentication-Warning:" ; sendmail | 2307 | "X-Authentication-Warning:" ; sendmail |
| 2308 | "X-Barracuda-" ; Barracuda spam scores | ||
| 2307 | "X-Beenthere:" ; Mailman mailing list manager | 2309 | "X-Beenthere:" ; Mailman mailing list manager |
| 2308 | "X-Bogosity:" ; bogofilter | 2310 | "X-Bogosity:" ; bogofilter |
| 2309 | "X-BrightmailFiltered:" ; Brightmail | 2311 | "X-BrightmailFiltered:" ; Brightmail |
| 2310 | "X-Brightmail-Tracker:" ; Brightmail | 2312 | "X-Brightmail-Tracker:" ; Brightmail |
| 2311 | "X-Bugzilla-*" ; Bugzilla | 2313 | "X-Bugzilla-" ; Bugzilla |
| 2312 | "X-Complaints-To:" | 2314 | "X-Complaints-To:" |
| 2313 | "X-ContentStamp:" ; NetZero | 2315 | "X-ContentStamp:" ; NetZero |
| 2314 | "X-Cron-Env:" | 2316 | "X-Cron-Env:" |
| 2315 | "X-DMCA" | 2317 | "X-DMCA" |
| 2316 | "X-Delivered" | 2318 | "X-Delivered" |
| 2319 | "X-EFL-Spamscore:" ; MIT alumni spam filtering | ||
| 2317 | "X-ELNK-Trace:" ; Earthlink mailer | 2320 | "X-ELNK-Trace:" ; Earthlink mailer |
| 2318 | "X-Envelope-Date:" ; GNU mailutils | 2321 | "X-Envelope-Date:" ; GNU mailutils |
| 2319 | "X-Envelope-From:" | 2322 | "X-Envelope-From:" |
| @@ -2337,6 +2340,7 @@ of citations entirely, choose \"None\"." | |||
| 2337 | "X-Habeas-SWE-9:" ; Spam | 2340 | "X-Habeas-SWE-9:" ; Spam |
| 2338 | "X-Hashcash:" ; hashcash | 2341 | "X-Hashcash:" ; hashcash |
| 2339 | "X-Info:" ; NTMail | 2342 | "X-Info:" ; NTMail |
| 2343 | "X-IronPort-AV:" ; IronPort AV | ||
| 2340 | "X-Juno-" ; Juno | 2344 | "X-Juno-" ; Juno |
| 2341 | "X-List-Host:" ; Unknown mailing list managers | 2345 | "X-List-Host:" ; Unknown mailing list managers |
| 2342 | "X-List-Subscribe:" ; Unknown mailing list managers | 2346 | "X-List-Subscribe:" ; Unknown mailing list managers |
| @@ -2346,12 +2350,14 @@ of citations entirely, choose \"None\"." | |||
| 2346 | "X-Loop:" ; Unknown mailing list managers | 2350 | "X-Loop:" ; Unknown mailing list managers |
| 2347 | "X-Lumos-SenderID:" ; Roving ConstantContact | 2351 | "X-Lumos-SenderID:" ; Roving ConstantContact |
| 2348 | "X-MAIL-INFO:" ; NetZero | 2352 | "X-MAIL-INFO:" ; NetZero |
| 2349 | "X-MHE-Checksum" ; Checksum added during index search | 2353 | "X-MHE-Checksum:" ; Checksum added during index search |
| 2350 | "X-MIME-Autoconverted:" ; sendmail | 2354 | "X-MIME-Autoconverted:" ; sendmail |
| 2351 | "X-MIMETrack:" | 2355 | "X-MIMETrack:" |
| 2352 | "X-MS-" ; MS Outlook | 2356 | "X-MS-" ; MS Outlook |
| 2357 | "X-Mail-from:" ; fastmail.fm | ||
| 2353 | "X-MailScanner" ; ListProc(tm) by CREN | 2358 | "X-MailScanner" ; ListProc(tm) by CREN |
| 2354 | "X-Mailing-List:" ; Unknown mailing list managers | 2359 | "X-Mailing-List:" ; Unknown mailing list managers |
| 2360 | "X-Mailman-Approved-At:" ; Mailman mailing list manager | ||
| 2355 | "X-Mailman-Version:" ; Mailman mailing list manager | 2361 | "X-Mailman-Version:" ; Mailman mailing list manager |
| 2356 | "X-Majordomo:" ; Majordomo mailing list manager | 2362 | "X-Majordomo:" ; Majordomo mailing list manager |
| 2357 | "X-Message-Id" | 2363 | "X-Message-Id" |
| @@ -2380,14 +2386,17 @@ of citations entirely, choose \"None\"." | |||
| 2380 | "X-Received-Date:" | 2386 | "X-Received-Date:" |
| 2381 | "X-Received:" | 2387 | "X-Received:" |
| 2382 | "X-Request-" | 2388 | "X-Request-" |
| 2389 | "X-Resolved-to:" ; fastmail.fm | ||
| 2383 | "X-Return-Path-Hint:" ; Roving ConstantContact | 2390 | "X-Return-Path-Hint:" ; Roving ConstantContact |
| 2384 | "X-Roving-*" ; Roving ConstantContact | 2391 | "X-Roving-" ; Roving ConstantContact |
| 2392 | "X-SA-Exim-" ; Exim SpamAssassin | ||
| 2385 | "X-SBClass:" ; Spam | 2393 | "X-SBClass:" ; Spam |
| 2386 | "X-SBNote:" ; Spam | 2394 | "X-SBNote:" ; Spam |
| 2387 | "X-SBPass:" ; Spam | 2395 | "X-SBPass:" ; Spam |
| 2388 | "X-SBRule:" ; Spam | 2396 | "X-SBRule:" ; Spam |
| 2389 | "X-SMTP-" | 2397 | "X-SMTP-" |
| 2390 | "X-Scanned-By" | 2398 | "X-Sasl-enc:" ; Apple Mail |
| 2399 | "X-Scanned-By:" | ||
| 2391 | "X-Sender:" | 2400 | "X-Sender:" |
| 2392 | "X-Server-Date:" | 2401 | "X-Server-Date:" |
| 2393 | "X-Server-Uuid:" | 2402 | "X-Server-Uuid:" |
| @@ -2615,22 +2624,6 @@ message are shown regardless of size." | |||
| 2615 | :type 'integer | 2624 | :type 'integer |
| 2616 | :group 'mh-show) | 2625 | :group 'mh-show) |
| 2617 | 2626 | ||
| 2618 | (defcustom mh-show-use-goto-addr-flag (and (boundp 'goto-address-highlight-p) | ||
| 2619 | goto-address-highlight-p) | ||
| 2620 | "*Non-nil means highlight URLs and email addresses\\<goto-address-highlight-keymap>. | ||
| 2621 | |||
| 2622 | To send a message using the highlighted email address or to view | ||
| 2623 | the web page for the highlighted URL, use the middle mouse button | ||
| 2624 | or \\[goto-address-at-point]. | ||
| 2625 | |||
| 2626 | See Info node `(mh-e)Sending Mail' to see how to configure Emacs | ||
| 2627 | to send the message using MH-E. | ||
| 2628 | |||
| 2629 | The default value of this option comes from the value of | ||
| 2630 | `goto-address-highlight-p'." | ||
| 2631 | :type 'boolean | ||
| 2632 | :group 'mh-show) | ||
| 2633 | |||
| 2634 | (defcustom mh-show-use-xface-flag (>= emacs-major-version 21) | 2627 | (defcustom mh-show-use-xface-flag (>= emacs-major-version 21) |
| 2635 | "*Non-nil means display face images in MH-show buffers. | 2628 | "*Non-nil means display face images in MH-show buffers. |
| 2636 | 2629 | ||
| @@ -3019,7 +3012,9 @@ GNU Emacs and XEmacs from at least 21.5.23 on.") | |||
| 3019 | (:foreground "snow4")) | 3012 | (:foreground "snow4")) |
| 3020 | (((class color) (min-colors 64) (background dark)) | 3013 | (((class color) (min-colors 64) (background dark)) |
| 3021 | (:foreground "snow3")) | 3014 | (:foreground "snow3")) |
| 3022 | (((class color)) | 3015 | (((class color) (background light)) |
| 3016 | (:foreground "purple")) | ||
| 3017 | (((class color) (background dark)) | ||
| 3023 | (:foreground "cyan")))) | 3018 | (:foreground "cyan")))) |
| 3024 | (mh-folder-refiled | 3019 | (mh-folder-refiled |
| 3025 | ((((class color) (min-colors 64) (background light)) | 3020 | ((((class color) (min-colors 64) (background light)) |
| @@ -3042,9 +3037,9 @@ GNU Emacs and XEmacs from at least 21.5.23 on.") | |||
| 3042 | (t | 3037 | (t |
| 3043 | (:bold t)))) | 3038 | (:bold t)))) |
| 3044 | (mh-folder-tick | 3039 | (mh-folder-tick |
| 3045 | ((((class color) (background dark)) | 3040 | ((((class color) (background light)) |
| 3046 | (:background "#dddf7e")) | 3041 | (:background "#dddf7e")) |
| 3047 | (((class color) (background light)) | 3042 | (((class color) (background dark)) |
| 3048 | (:background "#dddf7e")) | 3043 | (:background "#dddf7e")) |
| 3049 | (t | 3044 | (t |
| 3050 | (:underline t)))) | 3045 | (:underline t)))) |
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index ab636ae8ab6..3ae609d9204 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el | |||
| @@ -36,13 +36,13 @@ | |||
| 36 | (require 'mh-e) | 36 | (require 'mh-e) |
| 37 | (require 'mh-scan) | 37 | (require 'mh-scan) |
| 38 | 38 | ||
| 39 | (require 'font-lock) | ||
| 39 | (require 'gnus-cite) | 40 | (require 'gnus-cite) |
| 40 | (require 'gnus-util) | 41 | (require 'gnus-util) |
| 42 | (require 'goto-addr) | ||
| 41 | 43 | ||
| 42 | (autoload 'mh-make-buffer-data "mh-mime") ;can't be automatically generated | 44 | (autoload 'mh-make-buffer-data "mh-mime") ;can't be automatically generated |
| 43 | 45 | ||
| 44 | (require 'font-lock) | ||
| 45 | |||
| 46 | 46 | ||
| 47 | 47 | ||
| 48 | ;;; MH-Folder Commands | 48 | ;;; MH-Folder Commands |
| @@ -818,6 +818,13 @@ operation." | |||
| 818 | (define-derived-mode mh-show-mode text-mode "MH-Show" | 818 | (define-derived-mode mh-show-mode text-mode "MH-Show" |
| 819 | "Major mode for showing messages in MH-E.\\<mh-show-mode-map> | 819 | "Major mode for showing messages in MH-E.\\<mh-show-mode-map> |
| 820 | 820 | ||
| 821 | Email addresses and URLs in the message are highlighted if the | ||
| 822 | option `goto-address-highlight-p' is on, which it is by default. | ||
| 823 | To view the web page for a highlighted URL or to send a message | ||
| 824 | using a highlighted email address, use the middle mouse button or | ||
| 825 | \\[goto-address-at-point]. See Info node `(mh-e)Sending Mail' to | ||
| 826 | see how to configure Emacs to send the message using MH-E. | ||
| 827 | |||
| 821 | The hook `mh-show-mode-hook' is called upon entry to this mode. | 828 | The hook `mh-show-mode-hook' is called upon entry to this mode. |
| 822 | 829 | ||
| 823 | See also `mh-folder-mode'. | 830 | See also `mh-folder-mode'. |
| @@ -877,10 +884,7 @@ See also `mh-folder-mode'. | |||
| 877 | ;;;###mh-autoload | 884 | ;;;###mh-autoload |
| 878 | (defun mh-show-addr () | 885 | (defun mh-show-addr () |
| 879 | "Use `goto-address'." | 886 | "Use `goto-address'." |
| 880 | (when mh-show-use-goto-addr-flag | 887 | (goto-address)) |
| 881 | (mh-require 'goto-addr nil t) | ||
| 882 | (if (fboundp 'goto-address) | ||
| 883 | (goto-address)))) | ||
| 884 | 888 | ||
| 885 | ;;;###mh-autoload | 889 | ;;;###mh-autoload |
| 886 | (defun mh-gnus-article-highlight-citation () | 890 | (defun mh-gnus-article-highlight-citation () |
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index 58d29bc5d1c..c00558860d1 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el | |||
| @@ -111,18 +111,8 @@ already there. | |||
| 111 | See also variable `mh-image-load-path-called-flag'." | 111 | See also variable `mh-image-load-path-called-flag'." |
| 112 | (unless mh-image-load-path-called-flag | 112 | (unless mh-image-load-path-called-flag |
| 113 | (cond | 113 | (cond |
| 114 | (mh-image-load-path) ; user setting exists; we're done | 114 | (mh-image-load-path) ; user setting exists |
| 115 | ((mh-image-search-load-path "mh-logo.xpm") | 115 | ((let (mh-library-name) ; try relative setting |
| 116 | ;; Images already in image-load-path. | ||
| 117 | (setq mh-image-load-path | ||
| 118 | (file-name-directory (mh-image-search-load-path "mh-logo.xpm")))) | ||
| 119 | ((locate-library "mh-logo.xpm") | ||
| 120 | ;; Images already in load-path. | ||
| 121 | (setq mh-image-load-path | ||
| 122 | (file-name-directory (locate-library "mh-logo.xpm")))) | ||
| 123 | (t | ||
| 124 | ;; Guess `mh-image-load-path' if it wasn't provided by the user. | ||
| 125 | (let (mh-library-name) | ||
| 126 | ;; First, find mh-e in the load-path. | 116 | ;; First, find mh-e in the load-path. |
| 127 | (setq mh-library-name (locate-library "mh-e")) | 117 | (setq mh-library-name (locate-library "mh-e")) |
| 128 | (if (not mh-library-name) | 118 | (if (not mh-library-name) |
| @@ -131,7 +121,17 @@ See also variable `mh-image-load-path-called-flag'." | |||
| 131 | (setq mh-image-load-path | 121 | (setq mh-image-load-path |
| 132 | (expand-file-name (concat | 122 | (expand-file-name (concat |
| 133 | (file-name-directory mh-library-name) | 123 | (file-name-directory mh-library-name) |
| 134 | "../../etc/images")))))) | 124 | "../../etc/images"))) |
| 125 | (file-exists-p (expand-file-name "mh-logo.xpm" mh-image-load-path)))) | ||
| 126 | ((mh-image-search-load-path "mh-logo.xpm") | ||
| 127 | ;; Images in image-load-path. | ||
| 128 | (setq mh-image-load-path | ||
| 129 | (file-name-directory (mh-image-search-load-path "mh-logo.xpm")))) | ||
| 130 | ((locate-library "mh-logo.xpm") | ||
| 131 | ;; Images in load-path. | ||
| 132 | (setq mh-image-load-path | ||
| 133 | (file-name-directory (locate-library "mh-logo.xpm"))))) | ||
| 134 | |||
| 135 | (if (not (file-exists-p mh-image-load-path)) | 135 | (if (not (file-exists-p mh-image-load-path)) |
| 136 | (error "Directory %s in mh-image-load-path does not exist" | 136 | (error "Directory %s in mh-image-load-path does not exist" |
| 137 | mh-image-load-path)) | 137 | mh-image-load-path)) |
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 971b65bf25c..f2eff379d14 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -49,7 +49,7 @@ | |||
| 49 | (defgroup rcirc nil | 49 | (defgroup rcirc nil |
| 50 | "Simple IRC client." | 50 | "Simple IRC client." |
| 51 | :version "22.1" | 51 | :version "22.1" |
| 52 | :prefix "rcirc" | 52 | :prefix "rcirc-" |
| 53 | :group 'applications) | 53 | :group 'applications) |
| 54 | 54 | ||
| 55 | (defcustom rcirc-server "irc.freenode.net" | 55 | (defcustom rcirc-server "irc.freenode.net" |
| @@ -295,16 +295,23 @@ If ARG is non-nil, prompt for a server to connect to." | |||
| 295 | (defvar rcirc-topic nil) | 295 | (defvar rcirc-topic nil) |
| 296 | (defvar rcirc-keepalive-timer nil) | 296 | (defvar rcirc-keepalive-timer nil) |
| 297 | (defvar rcirc-last-server-message-time nil) | 297 | (defvar rcirc-last-server-message-time nil) |
| 298 | (defun rcirc-connect (server port nick user-name full-name startup-channels) | 298 | (defun rcirc-connect (&optional server port nick user-name full-name startup-channels) |
| 299 | (add-hook 'window-configuration-change-hook | 299 | (add-hook 'window-configuration-change-hook |
| 300 | 'rcirc-window-configuration-change) | 300 | 'rcirc-window-configuration-change) |
| 301 | 301 | ||
| 302 | (save-excursion | 302 | (save-excursion |
| 303 | (message "Connecting to %s..." server) | 303 | (message "Connecting to %s..." server) |
| 304 | (let* ((inhibit-eol-conversion) | 304 | (let* ((inhibit-eol-conversion) |
| 305 | (port-number (if (stringp port) | 305 | (port-number (if port |
| 306 | (string-to-number port) | 306 | (if (stringp port) |
| 307 | port)) | 307 | (string-to-number port) |
| 308 | port) | ||
| 309 | rcirc-port)) | ||
| 310 | (server (or server rcirc-server)) | ||
| 311 | (nick (or nick rcirc-nick)) | ||
| 312 | (user-name (or user-name rcirc-user-name)) | ||
| 313 | (full-name (or full-name rcirc-user-full-name)) | ||
| 314 | (startup-channels (or startup-channels (rcirc-startup-channels server))) | ||
| 308 | (process (open-network-stream server nil server port-number))) | 315 | (process (open-network-stream server nil server port-number))) |
| 309 | ;; set up process | 316 | ;; set up process |
| 310 | (set-process-coding-system process 'raw-text 'raw-text) | 317 | (set-process-coding-system process 'raw-text 'raw-text) |
| @@ -758,9 +765,9 @@ if there is no existing buffer for TARGET, otherwise return nil." | |||
| 758 | Create the buffer if it doesn't exist." | 765 | Create the buffer if it doesn't exist." |
| 759 | (let ((buffer (rcirc-get-buffer process target))) | 766 | (let ((buffer (rcirc-get-buffer process target))) |
| 760 | (if buffer | 767 | (if buffer |
| 761 | (progn | 768 | (with-current-buffer buffer |
| 762 | (when (not rcirc-target) | 769 | (when (not rcirc-target) |
| 763 | (setq rcirc-target target)) | 770 | (setq rcirc-target target)) |
| 764 | buffer) | 771 | buffer) |
| 765 | ;; create the buffer | 772 | ;; create the buffer |
| 766 | (with-rcirc-process-buffer process | 773 | (with-rcirc-process-buffer process |
| @@ -896,20 +903,22 @@ Create the buffer if it doesn't exist." | |||
| 896 | (kill-buffer (current-buffer)) | 903 | (kill-buffer (current-buffer)) |
| 897 | (set-window-configuration rcirc-window-configuration)) | 904 | (set-window-configuration rcirc-window-configuration)) |
| 898 | 905 | ||
| 899 | (defun rcirc-get-any-buffer (process) | 906 | (defun rcirc-any-buffer (process) |
| 900 | "Return a buffer for PROCESS, either the one selected or the process buffer." | 907 | "Return a buffer for PROCESS, either the one selected or the process buffer." |
| 901 | (let ((buffer (window-buffer (selected-window)))) | 908 | (if rcirc-always-use-server-buffer-flag |
| 902 | (if (and buffer | 909 | (process-buffer process) |
| 903 | (with-current-buffer buffer | 910 | (let ((buffer (window-buffer (selected-window)))) |
| 904 | (and (eq major-mode 'rcirc-mode) | 911 | (if (and buffer |
| 905 | (eq rcirc-process process)))) | 912 | (with-current-buffer buffer |
| 906 | buffer | 913 | (and (eq major-mode 'rcirc-mode) |
| 907 | (process-buffer process)))) | 914 | (eq rcirc-process process)))) |
| 915 | buffer | ||
| 916 | (process-buffer process))))) | ||
| 908 | 917 | ||
| 909 | (defcustom rcirc-response-formats | 918 | (defcustom rcirc-response-formats |
| 910 | '(("PRIVMSG" . "%T<%n> %m") | 919 | '(("PRIVMSG" . "%T<%N> %m") |
| 911 | ("NOTICE" . "%T-%n- %m") | 920 | ("NOTICE" . "%T-%N- %m") |
| 912 | ("ACTION" . "%T[%n] %m") | 921 | ("ACTION" . "%T[%N %m]") |
| 913 | ("COMMAND" . "%T%m") | 922 | ("COMMAND" . "%T%m") |
| 914 | ("ERROR" . "%T%fw!!! %m") | 923 | ("ERROR" . "%T%fw!!! %m") |
| 915 | (t . "%T%fp*** %fs%n %r %m")) | 924 | (t . "%T%fp*** %fs%n %r %m")) |
| @@ -921,7 +930,8 @@ The entry's value part should be a string, which is inserted with | |||
| 921 | the of the following escape sequences replaced by the described values: | 930 | the of the following escape sequences replaced by the described values: |
| 922 | 931 | ||
| 923 | %m The message text | 932 | %m The message text |
| 924 | %n The sender's nick (with face `rcirc-my-nick' or `rcirc-other-nick') | 933 | %n The sender's nick |
| 934 | %N The sender's nick (with face `rcirc-my-nick' or `rcirc-other-nick') | ||
| 925 | %r The response-type | 935 | %r The response-type |
| 926 | %T The timestamp (with face `rcirc-timestamp') | 936 | %T The timestamp (with face `rcirc-timestamp') |
| 927 | %t The target | 937 | %t The target |
| @@ -959,13 +969,20 @@ is found by looking up RESPONSE in `rcirc-response-formats'." | |||
| 959 | (cond ((eq key ?%) | 969 | (cond ((eq key ?%) |
| 960 | ;; %% -- literal % character | 970 | ;; %% -- literal % character |
| 961 | "%") | 971 | "%") |
| 962 | ((eq key ?n) | 972 | ((or (eq key ?n) (eq key ?N)) |
| 963 | ;; %n -- nick | 973 | ;; %n/%N -- nick |
| 964 | (rcirc-facify (concat (rcirc-abbrev-nick sender) | 974 | (let ((nick (concat (if (string= (with-rcirc-process-buffer |
| 965 | (and target (concat "," target))) | 975 | process rcirc-server) |
| 966 | (if (string= sender (rcirc-nick process)) | 976 | sender) |
| 967 | 'rcirc-my-nick | 977 | "" |
| 968 | 'rcirc-other-nick))) | 978 | (rcirc-abbrev-nick sender)) |
| 979 | (and target (concat "," target))))) | ||
| 980 | (rcirc-facify nick | ||
| 981 | (if (eq key ?n) | ||
| 982 | face | ||
| 983 | (if (string= sender (rcirc-nick process)) | ||
| 984 | 'rcirc-my-nick | ||
| 985 | 'rcirc-other-nick))))) | ||
| 969 | ((eq key ?T) | 986 | ((eq key ?T) |
| 970 | ;; %T -- timestamp | 987 | ;; %T -- timestamp |
| 971 | (rcirc-facify | 988 | (rcirc-facify |
| @@ -1015,9 +1032,7 @@ is found by looking up RESPONSE in `rcirc-response-formats'." | |||
| 1015 | (assert (not (bufferp target))) | 1032 | (assert (not (bufferp target))) |
| 1016 | (with-rcirc-process-buffer process | 1033 | (with-rcirc-process-buffer process |
| 1017 | (cond ((not target) | 1034 | (cond ((not target) |
| 1018 | (if rcirc-always-use-server-buffer-flag | 1035 | (rcirc-any-buffer process)) |
| 1019 | (process-buffer process) | ||
| 1020 | (rcirc-get-any-buffer process))) | ||
| 1021 | ((not (rcirc-channel-p target)) | 1036 | ((not (rcirc-channel-p target)) |
| 1022 | ;; message from another user | 1037 | ;; message from another user |
| 1023 | (if (string= response "PRIVMSG") | 1038 | (if (string= response "PRIVMSG") |
| @@ -1026,7 +1041,7 @@ is found by looking up RESPONSE in `rcirc-response-formats'." | |||
| 1026 | sender)) | 1041 | sender)) |
| 1027 | (rcirc-get-buffer process target t))) | 1042 | (rcirc-get-buffer process target t))) |
| 1028 | ((or (rcirc-get-buffer process target) | 1043 | ((or (rcirc-get-buffer process target) |
| 1029 | (rcirc-get-any-buffer process)))))) | 1044 | (rcirc-any-buffer process)))))) |
| 1030 | 1045 | ||
| 1031 | (defvar rcirc-activity-type nil) | 1046 | (defvar rcirc-activity-type nil) |
| 1032 | (make-variable-buffer-local 'rcirc-activity-type) | 1047 | (make-variable-buffer-local 'rcirc-activity-type) |
| @@ -1069,22 +1084,26 @@ record activity." | |||
| 1069 | (set-marker-insertion-type rcirc-prompt-start-marker nil) | 1084 | (set-marker-insertion-type rcirc-prompt-start-marker nil) |
| 1070 | (set-marker-insertion-type rcirc-prompt-end-marker nil) | 1085 | (set-marker-insertion-type rcirc-prompt-end-marker nil) |
| 1071 | 1086 | ||
| 1072 | ;; fill the text we just inserted, maybe | 1087 | (let ((text-start (make-marker))) |
| 1073 | (when (and rcirc-fill-flag | 1088 | (set-marker text-start |
| 1074 | (not (string= response "372"))) ;/motd | 1089 | (or (next-single-property-change fill-start |
| 1075 | (let ((fill-prefix | 1090 | 'rcirc-text) |
| 1076 | (or rcirc-fill-prefix | 1091 | (point-max))) |
| 1077 | (make-string | 1092 | ;; squeeze spaces out of text before rcirc-text |
| 1078 | (or (next-single-property-change 0 'rcirc-text | 1093 | (fill-region fill-start (1- text-start)) |
| 1079 | fmted-text) | 1094 | |
| 1080 | 8) | 1095 | ;; fill the text we just inserted, maybe |
| 1081 | ?\s))) | 1096 | (when (and rcirc-fill-flag |
| 1082 | (fill-column (cond ((eq rcirc-fill-column 'frame-width) | 1097 | (not (string= response "372"))) ;/motd |
| 1083 | (1- (frame-width))) | 1098 | (let ((fill-prefix |
| 1084 | (rcirc-fill-column | 1099 | (or rcirc-fill-prefix |
| 1085 | rcirc-fill-column) | 1100 | (make-string (- text-start fill-start) ?\s))) |
| 1086 | (t fill-column)))) | 1101 | (fill-column (cond ((eq rcirc-fill-column 'frame-width) |
| 1087 | (fill-region fill-start rcirc-prompt-start-marker 'left t)))) | 1102 | (1- (frame-width))) |
| 1103 | (rcirc-fill-column | ||
| 1104 | rcirc-fill-column) | ||
| 1105 | (t fill-column)))) | ||
| 1106 | (fill-region fill-start rcirc-prompt-start-marker 'left t))))) | ||
| 1088 | 1107 | ||
| 1089 | ;; set inserted text to be read-only | 1108 | ;; set inserted text to be read-only |
| 1090 | (when rcirc-read-only-flag | 1109 | (when rcirc-read-only-flag |
| @@ -1175,14 +1194,15 @@ record activity." | |||
| 1175 | 1194 | ||
| 1176 | (defun rcirc-put-nick-channel (process nick channel) | 1195 | (defun rcirc-put-nick-channel (process nick channel) |
| 1177 | "Add CHANNEL to list associated with NICK." | 1196 | "Add CHANNEL to list associated with NICK." |
| 1178 | (with-rcirc-process-buffer process | 1197 | (let ((nick (rcirc-user-nick nick))) |
| 1179 | (let* ((chans (gethash nick rcirc-nick-table)) | 1198 | (with-rcirc-process-buffer process |
| 1180 | (record (assoc-string channel chans t))) | 1199 | (let* ((chans (gethash nick rcirc-nick-table)) |
| 1181 | (if record | 1200 | (record (assoc-string channel chans t))) |
| 1182 | (setcdr record (current-time)) | 1201 | (if record |
| 1183 | (puthash nick (cons (cons channel (current-time)) | 1202 | (setcdr record (current-time)) |
| 1184 | chans) | 1203 | (puthash nick (cons (cons channel (current-time)) |
| 1185 | rcirc-nick-table))))) | 1204 | chans) |
| 1205 | rcirc-nick-table)))))) | ||
| 1186 | 1206 | ||
| 1187 | (defun rcirc-nick-remove (process nick) | 1207 | (defun rcirc-nick-remove (process nick) |
| 1188 | "Remove NICK from table." | 1208 | "Remove NICK from table." |
| @@ -1613,15 +1633,21 @@ ones added to the list automatically are marked with an asterisk." | |||
| 1613 | (propertize (or string "") 'face face 'rear-nonsticky t)) | 1633 | (propertize (or string "") 'face face 'rear-nonsticky t)) |
| 1614 | 1634 | ||
| 1615 | (defvar rcirc-url-regexp | 1635 | (defvar rcirc-url-regexp |
| 1616 | (rx word-boundary | 1636 | (rx-to-string |
| 1617 | (or "www." | 1637 | `(and word-boundary |
| 1618 | (and (or "http" "https" "ftp" "file" "gopher" "news" "telnet" "wais" | 1638 | (or "www." |
| 1619 | "mailto") | 1639 | (and (or "http" "https" "ftp" "file" "gopher" "news" "telnet" |
| 1620 | "://" | 1640 | "wais" "mailto") |
| 1621 | (1+ (char "a-zA-Z0-9_.")) | 1641 | "://" |
| 1622 | (optional ":" (1+ (char "0-9"))))) | 1642 | (1+ (char "-a-zA-Z0-9_.")) |
| 1623 | (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,{}[]")) | 1643 | (optional ":" (1+ (char "0-9")))) |
| 1624 | (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]")) | 1644 | (and (1+ (char "-a-zA-Z0-9_.")) |
| 1645 | (or ".com" ".net" ".org") | ||
| 1646 | word-boundary)) | ||
| 1647 | (optional | ||
| 1648 | (and "/" | ||
| 1649 | (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,{}[]")) | ||
| 1650 | (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]"))))) | ||
| 1625 | "Regexp matching URLs. Set to nil to disable URL features in rcirc.") | 1651 | "Regexp matching URLs. Set to nil to disable URL features in rcirc.") |
| 1626 | 1652 | ||
| 1627 | (defun rcirc-browse-url (&optional arg) | 1653 | (defun rcirc-browse-url (&optional arg) |
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 2e7fa41d622..df603dc0d74 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -107,8 +107,10 @@ | |||
| 107 | (defvar gdb-current-language nil) | 107 | (defvar gdb-current-language nil) |
| 108 | (defvar gdb-var-list nil | 108 | (defvar gdb-var-list nil |
| 109 | "List of variables in watch window. | 109 | "List of variables in watch window. |
| 110 | Each element has the form (EXPRESSION VARNUM NUMCHILD TYPE VALUE CHANGED-P).") | 110 | Each element has the form (EXPRESSION VARNUM NUMCHILD TYPE VALUE STATUS) where |
| 111 | (defvar gdb-var-changed nil "Non-nil means that `gdb-var-list' has changed.") | 111 | STATUS is nil (unchanged), `changed' or `out-of-scope'.") |
| 112 | (defvar gdb-force-update t | ||
| 113 | "Non-nil means that view of watch expressions will be updated in the speedbar.") | ||
| 112 | (defvar gdb-main-file nil "Source file from which program execution begins.") | 114 | (defvar gdb-main-file nil "Source file from which program execution begins.") |
| 113 | (defvar gdb-overlay-arrow-position nil) | 115 | (defvar gdb-overlay-arrow-position nil) |
| 114 | (defvar gdb-server-prefix nil) | 116 | (defvar gdb-server-prefix nil) |
| @@ -454,7 +456,7 @@ With arg, use separate IO iff arg is positive." | |||
| 454 | gdb-current-language nil | 456 | gdb-current-language nil |
| 455 | gdb-frame-number nil | 457 | gdb-frame-number nil |
| 456 | gdb-var-list nil | 458 | gdb-var-list nil |
| 457 | gdb-var-changed nil | 459 | gdb-force-update t |
| 458 | gdb-first-post-prompt t | 460 | gdb-first-post-prompt t |
| 459 | gdb-prompting nil | 461 | gdb-prompting nil |
| 460 | gdb-input-queue nil | 462 | gdb-input-queue nil |
| @@ -540,7 +542,7 @@ With arg, use separate IO iff arg is positive." | |||
| 540 | (forward-char 2) | 542 | (forward-char 2) |
| 541 | (gud-call (concat "until *%a"))))))))) | 543 | (gud-call (concat "until *%a"))))))))) |
| 542 | 544 | ||
| 543 | (defcustom gdb-speedbar-auto-raise t | 545 | (defcustom gdb-speedbar-auto-raise nil |
| 544 | "If non-nil raise speedbar every time display of watch expressions is\ | 546 | "If non-nil raise speedbar every time display of watch expressions is\ |
| 545 | updated." | 547 | updated." |
| 546 | :type 'boolean | 548 | :type 'boolean |
| @@ -608,8 +610,7 @@ With arg, automatically raise speedbar iff arg is positive." | |||
| 608 | (nth 1 var) "\"\n") | 610 | (nth 1 var) "\"\n") |
| 609 | (concat "-var-evaluate-expression " (nth 1 var) "\n")) | 611 | (concat "-var-evaluate-expression " (nth 1 var) "\n")) |
| 610 | `(lambda () (gdb-var-evaluate-expression-handler | 612 | `(lambda () (gdb-var-evaluate-expression-handler |
| 611 | ,(nth 1 var) nil)))) | 613 | ,(nth 1 var) nil))))) |
| 612 | (setq gdb-var-changed t)) | ||
| 613 | (if (search-forward "Undefined command" nil t) | 614 | (if (search-forward "Undefined command" nil t) |
| 614 | (message-box "Watching expressions requires gdb 6.0 onwards") | 615 | (message-box "Watching expressions requires gdb 6.0 onwards") |
| 615 | (message "No symbol \"%s\" in current context." expr)))) | 616 | (message "No symbol \"%s\" in current context." expr)))) |
| @@ -618,16 +619,11 @@ With arg, automatically raise speedbar iff arg is positive." | |||
| 618 | (goto-char (point-min)) | 619 | (goto-char (point-min)) |
| 619 | (re-search-forward ".*value=\\(\".*\"\\)" nil t) | 620 | (re-search-forward ".*value=\\(\".*\"\\)" nil t) |
| 620 | (catch 'var-found | 621 | (catch 'var-found |
| 621 | (let ((num 0)) | 622 | (dolist (var gdb-var-list) |
| 622 | (dolist (var gdb-var-list) | 623 | (when (string-equal varnum (cadr var)) |
| 623 | (if (string-equal varnum (cadr var)) | 624 | (if changed (setcar (nthcdr 5 var) 'changed)) |
| 624 | (progn | 625 | (setcar (nthcdr 4 var) (read (match-string 1))) |
| 625 | (if changed (setcar (nthcdr 5 var) t)) | 626 | (throw 'var-found nil))))) |
| 626 | (setcar (nthcdr 4 var) (read (match-string 1))) | ||
| 627 | (setcar (nthcdr num gdb-var-list) var) | ||
| 628 | (throw 'var-found nil))) | ||
| 629 | (setq num (+ num 1))))) | ||
| 630 | (setq gdb-var-changed t)) | ||
| 631 | 627 | ||
| 632 | (defun gdb-var-list-children (varnum) | 628 | (defun gdb-var-list-children (varnum) |
| 633 | (gdb-enqueue-input | 629 | (gdb-enqueue-input |
| @@ -676,17 +672,22 @@ type=\"\\(.*?\\)\"") | |||
| 676 | (defconst gdb-var-update-regexp "name=\"\\(.*?\\)\",in_scope=\"\\(.*?\\)\"") | 672 | (defconst gdb-var-update-regexp "name=\"\\(.*?\\)\",in_scope=\"\\(.*?\\)\"") |
| 677 | 673 | ||
| 678 | (defun gdb-var-update-handler () | 674 | (defun gdb-var-update-handler () |
| 675 | (dolist (var gdb-var-list) | ||
| 676 | (setcar (nthcdr 5 var) nil)) | ||
| 679 | (goto-char (point-min)) | 677 | (goto-char (point-min)) |
| 680 | (while (re-search-forward gdb-var-update-regexp nil t) | 678 | (while (re-search-forward gdb-var-update-regexp nil t) |
| 681 | (catch 'var-found-1 | 679 | (let ((varnum (match-string 1))) |
| 682 | (let ((varnum (match-string 1))) | 680 | (if (string-equal (match-string 2) "false") |
| 683 | (dolist (var gdb-var-list) | 681 | (catch 'var-found |
| 684 | (gdb-enqueue-input | 682 | (dolist (var gdb-var-list) |
| 685 | (list | 683 | (when (string-equal varnum (cadr var)) |
| 686 | (concat "server interpreter mi \"-var-evaluate-expression " | 684 | (setcar (nthcdr 5 var) 'out-of-scope) |
| 687 | varnum "\"\n") | 685 | (throw 'var-found nil)))) |
| 688 | `(lambda () (gdb-var-evaluate-expression-handler ,varnum t)))) | 686 | (gdb-enqueue-input |
| 689 | (throw 'var-found-1 nil))))) | 687 | (list |
| 688 | (concat "server interpreter mi \"-var-evaluate-expression " | ||
| 689 | varnum "\"\n") | ||
| 690 | `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))) | ||
| 690 | (setq gdb-pending-triggers | 691 | (setq gdb-pending-triggers |
| 691 | (delq 'gdb-var-update gdb-pending-triggers)) | 692 | (delq 'gdb-var-update gdb-pending-triggers)) |
| 692 | (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) | 693 | (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) |
| @@ -722,8 +723,7 @@ type=\"\\(.*?\\)\"") | |||
| 722 | (setq gdb-var-list (delq var gdb-var-list)) | 723 | (setq gdb-var-list (delq var gdb-var-list)) |
| 723 | (dolist (varchild gdb-var-list) | 724 | (dolist (varchild gdb-var-list) |
| 724 | (if (string-match (concat (nth 1 var) "\\.") (nth 1 varchild)) | 725 | (if (string-match (concat (nth 1 var) "\\.") (nth 1 varchild)) |
| 725 | (setq gdb-var-list (delq varchild gdb-var-list)))) | 726 | (setq gdb-var-list (delq varchild gdb-var-list))))))))) |
| 726 | (setq gdb-var-changed t)))))) | ||
| 727 | 727 | ||
| 728 | (defun gdb-edit-value (text token indent) | 728 | (defun gdb-edit-value (text token indent) |
| 729 | "Assign a value to a variable displayed in the speedbar." | 729 | "Assign a value to a variable displayed in the speedbar." |
| @@ -739,8 +739,9 @@ type=\"\\(.*?\\)\"") | |||
| 739 | 'ignore)))) | 739 | 'ignore)))) |
| 740 | 740 | ||
| 741 | (defcustom gdb-show-changed-values t | 741 | (defcustom gdb-show-changed-values t |
| 742 | "If non-nil highlight values that have recently changed in the speedbar. | 742 | "If non-nil change the face of out of scope variables and changed values. |
| 743 | The highlighting is done with `font-lock-warning-face'." | 743 | Out of scope variables are suppressed with `shadow' face. |
| 744 | Changed values are highlighted with the face `font-lock-warning-face'." | ||
| 744 | :type 'boolean | 745 | :type 'boolean |
| 745 | :group 'gud | 746 | :group 'gud |
| 746 | :version "22.1") | 747 | :version "22.1") |
| @@ -760,7 +761,7 @@ INDENT is the current indentation depth." | |||
| 760 | (dolist (var gdb-var-list) | 761 | (dolist (var gdb-var-list) |
| 761 | (if (string-match (concat token "\\.") (nth 1 var)) | 762 | (if (string-match (concat token "\\.") (nth 1 var)) |
| 762 | (setq gdb-var-list (delq var gdb-var-list)))) | 763 | (setq gdb-var-list (delq var gdb-var-list)))) |
| 763 | (setq gdb-var-changed t) | 764 | (setq gdb-force-update t) |
| 764 | (with-current-buffer gud-comint-buffer | 765 | (with-current-buffer gud-comint-buffer |
| 765 | (speedbar-timer-fn))))) | 766 | (speedbar-timer-fn))))) |
| 766 | 767 | ||
| @@ -1214,8 +1215,7 @@ happens to be appropriate." | |||
| 1214 | ;; FIXME: with GDB-6 on Darwin, this might very well work. | 1215 | ;; FIXME: with GDB-6 on Darwin, this might very well work. |
| 1215 | ;; Only needed/used with speedbar/watch expressions. | 1216 | ;; Only needed/used with speedbar/watch expressions. |
| 1216 | (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) | 1217 | (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) |
| 1217 | (dolist (var gdb-var-list) | 1218 | (setq gdb-force-update t) |
| 1218 | (setcar (nthcdr 5 var) nil)) | ||
| 1219 | (if (string-equal gdb-version "pre-6.4") | 1219 | (if (string-equal gdb-version "pre-6.4") |
| 1220 | (gdb-var-update) | 1220 | (gdb-var-update) |
| 1221 | (gdb-var-update-1))))) | 1221 | (gdb-var-update-1))))) |
| @@ -2626,6 +2626,8 @@ Kills the gdb buffers and resets the source buffers." | |||
| 2626 | (setq gdb-overlay-arrow-position nil)) | 2626 | (setq gdb-overlay-arrow-position nil)) |
| 2627 | (setq overlay-arrow-variable-list | 2627 | (setq overlay-arrow-variable-list |
| 2628 | (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) | 2628 | (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) |
| 2629 | (if (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) | ||
| 2630 | (speedbar-refresh)) | ||
| 2629 | (setq gud-running nil) | 2631 | (setq gud-running nil) |
| 2630 | (setq gdb-active-process nil) | 2632 | (setq gdb-active-process nil) |
| 2631 | (setq gdb-var-list nil) | 2633 | (setq gdb-var-list nil) |
| @@ -3022,7 +3024,6 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}") | |||
| 3022 | (throw 'child-already-watched nil))) | 3024 | (throw 'child-already-watched nil))) |
| 3023 | (push varchild var-list)))) | 3025 | (push varchild var-list)))) |
| 3024 | (push var var-list))) | 3026 | (push var var-list))) |
| 3025 | (setq gdb-var-changed t) | ||
| 3026 | (setq gdb-var-list (nreverse var-list))))) | 3027 | (setq gdb-var-list (nreverse var-list))))) |
| 3027 | 3028 | ||
| 3028 | ; Uses "-var-update --all-values". Needs GDB 6.4 onwards. | 3029 | ; Uses "-var-update --all-values". Needs GDB 6.4 onwards. |
| @@ -3041,23 +3042,20 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}") | |||
| 3041 | "name=\"\\(.*?\\)\",\\(?:value=\\(\".*?\"\\),\\)?in_scope=\"\\(.*?\\)\"") | 3042 | "name=\"\\(.*?\\)\",\\(?:value=\\(\".*?\"\\),\\)?in_scope=\"\\(.*?\\)\"") |
| 3042 | 3043 | ||
| 3043 | (defun gdb-var-update-handler-1 () | 3044 | (defun gdb-var-update-handler-1 () |
| 3045 | (dolist (var gdb-var-list) | ||
| 3046 | (setcar (nthcdr 5 var) nil)) | ||
| 3044 | (goto-char (point-min)) | 3047 | (goto-char (point-min)) |
| 3045 | (while (re-search-forward gdb-var-update-regexp-1 nil t) | 3048 | (while (re-search-forward gdb-var-update-regexp-1 nil t) |
| 3046 | (let ((varnum (match-string 1))) | 3049 | (let ((varnum (match-string 1))) |
| 3047 | (catch 'var-found1 | 3050 | (catch 'var-found |
| 3048 | (let ((num 0)) | 3051 | (dolist (var gdb-var-list) |
| 3049 | (dolist (var gdb-var-list) | 3052 | (when (string-equal varnum (cadr var)) |
| 3050 | (if (string-equal varnum (cadr var)) | 3053 | (if (string-equal (match-string 3) "false") |
| 3051 | (progn | 3054 | (setcar (nthcdr 5 var) 'out-of-scope) |
| 3052 | (setcar (nthcdr 5 var) t) | 3055 | (setcar (nthcdr 5 var) 'changed) |
| 3053 | (setcar (nthcdr 4 var) | 3056 | (setcar (nthcdr 4 var) |
| 3054 | (if (string-equal (match-string 3) "true") | 3057 | (read (match-string 2)))) |
| 3055 | (read (match-string 2)) | 3058 | (throw 'var-found nil)))))) |
| 3056 | "*changed*")) | ||
| 3057 | (setcar (nthcdr num gdb-var-list) var) | ||
| 3058 | (throw 'var-found1 nil))) | ||
| 3059 | (setq num (+ num 1)))))) | ||
| 3060 | (setq gdb-var-changed t)) | ||
| 3061 | (setq gdb-pending-triggers | 3059 | (setq gdb-pending-triggers |
| 3062 | (delq 'gdb-var-update gdb-pending-triggers)) | 3060 | (delq 'gdb-var-update gdb-pending-triggers)) |
| 3063 | (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) | 3061 | (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 1d5172a1a52..ea2586a31d6 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -43,14 +43,13 @@ | |||
| 43 | (eval-when-compile (require 'cl)) ; for case macro | 43 | (eval-when-compile (require 'cl)) ; for case macro |
| 44 | 44 | ||
| 45 | (require 'comint) | 45 | (require 'comint) |
| 46 | (require 'font-lock) | ||
| 47 | 46 | ||
| 48 | (defvar gdb-active-process) | 47 | (defvar gdb-active-process) |
| 49 | (defvar gdb-define-alist) | 48 | (defvar gdb-define-alist) |
| 50 | (defvar gdb-macro-info) | 49 | (defvar gdb-macro-info) |
| 51 | (defvar gdb-server-prefix) | 50 | (defvar gdb-server-prefix) |
| 52 | (defvar gdb-show-changed-values) | 51 | (defvar gdb-show-changed-values) |
| 53 | (defvar gdb-var-changed) | 52 | (defvar gdb-force-update) |
| 54 | (defvar gdb-var-list) | 53 | (defvar gdb-var-list) |
| 55 | (defvar gdb-speedbar-auto-raise) | 54 | (defvar gdb-speedbar-auto-raise) |
| 56 | (defvar tool-bar-map) | 55 | (defvar tool-bar-map) |
| @@ -444,7 +443,7 @@ required by the caller." | |||
| 444 | (p (window-point window))) | 443 | (p (window-point window))) |
| 445 | (cond | 444 | (cond |
| 446 | ((memq minor-mode '(gdbmi gdba)) | 445 | ((memq minor-mode '(gdbmi gdba)) |
| 447 | (when (or gdb-var-changed | 446 | (when (or gdb-force-update |
| 448 | (not (save-excursion | 447 | (not (save-excursion |
| 449 | (goto-char (point-min)) | 448 | (goto-char (point-min)) |
| 450 | (let ((case-fold-search t)) | 449 | (let ((case-fold-search t)) |
| @@ -453,51 +452,68 @@ required by the caller." | |||
| 453 | (insert "Watch Expressions:\n") | 452 | (insert "Watch Expressions:\n") |
| 454 | (if gdb-speedbar-auto-raise | 453 | (if gdb-speedbar-auto-raise |
| 455 | (raise-frame speedbar-frame)) | 454 | (raise-frame speedbar-frame)) |
| 456 | (let ((var-list gdb-var-list)) | 455 | (let ((var-list gdb-var-list) parent) |
| 457 | (while var-list | 456 | (while var-list |
| 458 | (let* (char (depth 0) (start 0) | 457 | (let* (char (depth 0) (start 0) (var (car var-list)) |
| 459 | (var (car var-list)) (varnum (nth 1 var))) | 458 | (expr (car var)) (varnum (nth 1 var)) |
| 459 | (type (nth 3 var)) (status (nth 5 var))) | ||
| 460 | (put-text-property | ||
| 461 | 0 (length expr) 'face font-lock-variable-name-face expr) | ||
| 462 | (put-text-property | ||
| 463 | 0 (length type) 'face font-lock-type-face type) | ||
| 460 | (while (string-match "\\." varnum start) | 464 | (while (string-match "\\." varnum start) |
| 461 | (setq depth (1+ depth) | 465 | (setq depth (1+ depth) |
| 462 | start (1+ (match-beginning 0)))) | 466 | start (1+ (match-beginning 0)))) |
| 467 | (if (eq depth 0) (setq parent nil)) | ||
| 463 | (if (or (equal (nth 2 var) "0") | 468 | (if (or (equal (nth 2 var) "0") |
| 464 | (and (equal (nth 2 var) "1") | 469 | (and (equal (nth 2 var) "1") |
| 465 | (string-match "char \\*$" (nth 3 var)))) | 470 | (string-match "char \\*$" type))) |
| 466 | (speedbar-make-tag-line 'bracket ?? nil nil | 471 | (speedbar-make-tag-line |
| 467 | (concat (car var) "\t" (nth 4 var)) | 472 | 'bracket ?? nil nil |
| 468 | 'gdb-edit-value | 473 | (concat expr "\t" (nth 4 var)) |
| 469 | nil | 474 | (if (or parent (eq status 'out-of-scope)) |
| 470 | (if (and (nth 5 var) | 475 | nil 'gdb-edit-value) |
| 471 | gdb-show-changed-values) | 476 | nil |
| 472 | 'font-lock-warning-face | 477 | (if gdb-show-changed-values |
| 473 | nil) depth) | 478 | (or parent (case status |
| 479 | (changed 'font-lock-warning-face) | ||
| 480 | (out-of-scope 'shadow) | ||
| 481 | (t t))) | ||
| 482 | t) | ||
| 483 | depth) | ||
| 484 | (if (eq status 'out-of-scope) (setq parent 'shadow)) | ||
| 474 | (if (and (cadr var-list) | 485 | (if (and (cadr var-list) |
| 475 | (string-match (concat varnum "\\.") | 486 | (string-match (concat varnum "\\.") |
| 476 | (cadr (cadr var-list)))) | 487 | (cadr (cadr var-list)))) |
| 477 | (setq char ?-) | 488 | (setq char ?-) |
| 478 | (setq char ?+)) | 489 | (setq char ?+)) |
| 479 | (if (string-match "\\*$" (nth 3 var)) | 490 | (if (string-match "\\*$" type) |
| 480 | (speedbar-make-tag-line 'bracket char | 491 | (speedbar-make-tag-line |
| 481 | 'gdb-speedbar-expand-node varnum | 492 | 'bracket char |
| 482 | (concat (car var) "\t" | 493 | 'gdb-speedbar-expand-node varnum |
| 483 | (nth 3 var)"\t" | 494 | (concat expr "\t" |
| 484 | (nth 4 var)) | 495 | type "\t" |
| 485 | 'gdb-edit-value nil | 496 | (nth 4 var)) |
| 486 | (if (and (nth 5 var) | 497 | (if (or parent status 'out-of-scope) |
| 487 | gdb-show-changed-values) | 498 | nil 'gdb-edit-value) |
| 488 | 'font-lock-warning-face | 499 | nil |
| 489 | nil) depth) | 500 | (if (and (or parent status) gdb-show-changed-values) |
| 490 | (speedbar-make-tag-line 'bracket char | 501 | 'shadow t) |
| 491 | 'gdb-speedbar-expand-node varnum | 502 | depth) |
| 492 | (concat (car var) "\t" (nth 3 var)) | 503 | (speedbar-make-tag-line |
| 493 | nil nil nil depth)))) | 504 | 'bracket char |
| 505 | 'gdb-speedbar-expand-node varnum | ||
| 506 | (concat expr "\t" type) | ||
| 507 | nil nil | ||
| 508 | (if (and (or parent status) gdb-show-changed-values) | ||
| 509 | 'shadow t) | ||
| 510 | depth)))) | ||
| 494 | (setq var-list (cdr var-list)))) | 511 | (setq var-list (cdr var-list)))) |
| 495 | (setq gdb-var-changed nil))) | 512 | (setq gdb-force-update nil))) |
| 496 | (t (if (and (save-excursion | 513 | (t (unless (and (save-excursion |
| 497 | (goto-char (point-min)) | 514 | (goto-char (point-min)) |
| 498 | (looking-at "Current Stack:")) | 515 | (looking-at "Current Stack:")) |
| 499 | (equal gud-last-last-frame gud-last-speedbar-stackframe)) | 516 | (equal gud-last-last-frame gud-last-speedbar-stackframe)) |
| 500 | nil | ||
| 501 | (let ((gud-frame-list | 517 | (let ((gud-frame-list |
| 502 | (cond ((eq minor-mode 'gdb) | 518 | (cond ((eq minor-mode 'gdb) |
| 503 | (gud-gdb-get-stackframe buffer)) | 519 | (gud-gdb-get-stackframe buffer)) |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index a70941d9d3e..0ea9eef96cb 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1438,6 +1438,16 @@ with your script for an edit-interpret-debug cycle." | |||
| 1438 | ((and buffer-file-name | 1438 | ((and buffer-file-name |
| 1439 | (string-match "\\.m?spec\\'" buffer-file-name)) | 1439 | (string-match "\\.m?spec\\'" buffer-file-name)) |
| 1440 | "rpm"))))) | 1440 | "rpm"))))) |
| 1441 | (unless interpreter | ||
| 1442 | (setq interpreter | ||
| 1443 | (cond ((string-match "[.]sh\\>" buffer-file-name) | ||
| 1444 | "sh") | ||
| 1445 | ((string-match "[.]bash\\>" buffer-file-name) | ||
| 1446 | "bash") | ||
| 1447 | ((string-match "[.]ksh\\>" buffer-file-name) | ||
| 1448 | "ksh") | ||
| 1449 | ((string-match "[.]csh\\>" buffer-file-name) | ||
| 1450 | "csh")))) | ||
| 1441 | (sh-set-shell (or interpreter sh-shell-file) nil nil)) | 1451 | (sh-set-shell (or interpreter sh-shell-file) nil nil)) |
| 1442 | (run-mode-hooks 'sh-mode-hook)) | 1452 | (run-mode-hooks 'sh-mode-hook)) |
| 1443 | 1453 | ||
diff --git a/lisp/sort.el b/lisp/sort.el index 174a8531786..5183bf65afa 100644 --- a/lisp/sort.el +++ b/lisp/sort.el | |||
| @@ -499,8 +499,9 @@ Use \\[untabify] to convert tabs to spaces before sorting." | |||
| 499 | ;; in the region, since the sort utility would lose the | 499 | ;; in the region, since the sort utility would lose the |
| 500 | ;; properties. | 500 | ;; properties. |
| 501 | (let ((sort-args (list (if reverse "-rt\n" "-t\n") | 501 | (let ((sort-args (list (if reverse "-rt\n" "-t\n") |
| 502 | (concat "+0." (int-to-string col-start)) | 502 | (format "-k1.%d,1.%d" |
| 503 | (concat "-0." (int-to-string col-end))))) | 503 | (1+ col-start) |
| 504 | (1+ col-end))))) | ||
| 504 | (when sort-fold-case | 505 | (when sort-fold-case |
| 505 | (push "-f" sort-args)) | 506 | (push "-f" sort-args)) |
| 506 | (apply #'call-process-region beg1 end1 "sort" t t nil sort-args)) | 507 | (apply #'call-process-region beg1 end1 "sort" t t nil sort-args)) |
diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 4e639c586f2..4f0e2edf7cb 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el | |||
| @@ -1708,9 +1708,13 @@ Separators are not active, have no labels, depth, or actions." | |||
| 1708 | (defun speedbar-make-button (start end face mouse function &optional token) | 1708 | (defun speedbar-make-button (start end face mouse function &optional token) |
| 1709 | "Create a button from START to END, with FACE as the display face. | 1709 | "Create a button from START to END, with FACE as the display face. |
| 1710 | MOUSE is the mouse face. When this button is clicked on FUNCTION | 1710 | MOUSE is the mouse face. When this button is clicked on FUNCTION |
| 1711 | will be run with the TOKEN parameter (any Lisp object)" | 1711 | will be run with the TOKEN parameter (any Lisp object). If FACE |
| 1712 | is t use the text properties of the string that is passed as an | ||
| 1713 | argument." | ||
| 1714 | (unless (eq face t) | ||
| 1715 | (put-text-property start end 'face face)) | ||
| 1712 | (add-text-properties | 1716 | (add-text-properties |
| 1713 | start end `(face ,face mouse-face ,mouse invisible nil | 1717 | start end `(mouse-face ,mouse invisible nil |
| 1714 | speedbar-text ,(buffer-substring-no-properties start end))) | 1718 | speedbar-text ,(buffer-substring-no-properties start end))) |
| 1715 | (if speedbar-use-tool-tips-flag | 1719 | (if speedbar-use-tool-tips-flag |
| 1716 | (put-text-property start end 'help-echo #'dframe-help-echo)) | 1720 | (put-text-property start end 'help-echo #'dframe-help-echo)) |
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index f52ed056994..d6fdbffad74 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -508,11 +508,7 @@ re-start emacs." | |||
| 508 | (const "~nroff") (const "~list") | 508 | (const "~nroff") (const "~list") |
| 509 | (const "~latin1") (const "~latin3") | 509 | (const "~latin1") (const "~latin3") |
| 510 | (const :tag "default" nil)) | 510 | (const :tag "default" nil)) |
| 511 | (choice :tag "Coding system" | 511 | (coding-system :tag "Coding System"))) |
| 512 | (const iso-8859-1) | ||
| 513 | (const iso-8859-2) | ||
| 514 | (const koi8-r) | ||
| 515 | (const windows-1251)))) | ||
| 516 | :group 'ispell) | 512 | :group 'ispell) |
| 517 | 513 | ||
| 518 | 514 | ||
| @@ -570,10 +566,10 @@ re-start emacs." | |||
| 570 | '(("esperanto" | 566 | '(("esperanto" |
| 571 | "[A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]" | 567 | "[A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]" |
| 572 | "[^A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]" | 568 | "[^A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]" |
| 573 | "[-']" t ("-C") "~latin3" iso-8859-1) | 569 | "[-']" t ("-C") "~latin3" iso-8859-3) |
| 574 | ("esperanto-tex" | 570 | ("esperanto-tex" |
| 575 | "[A-Za-z^\\]" "[^A-Za-z^\\]" | 571 | "[A-Za-z^\\]" "[^A-Za-z^\\]" |
| 576 | "[-'`\"]" t ("-C" "-d" "esperanto") "~tex" iso-8859-1) | 572 | "[-'`\"]" t ("-C" "-d" "esperanto") "~tex" iso-8859-3) |
| 577 | ("francais7" | 573 | ("francais7" |
| 578 | "[A-Za-z]" "[^A-Za-z]" "[`'^---]" t nil nil iso-8859-1) | 574 | "[A-Za-z]" "[^A-Za-z]" "[`'^---]" t nil nil iso-8859-1) |
| 579 | ("francais" ; Francais.aff | 575 | ("francais" ; Francais.aff |
| @@ -2574,7 +2570,7 @@ By just answering RET you can find out what the current dictionary is." | |||
| 2574 | (mapcar 'list (ispell-valid-dictionary-list))) | 2570 | (mapcar 'list (ispell-valid-dictionary-list))) |
| 2575 | nil t) | 2571 | nil t) |
| 2576 | current-prefix-arg)) | 2572 | current-prefix-arg)) |
| 2577 | (unless arg (ispell-accept-buffer-local-defs)) | 2573 | (unless arg (ispell-buffer-local-dict)) |
| 2578 | (if (equal dict "default") (setq dict nil)) | 2574 | (if (equal dict "default") (setq dict nil)) |
| 2579 | ;; This relies on completing-read's bug of returning "" for no match | 2575 | ;; This relies on completing-read's bug of returning "" for no match |
| 2580 | (cond ((equal dict "") | 2576 | (cond ((equal dict "") |
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 04cd080db8f..cb002731eec 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2006-02-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * url.el (url-redirect-buffer): New var. | ||
| 4 | (url-retrieve-synchronously): Use it to follow redirections. | ||
| 5 | |||
| 6 | * url-http.el: Require `url' rather than try to autoload parts of it. | ||
| 7 | (url-http-find-free-connection): `url-open-stream' needs a real buffer. | ||
| 8 | (url-http-parse-headers): Set `url-redirect-buffer' when following | ||
| 9 | a redirection reply. | ||
| 10 | |||
| 1 | 2006-01-18 Stefan Monnier <monnier@iro.umontreal.ca> | 11 | 2006-01-18 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 12 | ||
| 3 | * url-news.el: Move defvars out of eval-when-compile. | 13 | * url-news.el: Move defvars out of eval-when-compile. |
| @@ -18,7 +28,7 @@ | |||
| 18 | (url-history-save-history): Create parent dir if necessary. | 28 | (url-history-save-history): Create parent dir if necessary. |
| 19 | (url-history-save-history): Don't write the initialization of | 29 | (url-history-save-history): Don't write the initialization of |
| 20 | url-history-hash-table into the history file. | 30 | url-history-hash-table into the history file. |
| 21 | (url-have-visited-url): Simplify since url-history-hash-table is non-nil. | 31 | (url-have-visited-url): Simplify since url-history-hash-table isn't nil. |
| 22 | (url-completion-function): Simplify. | 32 | (url-completion-function): Simplify. |
| 23 | 33 | ||
| 24 | * url-cookie.el (url-cookie-parse-file): Don't complain of missing file. | 34 | * url-cookie.el (url-cookie-parse-file): Don't complain of missing file. |
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index ac8f490f3e8..22ca6010ef9 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; url-http.el --- HTTP retrieval routines | 1 | ;;; url-http.el --- HTTP retrieval routines |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1999, 2001, 2004, 2005, 2006 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1999, 2001, 2004, 2005, 2006 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Bill Perry <wmperry@gnu.org> | 5 | ;; Author: Bill Perry <wmperry@gnu.org> |
| 6 | ;; Keywords: comm, data, processes | 6 | ;; Keywords: comm, data, processes |
| @@ -35,10 +35,8 @@ | |||
| 35 | (require 'url-cookie) | 35 | (require 'url-cookie) |
| 36 | (require 'mail-parse) | 36 | (require 'mail-parse) |
| 37 | (require 'url-auth) | 37 | (require 'url-auth) |
| 38 | (autoload 'url-retrieve-synchronously "url") | 38 | (require 'url) |
| 39 | (autoload 'url-retrieve "url") | ||
| 40 | (autoload 'url-cache-create-filename "url-cache") | 39 | (autoload 'url-cache-create-filename "url-cache") |
| 41 | (autoload 'url-mark-buffer-as-dead "url") | ||
| 42 | 40 | ||
| 43 | (defconst url-http-default-port 80 "Default HTTP port.") | 41 | (defconst url-http-default-port 80 "Default HTTP port.") |
| 44 | (defconst url-http-asynchronous-p t "HTTP retrievals are asynchronous.") | 42 | (defconst url-http-asynchronous-p t "HTTP retrievals are asynchronous.") |
| @@ -57,15 +55,13 @@ Valid values are 1.1 and 1.0. | |||
| 57 | This is only useful when debugging the HTTP subsystem. | 55 | This is only useful when debugging the HTTP subsystem. |
| 58 | 56 | ||
| 59 | Setting this to 1.0 will tell servers not to send chunked encoding, | 57 | Setting this to 1.0 will tell servers not to send chunked encoding, |
| 60 | and other HTTP/1.1 specific features. | 58 | and other HTTP/1.1 specific features.") |
| 61 | ") | ||
| 62 | 59 | ||
| 63 | (defvar url-http-attempt-keepalives t | 60 | (defvar url-http-attempt-keepalives t |
| 64 | "Whether to use a single TCP connection multiple times in HTTP. | 61 | "Whether to use a single TCP connection multiple times in HTTP. |
| 65 | This is only useful when debugging the HTTP subsystem. Setting to | 62 | This is only useful when debugging the HTTP subsystem. Setting to |
| 66 | `nil' will explicitly close the connection to the server after every | 63 | nil will explicitly close the connection to the server after every |
| 67 | request. | 64 | request.") |
| 68 | ") | ||
| 69 | 65 | ||
| 70 | ;(eval-when-compile | 66 | ;(eval-when-compile |
| 71 | ;; These are all macros so that they are hidden from external sight | 67 | ;; These are all macros so that they are hidden from external sight |
| @@ -119,10 +115,14 @@ request. | |||
| 119 | (url-http-debug "Reusing existing connection: %s:%d" host port) | 115 | (url-http-debug "Reusing existing connection: %s:%d" host port) |
| 120 | (url-http-debug "Contacting host: %s:%d" host port)) | 116 | (url-http-debug "Contacting host: %s:%d" host port)) |
| 121 | (url-lazy-message "Contacting host: %s:%d" host port) | 117 | (url-lazy-message "Contacting host: %s:%d" host port) |
| 122 | (url-http-mark-connection-as-busy host port | 118 | (url-http-mark-connection-as-busy |
| 123 | (or found | 119 | host port |
| 124 | (url-open-stream host nil host | 120 | (or found |
| 125 | port))))) | 121 | (let ((buf (generate-new-buffer " *url-http-temp*"))) |
| 122 | ;; `url-open-stream' needs a buffer in which to do things | ||
| 123 | ;; like authentication. But we use another buffer afterwards. | ||
| 124 | (unwind-protect (url-open-stream host buf host port) | ||
| 125 | (kill-buffer buf))))))) | ||
| 126 | 126 | ||
| 127 | ;; Building an HTTP request | 127 | ;; Building an HTTP request |
| 128 | (defun url-http-user-agent-string () | 128 | (defun url-http-user-agent-string () |
| @@ -346,7 +346,7 @@ This allows us to use `mail-fetch-field', etc." | |||
| 346 | 346 | ||
| 347 | (defun url-http-handle-cookies () | 347 | (defun url-http-handle-cookies () |
| 348 | "Handle all set-cookie / set-cookie2 headers in an HTTP response. | 348 | "Handle all set-cookie / set-cookie2 headers in an HTTP response. |
| 349 | The buffer must already be narrowed to the headers, so mail-fetch-field will | 349 | The buffer must already be narrowed to the headers, so `mail-fetch-field' will |
| 350 | work correctly." | 350 | work correctly." |
| 351 | (let ((cookies (mail-fetch-field "Set-Cookie" nil nil t)) | 351 | (let ((cookies (mail-fetch-field "Set-Cookie" nil nil t)) |
| 352 | (cookies2 (mail-fetch-field "Set-Cookie2" nil nil t)) | 352 | (cookies2 (mail-fetch-field "Set-Cookie2" nil nil t)) |
| @@ -509,10 +509,17 @@ should be shown to the user." | |||
| 509 | (let ((url-request-method url-http-method) | 509 | (let ((url-request-method url-http-method) |
| 510 | (url-request-data url-http-data) | 510 | (url-request-data url-http-data) |
| 511 | (url-request-extra-headers url-http-extra-headers)) | 511 | (url-request-extra-headers url-http-extra-headers)) |
| 512 | (url-retrieve redirect-uri url-callback-function | 512 | ;; Put in the current buffer a forwarding pointer to the new |
| 513 | (cons :redirect | 513 | ;; destination buffer. |
| 514 | (cons redirect-uri | 514 | ;; FIXME: This is a hack to fix url-retrieve-synchronously |
| 515 | url-callback-arguments))) | 515 | ;; without changing the API. Instead url-retrieve should |
| 516 | ;; either simply not return the "destination" buffer, or it | ||
| 517 | ;; should take an optional `dest-buf' argument. | ||
| 518 | (set (make-local-variable 'url-redirect-buffer) | ||
| 519 | (url-retrieve redirect-uri url-callback-function | ||
| 520 | (cons :redirect | ||
| 521 | (cons redirect-uri | ||
| 522 | url-callback-arguments)))) | ||
| 516 | (url-mark-buffer-as-dead (current-buffer)))))) | 523 | (url-mark-buffer-as-dead (current-buffer)))))) |
| 517 | (4 ; Client error | 524 | (4 ; Client error |
| 518 | ;; 400 Bad Request | 525 | ;; 400 Bad Request |
| @@ -1156,7 +1163,7 @@ CBARGS as the arguments." | |||
| 1156 | 1163 | ||
| 1157 | ;;;###autoload | 1164 | ;;;###autoload |
| 1158 | (defun url-http-options (url) | 1165 | (defun url-http-options (url) |
| 1159 | "Returns a property list describing options available for URL. | 1166 | "Return a property list describing options available for URL. |
| 1160 | This list is retrieved using the `OPTIONS' HTTP method. | 1167 | This list is retrieved using the `OPTIONS' HTTP method. |
| 1161 | 1168 | ||
| 1162 | Property list members: | 1169 | Property list members: |
| @@ -1179,8 +1186,7 @@ p3p | |||
| 1179 | The `Platform For Privacy Protection' description for the resource. | 1186 | The `Platform For Privacy Protection' description for the resource. |
| 1180 | Currently this is just the raw header contents. This is likely to | 1187 | Currently this is just the raw header contents. This is likely to |
| 1181 | change once P3P is formally supported by the URL package or | 1188 | change once P3P is formally supported by the URL package or |
| 1182 | Emacs/W3. | 1189 | Emacs/W3." |
| 1183 | " | ||
| 1184 | (let* ((url-request-method "OPTIONS") | 1190 | (let* ((url-request-method "OPTIONS") |
| 1185 | (url-request-data nil) | 1191 | (url-request-data nil) |
| 1186 | (buffer (url-retrieve-synchronously url)) | 1192 | (buffer (url-retrieve-synchronously url)) |
diff --git a/lisp/url/url.el b/lisp/url/url.el index 10c449cb30b..07ac55dcd3d 100644 --- a/lisp/url/url.el +++ b/lisp/url/url.el | |||
| @@ -114,6 +114,13 @@ Emacs." | |||
| 114 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 114 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 115 | ;;; Retrieval functions | 115 | ;;; Retrieval functions |
| 116 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 116 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 117 | |||
| 118 | (defvar url-redirect-buffer nil | ||
| 119 | "New buffer into which the retrieval will take place. | ||
| 120 | Sometimes while retrieving a URL, the URL library needs to use another buffer | ||
| 121 | than the one returned initially by `url-retrieve'. In this case, it sets this | ||
| 122 | variable in the original buffer as a forwarding pointer.") | ||
| 123 | |||
| 117 | ;;;###autoload | 124 | ;;;###autoload |
| 118 | (defun url-retrieve (url callback &optional cbargs) | 125 | (defun url-retrieve (url callback &optional cbargs) |
| 119 | "Retrieve URL asynchronously and call CALLBACK with CBARGS when finished. | 126 | "Retrieve URL asynchronously and call CALLBACK with CBARGS when finished. |
| @@ -189,18 +196,22 @@ no further processing). URL is either a string or a parsed URL." | |||
| 189 | (url-debug 'retrieval | 196 | (url-debug 'retrieval |
| 190 | "Spinning in url-retrieve-synchronously: %S (%S)" | 197 | "Spinning in url-retrieve-synchronously: %S (%S)" |
| 191 | retrieval-done asynch-buffer) | 198 | retrieval-done asynch-buffer) |
| 192 | (if (and proc (memq (process-status proc) | 199 | (if (buffer-local-value 'url-redirect-buffer asynch-buffer) |
| 193 | '(closed exit signal failed)) | 200 | (setq proc (get-buffer-process |
| 194 | ;; Make sure another process hasn't been started, as can | 201 | (setq asynch-buffer |
| 195 | ;; happen with http redirections. | 202 | (buffer-local-value 'url-redirect-buffer |
| 196 | (eq proc (or (get-buffer-process asynch-buffer) proc))) | 203 | asynch-buffer)))) |
| 197 | ;; FIXME: It's not clear whether url-retrieve's callback is | 204 | (if (and proc (memq (process-status proc) |
| 198 | ;; guaranteed to be called or not. It seems that url-http | 205 | '(closed exit signal failed)) |
| 199 | ;; decides sometimes consciously not to call it, so it's not | 206 | ;; Make sure another process hasn't been started. |
| 200 | ;; clear that it's a bug, but even then we need to decide how | 207 | (eq proc (or (get-buffer-process asynch-buffer) proc))) |
| 201 | ;; url-http can then warn us that the download has completed. | 208 | ;; FIXME: It's not clear whether url-retrieve's callback is |
| 202 | ;; In the mean time, we use this here workaround. | 209 | ;; guaranteed to be called or not. It seems that url-http |
| 203 | (setq retrieval-done t) | 210 | ;; decides sometimes consciously not to call it, so it's not |
| 211 | ;; clear that it's a bug, but even then we need to decide how | ||
| 212 | ;; url-http can then warn us that the download has completed. | ||
| 213 | ;; In the mean time, we use this here workaround. | ||
| 214 | (setq retrieval-done t)) | ||
| 204 | ;; We used to use `sit-for' here, but in some cases it wouldn't | 215 | ;; We used to use `sit-for' here, but in some cases it wouldn't |
| 205 | ;; work because apparently pending keyboard input would always | 216 | ;; work because apparently pending keyboard input would always |
| 206 | ;; interrupt it before it got a chance to handle process input. | 217 | ;; interrupt it before it got a chance to handle process input. |