diff options
| author | Miles Bader | 2006-03-03 07:48:46 +0000 |
|---|---|---|
| committer | Miles Bader | 2006-03-03 07:48:46 +0000 |
| commit | d2ad6275c8b11d33d6bbfa9359420d534aa641bc (patch) | |
| tree | 5cf31f082f04af6e24b8d6907583ce257ec2d5ea | |
| parent | b2ed9e82ab8f37303692290f4e0d03ea61ee13f5 (diff) | |
| parent | 719120eff4b070687d146d70133f5f73cc8fe5c4 (diff) | |
| download | emacs-d2ad6275c8b11d33d6bbfa9359420d534aa641bc.tar.gz emacs-d2ad6275c8b11d33d6bbfa9359420d534aa641bc.zip | |
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-34
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 123-134)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 40-48)
- Merge from emacs--devo--0
- Update from CVS
- Munge arch explicit ids in etc/images to match Emacs
65 files changed, 2242 insertions, 791 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 24d746e1391..3f035d1d55a 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE | |||
| @@ -31,15 +31,22 @@ and KDE projects, to use the new Emacs icons in etc/images/icons. | |||
| 31 | ** Ensure MH-E 8.0 has been released. | 31 | ** Ensure MH-E 8.0 has been released. |
| 32 | Assigned to Bill Wohler <wohler@newt.com>. | 32 | Assigned to Bill Wohler <wohler@newt.com>. |
| 33 | 33 | ||
| 34 | * NEW FEATURES | ||
| 35 | |||
| 36 | * BUGS | 34 | * BUGS |
| 37 | 35 | ||
| 38 | ** Reiner Steib's 23 Jan 2006 bug report that tool bar icons don't update. | 36 | ** Reiner Steib's 23 Jan 2006 bug report that tool bar icons don't update. |
| 39 | URL/MID: http://mid.gmane.org/v9acdmrcse.fsf@marauder.physik.uni-ulm.de | 37 | URL/MID: http://mid.gmane.org/v9acdmrcse.fsf@marauder.physik.uni-ulm.de |
| 40 | 38 | ||
| 41 | ** Ralf Angeli's 4 Jul 2005 bug report about scroll-preserve-screen-position. | 39 | ** Problems with moving point across invisible text, |
| 42 | URL/MID: http://mid.gmane.org/877jg6o7k4.fsf@neutrino.iwi.uni-sb.de | 40 | including Ralf Angeli's 21 Feb bug report |
| 41 | and Martin Rudalics' 14 Feb bug report "Re: moving point and invisible text" | ||
| 42 | |||
| 43 | ** Markus Gritsch's report about Emacs looping on Windoze with the following | ||
| 44 | .emacs file, and then reduce Emacs frame width to "something quite narrow": | ||
| 45 | (setq-default truncate-lines t) | ||
| 46 | (custom-set-variables | ||
| 47 | '(hscroll-margin 20) | ||
| 48 | '(hscroll-step 1) | ||
| 49 | ) | ||
| 43 | 50 | ||
| 44 | ** TCP server processes do not work on Windows. | 51 | ** TCP server processes do not work on Windows. |
| 45 | 52 | ||
diff --git a/etc/gnus-tut.txt b/etc/gnus-tut.txt index 5dd26f1dfc5..43a1f647488 100644 --- a/etc/gnus-tut.txt +++ b/etc/gnus-tut.txt | |||
| @@ -223,7 +223,7 @@ want this is beyond me, but here goes: | |||
| 223 | 223 | ||
| 224 | Create the group by saying | 224 | Create the group by saying |
| 225 | 225 | ||
| 226 | `M-a my.virtual.newsgroup<RET>nnvirtual<RET>^rec\.aquaria\.*<RET>' | 226 | `G m my.virtual.newsgroup<RET>nnvirtual<RET>^rec\.aquaria\.*<RET>' |
| 227 | 227 | ||
| 228 | This will create the group "nnvirtual:my.virtual.newsgroup", which | 228 | This will create the group "nnvirtual:my.virtual.newsgroup", which |
| 229 | will collect all articles from all the groups in the "rec.aquaria" | 229 | will collect all articles from all the groups in the "rec.aquaria" |
diff --git a/etc/orgcard.tex b/etc/orgcard.tex index 75ff98514b5..1e39ea23327 100644 --- a/etc/orgcard.tex +++ b/etc/orgcard.tex | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | % Reference Card for Org Mode 4.06 | 1 | % Reference Card for Org Mode 4.07 |
| 2 | % | 2 | % |
| 3 | %**start of header | 3 | %**start of header |
| 4 | \newcount\columnsperpage | 4 | \newcount\columnsperpage |
| @@ -58,7 +58,7 @@ | |||
| 58 | % Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik | 58 | % Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik |
| 59 | % for their many good ideas. | 59 | % for their many good ideas. |
| 60 | 60 | ||
| 61 | \def\orgversionnumber{4.06} | 61 | \def\orgversionnumber{4.07} |
| 62 | \def\year{2006} | 62 | \def\year{2006} |
| 63 | 63 | ||
| 64 | \def\shortcopyrightnotice{\vskip 1ex plus 2 fill | 64 | \def\shortcopyrightnotice{\vskip 1ex plus 2 fill |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7725ded39fd..5ec54b1da30 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,149 @@ | |||
| 1 | 2006-03-02 Carsten Dominik <dominik@science.uva.nl> | ||
| 2 | |||
| 3 | * textmodes/org.el (org-paste-subtree): Removed forgotten (debug) | ||
| 4 | form. | ||
| 5 | |||
| 6 | 2006-03-02 Nick Roberts <nickrob@snap.net.nz> | ||
| 7 | |||
| 8 | * dframe.el (dframe-frame-mode): Don't burp when menu-bar-lines | ||
| 9 | is nil. | ||
| 10 | |||
| 11 | * progmodes/gud.el (gud-speedbar-menu-items): Use | ||
| 12 | buffer-local-value and add missing :visible keyword. | ||
| 13 | |||
| 14 | * progmodes/gdb-ui.el (gdb-speedbar-refresh): Quieten | ||
| 15 | speedbar-refresh. | ||
| 16 | |||
| 17 | 2006-03-01 Carsten Dominik <dominik@science.uva.nl> | ||
| 18 | |||
| 19 | * textmodes/reftex-index.el (reftex-index-map): `follow-mouse' | ||
| 20 | must be `follow-link'. | ||
| 21 | |||
| 22 | * textmodes/reftex-toc.el (reftex-toc-map): `follow-mouse' must be | ||
| 23 | `follow-link'. | ||
| 24 | |||
| 25 | * textmodes/org.el (org-export-as-html): Fix bugs in HTML | ||
| 26 | formatting: No nested anchors. | ||
| 27 | (org-all-targets): Fix bug with XEmacs compatibility. | ||
| 28 | (org-read-date): Add (require 'parse-time). | ||
| 29 | (org-set-tags): Fix bug with extra inserted space. | ||
| 30 | (org-export-html-style): Define a style class for targets. | ||
| 31 | (org-agenda-keymap, org-mouse-map): Add a binding for | ||
| 32 | `follow-link'. | ||
| 33 | (org-hide-leading-stars): New option. | ||
| 34 | (org-hide): New face. | ||
| 35 | (org-set-font-lock-defaults): Allow to hide leading stars. | ||
| 36 | (org-get-legal-level, org-tr-level): New functions. | ||
| 37 | (org-odd-levels-only): New option. | ||
| 38 | (org-level-faces, org-paste-subtree, org-convert-to-odd-levels) | ||
| 39 | (org-demote, org-promote): Deal with double-star levels. | ||
| 40 | (org-convert-to-odd-levels): New command. | ||
| 41 | |||
| 42 | 2006-03-01 Nick Roberts <nickrob@snap.net.nz> | ||
| 43 | |||
| 44 | * speedbar.el (speedbar-update-localized-contents): Try to | ||
| 45 | preserve window-start. | ||
| 46 | (speedbar-update-directory-contents): Try to preserve window-start | ||
| 47 | and window-point. | ||
| 48 | (speedbar-update-special-contents): Don't move back to start of | ||
| 49 | window. | ||
| 50 | |||
| 51 | * progmodes/gdb-ui.el (gdb-speedbar-refresh): Rename from | ||
| 52 | gdb-speedbar-timer-fn. Use speedbar-refresh instead of | ||
| 53 | speedbar-timer-fn | ||
| 54 | (gdb-var-update-handler, gdb-var-update-handler-1): Use it. | ||
| 55 | (gdb-speedbar-expand-node): Use speedbar-delete-subblock | ||
| 56 | instead of gdb-speedbar-timer-fn. | ||
| 57 | |||
| 58 | 2006-02-28 Jay Belanger <belanger@truman.edu> | ||
| 59 | |||
| 60 | * calc/calccomp.el (math-compose-tex-matrix): Add a latex option. | ||
| 61 | (math-compose-expr): Use latex option when calling | ||
| 62 | `math-compose-tex-matrix' for latex mode. | ||
| 63 | |||
| 64 | 2006-02-28 Nick Roberts <nickrob@snap.net.nz> | ||
| 65 | |||
| 66 | * speedbar.el: Re-instate comments about developing for speedbar | ||
| 67 | [this is what info and gdb-ui use even if better methods exist now]. | ||
| 68 | |||
| 69 | * t-mouse.el: New file. | ||
| 70 | (t-mouse-tty): Use with-temp-buffer. Add more terminal types. | ||
| 71 | (t-mouse-lispy-buffer-posn-from-coords): Remove. Use the C | ||
| 72 | primitive... | ||
| 73 | (t-mouse-make-event-element): ...posn-at-x-y instead. | ||
| 74 | (t-mouse-make-event): Deal with Fedora Core 3. | ||
| 75 | (t-mouse-make-event): Don't sink the `stupid text mode menubar'. | ||
| 76 | (t-mouse-mouse-position-function): New function. Use it instead | ||
| 77 | of advising mouse-position. | ||
| 78 | (t-mouse-mode): New minor mode. | ||
| 79 | (t-mouse-stop, t-mouse-run): Remove. Use t-mouse-mode instead. | ||
| 80 | |||
| 81 | 2006-02-27 Glenn Morris <rgm@gnu.org> | ||
| 82 | |||
| 83 | * calendar/calendar.el (calendar-holidays): Doc fix. | ||
| 84 | |||
| 85 | 2006-02-27 Nick Roberts <nickrob@snap.net.nz> | ||
| 86 | |||
| 87 | * progmodes/gdb-ui.el (gdb-source-window): New variable. | ||
| 88 | Re-introduce the concept of a source window. | ||
| 89 | (gdb-get-buffer-create): Rename from gdb-get-create-buffer for | ||
| 90 | consistency with get-buffer-create. | ||
| 91 | (def-gdb-auto-update-handler, gdb-info-locals-handler) | ||
| 92 | (gdb-data-list-register-values-handler) | ||
| 93 | (gdb-stack-list-locals-handler): Try to preserve window-start as | ||
| 94 | well as window-point. | ||
| 95 | (gdb-display-source-buffer): New function (old concept). | ||
| 96 | (gdb-goto-breakpoint): Use it. | ||
| 97 | |||
| 98 | * progmodes/gud.el (gud-display-line): Use gdb-display-source-buffer | ||
| 99 | for gdb-ui/gdb-mi (old concept). | ||
| 100 | |||
| 101 | 2006-02-27 Carsten Dominik <dominik@science.uva.nl> | ||
| 102 | |||
| 103 | * textmodes/reftex-index.el (reftex-index-map): Add `follow-mouse' | ||
| 104 | binding. | ||
| 105 | |||
| 106 | * textmodes/reftex-toc.el (reftex-toc-map): Add `follow-mouse' | ||
| 107 | binding. | ||
| 108 | |||
| 109 | * textmodes/reftex-sel.el (reftex-select-label-map) | ||
| 110 | (reftex-select-bib-map): Add `follow-mouse' binding. | ||
| 111 | |||
| 112 | 2006-02-26 Luc Teirlinck <teirllm@auburn.edu> | ||
| 113 | |||
| 114 | * jka-cmpr-hook.el (jka-compr-compression-info-list) | ||
| 115 | (jka-compr-mode-alist-additions, jka-compr-load-suffixes): | ||
| 116 | Give :set functions to provide automatic updating. | ||
| 117 | Update docstring. Give compiler defvars early in the file | ||
| 118 | and move the defcustoms to a later spot where all called functions | ||
| 119 | are defined. | ||
| 120 | (jka-compr-file-name-handler-entry): Doc fix. | ||
| 121 | (jka-compr-compression-info-list--internal) | ||
| 122 | (jka-compr-mode-alist-additions--internal) | ||
| 123 | (jka-compr-load-suffixes--internal): New variables. | ||
| 124 | (jka-compr-install): Set the three above variables. | ||
| 125 | Update `load-file-rep-suffixes' instead of `load-suffixes'. | ||
| 126 | (jka-compr-update, jka-compr-set): New functions. | ||
| 127 | (auto-compression-mode): Doc fix. | ||
| 128 | |||
| 129 | * jka-compr.el (jka-compr-uninstall): Replace `mapcar' with `mapc'. | ||
| 130 | Update `load-file-rep-suffixes' instead of `load-suffixes'. | ||
| 131 | Use jka-compr-compression-info-list--internal, | ||
| 132 | jka-compr-mode-alist-additions--internal and | ||
| 133 | jka-compr-load-suffixes--internal. | ||
| 134 | |||
| 135 | * files.el (load-library): | ||
| 136 | * loadhist.el (file-loadhist-lookup): | ||
| 137 | * startup.el (command-line): | ||
| 138 | * subr.el (locate-library): | ||
| 139 | * emacs-lisp/autoload.el (update-directory-autoloads): | ||
| 140 | * emacs-lisp/find-func.el (find-library-suffixes): Use | ||
| 141 | `get-load-suffixes' instead of `load-suffixes'. | ||
| 142 | |||
| 143 | * subr.el (locate-library): | ||
| 144 | * emacs-lisp/find-func.el (find-library-name): Use | ||
| 145 | `load-file-rep-suffixes' instead of '(""). | ||
| 146 | |||
| 1 | 2006-02-26 Kim F. Storm <storm@cua.dk> | 147 | 2006-02-26 Kim F. Storm <storm@cua.dk> |
| 2 | 148 | ||
| 3 | * ido.el (ido-save-history, ido-load-history): Simplify. Don't | 149 | * ido.el (ido-save-history, ido-load-history): Simplify. Don't |
| @@ -20,7 +166,7 @@ | |||
| 20 | 166 | ||
| 21 | 2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org> | 167 | 2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org> |
| 22 | 168 | ||
| 23 | * progmodes/cc-mode.el (c-postprocess-file-styles): bind | 169 | * progmodes/cc-mode.el (c-postprocess-file-styles): Bind |
| 24 | inhibit-read-only to t, around the call to | 170 | inhibit-read-only to t, around the call to |
| 25 | c-remove-any-local-eval-or-mode-variables, so that it works on a | 171 | c-remove-any-local-eval-or-mode-variables, so that it works on a |
| 26 | RO file. | 172 | RO file. |
| @@ -53,8 +199,8 @@ | |||
| 53 | * progmodes/cc-mode.el: File Local variables: Solve the problem | 199 | * progmodes/cc-mode.el: File Local variables: Solve the problem |
| 54 | where both `mode' and c-file-offsets are specified: `mode' will | 200 | where both `mode' and c-file-offsets are specified: `mode' will |
| 55 | overwrite c-f-o's settings: | 201 | overwrite c-f-o's settings: |
| 56 | (c-remove-any-local-eval-or-mode-variables): new function. | 202 | (c-remove-any-local-eval-or-mode-variables): New function. |
| 57 | (c-postprocess-file-styles): call the above new function, within | 203 | (c-postprocess-file-styles): Call the above new function, within |
| 58 | c-tentative-buffer-change, to splat `mode' and `eval' before the | 204 | c-tentative-buffer-change, to splat `mode' and `eval' before the |
| 59 | second hack-local-variables. | 205 | second hack-local-variables. |
| 60 | 206 | ||
| @@ -93,15 +239,15 @@ | |||
| 93 | Sometimes, c-s-i got separated from the mode name on the mode | 239 | Sometimes, c-s-i got separated from the mode name on the mode |
| 94 | line. | 240 | line. |
| 95 | 241 | ||
| 96 | * progmodes/cc-cmds.el (c-electric-brace, c-electric-semi&comma, | 242 | * progmodes/cc-cmds.el (c-electric-brace, c-electric-semi&comma) |
| 97 | c-electric-colon): Correct doc-strings: "/ln" -> "/la". | 243 | (c-electric-colon): Correct doc-strings: "/ln" -> "/la". |
| 98 | 244 | ||
| 99 | 2006-02-24 Martin Stjernholm <bug-cc-mode@gnu.org> | 245 | 2006-02-24 Martin Stjernholm <bug-cc-mode@gnu.org> |
| 100 | 246 | ||
| 101 | * progmodes/cc-langs.el (c-make-init-lang-vars-fun): Improved the | 247 | * progmodes/cc-langs.el (c-make-init-lang-vars-fun): Improve the |
| 102 | error message when there's an evaluation error to show whether | 248 | error message when there's an evaluation error to show whether |
| 103 | it's loaded from source or not. | 249 | it's loaded from source or not. |
| 104 | (c-filter-ops): Made it available at runtime too to work when | 250 | (c-filter-ops): Make it available at runtime too to work when |
| 105 | `c-make-init-lang-vars-fun' needs to evaluate from source. | 251 | `c-make-init-lang-vars-fun' needs to evaluate from source. |
| 106 | 252 | ||
| 107 | 2006-02-24 Juanma Barranquero <lekktu@gmail.com> | 253 | 2006-02-24 Juanma Barranquero <lekktu@gmail.com> |
| @@ -182,6 +328,11 @@ | |||
| 182 | * textmodes/reftex.el (reftex-locate-file): Search all extensions | 328 | * textmodes/reftex.el (reftex-locate-file): Search all extensions |
| 183 | if `reftex-try-all-extensions' is set. | 329 | if `reftex-try-all-extensions' is set. |
| 184 | 330 | ||
| 331 | * textmodes/reftex-dcr.el (reftex-view-crossref): New argument to | ||
| 332 | fail silently when there is no valid argument at point. | ||
| 333 | (reftex-view-crossref-when-idle): Call `reftex-view-crossref' with | ||
| 334 | `fail-silently' argument. From a patch by David Reiter. | ||
| 335 | |||
| 185 | * textmodes/org.el (org-mark-ring-push, org-mark-ring-goto): | 336 | * textmodes/org.el (org-mark-ring-push, org-mark-ring-goto): |
| 186 | New commands. | 337 | New commands. |
| 187 | (org-mark-ring): New variable. | 338 | (org-mark-ring): New variable. |
diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index 548fe83882d..9b5eab5b133 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el | |||
| @@ -286,10 +286,10 @@ | |||
| 286 | (> calc-language-option 1) | 286 | (> calc-language-option 1) |
| 287 | (< calc-language-option -1))) | 287 | (< calc-language-option -1))) |
| 288 | (append '(vleft 0 "\\begin{pmatrix}") | 288 | (append '(vleft 0 "\\begin{pmatrix}") |
| 289 | (math-compose-tex-matrix (cdr a)) | 289 | (math-compose-tex-matrix (cdr a) t) |
| 290 | '("\\end{pmatrix}")) | 290 | '("\\end{pmatrix}")) |
| 291 | (append '(horiz "\\begin{pmatrix} ") | 291 | (append '(horiz "\\begin{pmatrix} ") |
| 292 | (math-compose-tex-matrix (cdr a)) | 292 | (math-compose-tex-matrix (cdr a) t) |
| 293 | '(" \\end{pmatrix}"))) | 293 | '(" \\end{pmatrix}"))) |
| 294 | (if (and (eq calc-language 'eqn) | 294 | (if (and (eq calc-language 'eqn) |
| 295 | (math-matrixp a)) | 295 | (math-matrixp a)) |
| @@ -1015,10 +1015,11 @@ | |||
| 1015 | (math-compose-expr (car a) math-comp-vector-prec) | 1015 | (math-compose-expr (car a) math-comp-vector-prec) |
| 1016 | (concat " " math-comp-right-bracket))))) | 1016 | (concat " " math-comp-right-bracket))))) |
| 1017 | 1017 | ||
| 1018 | (defun math-compose-tex-matrix (a) | 1018 | (defun math-compose-tex-matrix (a &optional ltx) |
| 1019 | (if (cdr a) | 1019 | (if (cdr a) |
| 1020 | (cons (append (math-compose-vector (cdr (car a)) " & " 0) '(" \\\\ ")) | 1020 | (cons (append (math-compose-vector (cdr (car a)) " & " 0) |
| 1021 | (math-compose-tex-matrix (cdr a))) | 1021 | (if ltx '(" \\\\ ") '(" \\cr "))) |
| 1022 | (math-compose-tex-matrix (cdr a) ltx)) | ||
| 1022 | (list (math-compose-vector (cdr (car a)) " & " 0)))) | 1023 | (list (math-compose-vector (cdr (car a)) " & " 0)))) |
| 1023 | 1024 | ||
| 1024 | (defun math-compose-eqn-matrix (a) | 1025 | (defun math-compose-eqn-matrix (a) |
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index b48f63458dc..9516e02c5e1 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1190,9 +1190,16 @@ list `other-holidays' in your .emacs file. Similarly, by setting any | |||
| 1190 | of `general-holidays', `local-holidays' `christian-holidays', | 1190 | of `general-holidays', `local-holidays' `christian-holidays', |
| 1191 | `hebrew-holidays', `islamic-holidays', `bahai-holidays', | 1191 | `hebrew-holidays', `islamic-holidays', `bahai-holidays', |
| 1192 | `oriental-holidays', or `solar-holidays' to nil in your .emacs file, | 1192 | `oriental-holidays', or `solar-holidays' to nil in your .emacs file, |
| 1193 | you can eliminate unwanted categories of holidays. The intention is | 1193 | you can eliminate unwanted categories of holidays. |
| 1194 | that (in the US) `local-holidays' be set in site-init.el and | 1194 | |
| 1195 | `other-holidays' be set by the user. | 1195 | Note that these variables are only used to initialize the default |
| 1196 | value of `calendar-holidays'. In other words, they only have an | ||
| 1197 | effect on the displayed holidays if set before the calendar is | ||
| 1198 | loaded. After the calendar has been loaded, you must customize | ||
| 1199 | `calendar-holidays' directly. | ||
| 1200 | |||
| 1201 | The intention is that (in the US) `local-holidays' be set in | ||
| 1202 | site-init.el and `other-holidays' be set by the user. | ||
| 1196 | 1203 | ||
| 1197 | Entries on the list are expressions that return (possibly empty) lists of | 1204 | Entries on the list are expressions that return (possibly empty) lists of |
| 1198 | items of the form ((month day year) string) of a holiday in the in the | 1205 | items of the form ((month day year) string) of a holiday in the in the |
diff --git a/lisp/dframe.el b/lisp/dframe.el index e238a469dd5..f77a5059026 100644 --- a/lisp/dframe.el +++ b/lisp/dframe.el | |||
| @@ -422,7 +422,7 @@ CREATE-HOOK are hooks to run after creating a frame." | |||
| 422 | parameters | 422 | parameters |
| 423 | (append | 423 | (append |
| 424 | parameters | 424 | parameters |
| 425 | (list (cons 'height (+ mh (frame-height))))))) | 425 | (list (cons 'height (+ (or mh 0) (frame-height))))))) |
| 426 | (params | 426 | (params |
| 427 | ;; Only add a guessed width if one is not specified | 427 | ;; Only add a guessed width if one is not specified |
| 428 | ;; in the input parameters. | 428 | ;; in the input parameters. |
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index d6477b854a1..ee2d74c5646 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -512,7 +512,7 @@ The function does NOT recursively descend into subdirectories of the | |||
| 512 | directory or directories specified." | 512 | directory or directories specified." |
| 513 | (interactive "DUpdate autoloads from directory: ") | 513 | (interactive "DUpdate autoloads from directory: ") |
| 514 | (let* ((files-re (let ((tmp nil)) | 514 | (let* ((files-re (let ((tmp nil)) |
| 515 | (dolist (suf load-suffixes | 515 | (dolist (suf (get-load-suffixes) |
| 516 | (concat "^[^=.].*" (regexp-opt tmp t) "\\'")) | 516 | (concat "^[^=.].*" (regexp-opt tmp t) "\\'")) |
| 517 | (unless (string-match "\\.elc" suf) (push suf tmp))))) | 517 | (unless (string-match "\\.elc" suf) (push suf tmp))))) |
| 518 | (files (apply 'nconc | 518 | (files (apply 'nconc |
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 8776d4522c2..4f961df0791 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -142,7 +142,7 @@ See the functions `find-function' and `find-variable'." | |||
| 142 | 142 | ||
| 143 | (defun find-library-suffixes () | 143 | (defun find-library-suffixes () |
| 144 | (let ((suffixes nil)) | 144 | (let ((suffixes nil)) |
| 145 | (dolist (suffix load-suffixes (nreverse suffixes)) | 145 | (dolist (suffix (get-load-suffixes) (nreverse suffixes)) |
| 146 | (unless (string-match "elc" suffix) (push suffix suffixes))))) | 146 | (unless (string-match "elc" suffix) (push suffix suffixes))))) |
| 147 | 147 | ||
| 148 | (defun find-library-name (library) | 148 | (defun find-library-name (library) |
| @@ -153,7 +153,7 @@ See the functions `find-function' and `find-variable'." | |||
| 153 | (setq library (replace-match "" t t library))) | 153 | (setq library (replace-match "" t t library))) |
| 154 | (or (locate-file library | 154 | (or (locate-file library |
| 155 | (or find-function-source-path load-path) | 155 | (or find-function-source-path load-path) |
| 156 | (append (find-library-suffixes) '(""))) | 156 | (append (find-library-suffixes) load-file-rep-suffixes)) |
| 157 | (error "Can't find library %s" library))) | 157 | (error "Can't find library %s" library))) |
| 158 | 158 | ||
| 159 | (defvar find-function-C-source-directory | 159 | (defvar find-function-C-source-directory |
diff --git a/lisp/files.el b/lisp/files.el index ab69c7958a9..db3309fcf0a 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -699,7 +699,7 @@ This is an interface to the function `load'." | |||
| 699 | (interactive | 699 | (interactive |
| 700 | (list (completing-read "Load library: " | 700 | (list (completing-read "Load library: " |
| 701 | 'locate-file-completion | 701 | 'locate-file-completion |
| 702 | (cons load-path load-suffixes)))) | 702 | (cons load-path (get-load-suffixes))))) |
| 703 | (load library)) | 703 | (load library)) |
| 704 | 704 | ||
| 705 | (defun file-remote-p (file) | 705 | (defun file-remote-p (file) |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 87327dde482..dce2a5ae07f 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,66 @@ | |||
| 1 | 2006-03-03 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * mm-decode.el (mm-get-part): Don't use | ||
| 4 | mm-with-unibyte-current-buffer. | ||
| 5 | |||
| 6 | * gnus-sum.el (gnus-summary-set-display-table): Don't nix out | ||
| 7 | characters 160 through 255 in Emacs 23. | ||
| 8 | |||
| 9 | 2006-03-02 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 10 | |||
| 11 | * mml.el (mml-generate-mime-1): Encode parts other than text/* or | ||
| 12 | message/* containing non-ASCII text properly. | ||
| 13 | |||
| 14 | 2006-02-28 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 15 | |||
| 16 | * mm-util.el (mm-with-unibyte-current-buffer): Add note. | ||
| 17 | |||
| 18 | 2006-02-28 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> | ||
| 19 | |||
| 20 | * nnweb.el (nnweb-gmane-create-mapping): Don't choke on ^M. | ||
| 21 | |||
| 22 | 2006-02-28 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 23 | |||
| 24 | * nnweb.el (nnweb-type-definition, nnweb-gmane-search): Use new | ||
| 25 | nov.php. | ||
| 26 | |||
| 27 | 2006-02-28 Andreas Seltenreich <uwi7@stud.uni-karlsruhe.de> | ||
| 28 | |||
| 29 | * nnweb.el (nnweb-type-definition, nnweb-gmane-create-mapping) | ||
| 30 | (nnweb-gmane-wash-article, nnweb-gmane-search): Fix Gmane web | ||
| 31 | groups. Kudos to Olly Betts <olly@survex.com> for providing NOV | ||
| 32 | output on the server side. | ||
| 33 | (nnweb-google-create-mapping): Update regexps and add some | ||
| 34 | progress indication. | ||
| 35 | |||
| 36 | 2006-02-28 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 37 | |||
| 38 | * message.el (message-user-fqdn): Remove useless * in doc string. | ||
| 39 | |||
| 40 | * gnus-draft.el (gnus-draft-send): Bind message-signature to avoid | ||
| 41 | unnecessary interaction when sending queued mails. Reported by | ||
| 42 | TAKAHASHI Yoshio <tkh@jp.fujitsu.com>. | ||
| 43 | |||
| 44 | 2006-02-28 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 45 | |||
| 46 | * gnus-int.el (gnus-open-server): Respect gnus-batch-mode. | ||
| 47 | Merge of 2006-02-20 change from the trunk. | ||
| 48 | |||
| 49 | 2006-02-28 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 50 | |||
| 51 | * dns.el (query-dns): Protect more against buggy tcp output. | ||
| 52 | Merge of 2006-02-20 change from the trunk. | ||
| 53 | |||
| 54 | 2006-02-27 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 55 | |||
| 56 | * gnus-sum.el (gnus-sequence-of-unread-articles): Return nil if | ||
| 57 | first or last are nil. | ||
| 58 | |||
| 59 | 2006-02-24 Simon Josefsson <jas@extundo.com> | ||
| 60 | |||
| 61 | * flow-fill.el (fill-flowed): Flow-fill unquoted lines too. | ||
| 62 | Merge of 2005-10-26 change from the trunk. | ||
| 63 | |||
| 1 | 2006-02-23 Lars Magne Ingebrigtsen <larsi@gnus.org> | 64 | 2006-02-23 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 65 | ||
| 3 | * flow-fill.el (fill-flowed): Bind adaptive-fill-mode to nil. | 66 | * flow-fill.el (fill-flowed): Bind adaptive-fill-mode to nil. |
| @@ -863,10 +926,9 @@ | |||
| 863 | * pgg-parse.el (top-level): Don't require custom, it is | 926 | * pgg-parse.el (top-level): Don't require custom, it is |
| 864 | autoloaded. (To sync with No Gnus.) | 927 | autoloaded. (To sync with No Gnus.) |
| 865 | 928 | ||
| 866 | 2005-05-09 Simon Josefsson <jas@extundo.com> | 929 | 2005-05-09 Georg C. F. Greve <greve@gnu.org> (tiny change) |
| 867 | 930 | ||
| 868 | * pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Fix PIN caching, | 931 | * pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Fix PIN caching. |
| 869 | tiny patch from "Georg C. F. Greve" <greve@gnu.org>. | ||
| 870 | 932 | ||
| 871 | 2005-10-08 Simon Josefsson <jas@extundo.com> | 933 | 2005-10-08 Simon Josefsson <jas@extundo.com> |
| 872 | 934 | ||
| @@ -2571,11 +2633,13 @@ | |||
| 2571 | 2633 | ||
| 2572 | * deuglify.el (gnus-outlook-deuglify): Add :version. | 2634 | * deuglify.el (gnus-outlook-deuglify): Add :version. |
| 2573 | 2635 | ||
| 2574 | * html2text.el: Beautify code. Improve doc strings. Some checkdoc | 2636 | * html2text.el: Beautify code. Improve doc strings. Some |
| 2575 | cleanup. | 2637 | checkdoc cleanup. |
| 2576 | (html2text-get-attr, html2text-fix-paragraph): Simplify code. | 2638 | (html2text-get-attr, html2text-fix-paragraph): Simplify code. |
| 2577 | (html2text-format-tag-list): Add "strong" and "em". | 2639 | |
| 2578 | From "Alfred M. Szmidt" <ams@kemisten.nu> (tiny change). | 2640 | 2004-11-01 Alfred M. Szmidt <ams@kemisten.nu> (tiny change) |
| 2641 | |||
| 2642 | * html2text.el (html2text-format-tag-list): Add "strong" and "em". | ||
| 2579 | 2643 | ||
| 2580 | 2004-10-29 Katsumi Yamaoka <yamaoka@jpl.org> | 2644 | 2004-10-29 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2581 | 2645 | ||
| @@ -3436,14 +3500,13 @@ | |||
| 3436 | Check `starttls-use-gnutls' and pass on to corresponding *-gnutls | 3500 | Check `starttls-use-gnutls' and pass on to corresponding *-gnutls |
| 3437 | function if it is set. | 3501 | function if it is set. |
| 3438 | 3502 | ||
| 3439 | 2004-08-31 Simon Josefsson <jas@extundo.com> | 3503 | 2004-08-30 Andreas Schwab <schwab@suse.de> |
| 3440 | 3504 | ||
| 3441 | * rfc2231.el (rfc2231-parse-string): Restore whitespace syntax for | 3505 | * rfc2231.el (rfc2231-parse-string): Restore whitespace syntax for |
| 3442 | ?* and ?\; (tiny patch). From Andreas Schwab <schwab@suse.de>. | 3506 | ?* and ?\;. |
| 3443 | 3507 | ||
| 3444 | * ietf-drums.el (ietf-drums-syntax-table): Set syntax of ?* ?\; | 3508 | * ietf-drums.el (ietf-drums-syntax-table): Set syntax of ?* ?\; |
| 3445 | and ?\' to symbol instead of whitespace (tiny patch). | 3509 | and ?\' to symbol instead of whitespace. |
| 3446 | From Andreas Schwab <schwab@suse.de>. | ||
| 3447 | 3510 | ||
| 3448 | 2004-08-31 Jesper Harder <harder@ifa.au.dk> | 3511 | 2004-08-31 Jesper Harder <harder@ifa.au.dk> |
| 3449 | 3512 | ||
diff --git a/lisp/gnus/dns.el b/lisp/gnus/dns.el index d6c41ea823e..5069230e736 100644 --- a/lisp/gnus/dns.el +++ b/lisp/gnus/dns.el | |||
| @@ -347,7 +347,7 @@ If FULLP, return the entire record returned." | |||
| 347 | (>= (buffer-size) 2)) | 347 | (>= (buffer-size) 2)) |
| 348 | (goto-char (point-min)) | 348 | (goto-char (point-min)) |
| 349 | (delete-region (point) (+ (point) 2))) | 349 | (delete-region (point) (+ (point) 2))) |
| 350 | (unless (zerop (buffer-size)) | 350 | (when (>= (buffer-size) 2) |
| 351 | (let ((result (dns-read (buffer-string)))) | 351 | (let ((result (dns-read (buffer-string)))) |
| 352 | (if fullp | 352 | (if fullp |
| 353 | result | 353 | result |
diff --git a/lisp/gnus/flow-fill.el b/lisp/gnus/flow-fill.el index 480505549c9..98697439106 100644 --- a/lisp/gnus/flow-fill.el +++ b/lisp/gnus/flow-fill.el | |||
| @@ -121,7 +121,7 @@ RFC 2646 suggests 66 characters for readability." | |||
| 121 | (while (re-search-forward " $" nil t) | 121 | (while (re-search-forward " $" nil t) |
| 122 | (when (save-excursion | 122 | (when (save-excursion |
| 123 | (beginning-of-line) | 123 | (beginning-of-line) |
| 124 | (looking-at "^\\(>+\\)\\( ?\\)")) | 124 | (looking-at "^\\(>*\\)\\( ?\\)")) |
| 125 | (let ((quote (match-string 1)) | 125 | (let ((quote (match-string 1)) |
| 126 | sig) | 126 | sig) |
| 127 | (if (string= quote "") | 127 | (if (string= quote "") |
diff --git a/lisp/gnus/gnus-draft.el b/lisp/gnus/gnus-draft.el index f9ff9d7122e..125e5bebd49 100644 --- a/lisp/gnus/gnus-draft.el +++ b/lisp/gnus/gnus-draft.el | |||
| @@ -146,6 +146,8 @@ | |||
| 146 | message-send-hook)) | 146 | message-send-hook)) |
| 147 | (message-setup-hook (and (not is-queue) | 147 | (message-setup-hook (and (not is-queue) |
| 148 | message-setup-hook)) | 148 | message-setup-hook)) |
| 149 | (message-signature (and (not is-queue) | ||
| 150 | message-signature)) | ||
| 149 | (gnus-agent-queue-mail (and (not is-queue) | 151 | (gnus-agent-queue-mail (and (not is-queue) |
| 150 | gnus-agent-queue-mail)) | 152 | gnus-agent-queue-mail)) |
| 151 | (rfc2047-encode-encoded-words nil) | 153 | (rfc2047-encode-encoded-words nil) |
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index b59a3c1530b..8af0aa2cca2 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el | |||
| @@ -250,10 +250,12 @@ If it is down, start it up (again)." | |||
| 250 | ;; recurse to open the agent's backend. | 250 | ;; recurse to open the agent's backend. |
| 251 | (setq open-offline (eq gnus-server-unopen-status 'offline)) | 251 | (setq open-offline (eq gnus-server-unopen-status 'offline)) |
| 252 | gnus-server-unopen-status) | 252 | gnus-server-unopen-status) |
| 253 | ((gnus-y-or-n-p | 253 | ((and |
| 254 | (format "Unable to open %s:%s, go offline? " | 254 | (not gnus-batch-mode) |
| 255 | (car gnus-command-method) | 255 | (gnus-y-or-n-p |
| 256 | (cadr gnus-command-method))) | 256 | (format "Unable to open %s:%s, go offline? " |
| 257 | (car gnus-command-method) | ||
| 258 | (cadr gnus-command-method)))) | ||
| 257 | (setq open-offline t) | 259 | (setq open-offline t) |
| 258 | 'offline) | 260 | 'offline) |
| 259 | (t | 261 | (t |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index b2a70b8fcb6..226a9bd50f1 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -3098,8 +3098,11 @@ display only a single character." | |||
| 3098 | (aset table ?\r nil) | 3098 | (aset table ?\r nil) |
| 3099 | ;; We keep TAB as well. | 3099 | ;; We keep TAB as well. |
| 3100 | (aset table ?\t nil) | 3100 | (aset table ?\t nil) |
| 3101 | ;; We nix out any glyphs over 126 that are not set already. | 3101 | ;; We nix out any glyphs 127 through 255, or 127 through 159 in |
| 3102 | (let ((i 256)) | 3102 | ;; Emacs 23, that are not set already. |
| 3103 | (let ((i (if (ignore-errors (= (make-char 'latin-iso8859-1 160) 160)) | ||
| 3104 | 160 | ||
| 3105 | 256))) | ||
| 3103 | (while (>= (setq i (1- i)) 127) | 3106 | (while (>= (setq i (1- i)) 127) |
| 3104 | ;; Only modify if the entry is nil. | 3107 | ;; Only modify if the entry is nil. |
| 3105 | (unless (aref table i) | 3108 | (unless (aref table i) |
| @@ -6452,10 +6455,12 @@ displayed, no centering will be performed." | |||
| 6452 | (setq nlast (if (atom (cadr read)) (cadr read) (caadr read))) | 6455 | (setq nlast (if (atom (cadr read)) (cadr read) (caadr read))) |
| 6453 | (setq read (cdr read))))) | 6456 | (setq read (cdr read))))) |
| 6454 | ;; And add the last unread articles. | 6457 | ;; And add the last unread articles. |
| 6455 | (cond ((< first last) | 6458 | (cond ((not (and first last)) |
| 6456 | (push (cons first last) unread)) | 6459 | nil) |
| 6457 | ((= first last) | 6460 | ((< first last) |
| 6458 | (push first unread))) | 6461 | (push (cons first last) unread)) |
| 6462 | ((= first last) | ||
| 6463 | (push first unread))) | ||
| 6459 | ;; Return the sequence of unread articles. | 6464 | ;; Return the sequence of unread articles. |
| 6460 | (delq 0 (nreverse unread)))) | 6465 | (delq 0 (nreverse unread)))) |
| 6461 | 6466 | ||
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index fa77b7776f0..01557659fd6 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el | |||
| @@ -1084,14 +1084,16 @@ external if displayed external." | |||
| 1084 | 1084 | ||
| 1085 | (defun mm-get-part (handle) | 1085 | (defun mm-get-part (handle) |
| 1086 | "Return the contents of HANDLE as a string." | 1086 | "Return the contents of HANDLE as a string." |
| 1087 | (mm-with-unibyte-buffer | 1087 | (let ((default-enable-multibyte-characters |
| 1088 | (insert (with-current-buffer (mm-handle-buffer handle) | 1088 | (with-current-buffer (mm-handle-buffer handle) |
| 1089 | (mm-with-unibyte-current-buffer | 1089 | (mm-multibyte-p)))) |
| 1090 | (buffer-string)))) | 1090 | (with-temp-buffer |
| 1091 | (mm-decode-content-transfer-encoding | 1091 | (insert-buffer-substring (mm-handle-buffer handle)) |
| 1092 | (mm-handle-encoding handle) | 1092 | (mm-disable-multibyte) |
| 1093 | (mm-handle-media-type handle)) | 1093 | (mm-decode-content-transfer-encoding |
| 1094 | (buffer-string))) | 1094 | (mm-handle-encoding handle) |
| 1095 | (mm-handle-media-type handle)) | ||
| 1096 | (buffer-string)))) | ||
| 1095 | 1097 | ||
| 1096 | (defun mm-insert-part (handle) | 1098 | (defun mm-insert-part (handle) |
| 1097 | "Insert the contents of HANDLE in the current buffer." | 1099 | "Insert the contents of HANDLE in the current buffer." |
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index efb5aeef082..4fc20200a6c 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el | |||
| @@ -727,11 +727,17 @@ Use multibyte mode for this." | |||
| 727 | (defmacro mm-with-unibyte-current-buffer (&rest forms) | 727 | (defmacro mm-with-unibyte-current-buffer (&rest forms) |
| 728 | "Evaluate FORMS with current buffer temporarily made unibyte. | 728 | "Evaluate FORMS with current buffer temporarily made unibyte. |
| 729 | Also bind `default-enable-multibyte-characters' to nil. | 729 | Also bind `default-enable-multibyte-characters' to nil. |
| 730 | Equivalent to `progn' in XEmacs" | 730 | Equivalent to `progn' in XEmacs |
| 731 | |||
| 732 | NOTE: Use this macro with caution in multibyte buffers (it is not | ||
| 733 | worth using this macro in unibyte buffers of course). Use of | ||
| 734 | `(set-buffer-multibyte t)', which is run finally, is generally | ||
| 735 | harmful since it is likely to modify existing data in the buffer. | ||
| 736 | For instance, it converts \"\\300\\255\" into \"\\255\" in Emacs 23." | ||
| 731 | (let ((multibyte (make-symbol "multibyte")) | 737 | (let ((multibyte (make-symbol "multibyte")) |
| 732 | (buffer (make-symbol "buffer"))) | 738 | (buffer (make-symbol "buffer"))) |
| 733 | `(if mm-emacs-mule | 739 | `(if mm-emacs-mule |
| 734 | (let ((,multibyte enable-multibyte-characters) | 740 | (let ((,multibyte enable-multibyte-characters) |
| 735 | (,buffer (current-buffer))) | 741 | (,buffer (current-buffer))) |
| 736 | (unwind-protect | 742 | (unwind-protect |
| 737 | (let (default-enable-multibyte-characters) | 743 | (let (default-enable-multibyte-characters) |
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index ee155755bab..566aabcc6ba 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el | |||
| @@ -506,7 +506,15 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." | |||
| 506 | (let ((coding-system-for-read mm-binary-coding-system)) | 506 | (let ((coding-system-for-read mm-binary-coding-system)) |
| 507 | (mm-insert-file-contents filename nil nil nil nil t))) | 507 | (mm-insert-file-contents filename nil nil nil nil t))) |
| 508 | (t | 508 | (t |
| 509 | (insert (cdr (assq 'contents cont))))) | 509 | (let ((contents (cdr (assq 'contents cont)))) |
| 510 | (if (if (featurep 'xemacs) | ||
| 511 | (string-match "[^\000-\377]" contents) | ||
| 512 | (mm-multibyte-string-p contents)) | ||
| 513 | (progn | ||
| 514 | (mm-enable-multibyte) | ||
| 515 | (insert contents) | ||
| 516 | (setq charset (mm-encode-body))) | ||
| 517 | (insert contents))))) | ||
| 510 | (setq encoding (mm-encode-buffer type) | 518 | (setq encoding (mm-encode-buffer type) |
| 511 | coded (mm-string-as-multibyte (buffer-string)))) | 519 | coded (mm-string-as-multibyte (buffer-string)))) |
| 512 | (mml-insert-mime-headers cont type charset encoding nil) | 520 | (mml-insert-mime-headers cont type charset encoding nil) |
diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index bf49aba7f08..13901e22f6d 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el | |||
| @@ -27,9 +27,6 @@ | |||
| 27 | 27 | ||
| 28 | ;; Note: You need to have `w3' installed for some functions to work. | 28 | ;; Note: You need to have `w3' installed for some functions to work. |
| 29 | 29 | ||
| 30 | ;; FIXME: Due to changes in the HTML output of Gmane, stuff related to Gmane | ||
| 31 | ;; web groups (`gnus-group-make-web-group') doesn't work anymore. | ||
| 32 | |||
| 33 | ;;; Code: | 30 | ;;; Code: |
| 34 | 31 | ||
| 35 | (eval-when-compile (require 'cl)) | 32 | (eval-when-compile (require 'cl)) |
| @@ -82,7 +79,7 @@ Valid types include `google', `dejanews', and `gmane'.") | |||
| 82 | (reference . identity) | 79 | (reference . identity) |
| 83 | (map . nnweb-gmane-create-mapping) | 80 | (map . nnweb-gmane-create-mapping) |
| 84 | (search . nnweb-gmane-search) | 81 | (search . nnweb-gmane-search) |
| 85 | (address . "http://gmane.org/") | 82 | (address . "http://search.gmane.org/nov.php") |
| 86 | (identifier . nnweb-gmane-identity))) | 83 | (identifier . nnweb-gmane-identity))) |
| 87 | "Type-definition alist.") | 84 | "Type-definition alist.") |
| 88 | 85 | ||
| @@ -99,7 +96,7 @@ Valid types include `google', `dejanews', and `gmane'.") | |||
| 99 | 96 | ||
| 100 | (defvoo nnweb-articles nil) | 97 | (defvoo nnweb-articles nil) |
| 101 | (defvoo nnweb-buffer nil) | 98 | (defvoo nnweb-buffer nil) |
| 102 | (defvar nnweb-group-alist nil) | 99 | (defvoo nnweb-group-alist nil) |
| 103 | (defvoo nnweb-group nil) | 100 | (defvoo nnweb-group nil) |
| 104 | (defvoo nnweb-hashtb nil) | 101 | (defvoo nnweb-hashtb nil) |
| 105 | 102 | ||
| @@ -309,22 +306,26 @@ Valid types include `google', `dejanews', and `gmane'.") | |||
| 309 | 306 | ||
| 310 | (defun nnweb-google-wash-article () | 307 | (defun nnweb-google-wash-article () |
| 311 | ;; We have Google's masked e-mail addresses here. :-/ | 308 | ;; We have Google's masked e-mail addresses here. :-/ |
| 312 | (let ((case-fold-search t)) | 309 | (let ((case-fold-search t) |
| 310 | (start-re "<pre>\n *") | ||
| 311 | (end-re "\n *</pre>")) | ||
| 313 | (goto-char (point-min)) | 312 | (goto-char (point-min)) |
| 314 | (if (save-excursion | 313 | (if (save-excursion |
| 315 | (or (re-search-forward "The requested message.*could not be found." | 314 | (or (re-search-forward "The requested message.*could not be found." |
| 316 | nil t) | 315 | nil t) |
| 317 | (not (and (re-search-forward "^<pre>" nil t) | 316 | (not (and (re-search-forward start-re nil t) |
| 318 | (re-search-forward "^</pre>" nil t))))) | 317 | (re-search-forward end-re nil t))))) |
| 319 | ;; FIXME: Don't know how to indicate "not found". | 318 | ;; FIXME: Don't know how to indicate "not found". |
| 320 | ;; Should this function throw an error? --rsteib | 319 | ;; Should this function throw an error? --rsteib |
| 321 | (progn | 320 | (progn |
| 322 | (gnus-message 3 "Requested article not found") | 321 | (gnus-message 3 "Requested article not found") |
| 323 | (erase-buffer)) | 322 | (erase-buffer)) |
| 324 | (delete-region (point-min) | 323 | (delete-region (point-min) |
| 325 | (1+ (re-search-forward "^<pre>" nil t))) | 324 | (re-search-forward start-re)) |
| 326 | (goto-char (point-min)) | 325 | (goto-char (point-min)) |
| 327 | (delete-region (- (re-search-forward "^</pre>" nil t) (length "</pre>")) | 326 | (delete-region (progn |
| 327 | (re-search-forward end-re) | ||
| 328 | (match-beginning 0)) | ||
| 328 | (point-max)) | 329 | (point-max)) |
| 329 | (mm-url-decode-entities)))) | 330 | (mm-url-decode-entities)))) |
| 330 | 331 | ||
| @@ -403,6 +404,7 @@ Valid types include `google', `dejanews', and `gmane'.") | |||
| 403 | (save-excursion | 404 | (save-excursion |
| 404 | (set-buffer nnweb-buffer) | 405 | (set-buffer nnweb-buffer) |
| 405 | (erase-buffer) | 406 | (erase-buffer) |
| 407 | (nnheader-message 7 "Searching google...") | ||
| 406 | (when (funcall (nnweb-definition 'search) nnweb-search) | 408 | (when (funcall (nnweb-definition 'search) nnweb-search) |
| 407 | (let ((more t) | 409 | (let ((more t) |
| 408 | (i 0)) | 410 | (i 0)) |
| @@ -413,15 +415,18 @@ Valid types include `google', `dejanews', and `gmane'.") | |||
| 413 | (goto-char (point-min)) | 415 | (goto-char (point-min)) |
| 414 | (incf i 100) | 416 | (incf i 100) |
| 415 | (if (or (not (re-search-forward | 417 | (if (or (not (re-search-forward |
| 416 | "<td><a href=\"\n\\([^>\"]+\\)\"><img src=\"/img/nav_next" nil t)) | 418 | "<a href=\"\n\\([^>\"]+\\)\"><img src=\"[^\"]+next" |
| 419 | nil t)) | ||
| 417 | (>= i nnweb-max-hits)) | 420 | (>= i nnweb-max-hits)) |
| 418 | (setq more nil) | 421 | (setq more nil) |
| 419 | ;; Yup, there are more articles | 422 | ;; Yup, there are more articles |
| 420 | (setq more (concat (nnweb-definition 'base) (match-string 1))) | 423 | (setq more (concat (nnweb-definition 'base) (match-string 1))) |
| 421 | (when more | 424 | (when more |
| 422 | (erase-buffer) | 425 | (erase-buffer) |
| 426 | (nnheader-message 7 "Searching google...(%d)" i) | ||
| 423 | (mm-url-insert more)))) | 427 | (mm-url-insert more)))) |
| 424 | ;; Return the articles in the right order. | 428 | ;; Return the articles in the right order. |
| 429 | (nnheader-message 7 "Searching google...done") | ||
| 425 | (setq nnweb-articles | 430 | (setq nnweb-articles |
| 426 | (sort nnweb-articles 'car-less-than-car)))))) | 431 | (sort nnweb-articles 'car-less-than-car)))))) |
| 427 | 432 | ||
| @@ -454,46 +459,61 @@ Valid types include `google', `dejanews', and `gmane'.") | |||
| 454 | "Perform the search and create a number-to-url alist." | 459 | "Perform the search and create a number-to-url alist." |
| 455 | (save-excursion | 460 | (save-excursion |
| 456 | (set-buffer nnweb-buffer) | 461 | (set-buffer nnweb-buffer) |
| 457 | (erase-buffer) | 462 | (let ((case-fold-search t) |
| 458 | (when (funcall (nnweb-definition 'search) nnweb-search) | 463 | (active (or (cadr (assoc nnweb-group nnweb-group-alist)) |
| 459 | (let ((more t) | 464 | (cons 1 0))) |
| 460 | (case-fold-search t) | 465 | map) |
| 461 | (active (or (cadr (assoc nnweb-group nnweb-group-alist)) | 466 | (erase-buffer) |
| 462 | (cons 1 0))) | 467 | (nnheader-message 7 "Searching Gmane..." ) |
| 463 | subject group url | 468 | (when (funcall (nnweb-definition 'search) nnweb-search) |
| 464 | map) | ||
| 465 | ;; Remove stuff from the beginning of results | ||
| 466 | (goto-char (point-min)) | ||
| 467 | (search-forward "Search Results</h1><ul>" nil t) | ||
| 468 | (delete-region (point-min) (point)) | ||
| 469 | (goto-char (point-min)) | 469 | (goto-char (point-min)) |
| 470 | ;; Iterate over the actual hits | 470 | ;; Skip the status line |
| 471 | (while (re-search-forward ".*href=\"\\([^\"]+\\)\">\\(.*\\)" nil t) | 471 | (forward-line 1) |
| 472 | (setq url (concat "http://gmane.org/" (match-string 1))) | 472 | ;; Thanks to Olly Betts we now have NOV lines in our buffer! |
| 473 | (setq subject (match-string 2)) | 473 | (while (not (eobp)) |
| 474 | (unless (nnweb-get-hashtb url) | 474 | (unless (or (eolp) (looking-at "\x0d")) |
| 475 | (push | 475 | (let ((header (nnheader-parse-nov))) |
| 476 | (list | 476 | (let ((xref (mail-header-xref header)) |
| 477 | (incf (cdr active)) | 477 | (from (mail-header-from header)) |
| 478 | (make-full-mail-header | 478 | (subject (mail-header-subject header)) |
| 479 | (cdr active) (concat "(" group ") " subject) nil nil | 479 | (rfc2047-encoding-type 'mime)) |
| 480 | nil nil 0 0 url)) | 480 | (when (string-match " \\([^:]+\\):\\([0-9]+\\)" xref) |
| 481 | map) | 481 | (mail-header-set-xref |
| 482 | (nnweb-set-hashtb (cadar map) (car map)))) | 482 | header |
| 483 | ;; Return the articles in the right order. | 483 | (format "http://article.gmane.org/%s/%s/raw" |
| 484 | (setq nnweb-articles | 484 | (match-string 1 xref) |
| 485 | (sort (nconc nnweb-articles map) 'car-less-than-car)))))) | 485 | (match-string 2 xref)))) |
| 486 | |||
| 487 | ;; Add host part to gmane-encrypted addresses | ||
| 488 | (when (string-match "@$" from) | ||
| 489 | (mail-header-set-from header | ||
| 490 | (concat from "public.gmane.org"))) | ||
| 491 | |||
| 492 | (mail-header-set-subject header | ||
| 493 | (rfc2047-encode-string subject)) | ||
| 494 | |||
| 495 | (unless (nnweb-get-hashtb (mail-header-xref header)) | ||
| 496 | (push | ||
| 497 | (list | ||
| 498 | (incf (cdr active)) | ||
| 499 | header) | ||
| 500 | map) | ||
| 501 | (nnweb-set-hashtb (cadar map) (car map)))))) | ||
| 502 | (forward-line 1))) | ||
| 503 | (nnheader-message 7 "Searching Gmane...done") | ||
| 504 | (setq nnweb-articles | ||
| 505 | (sort (nconc nnweb-articles map) 'car-less-than-car))))) | ||
| 486 | 506 | ||
| 487 | (defun nnweb-gmane-wash-article () | 507 | (defun nnweb-gmane-wash-article () |
| 488 | (let ((case-fold-search t)) | 508 | (let ((case-fold-search t)) |
| 489 | (goto-char (point-min)) | 509 | (goto-char (point-min)) |
| 490 | (re-search-forward "<!--X-Head-of-Message-->" nil t) | 510 | (when (search-forward "<!--X-Head-of-Message-->" nil t) |
| 491 | (delete-region (point-min) (point)) | 511 | (delete-region (point-min) (point)) |
| 492 | (goto-char (point-min)) | 512 | (goto-char (point-min)) |
| 493 | (while (looking-at "^<li><em>\\([^ ]+\\)</em>.*</li>") | 513 | (while (looking-at "^<li><em>\\([^ ]+\\)</em>.*</li>") |
| 494 | (replace-match "\\1\\2" t) | 514 | (replace-match "\\1\\2" t) |
| 495 | (forward-line 1)) | 515 | (forward-line 1)) |
| 496 | (mm-url-remove-markup))) | 516 | (mm-url-remove-markup)))) |
| 497 | 517 | ||
| 498 | (defun nnweb-gmane-search (search) | 518 | (defun nnweb-gmane-search (search) |
| 499 | (mm-url-insert | 519 | (mm-url-insert |
| @@ -501,11 +521,13 @@ Valid types include `google', `dejanews', and `gmane'.") | |||
| 501 | (nnweb-definition 'address) | 521 | (nnweb-definition 'address) |
| 502 | "?" | 522 | "?" |
| 503 | (mm-url-encode-www-form-urlencoded | 523 | (mm-url-encode-www-form-urlencoded |
| 504 | `(("query" . ,search))))) | 524 | `(("query" . ,search) |
| 525 | ("HITSPERPAGE" . ,(number-to-string nnweb-max-hits)))))) | ||
| 505 | (setq buffer-file-name nil) | 526 | (setq buffer-file-name nil) |
| 527 | (set-buffer-multibyte t) | ||
| 528 | (mm-decode-coding-region (point-min) (point-max) 'utf-8) | ||
| 506 | t) | 529 | t) |
| 507 | 530 | ||
| 508 | |||
| 509 | (defun nnweb-gmane-identity (url) | 531 | (defun nnweb-gmane-identity (url) |
| 510 | "Return a unique identifier based on URL." | 532 | "Return a unique identifier based on URL." |
| 511 | (if (string-match "group=\\(.+\\)" url) | 533 | (if (string-match "group=\\(.+\\)" url) |
diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el index 3de3b7daccc..12941e962a0 100644 --- a/lisp/jka-cmpr-hook.el +++ b/lisp/jka-cmpr-hook.el | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | ;;; Commentary: | 27 | ;;; Commentary: |
| 28 | 28 | ||
| 29 | ;; This file contains the code to enable and disable Auto-Compression mode. | 29 | ;; This file contains the code to enable and disable Auto-Compression mode. |
| 30 | ;; It is preloaded. The guts of this mode are in jka-compr.el, which | 30 | ;; It is preloaded. The guts of this mode are in jka-compr.el, which |
| 31 | ;; is loaded only when you really try to uncompress something. | 31 | ;; is loaded only when you really try to uncompress something. |
| 32 | 32 | ||
| @@ -40,6 +40,143 @@ | |||
| 40 | "jka-compr customization." | 40 | "jka-compr customization." |
| 41 | :group 'compression) | 41 | :group 'compression) |
| 42 | 42 | ||
| 43 | ;; List of all the elements we actually added to file-coding-system-alist. | ||
| 44 | (defvar jka-compr-added-to-file-coding-system-alist nil) | ||
| 45 | |||
| 46 | (defvar jka-compr-file-name-handler-entry | ||
| 47 | nil | ||
| 48 | "`file-name-handler-alist' entry used by jka-compr I/O functions.") | ||
| 49 | |||
| 50 | ;; Compiler defvars. These three variables will be defined later with | ||
| 51 | ;; `defcustom' when everything used in the :set functions is defined. | ||
| 52 | (defvar jka-compr-compression-info-list) | ||
| 53 | (defvar jka-compr-mode-alist-additions) | ||
| 54 | (defvar jka-compr-load-suffixes) | ||
| 55 | |||
| 56 | (defvar jka-compr-compression-info-list--internal nil | ||
| 57 | "Stored value of `jka-compr-compression-info-list'. | ||
| 58 | If Auto Compression mode is enabled, this is the value of | ||
| 59 | `jka-compr-compression-info-list' when `jka-compr-install' was last called. | ||
| 60 | Otherwise, it is nil.") | ||
| 61 | |||
| 62 | (defvar jka-compr-mode-alist-additions--internal nil | ||
| 63 | "Stored value of `jka-compr-mode-alist-additions'. | ||
| 64 | If Auto Compression mode is enabled, this is the value of | ||
| 65 | `jka-compr-mode-alist-additions' when `jka-compr-install' was last called. | ||
| 66 | Otherwise, it is nil.") | ||
| 67 | |||
| 68 | (defvar jka-compr-load-suffixes--internal nil | ||
| 69 | "Stored value of `jka-compr-load-suffixes'. | ||
| 70 | If Auto Compression mode is enabled, this is the value of | ||
| 71 | `jka-compr-load-suffixes' when `jka-compr-install' was last called. | ||
| 72 | Otherwise, it is nil.") | ||
| 73 | |||
| 74 | |||
| 75 | (defun jka-compr-build-file-regexp () | ||
| 76 | (mapconcat | ||
| 77 | 'jka-compr-info-regexp | ||
| 78 | jka-compr-compression-info-list | ||
| 79 | "\\|")) | ||
| 80 | |||
| 81 | ;; Functions for accessing the return value of jka-compr-get-compression-info | ||
| 82 | (defun jka-compr-info-regexp (info) (aref info 0)) | ||
| 83 | (defun jka-compr-info-compress-message (info) (aref info 1)) | ||
| 84 | (defun jka-compr-info-compress-program (info) (aref info 2)) | ||
| 85 | (defun jka-compr-info-compress-args (info) (aref info 3)) | ||
| 86 | (defun jka-compr-info-uncompress-message (info) (aref info 4)) | ||
| 87 | (defun jka-compr-info-uncompress-program (info) (aref info 5)) | ||
| 88 | (defun jka-compr-info-uncompress-args (info) (aref info 6)) | ||
| 89 | (defun jka-compr-info-can-append (info) (aref info 7)) | ||
| 90 | (defun jka-compr-info-strip-extension (info) (aref info 8)) | ||
| 91 | (defun jka-compr-info-file-magic-bytes (info) (aref info 9)) | ||
| 92 | |||
| 93 | |||
| 94 | (defun jka-compr-get-compression-info (filename) | ||
| 95 | "Return information about the compression scheme of FILENAME. | ||
| 96 | The determination as to which compression scheme, if any, to use is | ||
| 97 | based on the filename itself and `jka-compr-compression-info-list'." | ||
| 98 | (catch 'compression-info | ||
| 99 | (let ((case-fold-search nil)) | ||
| 100 | (mapcar | ||
| 101 | (function (lambda (x) | ||
| 102 | (and (string-match (jka-compr-info-regexp x) filename) | ||
| 103 | (throw 'compression-info x)))) | ||
| 104 | jka-compr-compression-info-list) | ||
| 105 | nil))) | ||
| 106 | |||
| 107 | (defun jka-compr-install () | ||
| 108 | "Install jka-compr. | ||
| 109 | This adds entries to `file-name-handler-alist' and `auto-mode-alist' | ||
| 110 | and `inhibit-first-line-modes-suffixes'." | ||
| 111 | |||
| 112 | (setq jka-compr-file-name-handler-entry | ||
| 113 | (cons (jka-compr-build-file-regexp) 'jka-compr-handler)) | ||
| 114 | |||
| 115 | (push jka-compr-file-name-handler-entry file-name-handler-alist) | ||
| 116 | |||
| 117 | (setq jka-compr-compression-info-list--internal | ||
| 118 | jka-compr-compression-info-list | ||
| 119 | jka-compr-mode-alist-additions--internal | ||
| 120 | jka-compr-mode-alist-additions | ||
| 121 | jka-compr-load-suffixes--internal | ||
| 122 | jka-compr-load-suffixes) | ||
| 123 | |||
| 124 | (dolist (x jka-compr-compression-info-list) | ||
| 125 | ;; Don't do multibyte encoding on the compressed files. | ||
| 126 | (let ((elt (cons (jka-compr-info-regexp x) | ||
| 127 | '(no-conversion . no-conversion)))) | ||
| 128 | (push elt file-coding-system-alist) | ||
| 129 | (push elt jka-compr-added-to-file-coding-system-alist)) | ||
| 130 | |||
| 131 | (and (jka-compr-info-strip-extension x) | ||
| 132 | ;; Make entries in auto-mode-alist so that modes | ||
| 133 | ;; are chosen right according to the file names | ||
| 134 | ;; sans `.gz'. | ||
| 135 | (push (list (jka-compr-info-regexp x) nil 'jka-compr) auto-mode-alist) | ||
| 136 | ;; Also add these regexps to | ||
| 137 | ;; inhibit-first-line-modes-suffixes, so that a | ||
| 138 | ;; -*- line in the first file of a compressed tar | ||
| 139 | ;; file doesn't override tar-mode. | ||
| 140 | (push (jka-compr-info-regexp x) | ||
| 141 | inhibit-first-line-modes-suffixes))) | ||
| 142 | (setq auto-mode-alist | ||
| 143 | (append auto-mode-alist jka-compr-mode-alist-additions)) | ||
| 144 | |||
| 145 | ;; Make sure that (load "foo") will find /bla/foo.el.gz. | ||
| 146 | (setq load-file-rep-suffixes | ||
| 147 | (append load-file-rep-suffixes jka-compr-load-suffixes nil))) | ||
| 148 | |||
| 149 | (defun jka-compr-installed-p () | ||
| 150 | "Return non-nil if jka-compr is installed. | ||
| 151 | The return value is the entry in `file-name-handler-alist' for jka-compr." | ||
| 152 | |||
| 153 | (let ((fnha file-name-handler-alist) | ||
| 154 | (installed nil)) | ||
| 155 | |||
| 156 | (while (and fnha (not installed)) | ||
| 157 | (and (eq (cdr (car fnha)) 'jka-compr-handler) | ||
| 158 | (setq installed (car fnha))) | ||
| 159 | (setq fnha (cdr fnha))) | ||
| 160 | |||
| 161 | installed)) | ||
| 162 | |||
| 163 | (defun jka-compr-update () | ||
| 164 | "Update Auto Compression mode for changes in option values. | ||
| 165 | If you change the options `jka-compr-compression-info-list', | ||
| 166 | `jka-compr-mode-alist-additions' or `jka-compr-load-suffixes' | ||
| 167 | outside Custom, while Auto Compression mode is already enabled | ||
| 168 | \(as it is by default), then you have to call this function | ||
| 169 | afterward to properly update other variables. Setting these | ||
| 170 | options through Custom does this automatically." | ||
| 171 | (when (jka-compr-installed-p) | ||
| 172 | (jka-compr-uninstall) | ||
| 173 | (jka-compr-install))) | ||
| 174 | |||
| 175 | (defun jka-compr-set (variable value) | ||
| 176 | "Internal Custom :set function." | ||
| 177 | (set-default variable value) | ||
| 178 | (jka-compr-update)) | ||
| 179 | |||
| 43 | ;; I have this defined so that .Z files are assumed to be in unix | 180 | ;; I have this defined so that .Z files are assumed to be in unix |
| 44 | ;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt. | 181 | ;; compress format; and .gz files, in gzip format, and .bz2 files in bzip fmt. |
| 45 | (defcustom jka-compr-compression-info-list | 182 | (defcustom jka-compr-compression-info-list |
| @@ -113,7 +250,12 @@ APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where: | |||
| 113 | 250 | ||
| 114 | Because of the way `call-process' is defined, discarding the stderr output of | 251 | Because of the way `call-process' is defined, discarding the stderr output of |
| 115 | a program adds the overhead of starting a shell each time the program is | 252 | a program adds the overhead of starting a shell each time the program is |
| 116 | invoked." | 253 | invoked. |
| 254 | |||
| 255 | If you set this outside Custom while Auto Compression mode is | ||
| 256 | already enabled \(as it is by default), you have to call | ||
| 257 | `jka-compr-update' after setting it to properly update other | ||
| 258 | variables. Setting this through Custom does that automatically." | ||
| 117 | :type '(repeat (vector regexp | 259 | :type '(repeat (vector regexp |
| 118 | (choice :tag "Compress Message" | 260 | (choice :tag "Compress Message" |
| 119 | (string :format "%v") | 261 | (string :format "%v") |
| @@ -132,118 +274,41 @@ invoked." | |||
| 132 | (boolean :tag "Append") | 274 | (boolean :tag "Append") |
| 133 | (boolean :tag "Strip Extension") | 275 | (boolean :tag "Strip Extension") |
| 134 | (string :tag "Magic Bytes"))) | 276 | (string :tag "Magic Bytes"))) |
| 277 | :set 'jka-compr-set | ||
| 135 | :group 'jka-compr) | 278 | :group 'jka-compr) |
| 136 | 279 | ||
| 137 | (defcustom jka-compr-mode-alist-additions | 280 | (defcustom jka-compr-mode-alist-additions |
| 138 | (list (cons "\\.tgz\\'" 'tar-mode) (cons "\\.tbz\\'" 'tar-mode)) | 281 | (list (cons "\\.tgz\\'" 'tar-mode) (cons "\\.tbz\\'" 'tar-mode)) |
| 139 | "A list of pairs to add to `auto-mode-alist' when jka-compr is installed." | 282 | "List of pairs added to `auto-mode-alist' when installing jka-compr. |
| 283 | Uninstalling jka-compr removes all pairs from `auto-mode-alist' that | ||
| 284 | installing added. | ||
| 285 | |||
| 286 | If you set this outside Custom while Auto Compression mode is | ||
| 287 | already enabled \(as it is by default), you have to call | ||
| 288 | `jka-compr-update' after setting it to properly update other | ||
| 289 | variables. Setting this through Custom does that automatically." | ||
| 140 | :type '(repeat (cons string symbol)) | 290 | :type '(repeat (cons string symbol)) |
| 291 | :set 'jka-compr-set | ||
| 141 | :group 'jka-compr) | 292 | :group 'jka-compr) |
| 142 | 293 | ||
| 143 | (defcustom jka-compr-load-suffixes '(".gz") | 294 | (defcustom jka-compr-load-suffixes '(".gz") |
| 144 | "List of suffixes to try when loading files." | 295 | "List of compression related suffixes to try when loading files. |
| 296 | Enabling Auto Compression mode appends this list to `load-file-rep-suffixes', | ||
| 297 | which see. Disabling Auto Compression mode removes all suffixes | ||
| 298 | from `load-file-rep-suffixes' that enabling added. | ||
| 299 | |||
| 300 | If you set this outside Custom while Auto Compression mode is | ||
| 301 | already enabled \(as it is by default), you have to call | ||
| 302 | `jka-compr-update' after setting it to properly update other | ||
| 303 | variables. Setting this through Custom does that automatically." | ||
| 145 | :type '(repeat string) | 304 | :type '(repeat string) |
| 305 | :set 'jka-compr-set | ||
| 146 | :group 'jka-compr) | 306 | :group 'jka-compr) |
| 147 | 307 | ||
| 148 | ;; List of all the elements we actually added to file-coding-system-alist. | ||
| 149 | (defvar jka-compr-added-to-file-coding-system-alist nil) | ||
| 150 | |||
| 151 | (defvar jka-compr-file-name-handler-entry | ||
| 152 | nil | ||
| 153 | "The entry in `file-name-handler-alist' used by the jka-compr I/O functions.") | ||
| 154 | |||
| 155 | (defun jka-compr-build-file-regexp () | ||
| 156 | (mapconcat | ||
| 157 | 'jka-compr-info-regexp | ||
| 158 | jka-compr-compression-info-list | ||
| 159 | "\\|")) | ||
| 160 | |||
| 161 | ;; Functions for accessing the return value of jka-compr-get-compression-info | ||
| 162 | (defun jka-compr-info-regexp (info) (aref info 0)) | ||
| 163 | (defun jka-compr-info-compress-message (info) (aref info 1)) | ||
| 164 | (defun jka-compr-info-compress-program (info) (aref info 2)) | ||
| 165 | (defun jka-compr-info-compress-args (info) (aref info 3)) | ||
| 166 | (defun jka-compr-info-uncompress-message (info) (aref info 4)) | ||
| 167 | (defun jka-compr-info-uncompress-program (info) (aref info 5)) | ||
| 168 | (defun jka-compr-info-uncompress-args (info) (aref info 6)) | ||
| 169 | (defun jka-compr-info-can-append (info) (aref info 7)) | ||
| 170 | (defun jka-compr-info-strip-extension (info) (aref info 8)) | ||
| 171 | (defun jka-compr-info-file-magic-bytes (info) (aref info 9)) | ||
| 172 | |||
| 173 | |||
| 174 | (defun jka-compr-get-compression-info (filename) | ||
| 175 | "Return information about the compression scheme of FILENAME. | ||
| 176 | The determination as to which compression scheme, if any, to use is | ||
| 177 | based on the filename itself and `jka-compr-compression-info-list'." | ||
| 178 | (catch 'compression-info | ||
| 179 | (let ((case-fold-search nil)) | ||
| 180 | (mapcar | ||
| 181 | (function (lambda (x) | ||
| 182 | (and (string-match (jka-compr-info-regexp x) filename) | ||
| 183 | (throw 'compression-info x)))) | ||
| 184 | jka-compr-compression-info-list) | ||
| 185 | nil))) | ||
| 186 | |||
| 187 | (defun jka-compr-install () | ||
| 188 | "Install jka-compr. | ||
| 189 | This adds entries to `file-name-handler-alist' and `auto-mode-alist' | ||
| 190 | and `inhibit-first-line-modes-suffixes'." | ||
| 191 | |||
| 192 | (setq jka-compr-file-name-handler-entry | ||
| 193 | (cons (jka-compr-build-file-regexp) 'jka-compr-handler)) | ||
| 194 | |||
| 195 | (push jka-compr-file-name-handler-entry file-name-handler-alist) | ||
| 196 | |||
| 197 | (dolist (x jka-compr-compression-info-list) | ||
| 198 | ;; Don't do multibyte encoding on the compressed files. | ||
| 199 | (let ((elt (cons (jka-compr-info-regexp x) | ||
| 200 | '(no-conversion . no-conversion)))) | ||
| 201 | (push elt file-coding-system-alist) | ||
| 202 | (push elt jka-compr-added-to-file-coding-system-alist)) | ||
| 203 | |||
| 204 | (and (jka-compr-info-strip-extension x) | ||
| 205 | ;; Make entries in auto-mode-alist so that modes | ||
| 206 | ;; are chosen right according to the file names | ||
| 207 | ;; sans `.gz'. | ||
| 208 | (push (list (jka-compr-info-regexp x) nil 'jka-compr) auto-mode-alist) | ||
| 209 | ;; Also add these regexps to | ||
| 210 | ;; inhibit-first-line-modes-suffixes, so that a | ||
| 211 | ;; -*- line in the first file of a compressed tar | ||
| 212 | ;; file doesn't override tar-mode. | ||
| 213 | (push (jka-compr-info-regexp x) | ||
| 214 | inhibit-first-line-modes-suffixes))) | ||
| 215 | (setq auto-mode-alist | ||
| 216 | (append auto-mode-alist jka-compr-mode-alist-additions)) | ||
| 217 | |||
| 218 | ;; Make sure that (load "foo") will find /bla/foo.el.gz. | ||
| 219 | (setq load-suffixes | ||
| 220 | (apply 'append | ||
| 221 | (append (mapcar (lambda (suffix) | ||
| 222 | (cons suffix | ||
| 223 | (mapcar (lambda (ext) (concat suffix ext)) | ||
| 224 | jka-compr-load-suffixes))) | ||
| 225 | load-suffixes) | ||
| 226 | (list jka-compr-load-suffixes))))) | ||
| 227 | |||
| 228 | |||
| 229 | (defun jka-compr-installed-p () | ||
| 230 | "Return non-nil if jka-compr is installed. | ||
| 231 | The return value is the entry in `file-name-handler-alist' for jka-compr." | ||
| 232 | |||
| 233 | (let ((fnha file-name-handler-alist) | ||
| 234 | (installed nil)) | ||
| 235 | |||
| 236 | (while (and fnha (not installed)) | ||
| 237 | (and (eq (cdr (car fnha)) 'jka-compr-handler) | ||
| 238 | (setq installed (car fnha))) | ||
| 239 | (setq fnha (cdr fnha))) | ||
| 240 | |||
| 241 | installed)) | ||
| 242 | |||
| 243 | (define-minor-mode auto-compression-mode | 308 | (define-minor-mode auto-compression-mode |
| 244 | "Toggle automatic file compression and uncompression. | 309 | "Toggle automatic file compression and uncompression. |
| 245 | With prefix argument ARG, turn auto compression on if positive, else off. | 310 | With prefix argument ARG, turn auto compression on if positive, else off. |
| 246 | Returns the new status of auto compression (non-nil means on)." | 311 | Return the new status of auto compression (non-nil means on)." |
| 247 | :global t :init-value t :group 'jka-compr :version "22.1" | 312 | :global t :init-value t :group 'jka-compr :version "22.1" |
| 248 | (let* ((installed (jka-compr-installed-p)) | 313 | (let* ((installed (jka-compr-installed-p)) |
| 249 | (flag auto-compression-mode)) | 314 | (flag auto-compression-mode)) |
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index 389944fa3e2..82c0461a3f8 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el | |||
| @@ -662,13 +662,13 @@ and `inhibit-first-line-modes-suffixes' that were added | |||
| 662 | by `jka-compr-installed'." | 662 | by `jka-compr-installed'." |
| 663 | ;; Delete from inhibit-first-line-modes-suffixes | 663 | ;; Delete from inhibit-first-line-modes-suffixes |
| 664 | ;; what jka-compr-install added. | 664 | ;; what jka-compr-install added. |
| 665 | (mapcar | 665 | (mapc |
| 666 | (function (lambda (x) | 666 | (function (lambda (x) |
| 667 | (and (jka-compr-info-strip-extension x) | 667 | (and (jka-compr-info-strip-extension x) |
| 668 | (setq inhibit-first-line-modes-suffixes | 668 | (setq inhibit-first-line-modes-suffixes |
| 669 | (delete (jka-compr-info-regexp x) | 669 | (delete (jka-compr-info-regexp x) |
| 670 | inhibit-first-line-modes-suffixes))))) | 670 | inhibit-first-line-modes-suffixes))))) |
| 671 | jka-compr-compression-info-list) | 671 | jka-compr-compression-info-list--internal) |
| 672 | 672 | ||
| 673 | (let* ((fnha (cons nil file-name-handler-alist)) | 673 | (let* ((fnha (cons nil file-name-handler-alist)) |
| 674 | (last fnha)) | 674 | (last fnha)) |
| @@ -686,7 +686,7 @@ by `jka-compr-installed'." | |||
| 686 | 686 | ||
| 687 | (while (cdr last) | 687 | (while (cdr last) |
| 688 | (setq entry (car (cdr last))) | 688 | (setq entry (car (cdr last))) |
| 689 | (if (or (member entry jka-compr-mode-alist-additions) | 689 | (if (or (member entry jka-compr-mode-alist-additions--internal) |
| 690 | (and (consp (cdr entry)) | 690 | (and (consp (cdr entry)) |
| 691 | (eq (nth 2 entry) 'jka-compr))) | 691 | (eq (nth 2 entry) 'jka-compr))) |
| 692 | (setcdr last (cdr (cdr last))) | 692 | (setcdr last (cdr (cdr last))) |
| @@ -701,12 +701,12 @@ by `jka-compr-installed'." | |||
| 701 | file-coding-system-alist))) | 701 | file-coding-system-alist))) |
| 702 | 702 | ||
| 703 | ;; Remove the suffixes that were added by jka-compr. | 703 | ;; Remove the suffixes that were added by jka-compr. |
| 704 | (let ((suffixes nil) | 704 | (dolist (suff jka-compr-load-suffixes--internal) |
| 705 | (re (jka-compr-build-file-regexp))) | 705 | (setq load-file-rep-suffixes (delete suff load-file-rep-suffixes))) |
| 706 | (dolist (suffix load-suffixes) | 706 | |
| 707 | (unless (string-match re suffix) | 707 | (setq jka-compr-compression-info-list--internal nil |
| 708 | (push suffix suffixes))) | 708 | jka-compr-mode-alist-additions--internal nil |
| 709 | (setq load-suffixes (nreverse suffixes)))) | 709 | jka-compr-load-suffixes--internal nil)) |
| 710 | 710 | ||
| 711 | (provide 'jka-compr) | 711 | (provide 'jka-compr) |
| 712 | 712 | ||
diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 81dc8ebe3df..dc0e4bdc3a2 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el | |||
| @@ -60,8 +60,8 @@ A library name is equivalent to the file name that `load-library' would load." | |||
| 60 | (let ((symbols (assoc file load-history))) | 60 | (let ((symbols (assoc file load-history))) |
| 61 | ;; Try converting a library name to an absolute file name. | 61 | ;; Try converting a library name to an absolute file name. |
| 62 | (and (null symbols) | 62 | (and (null symbols) |
| 63 | (let ((absname | 63 | (let ((absname |
| 64 | (locate-file file load-path load-suffixes))) | 64 | (locate-file file load-path (get-load-suffixes)))) |
| 65 | (and absname (not (equal absname file)) | 65 | (and absname (not (equal absname file)) |
| 66 | (setq symbols (cdr (assoc absname load-history)))))) | 66 | (setq symbols (cdr (assoc absname load-history)))))) |
| 67 | symbols)) | 67 | symbols)) |
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index a1043c6c6ee..ed8cc726ddb 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog | |||
| @@ -1,11 +1,81 @@ | |||
| 1 | 2006-03-02 Bill Wohler <wohler@newt.com> | ||
| 2 | |||
| 3 | * mh-folder.el (mh-tool-bar-init): Autoload. | ||
| 4 | (mh-folder-mode): Call mh-tool-bar-init conditionally in XEmacs. | ||
| 5 | Set scoped variables image-load-path and load-path with updated | ||
| 6 | mh-image-load-path before calling mh-tool-bar-folder-buttons-init. | ||
| 7 | |||
| 8 | * mh-letter.el (mh-tool-bar-init): Autoload. | ||
| 9 | (mh-letter-mode): Call mh-tool-bar-init conditionally in XEmacs. | ||
| 10 | Set scoped variables image-load-path and load-path with updated | ||
| 11 | mh-image-load-path before calling mh-tool-bar-letter-buttons-init. | ||
| 12 | |||
| 13 | * mh-show.el (mh-tool-bar-init): Autoload. | ||
| 14 | (mh-show-mode): Perform tool bar stuff conditionally in XEmacs and | ||
| 15 | GNU Emacs. | ||
| 16 | |||
| 17 | * mh-tool-bar.el (mh-tool-bar-define): Don't quote stuff in error | ||
| 18 | messages per conventions. | ||
| 19 | (mh-tool-bar-folder-buttons-init) | ||
| 20 | (mh-tool-bar-letter-buttons-init): Don't call mh-image-load-path. | ||
| 21 | (mh-tool-bar-define call): Format. | ||
| 22 | |||
| 23 | * mh-utils.el (mh-image-directory, | ||
| 24 | mh-image-load-path-called-flag): Delete. | ||
| 25 | (mh-image-load-path): Incorporate changes from Gnus team. Biggest | ||
| 26 | changes are that it no longer uses/sets mh-image-directory or | ||
| 27 | mh-image-load-path-called-flag, and returns the updated path | ||
| 28 | rather than change it. | ||
| 29 | (mh-logo-display): Change usage of mh-image-load-path. | ||
| 30 | |||
| 31 | 2006-02-28 Bill Wohler <wohler@newt.com> | ||
| 32 | |||
| 33 | * mh-limit.el (mh-narrow-to-cc, mh-narrow-to-from) | ||
| 34 | (mh-narrow-to-subject, mh-narrow-to-to): Fix inability to narrow | ||
| 35 | to subjects with special characters by quoting regular expression | ||
| 36 | characters in pick expression derived from existing subjects and | ||
| 37 | other fields (closes SF #1432548). | ||
| 38 | (mh-narrow-to-subject): Remove Re: string from subject so that | ||
| 39 | pick can find originating message (closes SF #1438369). | ||
| 40 | |||
| 41 | * mh-utils.el (mh-image-load-path): Rename variable to | ||
| 42 | mh-image-directory. | ||
| 43 | (mh-image-load-path): Access mh-image-directory instead of | ||
| 44 | mh-image-load-path. | ||
| 45 | (mh-folder-list): Fix problem with passing in a folder and getting | ||
| 46 | nothing back. Fix problem with passing in empty string and getting | ||
| 47 | the entire filesystem (or infinite loop). Don't append slash to | ||
| 48 | folder. These fixes fix problems observed with the pick search. | ||
| 49 | Thanks to Thomas Baumann for the help (closes SF #1435381). | ||
| 50 | (mh-pick-regexp-chars, mh-quote-pick-expr): New variable and | ||
| 51 | function for quoting pick regular expression characters (closes SF | ||
| 52 | #1432548). | ||
| 53 | |||
| 54 | 2006-02-27 Bill Wohler <wohler@newt.com> | ||
| 55 | |||
| 56 | * mh-e.el (mh-default-folder-for-message-function): Sync docstring | ||
| 57 | with manual. | ||
| 58 | |||
| 59 | * mh-mime.el (mh-minibuffer-read-type): Delete comment in | ||
| 60 | docstring about obsolete variable mh-mime-content-types. | ||
| 61 | |||
| 62 | * mh-e.el (mh-variant): Sync docstring with manual. | ||
| 63 | (cus-face): Require as it is needed by mh-inherit-face-flag. | ||
| 64 | |||
| 65 | * mh-compat.el (mh-display-color-cells): Return 2 if | ||
| 66 | device-color-cells returns nil (closes SF #1436924). | ||
| 67 | |||
| 68 | * mh-e.el (mh-compiling-flag): Delete. No longer needed by | ||
| 69 | mh-display-color-cells. | ||
| 70 | |||
| 1 | 2006-02-21 Eric Ding <ericding@alum.mit.edu> | 71 | 2006-02-21 Eric Ding <ericding@alum.mit.edu> |
| 2 | 72 | ||
| 3 | * mh-e.el (mh-invisible-header-fields-internal): Added entry | 73 | * mh-e.el (mh-invisible-header-fields-internal): Add entry |
| 4 | "X-Sasl-enc:" | 74 | "X-Sasl-enc:" |
| 5 | 75 | ||
| 6 | 2006-02-20 Eric Ding <ericding@alum.mit.edu> | 76 | 2006-02-20 Eric Ding <ericding@alum.mit.edu> |
| 7 | 77 | ||
| 8 | * mh-e.el (mh-invisible-header-fields-internal): Added entries | 78 | * mh-e.el (mh-invisible-header-fields-internal): Add entries |
| 9 | "X-Authenticated-Sender:", "X-Barracuda-", "X-EFL-Spamscore", | 79 | "X-Authenticated-Sender:", "X-Barracuda-", "X-EFL-Spamscore", |
| 10 | "X-IronPort-AV:", "X-Mail-from:", "X-Mailman-Approved-At:", | 80 | "X-IronPort-AV:", "X-Mail-from:", "X-Mailman-Approved-At:", |
| 11 | "X-Resolved-to:", and "X-SA-Exim". Fixed "X-Bugzilla-" and | 81 | "X-Resolved-to:", and "X-SA-Exim". Fixed "X-Bugzilla-" and |
| @@ -111,7 +181,7 @@ | |||
| 111 | 181 | ||
| 112 | 2006-02-04 Eric Ding <ericding@alum.mit.edu> | 182 | 2006-02-04 Eric Ding <ericding@alum.mit.edu> |
| 113 | 183 | ||
| 114 | * mh-mime.el (mh-file-mime-type-substitutions): Added entries to | 184 | * mh-mime.el (mh-file-mime-type-substitutions): Add entries to |
| 115 | handle OpenOffice documents. | 185 | handle OpenOffice documents. |
| 116 | 186 | ||
| 117 | 2006-02-03 Bill Wohler <wohler@newt.com> | 187 | 2006-02-03 Bill Wohler <wohler@newt.com> |
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el index 4bc5fdf36f7..faa91a3bca2 100644 --- a/lisp/mh-e/mh-compat.el +++ b/lisp/mh-e/mh-compat.el | |||
| @@ -79,11 +79,11 @@ introduced in Emacs 22." | |||
| 79 | 79 | ||
| 80 | (mh-defun-compat mh-display-color-cells display-color-cells (&optional display) | 80 | (mh-defun-compat mh-display-color-cells display-color-cells (&optional display) |
| 81 | "Return the number of color cells supported by DISPLAY. | 81 | "Return the number of color cells supported by DISPLAY. |
| 82 | This function is used by XEmacs to always return 0 when compiling | 82 | This function is used by XEmacs to return 2 when |
| 83 | to avoid compiling errors. Otherwise uses `device-color-cells'." | 83 | `device-color-cells' returns nil. This happens when compiling or |
| 84 | (if mh-compiling-flag | 84 | running on a tty and causes errors since `display-color-cells' is |
| 85 | 0 | 85 | expected to return an integer." |
| 86 | (device-color-cells display))) | 86 | (or (device-color-cells display) 2)) |
| 87 | 87 | ||
| 88 | (defmacro mh-display-completion-list (completions &optional common-substring) | 88 | (defmacro mh-display-completion-list (completions &optional common-substring) |
| 89 | "Display the list of COMPLETIONS. | 89 | "Display the list of COMPLETIONS. |
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 5a07524aec4..fa4df0873b1 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el | |||
| @@ -101,12 +101,7 @@ | |||
| 101 | 101 | ||
| 102 | (eval-and-compile | 102 | (eval-and-compile |
| 103 | (defvar mh-xemacs-flag (featurep 'xemacs) | 103 | (defvar mh-xemacs-flag (featurep 'xemacs) |
| 104 | "Non-nil means the current Emacs is XEmacs.") | 104 | "Non-nil means the current Emacs is XEmacs.")) |
| 105 | (defvar mh-compiling-flag nil | ||
| 106 | "Non-nil means we're compiling.")) | ||
| 107 | |||
| 108 | (eval-when (compile) | ||
| 109 | (setq mh-compiling-flag t)) | ||
| 110 | 105 | ||
| 111 | (mh-do-in-xemacs | 106 | (mh-do-in-xemacs |
| 112 | (require 'mh-xemacs)) | 107 | (require 'mh-xemacs)) |
| @@ -869,14 +864,18 @@ The default setting of this option is \"Auto-detect\" which means | |||
| 869 | that MH-E will automatically choose the first of nmh, MH, or GNU | 864 | that MH-E will automatically choose the first of nmh, MH, or GNU |
| 870 | mailutils that it finds in the directories listed in | 865 | mailutils that it finds in the directories listed in |
| 871 | `mh-path' (which you can customize), `mh-sys-path', and | 866 | `mh-path' (which you can customize), `mh-sys-path', and |
| 872 | `exec-path'. If, for example, you have both nmh and mailutils | 867 | `exec-path'. If MH-E can't find MH at all, you may have to |
| 873 | installed and `mh-variant-in-use' was initialized to nmh but you | 868 | customize `mh-path' and add the directory in which the command |
| 874 | want to use mailutils, then you can set this option to | 869 | \"mhparam\" is located. If, on the other hand, you have both nmh |
| 875 | \"mailutils\". | 870 | and mailutils installed (for example) and `mh-variant-in-use' was |
| 871 | initialized to nmh but you want to use mailutils, then you can | ||
| 872 | set this option to \"mailutils\". | ||
| 876 | 873 | ||
| 877 | When this variable is changed, MH-E resets `mh-progs', `mh-lib', | 874 | When this variable is changed, MH-E resets `mh-progs', `mh-lib', |
| 878 | `mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use' | 875 | `mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use' |
| 879 | accordingly." | 876 | accordingly. Prior to version 8, it was often necessary to set |
| 877 | some of these variables in \"~/.emacs\"; now it is no longer | ||
| 878 | necessary and can actually cause problems." | ||
| 880 | :type `(radio | 879 | :type `(radio |
| 881 | (const :tag "Auto-detect" autodetect) | 880 | (const :tag "Auto-detect" autodetect) |
| 882 | ,@(mapcar (lambda (x) `(const ,(car x))) (mh-variants))) | 881 | ,@(mapcar (lambda (x) `(const ,(car x))) (mh-variants))) |
| @@ -1241,11 +1240,11 @@ an alternate view. For example, \"'(\"-nolimit\" \"-textfield\" | |||
| 1241 | (defcustom mh-default-folder-for-message-function nil | 1240 | (defcustom mh-default-folder-for-message-function nil |
| 1242 | "Function to select a default folder for refiling or \"Fcc:\". | 1241 | "Function to select a default folder for refiling or \"Fcc:\". |
| 1243 | 1242 | ||
| 1244 | The current buffer is set to the message being refiled with point | 1243 | When this function is called, the current buffer contains the message |
| 1245 | at the start of the message. This function should return the | 1244 | being refiled and point is at the start of the message. This function |
| 1246 | default folder as a string with a leading \"+\" sign. It can also | 1245 | should return the default folder as a string with a leading \"+\" |
| 1247 | return nil so that the last folder name is used as the default, | 1246 | sign. It can also return nil so that the last folder name is used as |
| 1248 | or an empty string to suppress the default entirely." | 1247 | the default, or an empty string to suppress the default entirely." |
| 1249 | :type 'function | 1248 | :type 'function |
| 1250 | :group 'mh-folder-selection) | 1249 | :group 'mh-folder-selection) |
| 1251 | 1250 | ||
| @@ -2994,6 +2993,8 @@ colors." | |||
| 2994 | (setq new-spec (cons entry new-spec))))) | 2993 | (setq new-spec (cons entry new-spec))))) |
| 2995 | new-spec))) | 2994 | new-spec))) |
| 2996 | 2995 | ||
| 2996 | (require 'cus-face) | ||
| 2997 | |||
| 2997 | (defvar mh-inherit-face-flag (assq :inherit custom-face-attributes) | 2998 | (defvar mh-inherit-face-flag (assq :inherit custom-face-attributes) |
| 2998 | "Non-nil means that the `defface' :inherit keyword is available. | 2999 | "Non-nil means that the `defface' :inherit keyword is available. |
| 2999 | The :inherit keyword is available on all supported versions of | 3000 | The :inherit keyword is available on all supported versions of |
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index 59526986d35..c25d3bc973f 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el | |||
| @@ -36,8 +36,9 @@ | |||
| 36 | (require 'mh-scan) | 36 | (require 'mh-scan) |
| 37 | (mh-require-cl) | 37 | (mh-require-cl) |
| 38 | 38 | ||
| 39 | ;; Dynamically-created function not found in mh-loaddefs.el. | 39 | ;; Dynamically-created functions not found in mh-loaddefs.el. |
| 40 | (autoload 'mh-tool-bar-folder-buttons-init "mh-tool-bar") | 40 | (autoload 'mh-tool-bar-folder-buttons-init "mh-tool-bar") |
| 41 | (autoload 'mh-tool-bar-init "mh-tool-bar") | ||
| 41 | 42 | ||
| 42 | (require 'gnus-util) | 43 | (require 'gnus-util) |
| 43 | (autoload 'message-fetch-field "message") | 44 | (autoload 'message-fetch-field "message") |
| @@ -589,9 +590,16 @@ perform the operation on all messages in that region. | |||
| 589 | 590 | ||
| 590 | \\{mh-folder-mode-map}" | 591 | \\{mh-folder-mode-map}" |
| 591 | (mh-do-in-gnu-emacs | 592 | (mh-do-in-gnu-emacs |
| 592 | (unless mh-folder-buttons-init-flag | 593 | (unless mh-folder-buttons-init-flag |
| 593 | (mh-tool-bar-folder-buttons-init) | 594 | (let ((load-path |
| 594 | (setq mh-folder-buttons-init-flag t))) | 595 | (mh-image-load-path "mh-e" "mh-logo.xpm" 'load-path)) |
| 596 | (image-load-path | ||
| 597 | (mh-image-load-path "mh-e" "mh-logo.xpm" 'image-load-path))) | ||
| 598 | (mh-tool-bar-folder-buttons-init) | ||
| 599 | (setq mh-folder-buttons-init-flag t))) | ||
| 600 | (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map)) | ||
| 601 | (mh-do-in-xemacs | ||
| 602 | (mh-tool-bar-init :folder)) | ||
| 595 | (make-local-variable 'font-lock-defaults) | 603 | (make-local-variable 'font-lock-defaults) |
| 596 | (setq font-lock-defaults '(mh-folder-font-lock-keywords t)) | 604 | (setq font-lock-defaults '(mh-folder-font-lock-keywords t)) |
| 597 | (make-local-variable 'desktop-save-buffer) | 605 | (make-local-variable 'desktop-save-buffer) |
| @@ -652,8 +660,6 @@ perform the operation on all messages in that region. | |||
| 652 | (easy-menu-add mh-folder-message-menu) | 660 | (easy-menu-add mh-folder-message-menu) |
| 653 | (easy-menu-add mh-folder-folder-menu) | 661 | (easy-menu-add mh-folder-folder-menu) |
| 654 | (mh-inc-spool-make) | 662 | (mh-inc-spool-make) |
| 655 | (set (make-local-variable 'tool-bar-map) mh-folder-tool-bar-map) | ||
| 656 | (mh-funcall-if-exists mh-tool-bar-init :folder) | ||
| 657 | (mh-set-help mh-folder-mode-help-messages) | 663 | (mh-set-help mh-folder-mode-help-messages) |
| 658 | (if (and mh-xemacs-flag | 664 | (if (and mh-xemacs-flag |
| 659 | font-lock-auto-fontify) | 665 | font-lock-auto-fontify) |
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index c6af5c323a9..535cbb8e242 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el | |||
| @@ -42,8 +42,9 @@ | |||
| 42 | 42 | ||
| 43 | (require 'gnus-util) | 43 | (require 'gnus-util) |
| 44 | 44 | ||
| 45 | ;; Dynamically-created function not found in mh-loaddefs.el. | 45 | ;; Dynamically-created functions not found in mh-loaddefs.el. |
| 46 | (autoload 'mh-tool-bar-letter-buttons-init "mh-tool-bar") | 46 | (autoload 'mh-tool-bar-letter-buttons-init "mh-tool-bar") |
| 47 | (autoload 'mh-tool-bar-init "mh-tool-bar") | ||
| 47 | 48 | ||
| 48 | (autoload 'mml-insert-tag "mml") | 49 | (autoload 'mml-insert-tag "mml") |
| 49 | 50 | ||
| @@ -311,9 +312,16 @@ order). | |||
| 311 | (make-local-variable 'mh-sent-from-folder) | 312 | (make-local-variable 'mh-sent-from-folder) |
| 312 | (make-local-variable 'mh-sent-from-msg) | 313 | (make-local-variable 'mh-sent-from-msg) |
| 313 | (mh-do-in-gnu-emacs | 314 | (mh-do-in-gnu-emacs |
| 314 | (unless mh-letter-buttons-init-flag | 315 | (unless mh-letter-buttons-init-flag |
| 315 | (mh-tool-bar-letter-buttons-init) | 316 | (let ((load-path |
| 316 | (setq mh-letter-buttons-init-flag t))) | 317 | (mh-image-load-path "mh-e" "mh-logo.xpm" 'load-path)) |
| 318 | (image-load-path | ||
| 319 | (mh-image-load-path "mh-e" "mh-logo.xpm" 'image-load-path))) | ||
| 320 | (mh-tool-bar-letter-buttons-init) | ||
| 321 | (setq mh-letter-buttons-init-flag t))) | ||
| 322 | (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map)) | ||
| 323 | (mh-do-in-xemacs | ||
| 324 | (mh-tool-bar-init :letter)) | ||
| 317 | ;; Set the local value of mh-mail-header-separator according to what is | 325 | ;; Set the local value of mh-mail-header-separator according to what is |
| 318 | ;; present in the buffer... | 326 | ;; present in the buffer... |
| 319 | (set (make-local-variable 'mh-mail-header-separator) | 327 | (set (make-local-variable 'mh-mail-header-separator) |
| @@ -328,8 +336,6 @@ order). | |||
| 328 | 336 | ||
| 329 | ;; Enable undo since a show-mode buffer might have been reused. | 337 | ;; Enable undo since a show-mode buffer might have been reused. |
| 330 | (buffer-enable-undo) | 338 | (buffer-enable-undo) |
| 331 | (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map) | ||
| 332 | (mh-funcall-if-exists mh-tool-bar-init :letter) | ||
| 333 | (make-local-variable 'font-lock-defaults) | 339 | (make-local-variable 'font-lock-defaults) |
| 334 | (cond | 340 | (cond |
| 335 | ((or (equal mh-highlight-citation-style 'font-lock) | 341 | ((or (equal mh-highlight-citation-style 'font-lock) |
diff --git a/lisp/mh-e/mh-limit.el b/lisp/mh-e/mh-limit.el index 7a90b890cad..64a61ce499a 100644 --- a/lisp/mh-e/mh-limit.el +++ b/lisp/mh-e/mh-limit.el | |||
| @@ -89,7 +89,8 @@ With a prefix argument, edit PICK-EXPR. | |||
| 89 | 89 | ||
| 90 | Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." | 90 | Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." |
| 91 | (interactive | 91 | (interactive |
| 92 | (list (mh-edit-pick-expr (mh-current-message-header-field 'cc)))) | 92 | (list (mh-edit-pick-expr |
| 93 | (mh-quote-pick-expr (mh-current-message-header-field 'cc))))) | ||
| 93 | (mh-narrow-to-header-field 'cc pick-expr)) | 94 | (mh-narrow-to-header-field 'cc pick-expr)) |
| 94 | 95 | ||
| 95 | ;;;###mh-autoload | 96 | ;;;###mh-autoload |
| @@ -99,7 +100,8 @@ With a prefix argument, edit PICK-EXPR. | |||
| 99 | 100 | ||
| 100 | Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." | 101 | Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." |
| 101 | (interactive | 102 | (interactive |
| 102 | (list (mh-edit-pick-expr (mh-current-message-header-field 'from)))) | 103 | (list (mh-edit-pick-expr |
| 104 | (mh-quote-pick-expr (mh-current-message-header-field 'from))))) | ||
| 103 | (mh-narrow-to-header-field 'from pick-expr)) | 105 | (mh-narrow-to-header-field 'from pick-expr)) |
| 104 | 106 | ||
| 105 | ;;;###mh-autoload | 107 | ;;;###mh-autoload |
| @@ -119,10 +121,16 @@ Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." | |||
| 119 | (defun mh-narrow-to-subject (&optional pick-expr) | 121 | (defun mh-narrow-to-subject (&optional pick-expr) |
| 120 | "Limit to messages with same subject. | 122 | "Limit to messages with same subject. |
| 121 | With a prefix argument, edit PICK-EXPR. | 123 | With a prefix argument, edit PICK-EXPR. |
| 124 | The string Re: is removed from the search. | ||
| 122 | 125 | ||
| 123 | Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." | 126 | Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." |
| 124 | (interactive | 127 | (interactive |
| 125 | (list (mh-edit-pick-expr (mh-current-message-header-field 'subject)))) | 128 | (list (mh-edit-pick-expr |
| 129 | (mh-quote-pick-expr (mh-current-message-header-field 'subject))))) | ||
| 130 | (setq pick-expr | ||
| 131 | (let ((case-fold-search t)) | ||
| 132 | (loop for s in pick-expr | ||
| 133 | collect (mh-replace-regexp-in-string "re: *" "" s)))) | ||
| 126 | (mh-narrow-to-header-field 'subject pick-expr)) | 134 | (mh-narrow-to-header-field 'subject pick-expr)) |
| 127 | 135 | ||
| 128 | ;;;###mh-autoload | 136 | ;;;###mh-autoload |
| @@ -132,7 +140,8 @@ With a prefix argument, edit PICK-EXPR. | |||
| 132 | 140 | ||
| 133 | Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." | 141 | Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." |
| 134 | (interactive | 142 | (interactive |
| 135 | (list (mh-edit-pick-expr (mh-current-message-header-field 'to)))) | 143 | (list (mh-edit-pick-expr |
| 144 | (mh-quote-pick-expr (mh-current-message-header-field 'to))))) | ||
| 136 | (mh-narrow-to-header-field 'to pick-expr)) | 145 | (mh-narrow-to-header-field 'to pick-expr)) |
| 137 | 146 | ||
| 138 | 147 | ||
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index 4b0ce65cf5d..d35e759bcd4 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el | |||
| @@ -1689,8 +1689,7 @@ buffer, while END defaults to the the end of the buffer." | |||
| 1689 | "Return the content type associated with the given FILENAME. | 1689 | "Return the content type associated with the given FILENAME. |
| 1690 | If the \"file\" command exists and recognizes the given file, | 1690 | If the \"file\" command exists and recognizes the given file, |
| 1691 | then its value is returned\; otherwise, the user is prompted for | 1691 | then its value is returned\; otherwise, the user is prompted for |
| 1692 | a type (see `mailcap-mime-types' and for Emacs 20, | 1692 | a type (see `mailcap-mime-types'). |
| 1693 | `mh-mime-content-types'). | ||
| 1694 | Optional argument DEFAULT is returned if a type isn't entered." | 1693 | Optional argument DEFAULT is returned if a type isn't entered." |
| 1695 | (mailcap-parse-mimetypes) | 1694 | (mailcap-parse-mimetypes) |
| 1696 | (let* ((default (or default | 1695 | (let* ((default (or default |
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index 3ae609d9204..d7b656d3462 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el | |||
| @@ -36,6 +36,9 @@ | |||
| 36 | (require 'mh-e) | 36 | (require 'mh-e) |
| 37 | (require 'mh-scan) | 37 | (require 'mh-scan) |
| 38 | 38 | ||
| 39 | ;; Dynamically-created function not found in mh-loaddefs.el. | ||
| 40 | (autoload 'mh-tool-bar-init "mh-tool-bar") | ||
| 41 | |||
| 39 | (require 'font-lock) | 42 | (require 'font-lock) |
| 40 | (require 'gnus-cite) | 43 | (require 'gnus-cite) |
| 41 | (require 'gnus-util) | 44 | (require 'gnus-util) |
| @@ -830,6 +833,10 @@ The hook `mh-show-mode-hook' is called upon entry to this mode. | |||
| 830 | See also `mh-folder-mode'. | 833 | See also `mh-folder-mode'. |
| 831 | 834 | ||
| 832 | \\{mh-show-mode-map}" | 835 | \\{mh-show-mode-map}" |
| 836 | (mh-do-in-gnu-emacs | ||
| 837 | (set (make-local-variable 'tool-bar-map) mh-show-tool-bar-map)) | ||
| 838 | (mh-do-in-xemacs | ||
| 839 | (mh-tool-bar-init :show)) | ||
| 833 | (set (make-local-variable 'mail-header-separator) mh-mail-header-separator) | 840 | (set (make-local-variable 'mail-header-separator) mh-mail-header-separator) |
| 834 | (setq paragraph-start (default-value 'paragraph-start)) | 841 | (setq paragraph-start (default-value 'paragraph-start)) |
| 835 | (mh-show-unquote-From) | 842 | (mh-show-unquote-From) |
| @@ -853,8 +860,6 @@ See also `mh-folder-mode'. | |||
| 853 | (if (and mh-xemacs-flag | 860 | (if (and mh-xemacs-flag |
| 854 | font-lock-auto-fontify) | 861 | font-lock-auto-fontify) |
| 855 | (turn-on-font-lock)) | 862 | (turn-on-font-lock)) |
| 856 | (set (make-local-variable 'tool-bar-map) mh-show-tool-bar-map) | ||
| 857 | (mh-funcall-if-exists mh-tool-bar-init :show) | ||
| 858 | (when mh-decode-mime-flag | 863 | (when mh-decode-mime-flag |
| 859 | (mh-make-local-hook 'kill-buffer-hook) | 864 | (mh-make-local-hook 'kill-buffer-hook) |
| 860 | (add-hook 'kill-buffer-hook 'mh-mime-cleanup nil t)) | 865 | (add-hook 'kill-buffer-hook 'mh-mime-cleanup nil t)) |
diff --git a/lisp/mh-e/mh-tool-bar.el b/lisp/mh-e/mh-tool-bar.el index 20b239189fa..d72fe8e06ce 100644 --- a/lisp/mh-e/mh-tool-bar.el +++ b/lisp/mh-e/mh-tool-bar.el | |||
| @@ -204,10 +204,10 @@ where, | |||
| 204 | letter-vectors (nreverse letter-vectors)) | 204 | letter-vectors (nreverse letter-vectors)) |
| 205 | (dolist (x folder-defaults) | 205 | (dolist (x folder-defaults) |
| 206 | (unless (memq x folder-buttons) | 206 | (unless (memq x folder-buttons) |
| 207 | (error "Folder defaults contains unknown button '%s'" x))) | 207 | (error "Folder defaults contains unknown button %s" x))) |
| 208 | (dolist (x letter-defaults) | 208 | (dolist (x letter-defaults) |
| 209 | (unless (memq x letter-buttons) | 209 | (unless (memq x letter-buttons) |
| 210 | (error "Letter defaults contains unknown button '%s'" x))) | 210 | (error "Letter defaults contains unknown button %s" x))) |
| 211 | `(eval-when (compile load eval) | 211 | `(eval-when (compile load eval) |
| 212 | (defun mh-buffer-exists-p (mode) | 212 | (defun mh-buffer-exists-p (mode) |
| 213 | "Test whether a buffer with major mode MODE is present." | 213 | "Test whether a buffer with major mode MODE is present." |
| @@ -222,7 +222,6 @@ where, | |||
| 222 | ;; Tool bar initialization functions | 222 | ;; Tool bar initialization functions |
| 223 | (defun mh-tool-bar-folder-buttons-init () | 223 | (defun mh-tool-bar-folder-buttons-init () |
| 224 | (when (mh-buffer-exists-p 'mh-folder-mode) | 224 | (when (mh-buffer-exists-p 'mh-folder-mode) |
| 225 | (mh-image-load-path) | ||
| 226 | (setq mh-folder-tool-bar-map | 225 | (setq mh-folder-tool-bar-map |
| 227 | (let ((tool-bar-map (make-sparse-keymap))) | 226 | (let ((tool-bar-map (make-sparse-keymap))) |
| 228 | ,@(nreverse folder-button-setter) | 227 | ,@(nreverse folder-button-setter) |
| @@ -241,7 +240,6 @@ where, | |||
| 241 | tool-bar-map)))) | 240 | tool-bar-map)))) |
| 242 | (defun mh-tool-bar-letter-buttons-init () | 241 | (defun mh-tool-bar-letter-buttons-init () |
| 243 | (when (mh-buffer-exists-p 'mh-letter-mode) | 242 | (when (mh-buffer-exists-p 'mh-letter-mode) |
| 244 | (mh-image-load-path) | ||
| 245 | (setq mh-letter-tool-bar-map | 243 | (setq mh-letter-tool-bar-map |
| 246 | (let ((tool-bar-map (make-sparse-keymap))) | 244 | (let ((tool-bar-map (make-sparse-keymap))) |
| 247 | ,@(nreverse letter-button-setter) | 245 | ,@(nreverse letter-button-setter) |
| @@ -334,84 +332,82 @@ where, | |||
| 334 | collect `(const :tag ,y ,x))))))) | 332 | collect `(const :tag ,y ,x))))))) |
| 335 | 333 | ||
| 336 | (mh-tool-bar-define | 334 | (mh-tool-bar-define |
| 337 | ((:folder mh-inc-folder mh-mime-save-parts mh-previous-undeleted-msg | 335 | ((:folder mh-inc-folder mh-mime-save-parts mh-previous-undeleted-msg |
| 338 | mh-page-msg mh-next-undeleted-msg mh-delete-msg mh-refile-msg | 336 | mh-page-msg mh-next-undeleted-msg mh-delete-msg mh-refile-msg |
| 339 | mh-undo mh-execute-commands mh-toggle-tick mh-reply | 337 | mh-undo mh-execute-commands mh-toggle-tick mh-reply |
| 340 | mh-alias-grab-from-field mh-send mh-rescan-folder | 338 | mh-alias-grab-from-field mh-send mh-rescan-folder |
| 341 | mh-tool-bar-search mh-visit-folder | 339 | mh-tool-bar-search mh-visit-folder |
| 342 | mh-tool-bar-customize mh-tool-bar-folder-help mh-widen) | 340 | mh-tool-bar-customize mh-tool-bar-folder-help mh-widen) |
| 343 | (:letter mh-send-letter mh-compose-insertion ispell-message save-buffer | 341 | (:letter mh-send-letter mh-compose-insertion ispell-message save-buffer |
| 344 | undo kill-region menu-bar-kill-ring-save yank mh-fully-kill-draft | 342 | undo kill-region menu-bar-kill-ring-save yank mh-fully-kill-draft |
| 345 | mh-tool-bar-customize mh-tool-bar-letter-help)) | 343 | mh-tool-bar-customize mh-tool-bar-letter-help)) |
| 346 | ;; Folder/Show buffer buttons | 344 | ;; Folder/Show buffer buttons |
| 347 | (mh-inc-folder (folder) "mail" | 345 | (mh-inc-folder (folder) "mail" "Incorporate new mail in Inbox |
| 348 | "Incorporate new mail in Inbox | ||
| 349 | This button runs `mh-inc-folder' which drags any | 346 | This button runs `mh-inc-folder' which drags any |
| 350 | new mail into your Inbox folder.") | 347 | new mail into your Inbox folder") |
| 351 | (mh-mime-save-parts (folder) "attach" | 348 | (mh-mime-save-parts (folder) "attach" "Save MIME parts from this message |
| 352 | "Save MIME parts from this message | ||
| 353 | This button runs `mh-mime-save-parts' which saves a message's | 349 | This button runs `mh-mime-save-parts' which saves a message's |
| 354 | different parts into separate files.") | 350 | different parts into separate files") |
| 355 | (mh-previous-undeleted-msg (folder) "left-arrow" | 351 | (mh-previous-undeleted-msg (folder) "left-arrow" |
| 356 | "Go to the previous undeleted message | 352 | "Go to the previous undeleted message |
| 357 | This button runs `mh-previous-undeleted-msg'") | 353 | This button runs `mh-previous-undeleted-msg'") |
| 358 | (mh-page-msg (folder) "page-down" | 354 | (mh-page-msg (folder) "page-down" "Page the current message forwards |
| 359 | "Page the current message forwards\nThis button runs `mh-page-msg'") | 355 | This button runs `mh-page-msg'") |
| 360 | (mh-next-undeleted-msg (folder) "right-arrow" | 356 | (mh-next-undeleted-msg (folder) "right-arrow" "Go to the next undeleted message |
| 361 | "Go to the next undeleted message\nThe button runs `mh-next-undeleted-msg'") | 357 | The button runs `mh-next-undeleted-msg'") |
| 362 | (mh-delete-msg (folder) "close" | 358 | (mh-delete-msg (folder) "close" "Mark this message for deletion |
| 363 | "Mark this message for deletion\nThis button runs `mh-delete-msg'") | 359 | This button runs `mh-delete-msg'") |
| 364 | (mh-refile-msg (folder) "mail/refile" | 360 | (mh-refile-msg (folder) "mail/refile" "Refile this message |
| 365 | "Refile this message\nThis button runs `mh-refile-msg'") | 361 | This button runs `mh-refile-msg'") |
| 366 | (mh-undo (folder) "undo" "Undo last operation\nThis button runs `undo'" | 362 | (mh-undo (folder) "undo" "Undo last operation |
| 367 | (mh-outstanding-commands-p)) | 363 | This button runs `undo'" |
| 368 | (mh-execute-commands (folder) "execute" | 364 | (mh-outstanding-commands-p)) |
| 369 | "Perform moves and deletes\nThis button runs `mh-execute-commands'" | 365 | (mh-execute-commands (folder) "execute" "Perform moves and deletes |
| 370 | (mh-outstanding-commands-p)) | 366 | This button runs `mh-execute-commands'" |
| 371 | (mh-toggle-tick (folder) "highlight" | 367 | (mh-outstanding-commands-p)) |
| 372 | "Toggle tick mark\nThis button runs `mh-toggle-tick'") | 368 | (mh-toggle-tick (folder) "highlight" "Toggle tick mark |
| 373 | (mh-toggle-showing (folder) "show" | 369 | This button runs `mh-toggle-tick'") |
| 374 | "Toggle showing message\nThis button runs `mh-toggle-showing'") | 370 | (mh-toggle-showing (folder) "show" "Toggle showing message |
| 375 | (mh-tool-bar-reply-from (folder) "mail/reply-from" "Reply to \"from\"") | 371 | This button runs `mh-toggle-showing'") |
| 376 | (mh-tool-bar-reply-to (folder) "mail/reply-to" "Reply to \"to\"") | 372 | (mh-tool-bar-reply-from (folder) "mail/reply-from" "Reply to \"from\"") |
| 377 | (mh-tool-bar-reply-all (folder) "mail/reply-all" "Reply to \"all\"") | 373 | (mh-tool-bar-reply-to (folder) "mail/reply-to" "Reply to \"to\"") |
| 378 | (mh-reply (folder) "mail/reply" | 374 | (mh-tool-bar-reply-all (folder) "mail/reply-all" "Reply to \"all\"") |
| 379 | "Reply to this message\nThis button runs `mh-reply'") | 375 | (mh-reply (folder) "mail/reply" "Reply to this message |
| 380 | (mh-alias-grab-from-field (folder) "mail/alias" | 376 | This button runs `mh-reply'") |
| 381 | "Grab From alias\nThis button runs `mh-alias-grab-from-field'" | 377 | (mh-alias-grab-from-field (folder) "mail/alias" "Grab From alias |
| 382 | (and (mh-extract-from-header-value) (not (mh-alias-for-from-p)))) | 378 | This button runs `mh-alias-grab-from-field'" |
| 383 | (mh-send (folder) "mail/compose" | 379 | (and (mh-extract-from-header-value) |
| 384 | "Compose new message\nThis button runs `mh-send'") | 380 | (not (mh-alias-for-from-p)))) |
| 385 | (mh-rescan-folder (folder) "refresh" | 381 | (mh-send (folder) "mail/compose" "Compose new message |
| 386 | "Rescan this folder\nThis button runs `mh-rescan-folder'") | 382 | This button runs `mh-send'") |
| 387 | (mh-pack-folder (folder) "mail/repack" | 383 | (mh-rescan-folder (folder) "refresh" "Rescan this folder |
| 388 | "Repack this folder\nThis button runs `mh-pack-folder'") | 384 | This button runs `mh-rescan-folder'") |
| 389 | (mh-tool-bar-search (folder) "search" | 385 | (mh-pack-folder (folder) "mail/repack" "Repack this folder |
| 390 | "Search\nThis button runs `mh-tool-bar-search-function'") | 386 | This button runs `mh-pack-folder'") |
| 391 | (mh-visit-folder (folder) "fld-open" | 387 | (mh-tool-bar-search (folder) "search" "Search |
| 392 | "Visit other folder\nThis button runs `mh-visit-folder'") | 388 | This button runs `mh-tool-bar-search-function'") |
| 393 | ;; Letter buffer buttons | 389 | (mh-visit-folder (folder) "fld-open" "Visit other folder |
| 394 | (mh-send-letter (letter) "mail/send" "Send this letter") | 390 | This button runs `mh-visit-folder'") |
| 395 | (mh-compose-insertion (letter) "attach" "Insert attachment") | 391 | ;; Letter buffer buttons |
| 396 | (ispell-message (letter) "spell" "Check spelling") | 392 | (mh-send-letter (letter) "mail/send" "Send this letter") |
| 397 | (save-buffer (letter) "save" "Save current buffer to its file" | 393 | (mh-compose-insertion (letter) "attach" "Insert attachment") |
| 398 | (buffer-modified-p)) | 394 | (ispell-message (letter) "spell" "Check spelling") |
| 399 | (undo (letter) "undo" "Undo last operation") | 395 | (save-buffer (letter) "save" "Save current buffer to its file" |
| 400 | (kill-region (letter) "cut" | 396 | (buffer-modified-p)) |
| 401 | "Cut (kill) text in region between mark and current position") | 397 | (undo (letter) "undo" "Undo last operation") |
| 402 | (menu-bar-kill-ring-save (letter) "copy" | 398 | (kill-region (letter) "cut" "Cut (kill) text in region") |
| 403 | "Copy text in region between mark and current position") | 399 | (menu-bar-kill-ring-save (letter) "copy" "Copy text in region") |
| 404 | (yank (letter) "paste" "Paste (yank) text cut or copied earlier") | 400 | (yank (letter) "paste" "Paste (yank) text cut or copied earlier") |
| 405 | (mh-fully-kill-draft (letter) "close" "Kill this draft") | 401 | (mh-fully-kill-draft (letter) "close" "Kill this draft") |
| 406 | ;; Common buttons | 402 | ;; Common buttons |
| 407 | (mh-tool-bar-customize (folder letter) "preferences" "MH-E Preferences") | 403 | (mh-tool-bar-customize (folder letter) "preferences" "MH-E Preferences") |
| 408 | (mh-tool-bar-folder-help (folder) "help" | 404 | (mh-tool-bar-folder-help (folder) "help" "Help! (general help) |
| 409 | "Help! (general help)\nThis button runs `info'") | 405 | This button runs `info'") |
| 410 | (mh-tool-bar-letter-help (letter) "help" | 406 | (mh-tool-bar-letter-help (letter) "help" "Help! (general help) |
| 411 | "Help! (general help)\nThis button runs `info'") | 407 | This button runs `info'") |
| 412 | ;; Folder narrowed to sequence buttons | 408 | ;; Folder narrowed to sequence buttons |
| 413 | (mh-widen (sequence) "widen" | 409 | (mh-widen (sequence) "widen" "Widen from the sequence |
| 414 | "Widen from the sequence\nThis button runs `mh-widen'")) | 410 | This button runs `mh-widen'")) |
| 415 | 411 | ||
| 416 | (provide 'mh-tool-bar) | 412 | (provide 'mh-tool-bar) |
| 417 | 413 | ||
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index c00558860d1..5f882e84020 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el | |||
| @@ -81,69 +81,77 @@ used in lieu of `search' in the CL package." | |||
| 81 | "Delete the next LINES lines." | 81 | "Delete the next LINES lines." |
| 82 | (delete-region (point) (progn (forward-line lines) (point)))) | 82 | (delete-region (point) (progn (forward-line lines) (point)))) |
| 83 | 83 | ||
| 84 | (defvar mh-image-load-path nil | ||
| 85 | "Directory where images for MH-E are found. | ||
| 86 | If nil, then the function `mh-image-load-path' will search for | ||
| 87 | the images in \"../../etc/images\" relative to the files in | ||
| 88 | \"lisp/mh-e\".") | ||
| 89 | |||
| 90 | (defvar mh-image-load-path-called-flag nil | ||
| 91 | "Non-nil means that the function `mh-image-load-path' has been called. | ||
| 92 | This variable is used by that function to avoid doing the work repeatedly.") | ||
| 93 | |||
| 94 | ;;;###mh-autoload | 84 | ;;;###mh-autoload |
| 95 | (defun mh-image-load-path () | 85 | (defun mh-image-load-path (library image &optional path) |
| 96 | "Ensure that the MH-E images are accessible by `find-image'. | 86 | "Return a suitable search path for images of LIBRARY. |
| 97 | 87 | ||
| 98 | Images for MH-E are found in \"../../etc/images\" relative to the | 88 | Images for LIBRARY are searched for in \"../../etc/images\" and |
| 99 | files in \"lisp/mh-e\", in `image-load-path', or in `load-path'. | 89 | \"../etc/images\" relative to the files in \"lisp/LIBRARY\", in |
| 100 | This function saves the actual location found in the variable | 90 | `image-load-path', or in `load-path'. |
| 101 | `mh-image-load-path'. If the images on your system are actually | 91 | |
| 102 | located elsewhere, then set the variable `mh-image-load-path' | 92 | This function returns value of `load-path' augmented with the |
| 103 | before starting MH-E. | 93 | path to IMAGE. If PATH is given, it is used instead of |
| 104 | 94 | `load-path'." | |
| 105 | If `image-load-path' exists (since Emacs 22), then the contents | 95 | (unless library (error "No library specified")) |
| 106 | of the variable `mh-image-load-path' is added to it if isn't | 96 | (unless image (error "No image specified")) |
| 107 | already there. Otherwise, the contents of the variable | 97 | (let ((mh-image-directory)) |
| 108 | `mh-image-load-path' is added to the `load-path' if it isn't | ||
| 109 | already there. | ||
| 110 | |||
| 111 | See also variable `mh-image-load-path-called-flag'." | ||
| 112 | (unless mh-image-load-path-called-flag | ||
| 113 | (cond | 98 | (cond |
| 114 | (mh-image-load-path) ; user setting exists | 99 | ;; Try relative setting. |
| 115 | ((let (mh-library-name) ; try relative setting | 100 | ((let (mh-library-name d1ei d2ei) |
| 116 | ;; First, find mh-e in the load-path. | 101 | ;; First, find library in the load-path. |
| 117 | (setq mh-library-name (locate-library "mh-e")) | 102 | (setq mh-library-name (locate-library library)) |
| 118 | (if (not mh-library-name) | 103 | (if (not mh-library-name) |
| 119 | (error "Can not find MH-E in load-path")) | 104 | (error "Cannot find library %s in load-path" library)) |
| 120 | ;; And then set mh-image-load-path relative to that. | 105 | ;; And then set mh-image-directory relative to that. |
| 121 | (setq mh-image-load-path | 106 | (setq |
| 122 | (expand-file-name (concat | 107 | ;; Go down 2 levels. |
| 123 | (file-name-directory mh-library-name) | 108 | d2ei (expand-file-name |
| 124 | "../../etc/images"))) | 109 | (concat (file-name-directory mh-library-name) |
| 125 | (file-exists-p (expand-file-name "mh-logo.xpm" mh-image-load-path)))) | 110 | "../../etc/images")) |
| 126 | ((mh-image-search-load-path "mh-logo.xpm") | 111 | ;; Go down 1 level. |
| 127 | ;; Images in image-load-path. | 112 | d1ei (expand-file-name |
| 128 | (setq mh-image-load-path | 113 | (concat (file-name-directory mh-library-name) |
| 129 | (file-name-directory (mh-image-search-load-path "mh-logo.xpm")))) | 114 | "../etc/images"))) |
| 130 | ((locate-library "mh-logo.xpm") | 115 | (setq mh-image-directory |
| 131 | ;; Images in load-path. | 116 | ;; Set it to nil if image is not found. |
| 132 | (setq mh-image-load-path | 117 | (cond ((file-exists-p (expand-file-name image d2ei)) d2ei) |
| 133 | (file-name-directory (locate-library "mh-logo.xpm"))))) | 118 | ((file-exists-p (expand-file-name image d1ei)) d1ei))))) |
| 134 | 119 | ;; Check for images in image-load-path or load-path. | |
| 135 | (if (not (file-exists-p mh-image-load-path)) | 120 | ((let ((img image) |
| 136 | (error "Directory %s in mh-image-load-path does not exist" | 121 | (dir (or |
| 137 | mh-image-load-path)) | 122 | ;; Images in image-load-path. |
| 138 | (if (not (file-exists-p | 123 | (mh-image-search-load-path image) |
| 139 | (expand-file-name "mh-logo.xpm" mh-image-load-path))) | 124 | ;; Images in load-path. |
| 140 | (error "Directory %s in mh-image-load-path does not contain MH-E images" | 125 | (locate-library image))) |
| 141 | mh-image-load-path)) | 126 | parent) |
| 142 | (if (boundp 'image-load-path) | 127 | ;; Since the image might be in a nested directory |
| 143 | (add-to-list 'image-load-path mh-image-load-path) | 128 | ;; (for example, mail/attach.pbm), adjust `mh-image-directory' |
| 144 | (add-to-list 'load-path mh-image-load-path)) | 129 | ;; accordingly. |
| 145 | 130 | (and dir | |
| 146 | (setq mh-image-load-path-called-flag t))) | 131 | (setq dir (file-name-directory dir)) |
| 132 | (progn | ||
| 133 | (while (setq parent (file-name-directory img)) | ||
| 134 | (setq img (directory-file-name parent) | ||
| 135 | dir (expand-file-name "../" dir))) | ||
| 136 | (setq mh-image-directory dir)))))) | ||
| 137 | ;; | ||
| 138 | (unless (file-exists-p mh-image-directory) | ||
| 139 | (error "Directory %s in mh-image-directory does not exist" | ||
| 140 | mh-image-directory)) | ||
| 141 | (unless (file-exists-p (expand-file-name image mh-image-directory)) | ||
| 142 | (error "Directory %s in mh-image-directory does not contain image %s" | ||
| 143 | mh-image-directory image)) | ||
| 144 | ;; Return augmented `image-load-path' or `load-path'. | ||
| 145 | (cond ((and path (symbolp path)) | ||
| 146 | (nconc (list mh-image-directory) | ||
| 147 | (delete mh-image-directory | ||
| 148 | (if (boundp path) | ||
| 149 | (copy-sequence (symbol-value path)) | ||
| 150 | nil)))) | ||
| 151 | (t | ||
| 152 | (nconc (list mh-image-directory) | ||
| 153 | (delete mh-image-directory | ||
| 154 | (copy-sequence load-path))))))) | ||
| 147 | 155 | ||
| 148 | ;;;###mh-autoload | 156 | ;;;###mh-autoload |
| 149 | (defun mh-make-local-vars (&rest pairs) | 157 | (defun mh-make-local-vars (&rest pairs) |
| @@ -159,6 +167,23 @@ See also variable `mh-image-load-path-called-flag'." | |||
| 159 | (funcall function (car list)) | 167 | (funcall function (car list)) |
| 160 | (setq list (cdr list)))) | 168 | (setq list (cdr list)))) |
| 161 | 169 | ||
| 170 | (defvar mh-pick-regexp-chars ".*$[" | ||
| 171 | "List of special characters in pick regular expressions.") | ||
| 172 | |||
| 173 | ;;;###mh-autoload | ||
| 174 | (defun mh-quote-pick-expr (pick-expr) | ||
| 175 | "Quote `mh-pick-regexp-chars' in PICK-EXPR. | ||
| 176 | PICK-EXPR is a list of strings. Return nil if PICK-EXPR is nil." | ||
| 177 | (let ((quoted-pick-expr)) | ||
| 178 | (dolist (string pick-expr) | ||
| 179 | (when (and string | ||
| 180 | (not (string-equal string ""))) | ||
| 181 | (loop for i from 0 to (1- (length mh-pick-regexp-chars)) do | ||
| 182 | (let ((s (string ?\\ (aref mh-pick-regexp-chars i)))) | ||
| 183 | (setq string (mh-replace-regexp-in-string s s string t t)))) | ||
| 184 | (setq quoted-pick-expr (append quoted-pick-expr (list string))))) | ||
| 185 | quoted-pick-expr)) | ||
| 186 | |||
| 162 | ;;;###mh-autoload | 187 | ;;;###mh-autoload |
| 163 | (defun mh-replace-string (old new) | 188 | (defun mh-replace-string (old new) |
| 164 | "Replace all occurrences of OLD with NEW in the current buffer. | 189 | "Replace all occurrences of OLD with NEW in the current buffer. |
| @@ -177,23 +202,26 @@ Ignores case when searching for OLD." | |||
| 177 | ;;;###mh-autoload | 202 | ;;;###mh-autoload |
| 178 | (defun mh-logo-display () | 203 | (defun mh-logo-display () |
| 179 | "Modify mode line to display MH-E logo." | 204 | "Modify mode line to display MH-E logo." |
| 180 | (mh-image-load-path) | ||
| 181 | (mh-do-in-gnu-emacs | 205 | (mh-do-in-gnu-emacs |
| 182 | (add-text-properties | 206 | (let ((load-path |
| 183 | 0 2 | 207 | (mh-image-load-path "mh-e" "mh-logo.xpm" 'load-path)) |
| 184 | `(display ,(or mh-logo-cache | 208 | (image-load-path |
| 185 | (setq mh-logo-cache | 209 | (mh-image-load-path "mh-e" "mh-logo.xpm" 'image-load-path))) |
| 186 | (mh-funcall-if-exists | 210 | (add-text-properties |
| 187 | find-image '((:type xpm :ascent center | 211 | 0 2 |
| 188 | :file "mh-logo.xpm")))))) | 212 | `(display ,(or mh-logo-cache |
| 189 | (car mode-line-buffer-identification))) | 213 | (setq mh-logo-cache |
| 214 | (mh-funcall-if-exists | ||
| 215 | find-image '((:type xpm :ascent center | ||
| 216 | :file "mh-logo.xpm")))))) | ||
| 217 | (car mode-line-buffer-identification)))) | ||
| 190 | (mh-do-in-xemacs | 218 | (mh-do-in-xemacs |
| 191 | (setq modeline-buffer-identification | 219 | (setq modeline-buffer-identification |
| 192 | (list | 220 | (list |
| 193 | (if mh-modeline-glyph | 221 | (if mh-modeline-glyph |
| 194 | (cons modeline-buffer-id-left-extent mh-modeline-glyph) | 222 | (cons modeline-buffer-id-left-extent mh-modeline-glyph) |
| 195 | (cons modeline-buffer-id-left-extent "XEmacs%N:")) | 223 | (cons modeline-buffer-id-left-extent "XEmacs%N:")) |
| 196 | (cons modeline-buffer-id-right-extent " %17b"))))) | 224 | (cons modeline-buffer-id-right-extent " %17b"))))) |
| 197 | 225 | ||
| 198 | 226 | ||
| 199 | 227 | ||
| @@ -526,14 +554,19 @@ number of sub-folders. XXX" | |||
| 526 | ;;;###mh-autoload | 554 | ;;;###mh-autoload |
| 527 | (defun mh-folder-list (folder) | 555 | (defun mh-folder-list (folder) |
| 528 | "Return FOLDER and its descendents. | 556 | "Return FOLDER and its descendents. |
| 529 | Returns a list of strings. For example, | 557 | FOLDER may have a + prefix. Returns a list of strings without the |
| 530 | 558 | + prefix. If FOLDER is nil, then all folders are considered. For | |
| 531 | '(\"inbox\" \"lists\" \"lists/mh-e\"). | 559 | example, if your Mail directory only contains the folders +inbox, |
| 532 | 560 | +outbox, +lists, and +lists/mh-e, then | |
| 533 | If folder is nil, then all folders are considered. Respects the | 561 | |
| 534 | value of `mh-recursive-folders-flag'. If this flag is nil, and | 562 | (mh-folder-list nil) |
| 535 | the sub-folders have not been explicitly viewed, then they will | 563 | => (\"inbox\" \"lists\" \"lists/mh-e\" \"outbox\") |
| 536 | not be returned." | 564 | (mh-folder-list \"+lists\") |
| 565 | => (\"lists/mh-e\") | ||
| 566 | |||
| 567 | Respects the value of `mh-recursive-folders-flag'. If this flag | ||
| 568 | is nil, and the sub-folders have not been explicitly viewed, then | ||
| 569 | they will not be returned." | ||
| 537 | (let ((folder-list)) | 570 | (let ((folder-list)) |
| 538 | ;; Normalize folder. Strip leading +. Add trailing slash (done in | 571 | ;; Normalize folder. Strip leading +. Add trailing slash (done in |
| 539 | ;; two steps to avoid infinite loops when replacing "/*$" with "/" | 572 | ;; two steps to avoid infinite loops when replacing "/*$" with "/" |
| @@ -542,16 +575,16 @@ not be returned." | |||
| 542 | ;; returns all the files in / if given an empty string or +. | 575 | ;; returns all the files in / if given an empty string or +. |
| 543 | (when folder | 576 | (when folder |
| 544 | (setq folder (mh-replace-regexp-in-string "^\+" "" folder)) | 577 | (setq folder (mh-replace-regexp-in-string "^\+" "" folder)) |
| 545 | (setq folder (mh-replace-regexp-in-string "/+$" "" folder)) | 578 | (setq folder (mh-replace-regexp-in-string "/+$" "" folder))) |
| 546 | (setq folder (concat folder "/")) | 579 | ;; Add provided folder to list, unless all folders are asked for. |
| 547 | (if (equal folder "") | 580 | (unless (null folder) |
| 548 | (setq folder nil))) | 581 | (setq folder-list (list folder))) |
| 549 | (loop for f in (mh-sub-folders folder) do | 582 | (loop for f in (mh-sub-folders folder) do |
| 550 | (setq folder-list (append folder-list (list (concat folder (car f))))) | 583 | (setq folder-list |
| 551 | (if (mh-children-p f) | 584 | (append folder-list |
| 552 | (setq folder-list | 585 | (if (mh-children-p f) |
| 553 | (append folder-list | 586 | (mh-folder-list (concat folder "/" (car f))) |
| 554 | (mh-folder-list (concat folder (car f))))))) | 587 | (list (concat folder "/" (car f))))))) |
| 555 | folder-list)) | 588 | folder-list)) |
| 556 | 589 | ||
| 557 | ;;;###mh-autoload | 590 | ;;;###mh-autoload |
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index db79d43d321..cbff1835ca6 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -71,17 +71,17 @@ | |||
| 71 | ;;; Known Bugs: | 71 | ;;; Known Bugs: |
| 72 | 72 | ||
| 73 | ;; 1) Strings that are watched don't update in the speedbar when their | 73 | ;; 1) Strings that are watched don't update in the speedbar when their |
| 74 | ;; contents change. | 74 | ;; contents change unless the first character changes. |
| 75 | ;; 2) Cannot handle multiple debug sessions. | 75 | ;; 2) Cannot handle multiple debug sessions. |
| 76 | ;; 3) Initially, the assembler buffer does not display the cursor at the | ||
| 77 | ;; current line if the line is not visible in the window (but when testing | ||
| 78 | ;; gdb-assembler-custom with a lisp debugger it does!). | ||
| 76 | 79 | ||
| 77 | ;;; Problems with watch expressions: | 80 | ;;; Problems with watch expressions, GDB/MI: |
| 78 | 81 | ||
| 79 | ;; 1) They go out of scope when the inferior is re-run. | 82 | ;; 1) They go out of scope when the inferior is re-run. |
| 80 | ;; 2) -var-update reports that an out of scope variable has changed: | 83 | ;; 2) -stack-list-locals has a type field but also prints type in values field. |
| 81 | ;; changelist=[{name="var1",in_scope="false"}], but the value can't be accessed. | 84 | ;; 3) VARNUM increments even when vairable object is not created (maybe trivial). |
| 82 | ;; (-var-list-children, in contrast allows you to create variable objects of | ||
| 83 | ;; the children when they are out of scope and get their values). | ||
| 84 | ;; 3) VARNUM increments even when vaiable object is not created (maybe trivial). | ||
| 85 | 85 | ||
| 86 | ;;; TODO: | 86 | ;;; TODO: |
| 87 | 87 | ||
| @@ -124,6 +124,7 @@ and #define directives otherwise.") | |||
| 124 | "Non-nil if GDB knows that the inferior includes preprocessor macro info.") | 124 | "Non-nil if GDB knows that the inferior includes preprocessor macro info.") |
| 125 | (defvar gdb-buffer-fringe-width nil) | 125 | (defvar gdb-buffer-fringe-width nil) |
| 126 | (defvar gdb-signalled nil) | 126 | (defvar gdb-signalled nil) |
| 127 | (defvar gdb-source-window nil) | ||
| 127 | 128 | ||
| 128 | (defvar gdb-buffer-type nil | 129 | (defvar gdb-buffer-type nil |
| 129 | "One of the symbols bound in `gdb-buffer-rules'.") | 130 | "One of the symbols bound in `gdb-buffer-rules'.") |
| @@ -489,7 +490,8 @@ With arg, use separate IO iff arg is positive." | |||
| 489 | gdb-macro-info nil | 490 | gdb-macro-info nil |
| 490 | gdb-buffer-fringe-width (car (window-fringes)) | 491 | gdb-buffer-fringe-width (car (window-fringes)) |
| 491 | gdb-debug-ring nil | 492 | gdb-debug-ring nil |
| 492 | gdb-signalled nil) | 493 | gdb-signalled nil |
| 494 | gdb-source-window nil) | ||
| 493 | 495 | ||
| 494 | (setq gdb-buffer-type 'gdba) | 496 | (setq gdb-buffer-type 'gdba) |
| 495 | 497 | ||
| @@ -748,15 +750,17 @@ type=\"\\(.*?\\)\"") | |||
| 748 | (delq 'gdb-var-update gdb-pending-triggers)) | 750 | (delq 'gdb-var-update gdb-pending-triggers)) |
| 749 | (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) | 751 | (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) |
| 750 | ;; Dummy command to update speedbar at right time. | 752 | ;; Dummy command to update speedbar at right time. |
| 751 | (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn)) | 753 | (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-refresh)) |
| 752 | ;; Keep gdb-pending-triggers non-nil till end. | 754 | ;; Keep gdb-pending-triggers non-nil till end. |
| 753 | (push 'gdb-speedbar-timer gdb-pending-triggers))) | 755 | (push 'gdb-speedbar-refresh gdb-pending-triggers))) |
| 754 | 756 | ||
| 755 | (defun gdb-speedbar-timer-fn () | 757 | (defun gdb-speedbar-refresh () |
| 756 | (setq gdb-pending-triggers | 758 | (setq gdb-pending-triggers |
| 757 | (delq 'gdb-speedbar-timer gdb-pending-triggers)) | 759 | (delq 'gdb-speedbar-refresh gdb-pending-triggers)) |
| 758 | (with-current-buffer gud-comint-buffer | 760 | (with-current-buffer gud-comint-buffer |
| 759 | (speedbar-timer-fn))) | 761 | (let ((speedbar-verbosity-level 0)) |
| 762 | (save-excursion | ||
| 763 | (speedbar-refresh))))) | ||
| 760 | 764 | ||
| 761 | (defun gdb-var-delete () | 765 | (defun gdb-var-delete () |
| 762 | "Delete watch expression at point from the speedbar." | 766 | "Delete watch expression at point from the speedbar." |
| @@ -817,9 +821,10 @@ INDENT is the current indentation depth." | |||
| 817 | (dolist (var gdb-var-list) | 821 | (dolist (var gdb-var-list) |
| 818 | (if (string-match (concat token "\\.") (nth 1 var)) | 822 | (if (string-match (concat token "\\.") (nth 1 var)) |
| 819 | (setq gdb-var-list (delq var gdb-var-list)))) | 823 | (setq gdb-var-list (delq var gdb-var-list)))) |
| 820 | (setq gdb-force-update t) | 824 | (speedbar-change-expand-button-char ?+) |
| 821 | (with-current-buffer gud-comint-buffer | 825 | (speedbar-delete-subblock indent)) |
| 822 | (speedbar-timer-fn))))) | 826 | (t (error "Ooops... not sure what to do"))) |
| 827 | (speedbar-center-buffer-smartly)) | ||
| 823 | 828 | ||
| 824 | (defun gdb-get-target-string () | 829 | (defun gdb-get-target-string () |
| 825 | (with-current-buffer gud-comint-buffer | 830 | (with-current-buffer gud-comint-buffer |
| @@ -835,7 +840,7 @@ INDENT is the current indentation depth." | |||
| 835 | ;; The usual gdb interaction buffer is given the type `gdba' and | 840 | ;; The usual gdb interaction buffer is given the type `gdba' and |
| 836 | ;; is constructed specially. | 841 | ;; is constructed specially. |
| 837 | ;; | 842 | ;; |
| 838 | ;; Others are constructed by gdb-get-create-buffer and | 843 | ;; Others are constructed by gdb-get-buffer-create and |
| 839 | ;; named according to the rules set forth in the gdb-buffer-rules-assoc | 844 | ;; named according to the rules set forth in the gdb-buffer-rules-assoc |
| 840 | 845 | ||
| 841 | (defvar gdb-buffer-rules-assoc '()) | 846 | (defvar gdb-buffer-rules-assoc '()) |
| @@ -846,7 +851,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." | |||
| 846 | (save-excursion | 851 | (save-excursion |
| 847 | (gdb-look-for-tagged-buffer key (buffer-list)))) | 852 | (gdb-look-for-tagged-buffer key (buffer-list)))) |
| 848 | 853 | ||
| 849 | (defun gdb-get-create-buffer (key) | 854 | (defun gdb-get-buffer-create (key) |
| 850 | "Create a new gdb buffer of the type specified by KEY. | 855 | "Create a new gdb buffer of the type specified by KEY. |
| 851 | The key should be one of the cars in `gdb-buffer-rules-assoc'." | 856 | The key should be one of the cars in `gdb-buffer-rules-assoc'." |
| 852 | (or (gdb-get-buffer key) | 857 | (or (gdb-get-buffer key) |
| @@ -924,7 +929,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." | |||
| 924 | (interactive) | 929 | (interactive) |
| 925 | (if gdb-use-separate-io-buffer | 930 | (if gdb-use-separate-io-buffer |
| 926 | (gdb-display-buffer | 931 | (gdb-display-buffer |
| 927 | (gdb-get-create-buffer 'gdb-inferior-io)))) | 932 | (gdb-get-buffer-create 'gdb-inferior-io)))) |
| 928 | 933 | ||
| 929 | (defconst gdb-frame-parameters | 934 | (defconst gdb-frame-parameters |
| 930 | '((height . 14) (width . 80) | 935 | '((height . 14) (width . 80) |
| @@ -939,7 +944,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." | |||
| 939 | (if gdb-use-separate-io-buffer | 944 | (if gdb-use-separate-io-buffer |
| 940 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 945 | (let ((special-display-regexps (append special-display-regexps '(".*"))) |
| 941 | (special-display-frame-alist gdb-frame-parameters)) | 946 | (special-display-frame-alist gdb-frame-parameters)) |
| 942 | (display-buffer (gdb-get-create-buffer 'gdb-inferior-io))))) | 947 | (display-buffer (gdb-get-buffer-create 'gdb-inferior-io))))) |
| 943 | 948 | ||
| 944 | (defvar gdb-inferior-io-mode-map | 949 | (defvar gdb-inferior-io-mode-map |
| 945 | (let ((map (make-sparse-keymap))) | 950 | (let ((map (make-sparse-keymap))) |
| @@ -1156,7 +1161,7 @@ This sends the next command (if any) to gdb." | |||
| 1156 | (setq gdb-output-sink 'user) | 1161 | (setq gdb-output-sink 'user) |
| 1157 | (let ((handler | 1162 | (let ((handler |
| 1158 | (car (cdr gdb-current-item)))) | 1163 | (car (cdr gdb-current-item)))) |
| 1159 | (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer) | 1164 | (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) |
| 1160 | (funcall handler)))) | 1165 | (funcall handler)))) |
| 1161 | (t | 1166 | (t |
| 1162 | (gdb-resync) | 1167 | (gdb-resync) |
| @@ -1248,12 +1253,13 @@ sink to `user' in `gdb-stopping', that is fine." | |||
| 1248 | "An annotation handler for `post-prompt'. | 1253 | "An annotation handler for `post-prompt'. |
| 1249 | This begins the collection of output from the current command if that | 1254 | This begins the collection of output from the current command if that |
| 1250 | happens to be appropriate." | 1255 | happens to be appropriate." |
| 1251 | ;; Don't add to queue if there outstanding items or GDB is not known yet. | 1256 | ;; Don't add to queue if there outstanding items or gdb-version is not known |
| 1257 | ;; yet. | ||
| 1252 | (unless (or gdb-pending-triggers gdb-first-post-prompt) | 1258 | (unless (or gdb-pending-triggers gdb-first-post-prompt) |
| 1253 | (gdb-get-selected-frame) | 1259 | (gdb-get-selected-frame) |
| 1254 | (gdb-invalidate-frames) | 1260 | (gdb-invalidate-frames) |
| 1255 | ;; Regenerate breakpoints buffer in case it has been inadvertantly deleted. | 1261 | ;; Regenerate breakpoints buffer in case it has been inadvertantly deleted. |
| 1256 | (gdb-get-create-buffer 'gdb-breakpoints-buffer) | 1262 | (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
| 1257 | (gdb-invalidate-breakpoints) | 1263 | (gdb-invalidate-breakpoints) |
| 1258 | ;; Do this through gdb-get-selected-frame -> gdb-frame-handler | 1264 | ;; Do this through gdb-get-selected-frame -> gdb-frame-handler |
| 1259 | ;; so gdb-frame-address is updated. | 1265 | ;; so gdb-frame-address is updated. |
| @@ -1288,6 +1294,22 @@ happens to be appropriate." | |||
| 1288 | (gdb-resync) | 1294 | (gdb-resync) |
| 1289 | (error "Phase error in gdb-post-prompt (got %s)" sink))))) | 1295 | (error "Phase error in gdb-post-prompt (got %s)" sink))))) |
| 1290 | 1296 | ||
| 1297 | ;; GUD displays the selected GDB frame. This might might not be the current | ||
| 1298 | ;; GDB frame (after up, down etc). If no GDB frame is visible but the last | ||
| 1299 | ;; visited breakpoint is, use that window. | ||
| 1300 | (defun gdb-display-source-buffer (buffer) | ||
| 1301 | (let* ((last-window (if gud-last-last-frame | ||
| 1302 | (get-buffer-window | ||
| 1303 | (gud-find-file (car gud-last-last-frame))))) | ||
| 1304 | (source-window (or last-window | ||
| 1305 | (if (and gdb-source-window | ||
| 1306 | (window-live-p gdb-source-window)) | ||
| 1307 | gdb-source-window)))) | ||
| 1308 | (when source-window | ||
| 1309 | (setq gdb-source-window source-window) | ||
| 1310 | (set-window-buffer source-window buffer)) | ||
| 1311 | source-window)) | ||
| 1312 | |||
| 1291 | (defun gud-gdba-marker-filter (string) | 1313 | (defun gud-gdba-marker-filter (string) |
| 1292 | "A gud marker filter for gdb. Handle a burst of output from GDB." | 1314 | "A gud marker filter for gdb. Handle a burst of output from GDB." |
| 1293 | (if gdb-flush-pending-output | 1315 | (if gdb-flush-pending-output |
| @@ -1370,23 +1392,23 @@ happens to be appropriate." | |||
| 1370 | (error "Bogon output sink %S" sink))))) | 1392 | (error "Bogon output sink %S" sink))))) |
| 1371 | 1393 | ||
| 1372 | (defun gdb-append-to-partial-output (string) | 1394 | (defun gdb-append-to-partial-output (string) |
| 1373 | (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer) | 1395 | (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) |
| 1374 | (goto-char (point-max)) | 1396 | (goto-char (point-max)) |
| 1375 | (insert string))) | 1397 | (insert string))) |
| 1376 | 1398 | ||
| 1377 | (defun gdb-clear-partial-output () | 1399 | (defun gdb-clear-partial-output () |
| 1378 | (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer) | 1400 | (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) |
| 1379 | (erase-buffer))) | 1401 | (erase-buffer))) |
| 1380 | 1402 | ||
| 1381 | (defun gdb-append-to-inferior-io (string) | 1403 | (defun gdb-append-to-inferior-io (string) |
| 1382 | (with-current-buffer (gdb-get-create-buffer 'gdb-inferior-io) | 1404 | (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) |
| 1383 | (goto-char (point-max)) | 1405 | (goto-char (point-max)) |
| 1384 | (insert-before-markers string)) | 1406 | (insert-before-markers string)) |
| 1385 | (if (not (string-equal string "")) | 1407 | (if (not (string-equal string "")) |
| 1386 | (gdb-display-buffer (gdb-get-create-buffer 'gdb-inferior-io)))) | 1408 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io)))) |
| 1387 | 1409 | ||
| 1388 | (defun gdb-clear-inferior-io () | 1410 | (defun gdb-clear-inferior-io () |
| 1389 | (with-current-buffer (gdb-get-create-buffer 'gdb-inferior-io) | 1411 | (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) |
| 1390 | (erase-buffer))) | 1412 | (erase-buffer))) |
| 1391 | 1413 | ||
| 1392 | 1414 | ||
| @@ -1434,11 +1456,13 @@ happens to be appropriate." | |||
| 1434 | (and buf | 1456 | (and buf |
| 1435 | (with-current-buffer buf | 1457 | (with-current-buffer buf |
| 1436 | (let* ((window (get-buffer-window buf 0)) | 1458 | (let* ((window (get-buffer-window buf 0)) |
| 1459 | (start (window-start window)) | ||
| 1437 | (p (window-point window)) | 1460 | (p (window-point window)) |
| 1438 | (buffer-read-only nil)) | 1461 | (buffer-read-only nil)) |
| 1439 | (erase-buffer) | 1462 | (erase-buffer) |
| 1440 | (insert-buffer-substring (gdb-get-create-buffer | 1463 | (insert-buffer-substring (gdb-get-buffer-create |
| 1441 | 'gdb-partial-output-buffer)) | 1464 | 'gdb-partial-output-buffer)) |
| 1465 | (set-window-start window start) | ||
| 1442 | (set-window-point window p))))) | 1466 | (set-window-point window p))))) |
| 1443 | ;; put customisation here | 1467 | ;; put customisation here |
| 1444 | (,custom-defun))) | 1468 | (,custom-defun))) |
| @@ -1688,14 +1712,14 @@ static char *magick[] = { | |||
| 1688 | "Display status of user-settable breakpoints." | 1712 | "Display status of user-settable breakpoints." |
| 1689 | (interactive) | 1713 | (interactive) |
| 1690 | (gdb-display-buffer | 1714 | (gdb-display-buffer |
| 1691 | (gdb-get-create-buffer 'gdb-breakpoints-buffer))) | 1715 | (gdb-get-buffer-create 'gdb-breakpoints-buffer))) |
| 1692 | 1716 | ||
| 1693 | (defun gdb-frame-breakpoints-buffer () | 1717 | (defun gdb-frame-breakpoints-buffer () |
| 1694 | "Display status of user-settable breakpoints in a new frame." | 1718 | "Display status of user-settable breakpoints in a new frame." |
| 1695 | (interactive) | 1719 | (interactive) |
| 1696 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 1720 | (let ((special-display-regexps (append special-display-regexps '(".*"))) |
| 1697 | (special-display-frame-alist gdb-frame-parameters)) | 1721 | (special-display-frame-alist gdb-frame-parameters)) |
| 1698 | (display-buffer (gdb-get-create-buffer 'gdb-breakpoints-buffer)))) | 1722 | (display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer)))) |
| 1699 | 1723 | ||
| 1700 | (defvar gdb-breakpoints-mode-map | 1724 | (defvar gdb-breakpoints-mode-map |
| 1701 | (let ((map (make-sparse-keymap)) | 1725 | (let ((map (make-sparse-keymap)) |
| @@ -1767,9 +1791,6 @@ static char *magick[] = { | |||
| 1767 | "Display the breakpoint location specified at current line." | 1791 | "Display the breakpoint location specified at current line." |
| 1768 | (interactive (list last-input-event)) | 1792 | (interactive (list last-input-event)) |
| 1769 | (if event (posn-set-point (event-end event))) | 1793 | (if event (posn-set-point (event-end event))) |
| 1770 | ;; Hack to stop gdb-goto-breakpoint displaying in GUD buffer. | ||
| 1771 | (let ((window (get-buffer-window gud-comint-buffer))) | ||
| 1772 | (if window (save-selected-window (select-window window)))) | ||
| 1773 | (save-excursion | 1794 | (save-excursion |
| 1774 | (beginning-of-line 1) | 1795 | (beginning-of-line 1) |
| 1775 | (if (looking-at "\\([0-9]+\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)") | 1796 | (if (looking-at "\\([0-9]+\\) .+ in .+ at\\s-+\\(\\S-+\\):\\([0-9]+\\)") |
| @@ -1777,11 +1798,13 @@ static char *magick[] = { | |||
| 1777 | (file (match-string 2)) | 1798 | (file (match-string 2)) |
| 1778 | (line (match-string 3))) | 1799 | (line (match-string 3))) |
| 1779 | (save-selected-window | 1800 | (save-selected-window |
| 1780 | (let* ((buf (find-file-noselect | 1801 | (let* ((buffer (find-file-noselect |
| 1781 | (if (file-exists-p file) file | 1802 | (if (file-exists-p file) file |
| 1782 | (cdr (assoc bptno gdb-location-alist))))) | 1803 | (cdr (assoc bptno gdb-location-alist))))) |
| 1783 | (window (display-buffer buf))) | 1804 | (window (unless (gdb-display-source-buffer buffer) |
| 1784 | (with-current-buffer buf | 1805 | (display-buffer buffer)))) |
| 1806 | (setq gdb-source-window window) | ||
| 1807 | (with-current-buffer buffer | ||
| 1785 | (goto-line (string-to-number line)) | 1808 | (goto-line (string-to-number line)) |
| 1786 | (set-window-point window (point)))))) | 1809 | (set-window-point window (point)))))) |
| 1787 | (error "No location specified.")))) | 1810 | (error "No location specified.")))) |
| @@ -1844,14 +1867,14 @@ static char *magick[] = { | |||
| 1844 | "Display backtrace of current stack." | 1867 | "Display backtrace of current stack." |
| 1845 | (interactive) | 1868 | (interactive) |
| 1846 | (gdb-display-buffer | 1869 | (gdb-display-buffer |
| 1847 | (gdb-get-create-buffer 'gdb-stack-buffer))) | 1870 | (gdb-get-buffer-create 'gdb-stack-buffer))) |
| 1848 | 1871 | ||
| 1849 | (defun gdb-frame-stack-buffer () | 1872 | (defun gdb-frame-stack-buffer () |
| 1850 | "Display backtrace of current stack in a new frame." | 1873 | "Display backtrace of current stack in a new frame." |
| 1851 | (interactive) | 1874 | (interactive) |
| 1852 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 1875 | (let ((special-display-regexps (append special-display-regexps '(".*"))) |
| 1853 | (special-display-frame-alist gdb-frame-parameters)) | 1876 | (special-display-frame-alist gdb-frame-parameters)) |
| 1854 | (display-buffer (gdb-get-create-buffer 'gdb-stack-buffer)))) | 1877 | (display-buffer (gdb-get-buffer-create 'gdb-stack-buffer)))) |
| 1855 | 1878 | ||
| 1856 | (defvar gdb-frames-mode-map | 1879 | (defvar gdb-frames-mode-map |
| 1857 | (let ((map (make-sparse-keymap))) | 1880 | (let ((map (make-sparse-keymap))) |
| @@ -1925,14 +1948,14 @@ static char *magick[] = { | |||
| 1925 | "Display IDs of currently known threads." | 1948 | "Display IDs of currently known threads." |
| 1926 | (interactive) | 1949 | (interactive) |
| 1927 | (gdb-display-buffer | 1950 | (gdb-display-buffer |
| 1928 | (gdb-get-create-buffer 'gdb-threads-buffer))) | 1951 | (gdb-get-buffer-create 'gdb-threads-buffer))) |
| 1929 | 1952 | ||
| 1930 | (defun gdb-frame-threads-buffer () | 1953 | (defun gdb-frame-threads-buffer () |
| 1931 | "Display IDs of currently known threads in a new frame." | 1954 | "Display IDs of currently known threads in a new frame." |
| 1932 | (interactive) | 1955 | (interactive) |
| 1933 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 1956 | (let ((special-display-regexps (append special-display-regexps '(".*"))) |
| 1934 | (special-display-frame-alist gdb-frame-parameters)) | 1957 | (special-display-frame-alist gdb-frame-parameters)) |
| 1935 | (display-buffer (gdb-get-create-buffer 'gdb-threads-buffer)))) | 1958 | (display-buffer (gdb-get-buffer-create 'gdb-threads-buffer)))) |
| 1936 | 1959 | ||
| 1937 | (defvar gdb-threads-mode-map | 1960 | (defvar gdb-threads-mode-map |
| 1938 | (let ((map (make-sparse-keymap))) | 1961 | (let ((map (make-sparse-keymap))) |
| @@ -2061,14 +2084,14 @@ static char *magick[] = { | |||
| 2061 | "Display integer register contents." | 2084 | "Display integer register contents." |
| 2062 | (interactive) | 2085 | (interactive) |
| 2063 | (gdb-display-buffer | 2086 | (gdb-display-buffer |
| 2064 | (gdb-get-create-buffer 'gdb-registers-buffer))) | 2087 | (gdb-get-buffer-create 'gdb-registers-buffer))) |
| 2065 | 2088 | ||
| 2066 | (defun gdb-frame-registers-buffer () | 2089 | (defun gdb-frame-registers-buffer () |
| 2067 | "Display integer register contents in a new frame." | 2090 | "Display integer register contents in a new frame." |
| 2068 | (interactive) | 2091 | (interactive) |
| 2069 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 2092 | (let ((special-display-regexps (append special-display-regexps '(".*"))) |
| 2070 | (special-display-frame-alist gdb-frame-parameters)) | 2093 | (special-display-frame-alist gdb-frame-parameters)) |
| 2071 | (display-buffer (gdb-get-create-buffer 'gdb-registers-buffer)))) | 2094 | (display-buffer (gdb-get-buffer-create 'gdb-registers-buffer)))) |
| 2072 | 2095 | ||
| 2073 | (defun gdb-all-registers () | 2096 | (defun gdb-all-registers () |
| 2074 | "Toggle the display of floating-point registers (pre GDB 6.4 only)." | 2097 | "Toggle the display of floating-point registers (pre GDB 6.4 only)." |
| @@ -2077,10 +2100,10 @@ static char *magick[] = { | |||
| 2077 | (if gdb-all-registers | 2100 | (if gdb-all-registers |
| 2078 | (progn | 2101 | (progn |
| 2079 | (setq gdb-all-registers nil) | 2102 | (setq gdb-all-registers nil) |
| 2080 | (with-current-buffer (gdb-get-create-buffer 'gdb-registers-buffer) | 2103 | (with-current-buffer (gdb-get-buffer-create 'gdb-registers-buffer) |
| 2081 | (setq mode-name "Registers"))) | 2104 | (setq mode-name "Registers"))) |
| 2082 | (setq gdb-all-registers t) | 2105 | (setq gdb-all-registers t) |
| 2083 | (with-current-buffer (gdb-get-create-buffer 'gdb-registers-buffer) | 2106 | (with-current-buffer (gdb-get-buffer-create 'gdb-registers-buffer) |
| 2084 | (setq mode-name "Registers:All"))) | 2107 | (setq mode-name "Registers:All"))) |
| 2085 | (message (format "Display of floating-point registers %sabled" | 2108 | (message (format "Display of floating-point registers %sabled" |
| 2086 | (if gdb-all-registers "en" "dis"))) | 2109 | (if gdb-all-registers "en" "dis"))) |
| @@ -2385,14 +2408,14 @@ corresponding to the mode line clicked." | |||
| 2385 | "Display memory contents." | 2408 | "Display memory contents." |
| 2386 | (interactive) | 2409 | (interactive) |
| 2387 | (gdb-display-buffer | 2410 | (gdb-display-buffer |
| 2388 | (gdb-get-create-buffer 'gdb-memory-buffer))) | 2411 | (gdb-get-buffer-create 'gdb-memory-buffer))) |
| 2389 | 2412 | ||
| 2390 | (defun gdb-frame-memory-buffer () | 2413 | (defun gdb-frame-memory-buffer () |
| 2391 | "Display memory contents in a new frame." | 2414 | "Display memory contents in a new frame." |
| 2392 | (interactive) | 2415 | (interactive) |
| 2393 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 2416 | (let ((special-display-regexps (append special-display-regexps '(".*"))) |
| 2394 | (special-display-frame-alist gdb-frame-parameters)) | 2417 | (special-display-frame-alist gdb-frame-parameters)) |
| 2395 | (display-buffer (gdb-get-create-buffer 'gdb-memory-buffer)))) | 2418 | (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer)))) |
| 2396 | 2419 | ||
| 2397 | 2420 | ||
| 2398 | ;; Locals buffer. | 2421 | ;; Locals buffer. |
| @@ -2450,12 +2473,15 @@ corresponding to the mode line clicked." | |||
| 2450 | (and buf | 2473 | (and buf |
| 2451 | (with-current-buffer buf | 2474 | (with-current-buffer buf |
| 2452 | (let* ((window (get-buffer-window buf 0)) | 2475 | (let* ((window (get-buffer-window buf 0)) |
| 2476 | (start (window-start window)) | ||
| 2453 | (p (window-point window)) | 2477 | (p (window-point window)) |
| 2454 | (buffer-read-only nil)) | 2478 | (buffer-read-only nil)) |
| 2455 | (erase-buffer) | 2479 | (erase-buffer) |
| 2456 | (insert-buffer-substring (gdb-get-create-buffer | 2480 | (insert-buffer-substring (gdb-get-buffer-create |
| 2457 | 'gdb-partial-output-buffer)) | 2481 | 'gdb-partial-output-buffer)) |
| 2458 | (set-window-point window p))))) | 2482 | (set-window-start window start) |
| 2483 | (set-window-point window p)) | ||
| 2484 | ))) | ||
| 2459 | (run-hooks 'gdb-info-locals-hook)) | 2485 | (run-hooks 'gdb-info-locals-hook)) |
| 2460 | 2486 | ||
| 2461 | (defvar gdb-locals-mode-map | 2487 | (defvar gdb-locals-mode-map |
| @@ -2489,14 +2515,14 @@ corresponding to the mode line clicked." | |||
| 2489 | "Display local variables of current stack and their values." | 2515 | "Display local variables of current stack and their values." |
| 2490 | (interactive) | 2516 | (interactive) |
| 2491 | (gdb-display-buffer | 2517 | (gdb-display-buffer |
| 2492 | (gdb-get-create-buffer 'gdb-locals-buffer))) | 2518 | (gdb-get-buffer-create 'gdb-locals-buffer))) |
| 2493 | 2519 | ||
| 2494 | (defun gdb-frame-locals-buffer () | 2520 | (defun gdb-frame-locals-buffer () |
| 2495 | "Display local variables of current stack and their values in a new frame." | 2521 | "Display local variables of current stack and their values in a new frame." |
| 2496 | (interactive) | 2522 | (interactive) |
| 2497 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 2523 | (let ((special-display-regexps (append special-display-regexps '(".*"))) |
| 2498 | (special-display-frame-alist gdb-frame-parameters)) | 2524 | (special-display-frame-alist gdb-frame-parameters)) |
| 2499 | (display-buffer (gdb-get-create-buffer 'gdb-locals-buffer)))) | 2525 | (display-buffer (gdb-get-buffer-create 'gdb-locals-buffer)))) |
| 2500 | 2526 | ||
| 2501 | 2527 | ||
| 2502 | ;;;; Window management | 2528 | ;;;; Window management |
| @@ -2619,7 +2645,7 @@ corresponding to the mode line clicked." | |||
| 2619 | (split-window-horizontally) | 2645 | (split-window-horizontally) |
| 2620 | (other-window 1) | 2646 | (other-window 1) |
| 2621 | (gdb-set-window-buffer | 2647 | (gdb-set-window-buffer |
| 2622 | (gdb-get-create-buffer 'gdb-inferior-io))) | 2648 | (gdb-get-buffer-create 'gdb-inferior-io))) |
| 2623 | (other-window 1) | 2649 | (other-window 1) |
| 2624 | (gdb-set-window-buffer (gdb-stack-buffer-name)) | 2650 | (gdb-set-window-buffer (gdb-stack-buffer-name)) |
| 2625 | (split-window-horizontally) | 2651 | (split-window-horizontally) |
| @@ -2672,7 +2698,7 @@ This arrangement depends on the value of `gdb-many-windows'." | |||
| 2672 | 2698 | ||
| 2673 | (defun gdb-reset () | 2699 | (defun gdb-reset () |
| 2674 | "Exit a debugging session cleanly. | 2700 | "Exit a debugging session cleanly. |
| 2675 | Kills the gdb buffers and resets the source buffers." | 2701 | Kills the gdb buffers, and resets variables and the source buffers." |
| 2676 | (dolist (buffer (buffer-list)) | 2702 | (dolist (buffer (buffer-list)) |
| 2677 | (unless (eq buffer gud-comint-buffer) | 2703 | (unless (eq buffer gud-comint-buffer) |
| 2678 | (with-current-buffer buffer | 2704 | (with-current-buffer buffer |
| @@ -2707,7 +2733,7 @@ buffers." | |||
| 2707 | (setq gdb-macro-info t)) | 2733 | (setq gdb-macro-info t)) |
| 2708 | (if gdb-many-windows | 2734 | (if gdb-many-windows |
| 2709 | (gdb-setup-windows) | 2735 | (gdb-setup-windows) |
| 2710 | (gdb-get-create-buffer 'gdb-breakpoints-buffer) | 2736 | (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
| 2711 | (if gdb-show-main | 2737 | (if gdb-show-main |
| 2712 | (let ((pop-up-windows t)) | 2738 | (let ((pop-up-windows t)) |
| 2713 | (display-buffer (gud-find-file gdb-main-file)))))) | 2739 | (display-buffer (gud-find-file gdb-main-file)))))) |
| @@ -2960,7 +2986,7 @@ BUFFER nil or omitted means use the current buffer." | |||
| 2960 | (interactive) | 2986 | (interactive) |
| 2961 | (setq gdb-previous-frame nil) | 2987 | (setq gdb-previous-frame nil) |
| 2962 | (gdb-display-buffer | 2988 | (gdb-display-buffer |
| 2963 | (gdb-get-create-buffer 'gdb-assembler-buffer))) | 2989 | (gdb-get-buffer-create 'gdb-assembler-buffer))) |
| 2964 | 2990 | ||
| 2965 | (defun gdb-frame-assembler-buffer () | 2991 | (defun gdb-frame-assembler-buffer () |
| 2966 | "Display disassembly view in a new frame." | 2992 | "Display disassembly view in a new frame." |
| @@ -2968,7 +2994,7 @@ BUFFER nil or omitted means use the current buffer." | |||
| 2968 | (setq gdb-previous-frame nil) | 2994 | (setq gdb-previous-frame nil) |
| 2969 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 2995 | (let ((special-display-regexps (append special-display-regexps '(".*"))) |
| 2970 | (special-display-frame-alist gdb-frame-parameters)) | 2996 | (special-display-frame-alist gdb-frame-parameters)) |
| 2971 | (display-buffer (gdb-get-create-buffer 'gdb-assembler-buffer)))) | 2997 | (display-buffer (gdb-get-buffer-create 'gdb-assembler-buffer)))) |
| 2972 | 2998 | ||
| 2973 | ;; modified because if gdb-frame-address has changed value a new command | 2999 | ;; modified because if gdb-frame-address has changed value a new command |
| 2974 | ;; must be enqueued to update the buffer with the new output | 3000 | ;; must be enqueued to update the buffer with the new output |
| @@ -3122,9 +3148,9 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}") | |||
| 3122 | (delq 'gdb-var-update gdb-pending-triggers)) | 3148 | (delq 'gdb-var-update gdb-pending-triggers)) |
| 3123 | (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) | 3149 | (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) |
| 3124 | ;; dummy command to update speedbar at right time | 3150 | ;; dummy command to update speedbar at right time |
| 3125 | (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn)) | 3151 | (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-refresh)) |
| 3126 | ;; keep gdb-pending-triggers non-nil till end | 3152 | ;; keep gdb-pending-triggers non-nil till end |
| 3127 | (push 'gdb-speedbar-timer gdb-pending-triggers))) | 3153 | (push 'gdb-speedbar-refresh gdb-pending-triggers))) |
| 3128 | 3154 | ||
| 3129 | ;; Registers buffer. | 3155 | ;; Registers buffer. |
| 3130 | ;; | 3156 | ;; |
| @@ -3166,11 +3192,14 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}") | |||
| 3166 | (concat register-values register-string))) | 3192 | (concat register-values register-string))) |
| 3167 | (let ((buf (gdb-get-buffer 'gdb-registers-buffer))) | 3193 | (let ((buf (gdb-get-buffer 'gdb-registers-buffer))) |
| 3168 | (with-current-buffer buf | 3194 | (with-current-buffer buf |
| 3169 | (let ((p (window-point (get-buffer-window buf 0))) | 3195 | (let* ((window (get-buffer-window buf 0)) |
| 3170 | (buffer-read-only nil)) | 3196 | (start (window-start window)) |
| 3197 | (p (window-point window)) | ||
| 3198 | (buffer-read-only nil)) | ||
| 3171 | (erase-buffer) | 3199 | (erase-buffer) |
| 3172 | (insert register-values) | 3200 | (insert register-values) |
| 3173 | (set-window-point (get-buffer-window buf 0) p)))))) | 3201 | (set-window-start window start) |
| 3202 | (set-window-point window p)))))) | ||
| 3174 | (gdb-data-list-register-values-custom)) | 3203 | (gdb-data-list-register-values-custom)) |
| 3175 | 3204 | ||
| 3176 | (defun gdb-data-list-register-values-custom () | 3205 | (defun gdb-data-list-register-values-custom () |
| @@ -3255,6 +3284,7 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}") | |||
| 3255 | (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) | 3284 | (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) |
| 3256 | (and buf (with-current-buffer buf | 3285 | (and buf (with-current-buffer buf |
| 3257 | (let* ((window (get-buffer-window buf 0)) | 3286 | (let* ((window (get-buffer-window buf 0)) |
| 3287 | (start (window-start window)) | ||
| 3258 | (p (window-point window)) | 3288 | (p (window-point window)) |
| 3259 | (buffer-read-only nil)) | 3289 | (buffer-read-only nil)) |
| 3260 | (erase-buffer) | 3290 | (erase-buffer) |
| @@ -3270,6 +3300,7 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}") | |||
| 3270 | (insert | 3300 | (insert |
| 3271 | (concat name "\t" (nth 1 local) | 3301 | (concat name "\t" (nth 1 local) |
| 3272 | "\t" (nth 2 local) "\n"))) | 3302 | "\t" (nth 2 local) "\n"))) |
| 3303 | (set-window-start window start) | ||
| 3273 | (set-window-point window p))))))) | 3304 | (set-window-point window p))))))) |
| 3274 | 3305 | ||
| 3275 | (defun gdb-get-register-names () | 3306 | (defun gdb-get-register-names () |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 5a09d5dd196..31c8fe0e8a2 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -406,18 +406,18 @@ t means that there is no stack, and we are in display-file mode.") | |||
| 406 | 406 | ||
| 407 | (defvar gud-speedbar-menu-items | 407 | (defvar gud-speedbar-menu-items |
| 408 | '(["Jump to stack frame" speedbar-edit-line | 408 | '(["Jump to stack frame" speedbar-edit-line |
| 409 | :visible (with-current-buffer gud-comint-buffer | 409 | :visible (not (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer) |
| 410 | (not (memq gud-minor-mode '(gdbmi gdba))))] | 410 | '(gdbmi gdba)))] |
| 411 | ["Edit value" speedbar-edit-line | 411 | ["Edit value" speedbar-edit-line |
| 412 | :visible (with-current-buffer gud-comint-buffer | 412 | :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer) |
| 413 | (memq gud-minor-mode '(gdbmi gdba)))] | 413 | '(gdbmi gdba))] |
| 414 | ["Delete expression" gdb-var-delete | 414 | ["Delete expression" gdb-var-delete |
| 415 | (with-current-buffer gud-comint-buffer | 415 | :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer) |
| 416 | (memq gud-minor-mode '(gdbmi gdba)))] | 416 | '(gdbmi gdba))] |
| 417 | ["Auto raise frame" gdb-speedbar-auto-raise | 417 | ["Auto raise frame" gdb-speedbar-auto-raise |
| 418 | :style toggle :selected gdb-speedbar-auto-raise | 418 | :style toggle :selected gdb-speedbar-auto-raise |
| 419 | :visible (with-current-buffer gud-comint-buffer | 419 | :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer) |
| 420 | (memq gud-minor-mode '(gdbmi gdba)))]) | 420 | '(gdbmi gdba))]) |
| 421 | "Additional menu items to add to the speedbar frame.") | 421 | "Additional menu items to add to the speedbar frame.") |
| 422 | 422 | ||
| 423 | ;; Make sure our special speedbar mode is loaded | 423 | ;; Make sure our special speedbar mode is loaded |
| @@ -2753,9 +2753,10 @@ Obeying it means displaying in another window the specified file and line." | |||
| 2753 | (with-current-buffer gud-comint-buffer | 2753 | (with-current-buffer gud-comint-buffer |
| 2754 | (gud-find-file true-file))) | 2754 | (gud-find-file true-file))) |
| 2755 | (window (and buffer (or (get-buffer-window buffer) | 2755 | (window (and buffer (or (get-buffer-window buffer) |
| 2756 | (display-buffer buffer)))) | 2756 | (if (memq gud-minor-mode '(gdbmi gdba)) |
| 2757 | (gdb-display-source-buffer buffer)) | ||
| 2758 | (display-buffer buffer)))) | ||
| 2757 | (pos)) | 2759 | (pos)) |
| 2758 | (message "%s %s" (current-buffer) buffer) | ||
| 2759 | (if buffer | 2760 | (if buffer |
| 2760 | (progn | 2761 | (progn |
| 2761 | (with-current-buffer buffer | 2762 | (with-current-buffer buffer |
diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 4f0e2edf7cb..2e55c4929d5 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el | |||
| @@ -57,6 +57,73 @@ this version is not backward compatible to 0.14 or earlier.") | |||
| 57 | ;; http://www.dina.kvl.dk/~abraham/custom/ | 57 | ;; http://www.dina.kvl.dk/~abraham/custom/ |
| 58 | ;; custom is available in all versions of Emacs version 20 or better. | 58 | ;; custom is available in all versions of Emacs version 20 or better. |
| 59 | ;; | 59 | ;; |
| 60 | ;;; Developing for speedbar | ||
| 61 | ;; | ||
| 62 | ;; Adding a speedbar specialized display mode: | ||
| 63 | ;; | ||
| 64 | ;; Speedbar can be configured to create a special display for certain | ||
| 65 | ;; modes that do not display traditional file/tag data. Rmail, Info, | ||
| 66 | ;; and the debugger are examples. These modes can, however, benefit | ||
| 67 | ;; from a speedbar style display in their own way. | ||
| 68 | ;; | ||
| 69 | ;; If your `major-mode' is `foo-mode', the only requirement is to | ||
| 70 | ;; create a function called `foo-speedbar-buttons' which takes one | ||
| 71 | ;; argument, BUFFER. BUFFER will be the buffer speedbar wants filled. | ||
| 72 | ;; In `foo-speedbar-buttons' there are several functions that make | ||
| 73 | ;; building a speedbar display easy. See the documentation for | ||
| 74 | ;; `speedbar-with-writable' (needed because the buffer is usually | ||
| 75 | ;; read-only) `speedbar-make-tag-line', `speedbar-insert-button', and | ||
| 76 | ;; `speedbar-insert-generic-list'. If you use | ||
| 77 | ;; `speedbar-insert-generic-list', also read the doc for | ||
| 78 | ;; `speedbar-tag-hierarchy-method' in case you wish to override it. | ||
| 79 | ;; The macro `speedbar-with-attached-buffer' brings you back to the | ||
| 80 | ;; buffer speedbar is displaying for. | ||
| 81 | ;; | ||
| 82 | ;; For those functions that make buttons, the "function" should be a | ||
| 83 | ;; symbol that is the function to call when clicked on. The "token" | ||
| 84 | ;; is extra data you can pass along. The "function" must take three | ||
| 85 | ;; parameters. They are (TEXT TOKEN INDENT). TEXT is the text of the | ||
| 86 | ;; button clicked on. TOKEN is the data passed in when you create the | ||
| 87 | ;; button. INDENT is an indentation level, or 0. You can store | ||
| 88 | ;; indentation levels with `speedbar-make-tag-line' which creates a | ||
| 89 | ;; line with an expander (eg. [+]) and a text button. | ||
| 90 | ;; | ||
| 91 | ;; Some useful functions when writing expand functions, and click | ||
| 92 | ;; functions are `speedbar-change-expand-button-char', | ||
| 93 | ;; `speedbar-delete-subblock', and `speedbar-center-buffer-smartly'. | ||
| 94 | ;; The variable `speedbar-power-click' is set to t in your functions | ||
| 95 | ;; when the user shift-clicks. This is an indication of anything from | ||
| 96 | ;; refreshing cached data to making a buffer appear in a new frame. | ||
| 97 | ;; | ||
| 98 | ;; If you wish to add to the default speedbar menu for the case of | ||
| 99 | ;; `foo-mode', create a variable `foo-speedbar-menu-items'. This | ||
| 100 | ;; should be a list compatible with the `easymenu' package. It will | ||
| 101 | ;; be spliced into the main menu. (Available with click-mouse-3). If | ||
| 102 | ;; you wish to have extra key bindings in your special mode, create a | ||
| 103 | ;; variable `foo-speedbar-key-map'. Instead of using `make-keymap', | ||
| 104 | ;; or `make-sparse-keymap', use the function | ||
| 105 | ;; `speedbar-make-specialized-keymap'. This lets you inherit all of | ||
| 106 | ;; speedbar's default bindings with low overhead. | ||
| 107 | ;; | ||
| 108 | ;; Adding a speedbar top-level display mode: | ||
| 109 | ;; | ||
| 110 | ;; Unlike the specialized modes, there are no name requirements, | ||
| 111 | ;; however the methods for writing a button display, menu, and keymap | ||
| 112 | ;; are the same. Once you create these items, you can call the | ||
| 113 | ;; function `speedbar-add-expansion-list'. It takes one parameter | ||
| 114 | ;; which is a list element of the form (NAME MENU KEYMAP &rest | ||
| 115 | ;; BUTTON-FUNCTIONS). NAME is a string that will show up in the | ||
| 116 | ;; Displays menu item. MENU is a symbol containing the menu items to | ||
| 117 | ;; splice in. KEYMAP is a symbol holding the keymap to use, and | ||
| 118 | ;; BUTTON-FUNCTIONS are the function names to call, in order, to create | ||
| 119 | ;; the display. | ||
| 120 | ;; Another tweakable variable is `speedbar-stealthy-function-list' | ||
| 121 | ;; which is of the form (NAME &rest FUNCTION ...). NAME is the string | ||
| 122 | ;; name matching `speedbar-add-expansion-list'. (It does not need to | ||
| 123 | ;; exist.). This provides additional display info which might be | ||
| 124 | ;; time-consuming to calculate. | ||
| 125 | ;; Lastly, `speedbar-mode-functions-list' allows you to set special | ||
| 126 | ;; function overrides. | ||
| 60 | 127 | ||
| 61 | ;;; TODO: | 128 | ;;; TODO: |
| 62 | ;; - Timeout directories we haven't visited in a while. | 129 | ;; - Timeout directories we haven't visited in a while. |
| @@ -2467,20 +2534,19 @@ name will have the function FIND-FUN and not token." | |||
| 2467 | (set-buffer speedbar-buffer) | 2534 | (set-buffer speedbar-buffer) |
| 2468 | (speedbar-with-writable | 2535 | (speedbar-with-writable |
| 2469 | (let* ((window (get-buffer-window speedbar-buffer 0)) | 2536 | (let* ((window (get-buffer-window speedbar-buffer 0)) |
| 2470 | (p (window-point window))) | 2537 | (p (window-point window)) |
| 2538 | (start (window-start window))) | ||
| 2471 | (erase-buffer) | 2539 | (erase-buffer) |
| 2472 | (dolist (func funclst) | 2540 | (dolist (func funclst) |
| 2473 | (setq default-directory cbd) | 2541 | (setq default-directory cbd) |
| 2474 | (funcall func cbd 0)) | 2542 | (funcall func cbd 0)) |
| 2475 | (speedbar-reconfigure-keymaps) | 2543 | (speedbar-reconfigure-keymaps) |
| 2476 | (set-window-point window p))) | 2544 | (set-window-point window p) |
| 2545 | (set-window-start window start))) | ||
| 2477 | )))) | 2546 | )))) |
| 2478 | 2547 | ||
| 2479 | (defun speedbar-update-directory-contents () | 2548 | (defun speedbar-update-directory-contents () |
| 2480 | "Update the contents of the speedbar buffer based on the current directory." | 2549 | "Update the contents of the speedbar buffer based on the current directory." |
| 2481 | |||
| 2482 | (save-excursion | ||
| 2483 | |||
| 2484 | (let ((cbd (expand-file-name default-directory)) | 2550 | (let ((cbd (expand-file-name default-directory)) |
| 2485 | cbd-parent | 2551 | cbd-parent |
| 2486 | (funclst (speedbar-initial-expansion-list)) | 2552 | (funclst (speedbar-initial-expansion-list)) |
| @@ -2541,17 +2607,21 @@ name will have the function FIND-FUN and not token." | |||
| 2541 | (speedbar-directory-line cbd)) | 2607 | (speedbar-directory-line cbd)) |
| 2542 | ;; Open it. | 2608 | ;; Open it. |
| 2543 | (speedbar-expand-line) | 2609 | (speedbar-expand-line) |
| 2544 | (erase-buffer) | 2610 | (let* ((window (get-buffer-window speedbar-buffer 0)) |
| 2545 | (cond (use-cache | 2611 | (p (window-point window)) |
| 2546 | (setq default-directory | 2612 | (start (window-start window))) |
| 2547 | (nth (1- (length speedbar-shown-directories)) | 2613 | (erase-buffer) |
| 2548 | speedbar-shown-directories)) | 2614 | (cond (use-cache |
| 2549 | (insert (cdr cache))) | 2615 | (setq default-directory |
| 2550 | (t | 2616 | (nth (1- (length speedbar-shown-directories)) |
| 2551 | (dolist (func funclst) | 2617 | speedbar-shown-directories)) |
| 2552 | (setq default-directory cbd) | 2618 | (insert (cdr cache))) |
| 2553 | (funcall func cbd 0))))) | 2619 | (t |
| 2554 | (goto-char (point-min))))) | 2620 | (dolist (func funclst) |
| 2621 | (setq default-directory cbd) | ||
| 2622 | (funcall func cbd 0)))) | ||
| 2623 | (set-window-point window p) | ||
| 2624 | (set-window-start window start))))) | ||
| 2555 | (speedbar-reconfigure-keymaps)) | 2625 | (speedbar-reconfigure-keymaps)) |
| 2556 | 2626 | ||
| 2557 | (defun speedbar-update-special-contents () | 2627 | (defun speedbar-update-special-contents () |
| @@ -2576,8 +2646,7 @@ This should only be used by modes classified as special." | |||
| 2576 | (dolist (func funclst) | 2646 | (dolist (func funclst) |
| 2577 | ;; We do not erase the buffer because these functions may | 2647 | ;; We do not erase the buffer because these functions may |
| 2578 | ;; decide NOT to update themselves. | 2648 | ;; decide NOT to update themselves. |
| 2579 | (funcall func specialbuff))) | 2649 | (funcall func specialbuff))))) |
| 2580 | (goto-char (point-min)))) | ||
| 2581 | (speedbar-reconfigure-keymaps)) | 2650 | (speedbar-reconfigure-keymaps)) |
| 2582 | 2651 | ||
| 2583 | (defun speedbar-set-timer (timeout) | 2652 | (defun speedbar-set-timer (timeout) |
diff --git a/lisp/startup.el b/lisp/startup.el index bdf3e7c3c9d..a8d8210e945 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -646,7 +646,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." | |||
| 646 | (let ((lisp-dir | 646 | (let ((lisp-dir |
| 647 | (file-name-directory | 647 | (file-name-directory |
| 648 | (locate-file "simple" load-path | 648 | (locate-file "simple" load-path |
| 649 | load-suffixes)))) | 649 | (get-load-suffixes))))) |
| 650 | 650 | ||
| 651 | (setq load-history | 651 | (setq load-history |
| 652 | (mapcar (lambda (elt) | 652 | (mapcar (lambda (elt) |
diff --git a/lisp/subr.el b/lisp/subr.el index 346ec53a472..0eb4e43943e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1324,12 +1324,13 @@ string. When run interactively, the argument INTERACTIVE-CALL is t, | |||
| 1324 | and the file name is displayed in the echo area." | 1324 | and the file name is displayed in the echo area." |
| 1325 | (interactive (list (completing-read "Locate library: " | 1325 | (interactive (list (completing-read "Locate library: " |
| 1326 | 'locate-file-completion | 1326 | 'locate-file-completion |
| 1327 | (cons load-path load-suffixes)) | 1327 | (cons load-path (get-load-suffixes))) |
| 1328 | nil nil | 1328 | nil nil |
| 1329 | t)) | 1329 | t)) |
| 1330 | (let ((file (locate-file library | 1330 | (let ((file (locate-file library |
| 1331 | (or path load-path) | 1331 | (or path load-path) |
| 1332 | (append (unless nosuffix load-suffixes) '(""))))) | 1332 | (append (unless nosuffix (get-load-suffixes)) |
| 1333 | load-file-rep-suffixes)))) | ||
| 1333 | (if interactive-call | 1334 | (if interactive-call |
| 1334 | (if file | 1335 | (if file |
| 1335 | (message "Library is file %s" (abbreviate-file-name file)) | 1336 | (message "Library is file %s" (abbreviate-file-name file)) |
diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el new file mode 100644 index 00000000000..2dae9d1f977 --- /dev/null +++ b/lisp/t-mouse.el | |||
| @@ -0,0 +1,306 @@ | |||
| 1 | ;;; t-mouse.el --- mouse support within the text terminal | ||
| 2 | |||
| 3 | ;; Authors: Alessandro Rubini and Ian T Zimmerman | ||
| 4 | ;; Maintainer: Nick Roberts <nickrob@gnu.org> | ||
| 5 | ;; Keywords: mouse gpm linux | ||
| 6 | |||
| 7 | ;; Copyright (C) 1994,1995 Alessandro Rubini <rubini@linux.it> | ||
| 8 | ;; parts are by Ian T Zimmermann <itz@rahul.net>, 1995,1998 | ||
| 9 | ;; Copyright (C) 2006 | ||
| 10 | ;; Free Software Foundation, Inc. | ||
| 11 | |||
| 12 | ;; This file is part of GNU Emacs. | ||
| 13 | |||
| 14 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 15 | ;; it under the terms of the GNU General Public License as published by | ||
| 16 | ;; the Free Software Foundation; either version 2, or (at your option) | ||
| 17 | ;; any later version. | ||
| 18 | |||
| 19 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 20 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | ;; GNU General Public License for more details. | ||
| 23 | |||
| 24 | ;; You should have received a copy of the GNU General Public License | ||
| 25 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | ||
| 26 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 27 | ;; Boston, MA 02110-1301, USA. | ||
| 28 | |||
| 29 | ;;; Commentary: | ||
| 30 | |||
| 31 | ;; This package provides access to mouse event as reported by the | ||
| 32 | ;; gpm-Linux package. It uses the program "mev" to get mouse events. | ||
| 33 | ;; It tries to reproduce the functionality offered by emacs under X. | ||
| 34 | ;; The "gpm" server runs under Linux, so this package is rather | ||
| 35 | ;; Linux-dependent. | ||
| 36 | |||
| 37 | ;; Modified by Nick Roberts for Emacs 22. In particular, the mode-line is | ||
| 38 | ;; now position sensitive. | ||
| 39 | |||
| 40 | (defvar t-mouse-process nil | ||
| 41 | "Embeds the process which passes mouse events to emacs. | ||
| 42 | It is used by the program t-mouse.") | ||
| 43 | |||
| 44 | (defvar t-mouse-filter-accumulator "" | ||
| 45 | "Accumulates input from the mouse reporting process.") | ||
| 46 | |||
| 47 | (defvar t-mouse-debug-buffer nil | ||
| 48 | "Events normally posted to command queue are printed here in debug mode. | ||
| 49 | See `t-mouse-start-debug'.") | ||
| 50 | |||
| 51 | (defvar t-mouse-current-xy '(0 . 0) | ||
| 52 | "Stores the last mouse position t-mouse has been told about.") | ||
| 53 | |||
| 54 | (defvar t-mouse-drag-start nil | ||
| 55 | "Whenever a drag starts in a special part of a window | ||
| 56 | (not the text), the `translated' starting coordinates including the | ||
| 57 | window and part involved are saved here. This is necessary lest they | ||
| 58 | get re-translated when the button goes up, at which time window | ||
| 59 | configuration may have changed.") | ||
| 60 | |||
| 61 | (defvar t-mouse-prev-set-selection-function 'x-set-selection) | ||
| 62 | (defvar t-mouse-prev-get-selection-function 'x-get-selection) | ||
| 63 | |||
| 64 | (defvar t-mouse-swap-alt-keys nil | ||
| 65 | "When set, Emacs will handle mouse events with the right Alt | ||
| 66 | (a.k.a. Alt-Ger) modifier, not with the regular left Alt modifier. | ||
| 67 | Useful for people who play strange games with their keyboard tables.") | ||
| 68 | |||
| 69 | (defvar t-mouse-fix-21 nil | ||
| 70 | "Enable brain-dead chords for 2 button mice.") | ||
| 71 | |||
| 72 | |||
| 73 | ;;; Code: | ||
| 74 | |||
| 75 | ;; get the number of the current virtual console | ||
| 76 | |||
| 77 | (defun t-mouse-tty () | ||
| 78 | "Returns number of virtual terminal Emacs is running on, as a string. | ||
| 79 | For example, \"2\" for /dev/tty2." | ||
| 80 | (with-temp-buffer | ||
| 81 | (call-process "ps" nil t nil "h" (format "%s" (emacs-pid))) | ||
| 82 | (goto-char (point-min)) | ||
| 83 | (if (or | ||
| 84 | ;; Many versions of "ps", all different.... | ||
| 85 | (re-search-forward " +tty\\(.?[0-9a-f]\\)" nil t) | ||
| 86 | (re-search-forward "p \\([0-9a-f]\\)" nil t) | ||
| 87 | (re-search-forward "v0\\([0-9a-f]\\)" nil t) | ||
| 88 | (re-search-forward "[0-9]+ +\\([0-9]+\\)" nil t) | ||
| 89 | (re-search-forward "[\\t ]*[0-9]+[\\t ]+\\([0-9]+\\)" nil t) | ||
| 90 | (re-search-forward " +vc/\\(.?[0-9a-f]\\)" nil t) | ||
| 91 | (re-search-forward " +pts/\\(.?[0-9a-f]\\)" nil t)) | ||
| 92 | (buffer-substring (match-beginning 1) (match-end 1))))) | ||
| 93 | |||
| 94 | |||
| 95 | ;; due to a horrible kludge in Emacs' keymap handler | ||
| 96 | ;; (read_key_sequence) mouse clicks on funny parts of windows generate | ||
| 97 | ;; TWO events, the first being a dummy of the sort '(mode-line). | ||
| 98 | ;; That's why Per Abrahamsen's code in xt-mouse.el doesn't work for | ||
| 99 | ;; the modeline, for instance. | ||
| 100 | |||
| 101 | ;; now get this: the Emacs C code that generates these fake events | ||
| 102 | ;; depends on certain things done by the very lowest level input | ||
| 103 | ;; handlers; namely the symbols for the events (for instance | ||
| 104 | ;; 'C-S-double-mouse-2) must have an 'event-kind property, set to | ||
| 105 | ;; 'mouse-click. Since events from unread-command-events do not pass | ||
| 106 | ;; through the low level handlers, they don't get this property unless | ||
| 107 | ;; I set it myself. I imagine this has caused innumerable attempts by | ||
| 108 | ;; hackers to do things similar to t-mouse to lose. | ||
| 109 | |||
| 110 | ;; The next page of code is devoted to fixing this ugly problem. | ||
| 111 | |||
| 112 | ;; WOW! a fully general powerset generator | ||
| 113 | ;; (C) Ian Zimmerman Mon Mar 23 12:00:16 PST 1998 :-) | ||
| 114 | (defun t-mouse-powerset (l) | ||
| 115 | (if (null l) '(nil) | ||
| 116 | (let ((l1 (t-mouse-powerset (cdr l))) | ||
| 117 | (first (nth 0 l))) | ||
| 118 | (append | ||
| 119 | (mapcar (function (lambda (l) (cons first l))) l1) l1)))) | ||
| 120 | |||
| 121 | ;; and a slightly less general cartesian product | ||
| 122 | (defun t-mouse-cartesian (l1 l2) | ||
| 123 | (if (null l1) l2 | ||
| 124 | (append (mapcar (function (lambda (x) (append (nth 0 l1) x))) l2) | ||
| 125 | (t-mouse-cartesian (cdr l1) l2)))) | ||
| 126 | |||
| 127 | (let* ((modifier-sets (t-mouse-powerset '(control meta shift))) | ||
| 128 | (typed-sets (t-mouse-cartesian '((down) (drag)) | ||
| 129 | '((mouse-1) (mouse-2) (mouse-3)))) | ||
| 130 | (multipled-sets (t-mouse-cartesian '((double) (triple)) typed-sets)) | ||
| 131 | (all-sets (t-mouse-cartesian modifier-sets multipled-sets))) | ||
| 132 | (while all-sets | ||
| 133 | (let ((event-sym (event-convert-list (nth 0 all-sets)))) | ||
| 134 | (if (not (get event-sym 'event-kind)) | ||
| 135 | (put event-sym 'event-kind 'mouse-click))) | ||
| 136 | (setq all-sets (cdr all-sets)))) | ||
| 137 | |||
| 138 | (defun t-mouse-make-event-element (x-dot-y-avec-time) | ||
| 139 | (let* ((x-dot-y (nth 0 x-dot-y-avec-time)) | ||
| 140 | (x (car x-dot-y)) | ||
| 141 | (y (cdr x-dot-y)) | ||
| 142 | (w (window-at x y)) | ||
| 143 | (ltrb (window-edges w)) | ||
| 144 | (left (nth 0 ltrb)) | ||
| 145 | (top (nth 1 ltrb))) | ||
| 146 | (if w (posn-at-x-y (- x left) (- y top) w t) | ||
| 147 | (append (list nil 'menu-bar) (nthcdr 2 (posn-at-x-y x y w t)))))) | ||
| 148 | |||
| 149 | ;;; This fun is partly Copyright (C) 1994 Per Abrahamsen <abraham@iesd.auc.dk> | ||
| 150 | (defun t-mouse-make-event () | ||
| 151 | "Makes a Lisp style event from the contents of mouse input accumulator. | ||
| 152 | Also trims the accumulator by all the data used to build the event." | ||
| 153 | (let (ob (ob-pos (condition-case nil | ||
| 154 | (progn | ||
| 155 | ;; this test is just needed for Fedora Core 3 | ||
| 156 | (if (string-match "STILL RUNNING_1\n" | ||
| 157 | t-mouse-filter-accumulator) | ||
| 158 | (setq t-mouse-filter-accumulator | ||
| 159 | (substring | ||
| 160 | t-mouse-filter-accumulator (match-end 0)))) | ||
| 161 | (read-from-string t-mouse-filter-accumulator)) | ||
| 162 | (error nil)))) | ||
| 163 | ;; this test is just needed for Fedora Core 3 | ||
| 164 | (if (or (eq (car ob-pos) 'STILL) (eq (car ob-pos) '***) (not ob-pos)) | ||
| 165 | nil | ||
| 166 | (setq ob (car ob-pos)) | ||
| 167 | (setq t-mouse-filter-accumulator | ||
| 168 | (substring t-mouse-filter-accumulator (cdr ob-pos))) | ||
| 169 | |||
| 170 | ;;now the real work | ||
| 171 | |||
| 172 | (let ((event-type (nth 0 ob)) | ||
| 173 | (current-xy-avec-time (nth 1 ob)) | ||
| 174 | (type-switch (length ob))) | ||
| 175 | (if t-mouse-fix-21 | ||
| 176 | (let | ||
| 177 | ;;Acquire the event's symbol's name. | ||
| 178 | ((event-name-string (symbol-name event-type)) | ||
| 179 | end-of-root-event-name | ||
| 180 | new-event-name-string) | ||
| 181 | |||
| 182 | (if (string-match "-\\(21\\|\\12\\)$" event-name-string) | ||
| 183 | |||
| 184 | ;;Transform the name to what it should have been. | ||
| 185 | (progn | ||
| 186 | (setq end-of-root-event-name (match-beginning 0)) | ||
| 187 | (setq new-event-name-string | ||
| 188 | (concat (substring | ||
| 189 | event-name-string 0 | ||
| 190 | end-of-root-event-name) "-3")) | ||
| 191 | |||
| 192 | ;;Change the event to the symbol that corresponds to the | ||
| 193 | ;;name we made. The proper symbol already exists. | ||
| 194 | (setq event-type | ||
| 195 | (intern new-event-name-string)))))) | ||
| 196 | |||
| 197 | ;;store current position for mouse-position | ||
| 198 | |||
| 199 | (setq t-mouse-current-xy (nth 0 current-xy-avec-time)) | ||
| 200 | |||
| 201 | ;;events have many types but fortunately they differ in length | ||
| 202 | |||
| 203 | (cond | ||
| 204 | ((= type-switch 4) ;must be drag | ||
| 205 | (let ((count (nth 2 ob)) | ||
| 206 | (start-element | ||
| 207 | (or t-mouse-drag-start | ||
| 208 | (t-mouse-make-event-element (nth 3 ob)))) | ||
| 209 | (end-element | ||
| 210 | (t-mouse-make-event-element current-xy-avec-time))) | ||
| 211 | (setq t-mouse-drag-start nil) | ||
| 212 | (list event-type start-element end-element count))) | ||
| 213 | ((= type-switch 3) ;down or up | ||
| 214 | (let ((count (nth 2 ob)) | ||
| 215 | (element | ||
| 216 | (t-mouse-make-event-element current-xy-avec-time))) | ||
| 217 | (if (and (not t-mouse-drag-start) | ||
| 218 | (symbolp (nth 1 element))) | ||
| 219 | ;; OUCH! GOTCHA! emacs uses setc[ad]r on these! | ||
| 220 | (setq t-mouse-drag-start (copy-sequence element)) | ||
| 221 | (setq t-mouse-drag-start nil)) | ||
| 222 | (list event-type element count))) | ||
| 223 | ((= type-switch 2) ;movement | ||
| 224 | (list (if (eq 'vertical-scroll-bar | ||
| 225 | (nth 1 t-mouse-drag-start)) 'scroll-bar-movement | ||
| 226 | 'mouse-movement) | ||
| 227 | (t-mouse-make-event-element current-xy-avec-time)))))))) | ||
| 228 | |||
| 229 | (defun t-mouse-process-filter (proc string) | ||
| 230 | (setq t-mouse-filter-accumulator | ||
| 231 | (concat t-mouse-filter-accumulator string)) | ||
| 232 | (let ((event (t-mouse-make-event))) | ||
| 233 | (while event | ||
| 234 | (if (or track-mouse | ||
| 235 | (not (eq 'mouse-movement (event-basic-type event)))) | ||
| 236 | (setq unread-command-events | ||
| 237 | (nconc unread-command-events (list event)))) | ||
| 238 | (if t-mouse-debug-buffer | ||
| 239 | (print unread-command-events t-mouse-debug-buffer)) | ||
| 240 | (setq event (t-mouse-make-event))))) | ||
| 241 | |||
| 242 | (defun t-mouse-mouse-position-function (pos) | ||
| 243 | "Return the t-mouse-position unless running with a window system. | ||
| 244 | The (secret) scrollbar interface is not implemented yet." | ||
| 245 | (setcdr pos t-mouse-current-xy) | ||
| 246 | pos) | ||
| 247 | |||
| 248 | ;; It should be possible to just send SIGTSTP to the inferior with | ||
| 249 | ;; stop-process. That doesn't work; mev receives the signal fine but | ||
| 250 | ;; is not really stopped: instead it returns from | ||
| 251 | ;; kill(getpid(), SIGTSTP) immediately. I don't understand what's up | ||
| 252 | ;; itz Tue Mar 24 14:27:38 PST 1998. | ||
| 253 | |||
| 254 | (add-hook 'suspend-hook | ||
| 255 | (function (lambda () | ||
| 256 | (and t-mouse-process | ||
| 257 | ;(stop-process t-mouse-process) | ||
| 258 | (process-send-string | ||
| 259 | t-mouse-process "push -enone -dall -Mnone\n"))))) | ||
| 260 | |||
| 261 | (add-hook 'suspend-resume-hook | ||
| 262 | (function (lambda () | ||
| 263 | (and t-mouse-process | ||
| 264 | ;(continue-process t-mouse-process) | ||
| 265 | (process-send-string t-mouse-process "pop\n"))))) | ||
| 266 | |||
| 267 | ;;;###autoload | ||
| 268 | (define-minor-mode t-mouse-mode | ||
| 269 | "Toggle t-mouse mode. | ||
| 270 | With prefix arg, turn t-mouse mode on iff arg is positive. | ||
| 271 | |||
| 272 | Turn it on to use emacs mouse commands, and off to use t-mouse commands." | ||
| 273 | nil " Mouse" nil :global t | ||
| 274 | (if t-mouse-mode | ||
| 275 | ;; Turn it on | ||
| 276 | (unless window-system | ||
| 277 | ;; Starts getting a stream of mouse events from an asynchronous process. | ||
| 278 | ;; Only works if Emacs is running on a virtual terminal without a window system. | ||
| 279 | (progn | ||
| 280 | (setq mouse-position-function #'t-mouse-mouse-position-function) | ||
| 281 | (let ((tty (t-mouse-tty)) | ||
| 282 | (process-connection-type t)) | ||
| 283 | (if (not (stringp tty)) | ||
| 284 | (error "Cannot find a virtual terminal.")) | ||
| 285 | (setq t-mouse-process | ||
| 286 | (start-process "t-mouse" nil | ||
| 287 | "mev" "-i" "-E" "-C" tty | ||
| 288 | (if t-mouse-swap-alt-keys | ||
| 289 | "-M-leftAlt" "-M-rightAlt") | ||
| 290 | "-e-move" | ||
| 291 | "-dall" "-d-hard" | ||
| 292 | "-f"))) | ||
| 293 | (setq t-mouse-filter-accumulator "") | ||
| 294 | (set-process-filter t-mouse-process 't-mouse-process-filter) | ||
| 295 | ; use commented line instead for emacs 21.4 onwards | ||
| 296 | (process-kill-without-query t-mouse-process))) | ||
| 297 | ; (set-process-query-on-exit-flag t-mouse-process nil))) | ||
| 298 | ;; Turn it off | ||
| 299 | (setq mouse-position-function nil) | ||
| 300 | (delete-process t-mouse-process) | ||
| 301 | (setq t-mouse-process nil))) | ||
| 302 | |||
| 303 | (provide 't-mouse) | ||
| 304 | |||
| 305 | ;; arch-tag: a63163b3-bfbe-4eb2-ab4f-201cd164b05d | ||
| 306 | ;;; t-mouse.el ends here | ||
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el index cecfe7f5164..cc822ddb436 100644 --- a/lisp/textmodes/org.el +++ b/lisp/textmodes/org.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Carsten Dominik <dominik at science dot uva dot nl> | 5 | ;; Author: Carsten Dominik <dominik at science dot uva dot nl> |
| 6 | ;; Keywords: outlines, hypermedia, calendar, wp | 6 | ;; Keywords: outlines, hypermedia, calendar, wp |
| 7 | ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ | 7 | ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ |
| 8 | ;; Version: 4.06 | 8 | ;; Version: 4.07 |
| 9 | ;; | 9 | ;; |
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | ;; | 11 | ;; |
| @@ -81,6 +81,12 @@ | |||
| 81 | ;; | 81 | ;; |
| 82 | ;; Changes since version 4.00: | 82 | ;; Changes since version 4.00: |
| 83 | ;; --------------------------- | 83 | ;; --------------------------- |
| 84 | ;; Version 4.07 | ||
| 85 | ;; - Bug fixes. | ||
| 86 | ;; - Leading stars in headlines can be hidden, so make the outline look | ||
| 87 | ;; cleaner. | ||
| 88 | ;; - Mouse-1 can be used to follow links. | ||
| 89 | ;; | ||
| 84 | ;; Version 4.06 | 90 | ;; Version 4.06 |
| 85 | ;; - HTML exporter treats targeted internal links. | 91 | ;; - HTML exporter treats targeted internal links. |
| 86 | ;; - Bug fixes. | 92 | ;; - Bug fixes. |
| @@ -130,7 +136,7 @@ | |||
| 130 | 136 | ||
| 131 | ;;; Customization variables | 137 | ;;; Customization variables |
| 132 | 138 | ||
| 133 | (defvar org-version "4.06" | 139 | (defvar org-version "4.07" |
| 134 | "The version number of the file org.el.") | 140 | "The version number of the file org.el.") |
| 135 | (defun org-version () | 141 | (defun org-version () |
| 136 | (interactive) | 142 | (interactive) |
| @@ -794,6 +800,24 @@ Changing it requires restart of Emacs to become effective." | |||
| 794 | :group 'org-structure | 800 | :group 'org-structure |
| 795 | :type 'boolean) | 801 | :type 'boolean) |
| 796 | 802 | ||
| 803 | (defcustom org-hide-leading-stars nil | ||
| 804 | "Non-nil means, hide the first N-1 stars in a headline. | ||
| 805 | This works by using the face `org-hide' for these stars. This | ||
| 806 | face is white for a light background, and black for a dark | ||
| 807 | background. You may have to customize the face `org-hide' to | ||
| 808 | make this work. | ||
| 809 | Changing the variable requires restart of Emacs to become effective." | ||
| 810 | :group 'org-structure | ||
| 811 | :type 'boolean) | ||
| 812 | |||
| 813 | (defcustom org-odd-levels-only nil | ||
| 814 | "Non-nil means, skip even levels and only use odd levels for the outline. | ||
| 815 | This has the effect that two stars are being added/taken away in | ||
| 816 | promotion/demotion commands. It also influences how levels are | ||
| 817 | handled by the exporters." | ||
| 818 | :group 'org-structure | ||
| 819 | :type 'boolean) | ||
| 820 | |||
| 797 | (defcustom org-adapt-indentation t | 821 | (defcustom org-adapt-indentation t |
| 798 | "Non-nil means, adapt indentation when promoting and demoting. | 822 | "Non-nil means, adapt indentation when promoting and demoting. |
| 799 | When this is set and the *entire* text in an entry is indented, the | 823 | When this is set and the *entire* text in an entry is indented, the |
| @@ -1409,6 +1433,7 @@ This should have an association in `org-export-language-setup'." | |||
| 1409 | .title { text-align: center; } | 1433 | .title { text-align: center; } |
| 1410 | .todo, .deadline { color: red; } | 1434 | .todo, .deadline { color: red; } |
| 1411 | .done { color: green; } | 1435 | .done { color: green; } |
| 1436 | .target { background-color: lavender; } | ||
| 1412 | pre { | 1437 | pre { |
| 1413 | border: 1pt solid #AEBDCC; | 1438 | border: 1pt solid #AEBDCC; |
| 1414 | background-color: #F3F5F7; | 1439 | background-color: #F3F5F7; |
| @@ -1633,7 +1658,7 @@ This option can also be set with the +OPTIONS line, e.g. \"TeX:nil\"." | |||
| 1633 | 1658 | ||
| 1634 | (defcustom org-export-html-with-timestamp nil | 1659 | (defcustom org-export-html-with-timestamp nil |
| 1635 | "If non-nil, write `org-export-html-html-helper-timestamp' | 1660 | "If non-nil, write `org-export-html-html-helper-timestamp' |
| 1636 | into the exported html text. Otherwise, the buffer will just be saved | 1661 | into the exported HTML text. Otherwise, the buffer will just be saved |
| 1637 | to a file." | 1662 | to a file." |
| 1638 | :group 'org-export | 1663 | :group 'org-export |
| 1639 | :type 'boolean) | 1664 | :type 'boolean) |
| @@ -1651,7 +1676,7 @@ Otherwise the buffer will just be saved to a file and stay hidden." | |||
| 1651 | :type 'boolean) | 1676 | :type 'boolean) |
| 1652 | 1677 | ||
| 1653 | (defcustom org-export-html-show-new-buffer nil | 1678 | (defcustom org-export-html-show-new-buffer nil |
| 1654 | "Non-nil means, popup buffer containing the exported HTML text. | 1679 | "Non-nil means, popup buffer containing the exported html text. |
| 1655 | Otherwise, the buffer will just be saved to a file and stay hidden." | 1680 | Otherwise, the buffer will just be saved to a file and stay hidden." |
| 1656 | :group 'org-export | 1681 | :group 'org-export |
| 1657 | :type 'boolean) | 1682 | :type 'boolean) |
| @@ -1677,6 +1702,16 @@ This file is created with the command \\[org-export-icalendar-all-agenda-files]. | |||
| 1677 | :tag "Org Faces" | 1702 | :tag "Org Faces" |
| 1678 | :group 'org) | 1703 | :group 'org) |
| 1679 | 1704 | ||
| 1705 | (defface org-hide | ||
| 1706 | '((((type tty) (class color)) (:foreground "blue" :weight bold)) | ||
| 1707 | (((class color) (background light)) (:foreground "white")) | ||
| 1708 | (((class color) (background dark)) (:foreground "black")) | ||
| 1709 | ; (((class color) (background light)) (:foreground "grey90")) | ||
| 1710 | ; (((class color) (background dark)) (:foreground "grey10")) | ||
| 1711 | (t (:inverse-video nil))) | ||
| 1712 | "Face used for level 1 headlines." | ||
| 1713 | :group 'org-faces) | ||
| 1714 | |||
| 1680 | (defface org-level-1 ;; font-lock-function-name-face | 1715 | (defface org-level-1 ;; font-lock-function-name-face |
| 1681 | '((((type tty) (class color)) (:foreground "blue" :weight bold)) | 1716 | '((((type tty) (class color)) (:foreground "blue" :weight bold)) |
| 1682 | (((class color) (background light)) (:foreground "Blue")) | 1717 | (((class color) (background light)) (:foreground "Blue")) |
| @@ -1844,17 +1879,25 @@ When this is non-nil, the headline after the keyword is set to the | |||
| 1844 | "Face used for time grids." | 1879 | "Face used for time grids." |
| 1845 | :group 'org-faces) | 1880 | :group 'org-faces) |
| 1846 | 1881 | ||
| 1847 | (defvar org-level-faces | 1882 | (defvar org-level-faces nil) |
| 1848 | '( | 1883 | |
| 1849 | org-level-1 | 1884 | (when (not org-level-faces) |
| 1850 | org-level-2 | 1885 | (setq org-level-faces |
| 1851 | org-level-3 | 1886 | '( |
| 1852 | org-level-4 | 1887 | org-level-1 |
| 1853 | org-level-5 | 1888 | org-level-2 |
| 1854 | org-level-6 | 1889 | org-level-3 |
| 1855 | org-level-7 | 1890 | org-level-4 |
| 1856 | org-level-8 | 1891 | org-level-5 |
| 1857 | )) | 1892 | org-level-6 |
| 1893 | org-level-7 | ||
| 1894 | org-level-8 | ||
| 1895 | )) | ||
| 1896 | (when org-odd-levels-only | ||
| 1897 | (setq org-level-faces (apply 'append (mapcar (lambda (x) (list x x)) | ||
| 1898 | org-level-faces))) | ||
| 1899 | (setq org-level-faces (append (cdr org-level-faces) (list 'org-level-1))))) | ||
| 1900 | |||
| 1858 | (defvar org-n-levels (length org-level-faces)) | 1901 | (defvar org-n-levels (length org-level-faces)) |
| 1859 | 1902 | ||
| 1860 | (defun org-set-regexps-and-options () | 1903 | (defun org-set-regexps-and-options () |
| @@ -1985,7 +2028,6 @@ When this is non-nil, the headline after the keyword is set to the | |||
| 1985 | (defvar remember-data-file) | 2028 | (defvar remember-data-file) |
| 1986 | (defvar last-arg)) | 2029 | (defvar last-arg)) |
| 1987 | 2030 | ||
| 1988 | |||
| 1989 | ;;; Define the mode | 2031 | ;;; Define the mode |
| 1990 | 2032 | ||
| 1991 | (defvar org-mode-map (copy-keymap outline-mode-map) | 2033 | (defvar org-mode-map (copy-keymap outline-mode-map) |
| @@ -2000,7 +2042,7 @@ When this is non-nil, the headline after the keyword is set to the | |||
| 2000 | (defvar org-table-may-need-update t | 2042 | (defvar org-table-may-need-update t |
| 2001 | "Indicates that a table might need an update. | 2043 | "Indicates that a table might need an update. |
| 2002 | This variable is set by `org-before-change-function'. | 2044 | This variable is set by `org-before-change-function'. |
| 2003 | `org-table-align'sets it back to nil.") | 2045 | `org-table-align' sets it back to nil.") |
| 2004 | (defvar org-mode-hook nil) | 2046 | (defvar org-mode-hook nil) |
| 2005 | (defvar org-inhibit-startup nil) ; Dynamically-scoped param. | 2047 | (defvar org-inhibit-startup nil) ; Dynamically-scoped param. |
| 2006 | (defvar org-agenda-keep-modes nil) ; Dynamically-scoped param. | 2048 | (defvar org-agenda-keep-modes nil) ; Dynamically-scoped param. |
| @@ -2090,6 +2132,7 @@ The following commands are available: | |||
| 2090 | (if org-xemacs-p [button2] [mouse-2]) 'org-open-at-mouse) | 2132 | (if org-xemacs-p [button2] [mouse-2]) 'org-open-at-mouse) |
| 2091 | (define-key org-mouse-map | 2133 | (define-key org-mouse-map |
| 2092 | (if org-xemacs-p [button3] [mouse-3]) 'org-find-file-at-mouse) | 2134 | (if org-xemacs-p [button3] [mouse-3]) 'org-find-file-at-mouse) |
| 2135 | (define-key org-mouse-map [follow-link] 'mouse-face) | ||
| 2093 | (when org-tab-follows-link | 2136 | (when org-tab-follows-link |
| 2094 | (define-key org-mouse-map [(tab)] 'org-open-at-point) | 2137 | (define-key org-mouse-map [(tab)] 'org-open-at-point) |
| 2095 | (define-key org-mouse-map "\C-i" 'org-open-at-point)) | 2138 | (define-key org-mouse-map "\C-i" 'org-open-at-point)) |
| @@ -2200,7 +2243,10 @@ With optional argument RADIO, only find radio targets." | |||
| 2200 | (save-excursion | 2243 | (save-excursion |
| 2201 | (goto-char (point-min)) | 2244 | (goto-char (point-min)) |
| 2202 | (while (re-search-forward re nil t) | 2245 | (while (re-search-forward re nil t) |
| 2203 | (add-to-list 'rtn (downcase (match-string-no-properties 1)))) | 2246 | (add-to-list 'rtn (downcase |
| 2247 | (if (fboundp 'match-string-no-properties) | ||
| 2248 | (match-string-no-properties 1) | ||
| 2249 | (match-string 1))))) | ||
| 2204 | rtn))) | 2250 | rtn))) |
| 2205 | 2251 | ||
| 2206 | (defun org-make-target-link-regexp (targets) | 2252 | (defun org-make-target-link-regexp (targets) |
| @@ -2274,8 +2320,6 @@ between words." | |||
| 2274 | ;; (3 'italic)) | 2320 | ;; (3 'italic)) |
| 2275 | ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)" | 2321 | ;; '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)" |
| 2276 | ;; (3 'underline)) | 2322 | ;; (3 'underline)) |
| 2277 | ; (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string "\\)\\>") | ||
| 2278 | ; '(1 'org-warning t)) | ||
| 2279 | (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string | 2323 | (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string |
| 2280 | "\\|" org-quote-string "\\)\\>") | 2324 | "\\|" org-quote-string "\\)\\>") |
| 2281 | '(1 'org-special-keyword t)) | 2325 | '(1 'org-special-keyword t)) |
| @@ -2290,24 +2334,25 @@ between words." | |||
| 2290 | '("^[ \t]*\\(:.*\\)" (1 'org-table t)) | 2334 | '("^[ \t]*\\(:.*\\)" (1 'org-table t)) |
| 2291 | '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t)) | 2335 | '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t)) |
| 2292 | '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t)) | 2336 | '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t)) |
| 2293 | ))) | 2337 | )) |
| 2338 | (exp | ||
| 2339 | ;; The font-lock expression for headlines is complicated. It depends | ||
| 2340 | ;; on two user options, and it needs to determine the level in | ||
| 2341 | ;; order to compute the level. | ||
| 2342 | (cond | ||
| 2343 | ((and org-level-color-stars-only (not org-hide-leading-stars)) | ||
| 2344 | '("^\\(\\*+\\).*" 1 (nth (% (- (match-end 1) (match-beginning 1) 1) org-n-levels) org-level-faces) nil t)) | ||
| 2345 | ((and (not org-level-color-stars-only) org-hide-leading-stars) | ||
| 2346 | '("^\\(\\**\\)\\(\\*.*\\)" (1 'org-hide) (2 (nth (% (- (match-end 1) (match-beginning 1)) org-n-levels) org-level-faces) nil t))) | ||
| 2347 | ((and org-level-color-stars-only org-hide-leading-stars) | ||
| 2348 | '("^\\(\\**\\)\\(\\*\\).*" (1 'org-hide) (2 (nth (% (- (match-end 1) (match-beginning 1)) org-n-levels) org-level-faces) nil t))) | ||
| 2349 | (t | ||
| 2350 | '("^\\(\\*+\\).*" 0 (nth (% (- (match-end 1) (match-beginning 1) 1) org-n-levels) org-level-faces) nil t))))) | ||
| 2351 | |||
| 2352 | ;; Now set the full font-lock-keywords | ||
| 2294 | (set (make-local-variable 'org-font-lock-keywords) | 2353 | (set (make-local-variable 'org-font-lock-keywords) |
| 2295 | (append | 2354 | (append |
| 2296 | (if org-noutline-p ; FIXME: I am not sure if eval will work | 2355 | (if org-xemacs-p (list exp) (list (cons 'eval (list 'quote exp)))) |
| 2297 | ; on XEmacs if noutline is ever ported | ||
| 2298 | `((eval . (list "^\\(\\*+\\).*" | ||
| 2299 | ,(if org-level-color-stars-only 1 0) | ||
| 2300 | '(nth | ||
| 2301 | (% (- (match-end 1) (match-beginning 1) 1) | ||
| 2302 | org-n-levels) | ||
| 2303 | org-level-faces) | ||
| 2304 | nil t))) | ||
| 2305 | `(("^\\(\\(\\*+\\)[^\r\n]*\\)[\n\r]" | ||
| 2306 | (,(if org-level-color-stars-only 2 0) | ||
| 2307 | (nth (% (- (match-end 2) (match-beginning 2) 1) | ||
| 2308 | org-n-levels) | ||
| 2309 | org-level-faces) | ||
| 2310 | nil t)))) | ||
| 2311 | org-font-lock-extra-keywords)) | 2356 | org-font-lock-extra-keywords)) |
| 2312 | (set (make-local-variable 'font-lock-defaults) | 2357 | (set (make-local-variable 'font-lock-defaults) |
| 2313 | '(org-font-lock-keywords t nil nil backward-paragraph)) | 2358 | '(org-font-lock-keywords t nil nil backward-paragraph)) |
| @@ -2731,19 +2776,32 @@ in the region." | |||
| 2731 | (equal (char-before) ?*) | 2776 | (equal (char-before) ?*) |
| 2732 | (forward-char 1))) | 2777 | (forward-char 1))) |
| 2733 | 2778 | ||
| 2779 | (defun org-get-legal-level (level change) | ||
| 2780 | "Rectify a level change under the influence of `org-odd-levels-only' | ||
| 2781 | LEVEL is a current level, CHANGE is by how much the level should be | ||
| 2782 | modified. Even if CHANGE is nil, LEVEL may be returned modified because | ||
| 2783 | even level numbers will become the next higher odd number." | ||
| 2784 | (if org-odd-levels-only | ||
| 2785 | (cond ((not change) (1+ (* 2 (/ level 2)))) | ||
| 2786 | ((> change 0) (1+ (* 2 (/ (+ level (* 2 change)) 2)))) | ||
| 2787 | ((< change 0) (max 1 (1+ (* 2 (/ (+ level (* 2 change)) 2)))))) | ||
| 2788 | (max 1 (+ level change)))) | ||
| 2789 | |||
| 2734 | (defun org-promote () | 2790 | (defun org-promote () |
| 2735 | "Promote the current heading higher up the tree. | 2791 | "Promote the current heading higher up the tree. |
| 2736 | If the region is active in `transient-mark-mode', promote all headings | 2792 | If the region is active in `transient-mark-mode', promote all headings |
| 2737 | in the region." | 2793 | in the region." |
| 2738 | (org-back-to-heading t) | 2794 | (org-back-to-heading t) |
| 2739 | (let* ((level (save-match-data (funcall outline-level))) | 2795 | (let* ((level (save-match-data (funcall outline-level))) |
| 2740 | (up-head (make-string (1- level) ?*))) | 2796 | (up-head (make-string (org-get-legal-level level -1) ?*)) |
| 2797 | (diff (abs (- level (length up-head))))) | ||
| 2741 | (if (= level 1) (error "Cannot promote to level 0. UNDO to recover")) | 2798 | (if (= level 1) (error "Cannot promote to level 0. UNDO to recover")) |
| 2742 | (replace-match up-head nil t) | 2799 | (replace-match up-head nil t) |
| 2743 | ;; Fixup tag positioning | 2800 | ;; Fixup tag positioning |
| 2744 | (and org-auto-align-tags (org-set-tags nil t)) | 2801 | (and org-auto-align-tags (org-set-tags nil t)) |
| 2745 | (if org-adapt-indentation | 2802 | (if org-adapt-indentation |
| 2746 | (org-fixup-indentation "^ " "" "^ ?\\S-")))) | 2803 | (org-fixup-indentation (if (> diff 1) "^ " "^ ") "" |
| 2804 | (if (> diff 1) "^ ? ?\\S-" "^ ?\\S-"))))) | ||
| 2747 | 2805 | ||
| 2748 | (defun org-demote () | 2806 | (defun org-demote () |
| 2749 | "Demote the current heading lower down the tree. | 2807 | "Demote the current heading lower down the tree. |
| @@ -2751,12 +2809,13 @@ If the region is active in `transient-mark-mode', demote all headings | |||
| 2751 | in the region." | 2809 | in the region." |
| 2752 | (org-back-to-heading t) | 2810 | (org-back-to-heading t) |
| 2753 | (let* ((level (save-match-data (funcall outline-level))) | 2811 | (let* ((level (save-match-data (funcall outline-level))) |
| 2754 | (down-head (make-string (1+ level) ?*))) | 2812 | (down-head (make-string (org-get-legal-level level 1) ?*)) |
| 2813 | (diff (abs (- level (length down-head))))) | ||
| 2755 | (replace-match down-head nil t) | 2814 | (replace-match down-head nil t) |
| 2756 | ;; Fixup tag positioning | 2815 | ;; Fixup tag positioning |
| 2757 | (and org-auto-align-tags (org-set-tags nil t)) | 2816 | (and org-auto-align-tags (org-set-tags nil t)) |
| 2758 | (if org-adapt-indentation | 2817 | (if org-adapt-indentation |
| 2759 | (org-fixup-indentation "^ " " " "^\\S-")))) | 2818 | (org-fixup-indentation "^ " (if (> diff 1) " " " ") "^\\S-")))) |
| 2760 | 2819 | ||
| 2761 | (defun org-map-tree (fun) | 2820 | (defun org-map-tree (fun) |
| 2762 | "Call FUN for every heading underneath the current one." | 2821 | "Call FUN for every heading underneath the current one." |
| @@ -2885,6 +2944,7 @@ If CUT is non nil, actually cut the subtree." | |||
| 2885 | (if cut "Cut" "Copied") | 2944 | (if cut "Cut" "Copied") |
| 2886 | (length org-subtree-clip))))) | 2945 | (length org-subtree-clip))))) |
| 2887 | 2946 | ||
| 2947 | ;; FIXME: this needs to be adapted for the odd-level-only stuff. | ||
| 2888 | (defun org-paste-subtree (&optional level tree) | 2948 | (defun org-paste-subtree (&optional level tree) |
| 2889 | "Paste the clipboard as a subtree, with modification of headline level. | 2949 | "Paste the clipboard as a subtree, with modification of headline level. |
| 2890 | The entire subtree is promoted or demoted in order to match a new headline | 2950 | The entire subtree is promoted or demoted in order to match a new headline |
| @@ -2945,6 +3005,7 @@ If optional TREE is given, use this text instead of the kill ring." | |||
| 2945 | (shift1 shift) | 3005 | (shift1 shift) |
| 2946 | (delta (if (> shift 0) -1 1)) | 3006 | (delta (if (> shift 0) -1 1)) |
| 2947 | (func (if (> shift 0) 'org-demote 'org-promote)) | 3007 | (func (if (> shift 0) 'org-demote 'org-promote)) |
| 3008 | (org-odd-levels-only nil) | ||
| 2948 | beg end) | 3009 | beg end) |
| 2949 | ;; Remove the forces level indicator | 3010 | ;; Remove the forces level indicator |
| 2950 | (if force-level | 3011 | (if force-level |
| @@ -3827,6 +3888,7 @@ insert a time. Note that when WITH-TIME is not set, you can still | |||
| 3827 | enter a time, and this function will inform the calling routine about | 3888 | enter a time, and this function will inform the calling routine about |
| 3828 | this change. The calling routine may then choose to change the format | 3889 | this change. The calling routine may then choose to change the format |
| 3829 | used to insert the time stamp into the buffer to include the time." | 3890 | used to insert the time stamp into the buffer to include the time." |
| 3891 | (require 'parse-time) | ||
| 3830 | (let* ((default-time | 3892 | (let* ((default-time |
| 3831 | ;; Default time is either today, or, when entering a range, | 3893 | ;; Default time is either today, or, when entering a range, |
| 3832 | ;; the range start. | 3894 | ;; the range start. |
| @@ -4348,7 +4410,7 @@ The following commands are available: | |||
| 4348 | (if org-xemacs-p [(button2)] [(mouse-2)]) 'org-agenda-goto-mouse) | 4410 | (if org-xemacs-p [(button2)] [(mouse-2)]) 'org-agenda-goto-mouse) |
| 4349 | (define-key org-agenda-keymap | 4411 | (define-key org-agenda-keymap |
| 4350 | (if org-xemacs-p [(button3)] [(mouse-3)]) 'org-agenda-show-mouse) | 4412 | (if org-xemacs-p [(button3)] [(mouse-3)]) 'org-agenda-show-mouse) |
| 4351 | 4413 | (define-key org-agenda-keymap [follow-link] 'mouse-face) | |
| 4352 | (easy-menu-define org-agenda-menu org-agenda-mode-map "Agenda menu" | 4414 | (easy-menu-define org-agenda-menu org-agenda-mode-map "Agenda menu" |
| 4353 | '("Agenda" | 4415 | '("Agenda" |
| 4354 | ("Agenda Files") | 4416 | ("Agenda Files") |
| @@ -6625,10 +6687,11 @@ With prefix ARG, realign all tags in headings in the current buffer." | |||
| 6625 | (completing-read "Tags: " 'org-tags-completion-function | 6687 | (completing-read "Tags: " 'org-tags-completion-function |
| 6626 | nil nil current 'org-tags-history))) | 6688 | nil nil current 'org-tags-history))) |
| 6627 | (while (string-match "[-+&]+" tags) | 6689 | (while (string-match "[-+&]+" tags) |
| 6628 | (setq tags (replace-match ":" t t tags))) | 6690 | (setq tags (replace-match ":" t t tags)))) |
| 6629 | (unless (setq empty (string-match "\\`[\t ]*\\'" tags)) | 6691 | ;; FIXME: still optimize this byt not checking when JUST-ALIGN? |
| 6630 | (unless (string-match ":$" tags) (setq tags (concat tags ":"))) | 6692 | (unless (setq empty (string-match "\\`[\t ]*\\'" tags)) |
| 6631 | (unless (string-match "^:" tags) (setq tags (concat ":" tags))))) | 6693 | (unless (string-match ":$" tags) (setq tags (concat tags ":"))) |
| 6694 | (unless (string-match "^:" tags) (setq tags (concat ":" tags)))) | ||
| 6632 | (if (equal current "") | 6695 | (if (equal current "") |
| 6633 | (progn | 6696 | (progn |
| 6634 | (end-of-line 1) | 6697 | (end-of-line 1) |
| @@ -7192,8 +7255,8 @@ use sequences." | |||
| 7192 | (mh-show-buffer-message-number)))) | 7255 | (mh-show-buffer-message-number)))) |
| 7193 | 7256 | ||
| 7194 | (defun org-mhe-get-header (header) | 7257 | (defun org-mhe-get-header (header) |
| 7195 | "Return a header of the message in folder mode. This will create a | 7258 | "Return a header of the message in folder mode. This will create a |
| 7196 | show buffer for the corresponding message. If you have a more clever | 7259 | show buffer for the corresponding message. If you have a more clever |
| 7197 | idea..." | 7260 | idea..." |
| 7198 | (let* ((folder (org-mhe-get-message-folder)) | 7261 | (let* ((folder (org-mhe-get-message-folder)) |
| 7199 | (num (org-mhe-get-message-num)) | 7262 | (num (org-mhe-get-message-num)) |
| @@ -10454,10 +10517,11 @@ translations. There is currently no way for users to extend this.") | |||
| 10454 | (erase-buffer) | 10517 | (erase-buffer) |
| 10455 | (insert string) | 10518 | (insert string) |
| 10456 | (org-mode) | 10519 | (org-mode) |
| 10457 | ;; Find targets in comments and move them out of comments | 10520 | ;; Find targets in comments and move them out of comments, |
| 10521 | ;; but mark them as targets that should be invisible | ||
| 10458 | (goto-char (point-min)) | 10522 | (goto-char (point-min)) |
| 10459 | (while (re-search-forward "^#.*?\\(<<<?[^>\r\n]+>>>?\\).*" nil t) | 10523 | (while (re-search-forward "^#.*?\\(<<<?[^>\r\n]+>>>?\\).*" nil t) |
| 10460 | (replace-match "\\1")) | 10524 | (replace-match "\\1(INVISIBLE)")) |
| 10461 | ;; Find matches for radio targets and turn them into links | 10525 | ;; Find matches for radio targets and turn them into links |
| 10462 | (goto-char (point-min)) | 10526 | (goto-char (point-min)) |
| 10463 | (while (re-search-forward re-radio nil t) | 10527 | (while (re-search-forward re-radio nil t) |
| @@ -10475,12 +10539,34 @@ translations. There is currently no way for users to extend this.") | |||
| 10475 | (kill-buffer " org-mode-tmp") | 10539 | (kill-buffer " org-mode-tmp") |
| 10476 | rtn)) | 10540 | rtn)) |
| 10477 | 10541 | ||
| 10478 | (defun org-solidify-link-text (s) | 10542 | (defun org-solidify-link-text (s &optional alist) |
| 10479 | "Take link text and make a safe target out of it." | 10543 | "Take link text and make a safe target out of it." |
| 10480 | (save-match-data | 10544 | (save-match-data |
| 10481 | (mapconcat | 10545 | (let* ((rtn |
| 10482 | 'identity | 10546 | (mapconcat |
| 10483 | (org-split-string s "[ \t\r\n]+") "--"))) | 10547 | 'identity |
| 10548 | (org-split-string s "[ \t\r\n]+") "--")) | ||
| 10549 | (a (assoc rtn alist))) | ||
| 10550 | (or (cdr a) rtn)))) | ||
| 10551 | |||
| 10552 | (defun org-convert-to-odd-levels () | ||
| 10553 | "Convert an org-mode file with all levels allowed to one with odd levels. | ||
| 10554 | This will leave level 1 alone, convert level 2 to level 3, level 3 to | ||
| 10555 | level 5 etc." | ||
| 10556 | (interactive) | ||
| 10557 | (when (yes-or-no-p "Are you sure you want to globally change levels? ") | ||
| 10558 | (let ((org-odd-levels-only nil) n) | ||
| 10559 | (save-excursion | ||
| 10560 | (goto-char (point-min)) | ||
| 10561 | (while (re-search-forward "^\\*\\*+" nil t) | ||
| 10562 | (setq n (1- (length (match-string 0)))) | ||
| 10563 | (while (>= (setq n (1- n)) 0) | ||
| 10564 | (org-demote)) | ||
| 10565 | (end-of-line 1)))))) | ||
| 10566 | |||
| 10567 | (defun org-tr-level (n) | ||
| 10568 | "Make N odd if required." | ||
| 10569 | (if org-odd-levels-only (1+ (/ n 2)) n)) | ||
| 10484 | 10570 | ||
| 10485 | (defvar org-last-level nil) ; dynamically scoped variable | 10571 | (defvar org-last-level nil) ; dynamically scoped variable |
| 10486 | 10572 | ||
| @@ -10561,6 +10647,7 @@ underlined headlines. The default is 3." | |||
| 10561 | ;; This is a headline | 10647 | ;; This is a headline |
| 10562 | (progn | 10648 | (progn |
| 10563 | (setq level (- (match-end 1) (match-beginning 1)) | 10649 | (setq level (- (match-end 1) (match-beginning 1)) |
| 10650 | level (org-tr-level level) | ||
| 10564 | txt (match-string 3 line) | 10651 | txt (match-string 3 line) |
| 10565 | todo | 10652 | todo |
| 10566 | (or (and (match-beginning 2) | 10653 | (or (and (match-beginning 2) |
| @@ -10599,7 +10686,7 @@ underlined headlines. The default is 3." | |||
| 10599 | (cond | 10686 | (cond |
| 10600 | ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line) | 10687 | ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line) |
| 10601 | ;; a Headline | 10688 | ;; a Headline |
| 10602 | (setq level (- (match-end 1) (match-beginning 1)) | 10689 | (setq level (org-tr-level (- (match-end 1) (match-beginning 1))) |
| 10603 | txt (match-string 2 line)) | 10690 | txt (match-string 2 line)) |
| 10604 | (org-ascii-level-start level txt umax)) | 10691 | (org-ascii-level-start level txt umax)) |
| 10605 | (t (insert line "\n")))) | 10692 | (t (insert line "\n")))) |
| @@ -10860,6 +10947,7 @@ headlines. The default is 3. Lower levels will become bulleted lists." | |||
| 10860 | (language org-export-default-language) | 10947 | (language org-export-default-language) |
| 10861 | (text nil) | 10948 | (text nil) |
| 10862 | (lang-words nil) | 10949 | (lang-words nil) |
| 10950 | (target-alist nil) tg | ||
| 10863 | (head-count 0) cnt | 10951 | (head-count 0) cnt |
| 10864 | (start 0) | 10952 | (start 0) |
| 10865 | ;; FIXME: The following returns always nil under XEmacs | 10953 | ;; FIXME: The following returns always nil under XEmacs |
| @@ -10923,11 +11011,13 @@ headlines. The default is 3. Lower levels will become bulleted lists." | |||
| 10923 | (progn | 11011 | (progn |
| 10924 | (insert (format "<H2>%s</H2>\n" (nth 3 lang-words))) | 11012 | (insert (format "<H2>%s</H2>\n" (nth 3 lang-words))) |
| 10925 | (insert "<ul>\n") | 11013 | (insert "<ul>\n") |
| 11014 | (setq lines | ||
| 10926 | (mapcar '(lambda (line) | 11015 | (mapcar '(lambda (line) |
| 10927 | (if (string-match org-todo-line-regexp line) | 11016 | (if (string-match org-todo-line-regexp line) |
| 10928 | ;; This is a headline | 11017 | ;; This is a headline |
| 10929 | (progn | 11018 | (progn |
| 10930 | (setq level (- (match-end 1) (match-beginning 1)) | 11019 | (setq level (- (match-end 1) (match-beginning 1)) |
| 11020 | level (org-tr-level level) | ||
| 10931 | txt (save-match-data | 11021 | txt (save-match-data |
| 10932 | (org-html-expand | 11022 | (org-html-expand |
| 10933 | (match-string 3 line))) | 11023 | (match-string 3 line))) |
| @@ -10957,15 +11047,28 @@ headlines. The default is 3. Lower levels will become bulleted lists." | |||
| 10957 | (while (>= (setq cnt (1- cnt)) 0) | 11047 | (while (>= (setq cnt (1- cnt)) 0) |
| 10958 | (insert "</ul>")) | 11048 | (insert "</ul>")) |
| 10959 | (insert "\n"))) | 11049 | (insert "\n"))) |
| 11050 | ;; Check for targets | ||
| 11051 | (while (string-match org-target-regexp line) | ||
| 11052 | (setq tg (match-string 1 line) | ||
| 11053 | line (replace-match | ||
| 11054 | (concat "@<span class=\"target\">" tg "@</span> ") | ||
| 11055 | t t line)) | ||
| 11056 | (push (cons (org-solidify-link-text tg) | ||
| 11057 | (format "sec-%d" head-count)) | ||
| 11058 | target-alist)) | ||
| 11059 | (while (string-match "<\\(<\\)+\\|>\\(>\\)+" txt) | ||
| 11060 | (setq txt (replace-match "" t t txt))) | ||
| 10960 | (insert | 11061 | (insert |
| 10961 | (format | 11062 | (format |
| 10962 | (if todo | 11063 | (if todo |
| 10963 | "<li><a href=\"#sec-%d\"><span class=\"todo\">%s</span></a>\n" | 11064 | "<li><a href=\"#sec-%d\"><span class=\"todo\">%s</span></a>\n" |
| 10964 | "<li><a href=\"#sec-%d\">%s</a>\n") | 11065 | "<li><a href=\"#sec-%d\">%s</a>\n") |
| 10965 | head-count txt)) | 11066 | head-count txt)) |
| 11067 | |||
| 10966 | (setq org-last-level level)) | 11068 | (setq org-last-level level)) |
| 10967 | )))) | 11069 | ))) |
| 10968 | lines) | 11070 | line) |
| 11071 | lines)) | ||
| 10969 | (while (> org-last-level 0) | 11072 | (while (> org-last-level 0) |
| 10970 | (setq org-last-level (1- org-last-level)) | 11073 | (setq org-last-level (1- org-last-level)) |
| 10971 | (insert "</ul>\n")) | 11074 | (insert "</ul>\n")) |
| @@ -11001,18 +11104,31 @@ headlines. The default is 3. Lower levels will become bulleted lists." | |||
| 11001 | 11104 | ||
| 11002 | 11105 | ||
| 11003 | ;; make targets to anchors | 11106 | ;; make targets to anchors |
| 11004 | (while (string-match "<<<?\\([^<>]*\\)>>>?[ \t]*\n?" line) | 11107 | (while (string-match "<<<?\\([^<>]*\\)>>>?\\((INVISIBLE)\\)?[ \t]*\n?" line) |
| 11005 | (setq line (replace-match | 11108 | (cond |
| 11006 | (concat "@<a name=\"" | 11109 | ((match-end 2) |
| 11007 | (org-solidify-link-text (match-string 1 line)) | 11110 | (setq line (replace-match |
| 11008 | "\">\\nbsp@</a>") | 11111 | (concat "@<a name=\"" |
| 11009 | t t line))) | 11112 | (org-solidify-link-text (match-string 1 line)) |
| 11113 | "\">\\nbsp@</a>") | ||
| 11114 | t t line))) | ||
| 11115 | ((and org-export-with-toc (equal (string-to-char line) ?*)) | ||
| 11116 | (setq line (replace-match | ||
| 11117 | (concat "@<span class=\"target\">" (match-string 1 line) "@</span> ") | ||
| 11118 | ; (concat "@<i>" (match-string 1 line) "@</i> ") | ||
| 11119 | t t line))) | ||
| 11120 | (t | ||
| 11121 | (setq line (replace-match | ||
| 11122 | (concat "@<a name=\"" | ||
| 11123 | (org-solidify-link-text (match-string 1 line)) | ||
| 11124 | "\" class=\"target\">" (match-string 1 line) "@</a> ") | ||
| 11125 | t t line))))) | ||
| 11010 | ;; Replace internal links | 11126 | ;; Replace internal links |
| 11011 | (while (string-match org-bracket-link-regexp line) | 11127 | (while (string-match org-bracket-link-regexp line) |
| 11012 | (setq line (replace-match | 11128 | (setq line (replace-match |
| 11013 | (concat | 11129 | (concat |
| 11014 | "@<a href=\"#" | 11130 | "@<a href=\"#" |
| 11015 | (org-solidify-link-text (match-string 1 line)) | 11131 | (org-solidify-link-text (match-string 1 line) target-alist) |
| 11016 | "\">" | 11132 | "\">" |
| 11017 | (match-string (if (match-end 3) 3 1) line) | 11133 | (match-string (if (match-end 3) 3 1) line) |
| 11018 | "@</a>") | 11134 | "@</a>") |
| @@ -11087,7 +11203,7 @@ headlines. The default is 3. Lower levels will become bulleted lists." | |||
| 11087 | (cond | 11203 | (cond |
| 11088 | ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line) | 11204 | ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line) |
| 11089 | ;; This is a headline | 11205 | ;; This is a headline |
| 11090 | (setq level (- (match-end 1) (match-beginning 1)) | 11206 | (setq level (org-tr-level (- (match-end 1) (match-beginning 1))) |
| 11091 | txt (match-string 2 line)) | 11207 | txt (match-string 2 line)) |
| 11092 | (if (<= level umax) (setq head-count (+ head-count 1))) | 11208 | (if (<= level umax) (setq head-count (+ head-count 1))) |
| 11093 | (when in-local-list | 11209 | (when in-local-list |
| @@ -11822,6 +11938,7 @@ a time), or the day by one (if it does not contain a time)." | |||
| 11822 | (define-key org-mode-map "\C-c\C-xb" 'org-export-as-html-and-open) | 11938 | (define-key org-mode-map "\C-c\C-xb" 'org-export-as-html-and-open) |
| 11823 | (define-key org-mode-map "\C-c\C-x\C-b" 'org-export-as-html-and-open) | 11939 | (define-key org-mode-map "\C-c\C-x\C-b" 'org-export-as-html-and-open) |
| 11824 | 11940 | ||
| 11941 | (define-key org-mode-map "\C-c\C-x\C-k" 'org-cut-special) | ||
| 11825 | (define-key org-mode-map "\C-c\C-x\C-w" 'org-cut-special) | 11942 | (define-key org-mode-map "\C-c\C-x\C-w" 'org-cut-special) |
| 11826 | (define-key org-mode-map "\C-c\C-x\M-w" 'org-copy-special) | 11943 | (define-key org-mode-map "\C-c\C-x\M-w" 'org-copy-special) |
| 11827 | (define-key org-mode-map "\C-c\C-x\C-y" 'org-paste-special) | 11944 | (define-key org-mode-map "\C-c\C-x\C-y" 'org-paste-special) |
| @@ -12244,7 +12361,9 @@ See the individual commands for more information." | |||
| 12244 | ["Demote Heading" org-metaright (not (org-at-table-p))] | 12361 | ["Demote Heading" org-metaright (not (org-at-table-p))] |
| 12245 | ["Demote Subtree" org-shiftmetaright (not (org-at-table-p))] | 12362 | ["Demote Subtree" org-shiftmetaright (not (org-at-table-p))] |
| 12246 | "--" | 12363 | "--" |
| 12247 | ["Archive Subtree" org-archive-subtree t]) | 12364 | ["Archive Subtree" org-archive-subtree t] |
| 12365 | "--" | ||
| 12366 | ["Convert file to odd levels" org-convert-to-odd-levels t]) | ||
| 12248 | "--" | 12367 | "--" |
| 12249 | ("TODO Lists" | 12368 | ("TODO Lists" |
| 12250 | ["TODO/DONE/-" org-todo t] | 12369 | ["TODO/DONE/-" org-todo t] |
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el index f005e7a3b87..5616d4f454c 100644 --- a/lisp/textmodes/reftex-index.el +++ b/lisp/textmodes/reftex-index.el | |||
| @@ -1034,6 +1034,7 @@ When index is restricted, select the previous section as restriction criterion." | |||
| 1034 | ;; Index map | 1034 | ;; Index map |
| 1035 | (define-key reftex-index-map (if (featurep 'xemacs) [(button2)] [(mouse-2)]) | 1035 | (define-key reftex-index-map (if (featurep 'xemacs) [(button2)] [(mouse-2)]) |
| 1036 | 'reftex-index-mouse-goto-line-and-hide) | 1036 | 'reftex-index-mouse-goto-line-and-hide) |
| 1037 | (define-key reftex-index-map [follow-link] 'mouse-face) | ||
| 1037 | 1038 | ||
| 1038 | (substitute-key-definition | 1039 | (substitute-key-definition |
| 1039 | 'next-line 'reftex-index-next reftex-index-map global-map) | 1040 | 'next-line 'reftex-index-next reftex-index-map global-map) |
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el index 69a893ff177..f0e8205024c 100644 --- a/lisp/textmodes/reftex-sel.el +++ b/lisp/textmodes/reftex-sel.el | |||
| @@ -685,7 +685,9 @@ Useful for large TOC's." | |||
| 685 | ;; The mouse-2 binding | 685 | ;; The mouse-2 binding |
| 686 | (if (featurep 'xemacs) | 686 | (if (featurep 'xemacs) |
| 687 | (define-key map [(button2)] 'reftex-select-mouse-accept) | 687 | (define-key map [(button2)] 'reftex-select-mouse-accept) |
| 688 | (define-key map [(mouse-2)] 'reftex-select-mouse-accept)) | 688 | (define-key map [(mouse-2)] 'reftex-select-mouse-accept) |
| 689 | (define-key map [follow-link] 'mouse-face)) | ||
| 690 | |||
| 689 | 691 | ||
| 690 | ;; Digit arguments | 692 | ;; Digit arguments |
| 691 | (loop for key across "0123456789" do | 693 | (loop for key across "0123456789" do |
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 9b710b92a67..7508351fb35 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el | |||
| @@ -1011,6 +1011,7 @@ always show the current section in connection with the option | |||
| 1011 | ;; Table of Contents map | 1011 | ;; Table of Contents map |
| 1012 | (define-key reftex-toc-map (if (featurep 'xemacs) [(button2)] [(mouse-2)]) | 1012 | (define-key reftex-toc-map (if (featurep 'xemacs) [(button2)] [(mouse-2)]) |
| 1013 | 'reftex-toc-mouse-goto-line-and-hide) | 1013 | 'reftex-toc-mouse-goto-line-and-hide) |
| 1014 | (define-key reftex-toc-map [follow-link] 'mouse-face) | ||
| 1014 | 1015 | ||
| 1015 | (substitute-key-definition | 1016 | (substitute-key-definition |
| 1016 | 'next-line 'reftex-toc-next reftex-toc-map global-map) | 1017 | 'next-line 'reftex-toc-next reftex-toc-map global-map) |
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index f1f263d18a5..a56517535f1 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,26 @@ | |||
| 1 | 2006-03-02 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * keymaps.texi (Tool Bar): Add tool-bar-border. | ||
| 4 | |||
| 5 | 2006-02-28 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6 | |||
| 7 | * loading.texi (Load Suffixes): Rephrase last paragraph. Fix typos. | ||
| 8 | |||
| 9 | 2006-02-27 Luc Teirlinck <teirllm@auburn.edu> | ||
| 10 | |||
| 11 | * elisp.texi (Top): Include "Load Suffixes" in the detailed menu. | ||
| 12 | |||
| 13 | * files.texi (Locating Files): Suggest additional values for the | ||
| 14 | SUFFIXES arg of `locate-file'. Update pxref. | ||
| 15 | |||
| 16 | * loading.texi (Loading): Include new node "Load Suffixes" in menu. | ||
| 17 | (How Programs Do Loading): Discuss the effects of Auto Compression | ||
| 18 | mode on `load'. | ||
| 19 | (Load Suffixes): New node. | ||
| 20 | (Library Search): Delete description of `load-suffixes'; it was | ||
| 21 | moved to "Load Suffixes". | ||
| 22 | (Autoload, Named Features): Mention `load-suffixes'. | ||
| 23 | |||
| 1 | 2006-02-21 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) | 24 | 2006-02-21 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change) |
| 2 | 25 | ||
| 3 | * display.texi (Fringe Indicators, Fringe Cursors): Fix typos. | 26 | * display.texi (Fringe Indicators, Fringe Cursors): Fix typos. |
diff --git a/lispref/elisp.texi b/lispref/elisp.texi index 4dd1c854a83..54056dd8a9a 100644 --- a/lispref/elisp.texi +++ b/lispref/elisp.texi | |||
| @@ -78,7 +78,7 @@ Cover art by Etienne Suvasa. | |||
| 78 | 78 | ||
| 79 | @ifnottex | 79 | @ifnottex |
| 80 | @node Top, Introduction, (dir), (dir) | 80 | @node Top, Introduction, (dir), (dir) |
| 81 | @top Emacs Lisp | 81 | @top Emacs Lisp |
| 82 | 82 | ||
| 83 | This Info file contains edition @value{VERSION} of the GNU Emacs Lisp | 83 | This Info file contains edition @value{VERSION} of the GNU Emacs Lisp |
| 84 | Reference Manual, corresponding to GNU Emacs version @value{EMACSVER}. | 84 | Reference Manual, corresponding to GNU Emacs version @value{EMACSVER}. |
| @@ -438,6 +438,7 @@ Writing Customization Definitions | |||
| 438 | Loading | 438 | Loading |
| 439 | 439 | ||
| 440 | * How Programs Do Loading:: The @code{load} function and others. | 440 | * How Programs Do Loading:: The @code{load} function and others. |
| 441 | * Load Suffixes:: Details about the suffixes that @code{load} tries. | ||
| 441 | * Library Search:: Finding a library to load. | 442 | * Library Search:: Finding a library to load. |
| 442 | * Loading Non-ASCII:: Non-@acronym{ASCII} characters in Emacs Lisp files. | 443 | * Loading Non-ASCII:: Non-@acronym{ASCII} characters in Emacs Lisp files. |
| 443 | * Autoload:: Setting up a function to autoload. | 444 | * Autoload:: Setting up a function to autoload. |
diff --git a/lispref/files.texi b/lispref/files.texi index 417bab81360..4d3cfd52c94 100644 --- a/lispref/files.texi +++ b/lispref/files.texi | |||
| @@ -1283,8 +1283,9 @@ suffixes to append to @var{filename} when searching. | |||
| 1283 | suffixes. If @var{suffixes} is @code{nil}, or @code{("")}, then there | 1283 | suffixes. If @var{suffixes} is @code{nil}, or @code{("")}, then there |
| 1284 | are no suffixes, and @var{filename} is used only as-is. Typical | 1284 | are no suffixes, and @var{filename} is used only as-is. Typical |
| 1285 | values of @var{suffixes} are @code{exec-suffixes} (@pxref{Subprocess | 1285 | values of @var{suffixes} are @code{exec-suffixes} (@pxref{Subprocess |
| 1286 | Creation, exec-suffixes}) and @code{load-suffixes} (@pxref{Library | 1286 | Creation, exec-suffixes}), @code{load-suffixes}, |
| 1287 | Search, load-suffixes}). | 1287 | @code{load-file-rep-suffixes} and the return value of the function |
| 1288 | @code{get-load-suffixes} (@pxref{Load Suffixes}). | ||
| 1288 | 1289 | ||
| 1289 | Typical values for @var{path} are @code{exec-path} (@pxref{Subprocess | 1290 | Typical values for @var{path} are @code{exec-path} (@pxref{Subprocess |
| 1290 | Creation, exec-path}) when looking for executable programs or | 1291 | Creation, exec-path}) when looking for executable programs or |
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi index b7bc34ece84..b1e2f7fbaea 100644 --- a/lispref/keymaps.texi +++ b/lispref/keymaps.texi | |||
| @@ -2498,6 +2498,15 @@ This variable specifies the shadow width for tool bar items. | |||
| 2498 | The value is an integer, a number of pixels. The default is 1. | 2498 | The value is an integer, a number of pixels. The default is 1. |
| 2499 | @end defvar | 2499 | @end defvar |
| 2500 | 2500 | ||
| 2501 | @tindex tool-bar-border | ||
| 2502 | @defvar tool-bar-border | ||
| 2503 | This variable specifies the height of the border drawn below the tool | ||
| 2504 | bar area. An integer value specifies height as a number of pixels. | ||
| 2505 | If the value is one of @code{internal-border-width} (the default) or | ||
| 2506 | @code{border-width}, the tool bar border height corresponds to the | ||
| 2507 | corresponding frame parameter. | ||
| 2508 | @end defvar | ||
| 2509 | |||
| 2501 | You can define a special meaning for clicking on a tool bar item with | 2510 | You can define a special meaning for clicking on a tool bar item with |
| 2502 | the shift, control, meta, etc., modifiers. You do this by setting up | 2511 | the shift, control, meta, etc., modifiers. You do this by setting up |
| 2503 | additional items that relate to the original item through the fake | 2512 | additional items that relate to the original item through the fake |
diff --git a/lispref/loading.texi b/lispref/loading.texi index b78fb92ad82..544bb0875b1 100644 --- a/lispref/loading.texi +++ b/lispref/loading.texi | |||
| @@ -36,6 +36,7 @@ containing Lisp code. | |||
| 36 | 36 | ||
| 37 | @menu | 37 | @menu |
| 38 | * How Programs Do Loading:: The @code{load} function and others. | 38 | * How Programs Do Loading:: The @code{load} function and others. |
| 39 | * Load Suffixes:: Details about the suffixes that @code{load} tries. | ||
| 39 | * Library Search:: Finding a library to load. | 40 | * Library Search:: Finding a library to load. |
| 40 | * Loading Non-ASCII:: Non-@acronym{ASCII} characters in Emacs Lisp files. | 41 | * Loading Non-ASCII:: Non-@acronym{ASCII} characters in Emacs Lisp files. |
| 41 | * Autoload:: Setting up a function to autoload. | 42 | * Autoload:: Setting up a function to autoload. |
| @@ -72,17 +73,27 @@ exists. (The @code{load} function is not clever about looking at | |||
| 72 | @var{filename}. In the perverse case of a file named @file{foo.el.el}, | 73 | @var{filename}. In the perverse case of a file named @file{foo.el.el}, |
| 73 | evaluation of @code{(load "foo.el")} will indeed find it.) | 74 | evaluation of @code{(load "foo.el")} will indeed find it.) |
| 74 | 75 | ||
| 75 | If the optional argument @var{nosuffix} is non-@code{nil}, then the | 76 | If Auto Compression mode is enabled, as it is by default, then |
| 76 | suffixes @samp{.elc} and @samp{.el} are not tried. In this case, you | 77 | if @code{load} can not find a file, it searches for a compressed |
| 77 | must specify the precise file name you want. By specifying the precise | 78 | version of the file before trying other file names. It decompresses |
| 78 | file name and using @code{t} for @var{nosuffix}, you can prevent | 79 | and loads it if it exists. It looks for compressed versions by |
| 79 | perverse file names such as @file{foo.el.el} from being tried. | 80 | appending the suffixes in @code{jka-compr-load-suffixes} to the file |
| 81 | name. The value of this variable must be a list of strings. Its | ||
| 82 | standard value is @code{(".gz")}. | ||
| 83 | |||
| 84 | If the optional argument @var{nosuffix} is non-@code{nil}, then | ||
| 85 | @code{load} does not try the suffixes @samp{.elc} and @samp{.el}. In | ||
| 86 | this case, you must specify the precise file name you want, except | ||
| 87 | that, if Auto Compression mode is enabled, @code{load} will still use | ||
| 88 | @code{jka-compr-load-suffixes} to find compressed versions. By | ||
| 89 | specifying the precise file name and using @code{t} for | ||
| 90 | @var{nosuffix}, you can prevent perverse file names such as | ||
| 91 | @file{foo.el.el} from being tried. | ||
| 80 | 92 | ||
| 81 | If the optional argument @var{must-suffix} is non-@code{nil}, then | 93 | If the optional argument @var{must-suffix} is non-@code{nil}, then |
| 82 | @code{load} insists that the file name used must end in either | 94 | @code{load} insists that the file name used must end in either |
| 83 | @samp{.el} or @samp{.elc}, unless it contains an explicit directory | 95 | @samp{.el} or @samp{.elc} (possibly extended with a compression |
| 84 | name. If @var{filename} does not contain an explicit directory name, | 96 | suffix), unless it contains an explicit directory name. |
| 85 | and does not end in a suffix, then @code{load} insists on adding one. | ||
| 86 | 97 | ||
| 87 | If @var{filename} is a relative file name, such as @file{foo} or | 98 | If @var{filename} is a relative file name, such as @file{foo} or |
| 88 | @file{baz/foo.bar}, @code{load} searches for the file using the variable | 99 | @file{baz/foo.bar}, @code{load} searches for the file using the variable |
| @@ -127,8 +138,10 @@ See below. | |||
| 127 | @deffn Command load-file filename | 138 | @deffn Command load-file filename |
| 128 | This command loads the file @var{filename}. If @var{filename} is a | 139 | This command loads the file @var{filename}. If @var{filename} is a |
| 129 | relative file name, then the current default directory is assumed. | 140 | relative file name, then the current default directory is assumed. |
| 130 | @code{load-path} is not used, and suffixes are not appended. Use this | 141 | This command does not use @code{load-path}, and does not append |
| 131 | command if you wish to specify precisely the file name to load. | 142 | suffixes. However, it does look for compressed versions (if Auto |
| 143 | Compression Mode is enabled). Use this command if you wish to specify | ||
| 144 | precisely the file name to load. | ||
| 132 | @end deffn | 145 | @end deffn |
| 133 | 146 | ||
| 134 | @deffn Command load-library library | 147 | @deffn Command load-library library |
| @@ -158,6 +171,52 @@ feature: to pass the function as the @var{read-function} argument to | |||
| 158 | For information about how @code{load} is used in building Emacs, see | 171 | For information about how @code{load} is used in building Emacs, see |
| 159 | @ref{Building Emacs}. | 172 | @ref{Building Emacs}. |
| 160 | 173 | ||
| 174 | @node Load Suffixes | ||
| 175 | @section Load Suffixes | ||
| 176 | We now describe some technical details about the exact suffixes that | ||
| 177 | @code{load} tries. | ||
| 178 | |||
| 179 | @defvar load-suffixes | ||
| 180 | This is a list of suffixes indicating (compiled or source) Emacs Lisp | ||
| 181 | files. It should not include the empty string. @code{load} uses | ||
| 182 | these suffixes in order when it appends Lisp suffixes to the specified | ||
| 183 | file name. The standard value is @code{(".elc" ".el")} which produces | ||
| 184 | the behavior described in the previous section. | ||
| 185 | @end defvar | ||
| 186 | |||
| 187 | @defvar load-file-rep-suffixes | ||
| 188 | This is a list of suffixes that indicate representations of the same | ||
| 189 | file. This list should normally start with the empty string. | ||
| 190 | When @code{load} searches for a file it appends the suffixes in this | ||
| 191 | list, in order, to the file name, before searching for another file. | ||
| 192 | |||
| 193 | Enabling Auto Compression mode appends the suffixes in | ||
| 194 | @code{jka-compr-load-suffixes} to this list and disabling Auto | ||
| 195 | Compression mode removes them again. The standard value of | ||
| 196 | @code{load-file-rep-suffixes} if Auto Compression mode is disabled is | ||
| 197 | @code{("")}. Given that the standard value of | ||
| 198 | @code{jka-compr-load-suffixes} is @code{(".gz")}, the standard value | ||
| 199 | of @code{load-file-rep-suffixes} if Auto Compression mode is enabled | ||
| 200 | is @code{("" ".gz")}. | ||
| 201 | @end defvar | ||
| 202 | |||
| 203 | @defun get-load-suffixes | ||
| 204 | This function returns the list of all suffixes that @code{load} should | ||
| 205 | try, in order, when its @var{must-suffix} argument is non-@code{nil}. | ||
| 206 | This takes both @code{load-suffixes} and @code{load-file-rep-suffixes} | ||
| 207 | into account. If @code{load-suffixes}, @code{jka-compr-load-suffixes} | ||
| 208 | and @code{load-file-rep-suffixes} all have their standard values, this | ||
| 209 | function returns @code{(".elc" ".elc.gz" ".el" ".el.gz")} if Auto | ||
| 210 | Compression mode is enabled and @code{(".elc" ".el")} if Auto | ||
| 211 | Compression mode is disabled. | ||
| 212 | @end defun | ||
| 213 | |||
| 214 | To summarize, @code{load} normally first tries the suffixes in the | ||
| 215 | value of @code{(get-load-suffixes)} and then those in | ||
| 216 | @code{load-file-rep-suffixes}. If @var{nosuffix} is non-@code{nil}, | ||
| 217 | it skips the former group, and if @var{must-suffix} is non-@code{nil}, | ||
| 218 | it skips the latter group. | ||
| 219 | |||
| 161 | @node Library Search | 220 | @node Library Search |
| 162 | @section Library Search | 221 | @section Library Search |
| 163 | 222 | ||
| @@ -288,13 +347,6 @@ interactively, the argument @var{interactive-call} is @code{t}, and this | |||
| 288 | tells @code{locate-library} to display the file name in the echo area. | 347 | tells @code{locate-library} to display the file name in the echo area. |
| 289 | @end deffn | 348 | @end deffn |
| 290 | 349 | ||
| 291 | @defvar load-suffixes | ||
| 292 | This variable is a list of suffixes (strings) that @code{load} should | ||
| 293 | try adding to the specified file name. The default value is | ||
| 294 | @code{(".elc" ".elc.gz" ".el" ".el.gz" ".gz")}. There is no need to | ||
| 295 | include the null suffix. | ||
| 296 | @end defvar | ||
| 297 | |||
| 298 | @node Loading Non-ASCII | 350 | @node Loading Non-ASCII |
| 299 | @section Loading Non-@acronym{ASCII} Characters | 351 | @section Loading Non-@acronym{ASCII} Characters |
| 300 | 352 | ||
| @@ -362,7 +414,8 @@ specifies the file to load to get the real definition of @var{function}. | |||
| 362 | If @var{filename} does not contain either a directory name, or the | 414 | If @var{filename} does not contain either a directory name, or the |
| 363 | suffix @code{.el} or @code{.elc}, then @code{autoload} insists on adding | 415 | suffix @code{.el} or @code{.elc}, then @code{autoload} insists on adding |
| 364 | one of these suffixes, and it will not load from a file whose name is | 416 | one of these suffixes, and it will not load from a file whose name is |
| 365 | just @var{filename} with no added suffix. | 417 | just @var{filename} with no added suffix. (The variable |
| 418 | @code{load-suffixes} specifies the exact required suffixes.) | ||
| 366 | 419 | ||
| 367 | The argument @var{docstring} is the documentation string for the | 420 | The argument @var{docstring} is the documentation string for the |
| 368 | function. Specifying the documentation string in the call to | 421 | function. Specifying the documentation string in the call to |
| @@ -699,8 +752,10 @@ If the feature is not present, then @code{require} loads @var{filename} | |||
| 699 | with @code{load}. If @var{filename} is not supplied, then the name of | 752 | with @code{load}. If @var{filename} is not supplied, then the name of |
| 700 | the symbol @var{feature} is used as the base file name to load. | 753 | the symbol @var{feature} is used as the base file name to load. |
| 701 | However, in this case, @code{require} insists on finding @var{feature} | 754 | However, in this case, @code{require} insists on finding @var{feature} |
| 702 | with an added suffix; a file whose name is just @var{feature} won't be | 755 | with an added @samp{.el} or @samp{.elc} suffix (possibly extended with |
| 703 | used. | 756 | a compression suffix); a file whose name is just @var{feature} won't |
| 757 | be used. (The variable @code{load-suffixes} specifies the exact | ||
| 758 | required Lisp suffixes.) | ||
| 704 | 759 | ||
| 705 | If @var{noerror} is non-@code{nil}, that suppresses errors from actual | 760 | If @var{noerror} is non-@code{nil}, that suppresses errors from actual |
| 706 | loading of the file. In that case, @code{require} returns @code{nil} | 761 | loading of the file. In that case, @code{require} returns @code{nil} |
diff --git a/man/ChangeLog b/man/ChangeLog index e7e2f620263..6b4127e35d7 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,22 @@ | |||
| 1 | 2006-03-01 Carsten Dominik <dominik@science.uva.nl> | ||
| 2 | |||
| 3 | * org.texi: (Interaction): Added item about `org-mouse.el' by | ||
| 4 | Piotr Zielinski. | ||
| 5 | (Managing links): Documented that also mouse-1 can be used to | ||
| 6 | activate a link. | ||
| 7 | (Headlines, FAQ): Added entry about hiding leading stars. | ||
| 8 | (Miscellaneous): Resorted the sections in this chapter to a more | ||
| 9 | logical sequence. | ||
| 10 | |||
| 11 | 2006-02-28 Andre Spiegel <spiegel@gnu.org> | ||
| 12 | |||
| 13 | * files.texi (Old Versions): Clarify operation of C-x v =. | ||
| 14 | |||
| 15 | 2006-02-27 Simon Josefsson <jas@extundo.com> | ||
| 16 | |||
| 17 | * emacs-mime.texi (Flowed text): Add mm-fill-flowed. (Sync | ||
| 18 | 2004-01-27 from the trunk). | ||
| 19 | |||
| 1 | 2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org> | 20 | 2006-02-24 Alan Mackenzie <bug-cc-mode@gnu.org> |
| 2 | 21 | ||
| 3 | * cc-mode.texi: Rename c-hungry-backspace to | 22 | * cc-mode.texi: Rename c-hungry-backspace to |
diff --git a/man/emacs-mime.texi b/man/emacs-mime.texi index 3e9f2b5f283..69c1c21b5aa 100644 --- a/man/emacs-mime.texi +++ b/man/emacs-mime.texi | |||
| @@ -983,7 +983,11 @@ together and wrapped after the column decided by | |||
| 983 | @code{fill-flowed-display-column}. The default is to wrap after | 983 | @code{fill-flowed-display-column}. The default is to wrap after |
| 984 | @code{fill-column}. | 984 | @code{fill-column}. |
| 985 | 985 | ||
| 986 | 986 | @table @code | |
| 987 | @item mm-fill-flowed | ||
| 988 | @vindex mm-fill-flowed | ||
| 989 | If non-@code{nil} a format=flowed article will be displayed flowed. | ||
| 990 | @end table | ||
| 987 | 991 | ||
| 988 | 992 | ||
| 989 | @node Interface Functions | 993 | @node Interface Functions |
diff --git a/man/files.texi b/man/files.texi index a0822054210..23846167b6e 100644 --- a/man/files.texi +++ b/man/files.texi | |||
| @@ -1661,11 +1661,11 @@ instance, when the version control back end is RCS, @code{diff} uses | |||
| 1661 | the options in @code{vc-rcs-diff-switches}. The | 1661 | the options in @code{vc-rcs-diff-switches}. The |
| 1662 | @samp{vc@dots{}diff-switches} variables are @code{nil} by default. | 1662 | @samp{vc@dots{}diff-switches} variables are @code{nil} by default. |
| 1663 | 1663 | ||
| 1664 | Unlike the @kbd{M-x diff} command, @kbd{C-x v =} does not try to | 1664 | The buffer produced by @kbd{C-x v =} supports the commands of |
| 1665 | locate the changes in the old and new versions. This is because | 1665 | Compilation mode (@pxref{Compilation Mode}), such as @kbd{C-x `} and |
| 1666 | normally one or both versions do not exist as files when you compare | 1666 | @kbd{C-c C-c}, in both the ``old'' and ``new'' text, and they always |
| 1667 | them; they exist only in the records of the master file. | 1667 | find the corresponding locations in the current work file. (Older |
| 1668 | @xref{Comparing Files}, for more information about @kbd{M-x diff}. | 1668 | versions are not, in general, present as files on your disk.) |
| 1669 | 1669 | ||
| 1670 | @findex vc-annotate | 1670 | @findex vc-annotate |
| 1671 | @kindex C-x v g | 1671 | @kindex C-x v g |
diff --git a/man/org.texi b/man/org.texi index ecb3480efa1..1f5ab0deeba 100644 --- a/man/org.texi +++ b/man/org.texi | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | @setfilename ../info/org | 4 | @setfilename ../info/org |
| 5 | @settitle Org Mode Manual | 5 | @settitle Org Mode Manual |
| 6 | 6 | ||
| 7 | @set VERSION 4.06 | 7 | @set VERSION 4.07 |
| 8 | @set DATE February 2006 | 8 | @set DATE March 2006 |
| 9 | 9 | ||
| 10 | @dircategory Emacs | 10 | @dircategory Emacs |
| 11 | @direntry | 11 | @direntry |
| @@ -188,9 +188,10 @@ Miscellaneous | |||
| 188 | 188 | ||
| 189 | * Completion:: M-TAB knows what you need | 189 | * Completion:: M-TAB knows what you need |
| 190 | * Customization:: Adapting Org-mode to your taste | 190 | * Customization:: Adapting Org-mode to your taste |
| 191 | * Clean view:: Getting rid of leading stars in the outline | ||
| 192 | * TTY keys:: Using Org-mode on a tty | ||
| 191 | * FAQ:: Frequently asked questions | 193 | * FAQ:: Frequently asked questions |
| 192 | * Interaction:: Other Emacs packages | 194 | * Interaction:: Other Emacs packages |
| 193 | * TTY keys:: Using Org-mode on a tty | ||
| 194 | * Bugs:: Things which do not work perfectly | 195 | * Bugs:: Things which do not work perfectly |
| 195 | * Acknowledgments:: These people provided feedback and more | 196 | * Acknowledgments:: These people provided feedback and more |
| 196 | 197 | ||
| @@ -378,6 +379,9 @@ example | |||
| 378 | more text | 379 | more text |
| 379 | * Another top level headline | 380 | * Another top level headline |
| 380 | @end example | 381 | @end example |
| 382 | @noindent Some people find the many stars too noisy and would prefer an | ||
| 383 | outline that has whitespace followed by a single star as headline | ||
| 384 | starters. @ref{Clean view} describes a setup to realize this. | ||
| 381 | 385 | ||
| 382 | @node Visibility cycling, Motion, Headlines, Document Structure | 386 | @node Visibility cycling, Motion, Headlines, Document Structure |
| 383 | @section Visibility cycling | 387 | @section Visibility cycling |
| @@ -512,7 +516,9 @@ level) | |||
| 512 | @item M-S-@key{down} | 516 | @item M-S-@key{down} |
| 513 | Move subtree down (swap with next subtree of same level) | 517 | Move subtree down (swap with next subtree of same level) |
| 514 | @kindex C-c C-x C-w | 518 | @kindex C-c C-x C-w |
| 519 | @kindex C-c C-x C-k | ||
| 515 | @item C-c C-x C-w | 520 | @item C-c C-x C-w |
| 521 | @itemx C-c C-x C-k | ||
| 516 | Kill subtree, i.e. remove it from buffer but save in kill ring. | 522 | Kill subtree, i.e. remove it from buffer but save in kill ring. |
| 517 | @kindex C-c C-x M-w | 523 | @kindex C-c C-x M-w |
| 518 | @item C-c C-x M-w | 524 | @item C-c C-x M-w |
| @@ -627,7 +633,7 @@ printed in any desired way. | |||
| 627 | If you wish to implement a tag system to cross-correlate information, | 633 | If you wish to implement a tag system to cross-correlate information, |
| 628 | this can be done as well in Org-mode. Every headline can contain a | 634 | this can be done as well in Org-mode. Every headline can contain a |
| 629 | list of tags, at the end of the headline. Tags are normal words | 635 | list of tags, at the end of the headline. Tags are normal words |
| 630 | containing letters and @samp{_}, but no numbers. Tags must be | 636 | containing letters, numbers, @samp{_}, and @samp{@@}. Tags must be |
| 631 | preceded and followed by a single colon; like @samp{:WORK:}. Several | 637 | preceded and followed by a single colon; like @samp{:WORK:}. Several |
| 632 | tags can be specified like @samp{:WORK:URGENT:}. | 638 | tags can be specified like @samp{:WORK:URGENT:}. |
| 633 | 639 | ||
| @@ -709,16 +715,20 @@ sometimes easier to read with hand-formatted lists. Org-mode supports | |||
| 709 | editing such lists, and the HTML exporter (@pxref{Exporting}) does | 715 | editing such lists, and the HTML exporter (@pxref{Exporting}) does |
| 710 | parse and format them. | 716 | parse and format them. |
| 711 | 717 | ||
| 712 | Org-mode knows ordered and unordered lists. Unordered list items | 718 | Org-mode knows ordered and unordered lists. Unordered list items start |
| 713 | start with @samp{-}, @samp{+}, or @samp{*}@footnote{When using | 719 | with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a |
| 714 | @samp{*} as a bullet, lines must be indented or they will be seen as | 720 | bullet, lines must be indented or they will be seen as top-level |
| 715 | top-level headlines.} as bullets. Ordered list items start with | 721 | headlines. Also, when you are hiding leading stars to get a clean |
| 716 | @samp{1.} or @samp{1)}. Items belonging to the same list must have | 722 | outline view, plain list items starting with a star are visually |
| 717 | the same indentation on the first line. In particular, if an ordered | 723 | indistinguishable from true headlines. In short: Even though @samp{*} |
| 718 | list reaches number @samp{10.}, also the 2--digit numbers must be | 724 | is supported, it may be better to not use it for plain list items} as |
| 719 | written left-aligned with the other numbers in the list. Indentation | 725 | bullets. Ordered list items start with @samp{1.} or @samp{1)}. Items |
| 720 | also determines the end of a list item. It ends before the next line | 726 | belonging to the same list must have the same indentation on the first |
| 721 | that is indented like the bullet/number, or less. For example: | 727 | line. In particular, if an ordered list reaches number @samp{10.}, also |
| 728 | the 2--digit numbers must be written left-aligned with the other numbers | ||
| 729 | in the list. Indentation also determines the end of a list item. It | ||
| 730 | ends before the next line that is indented like the bullet/number, or | ||
| 731 | less. For example: | ||
| 722 | 732 | ||
| 723 | @example | 733 | @example |
| 724 | ** Lord of the Rings | 734 | ** Lord of the Rings |
| @@ -1050,10 +1060,12 @@ recalculation can be automated. | |||
| 1050 | @cindex syntax, of formulas | 1060 | @cindex syntax, of formulas |
| 1051 | 1061 | ||
| 1052 | A formula can be any algebraic expression understood by the Emacs | 1062 | A formula can be any algebraic expression understood by the Emacs |
| 1053 | @file{calc} package. Before evaluation by @code{calc-eval} | 1063 | @file{calc} package. Note that @file{calc} has the slightly |
| 1054 | (@pxref{Calling Calc from Your Lisp Programs,calc-eval,Calling calc | 1064 | non-standard conversion that @samp{/} has lower precedence than |
| 1055 | from Your Lisp Programs,calc,GNU Emacs Calc Manual}), variable | 1065 | @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}. Before |
| 1056 | substitution takes place: | 1066 | evaluation by @code{calc-eval} (@pxref{Calling Calc from Your Lisp |
| 1067 | Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs | ||
| 1068 | Calc Manual}), variable substitution takes place: | ||
| 1057 | 1069 | ||
| 1058 | @example | 1070 | @example |
| 1059 | $ @r{refers to the current field} | 1071 | $ @r{refers to the current field} |
| @@ -1521,9 +1533,7 @@ can type or paste them straight into the buffer. | |||
| 1521 | 1533 | ||
| 1522 | @cindex following links | 1534 | @cindex following links |
| 1523 | @kindex C-c C-o | 1535 | @kindex C-c C-o |
| 1524 | @kindex mouse-2 | ||
| 1525 | @item C-c C-o | 1536 | @item C-c C-o |
| 1526 | @itemx mouse-2 | ||
| 1527 | Open link at point. This will launch a web browser for URLs (using | 1537 | Open link at point. This will launch a web browser for URLs (using |
| 1528 | @command{browse-url-at-point}), run vm/gnus/bbdb for the corresponding | 1538 | @command{browse-url-at-point}), run vm/gnus/bbdb for the corresponding |
| 1529 | links, and execute the command in a shell link. When the cursor is on | 1539 | links, and execute the command in a shell link. When the cursor is on |
| @@ -1542,8 +1552,11 @@ that date. | |||
| 1542 | shell link. | 1552 | shell link. |
| 1543 | 1553 | ||
| 1544 | @kindex mouse-2 | 1554 | @kindex mouse-2 |
| 1555 | @kindex mouse-1 | ||
| 1545 | @item mouse-2 | 1556 | @item mouse-2 |
| 1546 | On links, @kbd{mouse-2} will open the link just like @kbd{C-c C-o} would. | 1557 | @itemx mouse-1 |
| 1558 | On links, @kbd{mouse-2} will open the link just like @kbd{C-c C-o} | ||
| 1559 | would. Under Emacs 22, also @kbd{mouse-1} will follow a link. | ||
| 1547 | 1560 | ||
| 1548 | @kindex mouse-3 | 1561 | @kindex mouse-3 |
| 1549 | @item mouse-3 | 1562 | @item mouse-3 |
| @@ -2487,10 +2500,13 @@ Display the original location of the item in another window. | |||
| 2487 | Display original location and recenter that window. | 2500 | Display original location and recenter that window. |
| 2488 | 2501 | ||
| 2489 | @kindex mouse-2 | 2502 | @kindex mouse-2 |
| 2503 | @kindex mouse-1 | ||
| 2490 | @kindex @key{TAB} | 2504 | @kindex @key{TAB} |
| 2491 | @item mouse-2 | 2505 | @item mouse-2 |
| 2506 | @itemx mouse-1 | ||
| 2492 | @itemx @key{TAB} | 2507 | @itemx @key{TAB} |
| 2493 | Go to the original location of the item in another window. | 2508 | Go to the original location of the item in another window. Under Emacs |
| 2509 | 22, also @kbd{mouse-1} will works for this. | ||
| 2494 | 2510 | ||
| 2495 | @kindex @key{RET} | 2511 | @kindex @key{RET} |
| 2496 | @itemx @key{RET} | 2512 | @itemx @key{RET} |
| @@ -2952,9 +2968,10 @@ to make iCal re-read the calendar files each time a new version of | |||
| 2952 | @menu | 2968 | @menu |
| 2953 | * Completion:: M-TAB knows what you need | 2969 | * Completion:: M-TAB knows what you need |
| 2954 | * Customization:: Adapting Org-mode to your taste | 2970 | * Customization:: Adapting Org-mode to your taste |
| 2971 | * Clean view:: Getting rid of leading stars in the outline | ||
| 2972 | * TTY keys:: Using Org-mode on a tty | ||
| 2955 | * FAQ:: Frequently asked questions | 2973 | * FAQ:: Frequently asked questions |
| 2956 | * Interaction:: Other Emacs packages | 2974 | * Interaction:: Other Emacs packages |
| 2957 | * TTY keys:: Using Org-mode on a tty | ||
| 2958 | * Bugs:: Things which do not work perfectly | 2975 | * Bugs:: Things which do not work perfectly |
| 2959 | * Acknowledgments:: These people provided feedback and more | 2976 | * Acknowledgments:: These people provided feedback and more |
| 2960 | @end menu | 2977 | @end menu |
| @@ -3002,7 +3019,8 @@ Elsewhere, complete dictionary words using ispell. | |||
| 3002 | @end itemize | 3019 | @end itemize |
| 3003 | @end table | 3020 | @end table |
| 3004 | 3021 | ||
| 3005 | @node Customization, FAQ, Completion, Miscellaneous | 3022 | |
| 3023 | @node Customization, Clean view, Completion, Miscellaneous | ||
| 3006 | @section Customization | 3024 | @section Customization |
| 3007 | @cindex customization | 3025 | @cindex customization |
| 3008 | @cindex options, for customization | 3026 | @cindex options, for customization |
| @@ -3014,7 +3032,126 @@ describing the variables here. A structured overview of customization | |||
| 3014 | variables is available with @kbd{M-x org-customize}. Or select | 3032 | variables is available with @kbd{M-x org-customize}. Or select |
| 3015 | @code{Browse Org Group} from the @code{Org->Customization} menu. | 3033 | @code{Browse Org Group} from the @code{Org->Customization} menu. |
| 3016 | 3034 | ||
| 3017 | @node FAQ, Interaction, Customization, Miscellaneous | 3035 | @node Clean view, TTY keys, Customization, Miscellaneous |
| 3036 | @section A cleaner outline view | ||
| 3037 | @cindex hiding leading stars | ||
| 3038 | @cindex clean outline view | ||
| 3039 | |||
| 3040 | Some people find it noisy and distracting that the Org-mode headlines | ||
| 3041 | are starting with a potentially large number of stars. For example in | ||
| 3042 | the example tree from @ref{Headlines}: | ||
| 3043 | |||
| 3044 | @example | ||
| 3045 | * Top level headline | ||
| 3046 | ** Second level | ||
| 3047 | *** 3rd level | ||
| 3048 | some text | ||
| 3049 | *** 3rd level | ||
| 3050 | more text | ||
| 3051 | * Another top level headline | ||
| 3052 | @end example | ||
| 3053 | |||
| 3054 | @noindent | ||
| 3055 | Unfortunately this is deeply ingrained into the code of Org-mode and | ||
| 3056 | cannot be easily changed. You can, however, modify the display in such | ||
| 3057 | a way that all leading stars become invisible and the outline more easy | ||
| 3058 | to read. To do this, customize the variable | ||
| 3059 | @code{org-hide-leading-stars} like this: | ||
| 3060 | |||
| 3061 | @lisp | ||
| 3062 | (setq org-hide-leading-stars t) | ||
| 3063 | @end lisp | ||
| 3064 | |||
| 3065 | @noindent | ||
| 3066 | and restart emacs (this is necessary to make this change effective). | ||
| 3067 | The tree then becomes | ||
| 3068 | |||
| 3069 | @example | ||
| 3070 | * Top level headline | ||
| 3071 | * Second level | ||
| 3072 | * 3rd level | ||
| 3073 | some text | ||
| 3074 | * 3rd level | ||
| 3075 | more text | ||
| 3076 | * Another top level headline | ||
| 3077 | @end example | ||
| 3078 | |||
| 3079 | @noindent | ||
| 3080 | Note that the leading stars are not truly replaced by whitespace, they | ||
| 3081 | are only fontified with the face @code{org-hide} that uses the | ||
| 3082 | background color as font color. If are are not using either white or | ||
| 3083 | black background, you may have to customize this face to get the wanted | ||
| 3084 | effect. Another possibility is to set this font such that the extra | ||
| 3085 | stars are @i{almost} invisible, for example using the color | ||
| 3086 | @code{grey90} on a white background. | ||
| 3087 | |||
| 3088 | Things become cleaner still if you skip all the even levels and use only | ||
| 3089 | odd levels 1, 3, 5..., effectively adding two stars to go from one | ||
| 3090 | outline level to the next: | ||
| 3091 | |||
| 3092 | @example | ||
| 3093 | * Top level headline | ||
| 3094 | * Second level | ||
| 3095 | * 3rd level | ||
| 3096 | some text | ||
| 3097 | * 3rd level | ||
| 3098 | more text | ||
| 3099 | * Another top level headline | ||
| 3100 | @end example | ||
| 3101 | |||
| 3102 | @noindent | ||
| 3103 | In order to make the structure editing and export commands handle this | ||
| 3104 | convention correctly, use (again a restart of emacs will be needed) | ||
| 3105 | |||
| 3106 | @lisp | ||
| 3107 | (setq org-odd-levels-only t) | ||
| 3108 | @end lisp | ||
| 3109 | |||
| 3110 | @noindent | ||
| 3111 | You can convert an Org-mode file from single-star-per-level to | ||
| 3112 | double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels | ||
| 3113 | RET} in that file. It is not possible to use this setting on a | ||
| 3114 | file-local basis, so you need to decide which format to use. | ||
| 3115 | |||
| 3116 | @node TTY keys, FAQ, Clean view, Miscellaneous | ||
| 3117 | @section Using org-mode on a tty | ||
| 3118 | @cindex tty keybindings | ||
| 3119 | |||
| 3120 | Org-mode uses a number of keys that are not accessible on a tty. This | ||
| 3121 | applies to most special keys like cursor keys, @key{TAB} and | ||
| 3122 | @key{RET}, when these are combined with modifier keys like @key{Meta} | ||
| 3123 | and/or @key{Shift}. Org-mode uses these bindings because it needs to | ||
| 3124 | provide keys for a large number of commands, and because these keys | ||
| 3125 | appeared particularly easy to remember. In order to still be able to | ||
| 3126 | access the core functionality of Org-mode on a tty, alternative | ||
| 3127 | bindings are provided. Here is a complete list of these bindings, | ||
| 3128 | which are obviously more cumbersome to use. Note that sometimes a | ||
| 3129 | work-around can be better. For example changing a time stamp is | ||
| 3130 | really only fun with @kbd{S-@key{cursor}} keys. On a tty you would | ||
| 3131 | rather use @kbd{C-c .} to re-insert the timestamp. | ||
| 3132 | |||
| 3133 | @page | ||
| 3134 | @multitable @columnfractions 0.15 0.2 0.2 | ||
| 3135 | @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2} | ||
| 3136 | @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab | ||
| 3137 | @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}} | ||
| 3138 | @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab | ||
| 3139 | @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}} | ||
| 3140 | @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab | ||
| 3141 | @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}} | ||
| 3142 | @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab | ||
| 3143 | @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}} | ||
| 3144 | @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab | ||
| 3145 | @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab | ||
| 3146 | @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}} | ||
| 3147 | @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab | ||
| 3148 | @item @kbd{S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab | ||
| 3149 | @item @kbd{S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab | ||
| 3150 | @item @kbd{S-@key{up}} @tab @kbd{C-c C-x @key{up}} @tab | ||
| 3151 | @item @kbd{S-@key{down}} @tab @kbd{C-c C-x @key{down}} @tab | ||
| 3152 | @end multitable | ||
| 3153 | |||
| 3154 | @node FAQ, Interaction, TTY keys, Miscellaneous | ||
| 3018 | @section Frequently asked questions | 3155 | @section Frequently asked questions |
| 3019 | @cindex FAQ | 3156 | @cindex FAQ |
| 3020 | 3157 | ||
| @@ -3026,6 +3163,11 @@ turn it on for all @file{README} files?} | |||
| 3026 | (add-to-list 'auto-mode-alist '("README$" . org-mode)) | 3163 | (add-to-list 'auto-mode-alist '("README$" . org-mode)) |
| 3027 | @end example | 3164 | @end example |
| 3028 | 3165 | ||
| 3166 | @item @b{All these stars are driving me mad, I just find the Emacs | ||
| 3167 | outlines unreadable. Can't you just put white space and a single star as a | ||
| 3168 | starter for headlines?}@* | ||
| 3169 | See @ref{Clean view}. | ||
| 3170 | |||
| 3029 | @item @b{I would like to have two windows on the same Org-mode | 3171 | @item @b{I would like to have two windows on the same Org-mode |
| 3030 | file, but with different outline visibility. Is that possible?}@* | 3172 | file, but with different outline visibility. Is that possible?}@* |
| 3031 | @cindex @code{make-indirect-buffer} | 3173 | @cindex @code{make-indirect-buffer} |
| @@ -3138,15 +3280,23 @@ also the documentation of the @command{org-diary} function. | |||
| 3138 | @end enumerate | 3280 | @end enumerate |
| 3139 | 3281 | ||
| 3140 | 3282 | ||
| 3141 | @node Interaction, TTY keys, FAQ, Miscellaneous | 3283 | @node Interaction, Bugs, FAQ, Miscellaneous |
| 3142 | @section Interaction with other packages | 3284 | @section Interaction with other packages |
| 3143 | @cindex packages, interaction with other | 3285 | @cindex packages, interaction with other |
| 3144 | Org-mode can cooperate with the following packages: | 3286 | Org-mode can cooperate with the following packages: |
| 3145 | 3287 | ||
| 3146 | @table @asis | 3288 | @table @asis |
| 3289 | @cindex @file{org-mouse.el} | ||
| 3290 | @item @file{org-mouse.el} by Piotr Zielinski | ||
| 3291 | This package implements extended mouse functionality for Org-mode. It | ||
| 3292 | allows to cycle visibility and to edit the document structure with the | ||
| 3293 | mouse. It also provides a context-sensitive menu that changes depending | ||
| 3294 | on the context of a mouse-click. Use a search engine to find this | ||
| 3295 | package on the web. | ||
| 3147 | @cindex @file{table.el} | 3296 | @cindex @file{table.el} |
| 3148 | @item @file{table.el} by Takaaki Ota | 3297 | @item @file{table.el} by Takaaki Ota |
| 3149 | Org mode cooperates with table.el, see @ref{table.el}. | 3298 | Org mode cooperates with table.el, see @ref{table.el}. @file{table.el} |
| 3299 | is part of Emacs 22. | ||
| 3150 | @cindex @file{calc.el} | 3300 | @cindex @file{calc.el} |
| 3151 | @item @file{calc.el} by Dave Gillespie | 3301 | @item @file{calc.el} by Dave Gillespie |
| 3152 | Org-mode uses the calc package for implementing spreadsheet | 3302 | Org-mode uses the calc package for implementing spreadsheet |
| @@ -3189,6 +3339,7 @@ to have other replacement keys, look at the variable | |||
| 3189 | @code{org-disputed-keys}. | 3339 | @code{org-disputed-keys}. |
| 3190 | @item @file{remember.el} by John Wiegley | 3340 | @item @file{remember.el} by John Wiegley |
| 3191 | Org mode cooperates with remember, see @ref{Remember}. | 3341 | Org mode cooperates with remember, see @ref{Remember}. |
| 3342 | @file{remember.el} is not part of Emacs, find it on the web. | ||
| 3192 | @cindex @file{planner.el} | 3343 | @cindex @file{planner.el} |
| 3193 | @item @file{planner.el} by John Wiegley | 3344 | @item @file{planner.el} by John Wiegley |
| 3194 | Planner is another tool to plan work and keep track of tasks. Planner | 3345 | Planner is another tool to plan work and keep track of tasks. Planner |
| @@ -3197,48 +3348,11 @@ on Emacs-Wiki. If Planner is your primary tool, it can be useful to | |||
| 3197 | display the agenda entries resulting from org files in day-pages of | 3348 | display the agenda entries resulting from org files in day-pages of |
| 3198 | the planner. This can be done through the diary of the calendar: | 3349 | the planner. This can be done through the diary of the calendar: |
| 3199 | Integrate org files into the diary as described above, and then turn | 3350 | Integrate org files into the diary as described above, and then turn |
| 3200 | on the diary support of planner. | 3351 | on the diary support of planner. Planner is not part of Emacs, find it |
| 3352 | on the web. | ||
| 3201 | @end table | 3353 | @end table |
| 3202 | 3354 | ||
| 3203 | @node TTY keys, Bugs, Interaction, Miscellaneous | 3355 | @node Bugs, Acknowledgments, Interaction, Miscellaneous |
| 3204 | @section Using org-mode on a tty | ||
| 3205 | @cindex tty keybindings | ||
| 3206 | |||
| 3207 | Org-mode uses a number of keys that are not accessible on a tty. This | ||
| 3208 | applies to most special keys like cursor keys, @key{TAB} and | ||
| 3209 | @key{RET}, when these are combined with modifier keys like @key{Meta} | ||
| 3210 | and/or @key{Shift}. Org-mode uses these bindings because it needs to | ||
| 3211 | provide keys for a large number of commands, and because these keys | ||
| 3212 | appeared particularly easy to remember. In order to still be able to | ||
| 3213 | access the core functionality of Org-mode on a tty, alternative | ||
| 3214 | bindings are provided. Here is a complete list of these bindings, | ||
| 3215 | which are obviously more cumbersome to use. Note that sometimes a | ||
| 3216 | work-around can be better. For example changing a time stamp is | ||
| 3217 | really only fun with @kbd{S-@key{cursor}} keys. On a tty you would | ||
| 3218 | rather use @kbd{C-c .} to re-insert the timestamp. | ||
| 3219 | |||
| 3220 | @page | ||
| 3221 | @multitable @columnfractions 0.15 0.2 0.2 | ||
| 3222 | @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2} | ||
| 3223 | @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab | ||
| 3224 | @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}} | ||
| 3225 | @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab | ||
| 3226 | @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}} | ||
| 3227 | @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab | ||
| 3228 | @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}} | ||
| 3229 | @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab | ||
| 3230 | @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}} | ||
| 3231 | @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab | ||
| 3232 | @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab | ||
| 3233 | @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}} | ||
| 3234 | @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab | ||
| 3235 | @item @kbd{S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab | ||
| 3236 | @item @kbd{S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab | ||
| 3237 | @item @kbd{S-@key{up}} @tab @kbd{C-c C-x @key{up}} @tab | ||
| 3238 | @item @kbd{S-@key{down}} @tab @kbd{C-c C-x @key{down}} @tab | ||
| 3239 | @end multitable | ||
| 3240 | |||
| 3241 | @node Bugs, Acknowledgments, TTY keys, Miscellaneous | ||
| 3242 | @section Bugs | 3356 | @section Bugs |
| 3243 | @cindex bugs | 3357 | @cindex bugs |
| 3244 | 3358 | ||
| @@ -3246,13 +3360,6 @@ Here is a list of things which should work differently, but which I | |||
| 3246 | have found too hard to fix. | 3360 | have found too hard to fix. |
| 3247 | 3361 | ||
| 3248 | @itemize @bullet | 3362 | @itemize @bullet |
| 3249 | @c @item | ||
| 3250 | @c If you call @code{fill-paragraph} (bound to @kbd{M-q}) in a table, the | ||
| 3251 | @c filling is correctly disabled. However, if some text directly | ||
| 3252 | @c (without an empty line in between) precedes or follows a table, calling | ||
| 3253 | @c @code{fill-paragraph} in that text will also fill the table like | ||
| 3254 | @c normal text. Also, @code{fill-region} does bypass the | ||
| 3255 | @c @code{fill-paragraph} code and will fill tables like normal text. | ||
| 3256 | @item | 3363 | @item |
| 3257 | Text in an entry protected with the @samp{QUOTE} keyword should not | 3364 | Text in an entry protected with the @samp{QUOTE} keyword should not |
| 3258 | autowrap. | 3365 | autowrap. |
| @@ -3261,6 +3368,10 @@ When the application called by @kbd{C-c C-o} to open a file link fails | |||
| 3261 | (for example because the application does not exits or refuses to open | 3368 | (for example because the application does not exits or refuses to open |
| 3262 | the file), it does so silently. No error message is displayed. | 3369 | the file), it does so silently. No error message is displayed. |
| 3263 | @item | 3370 | @item |
| 3371 | Plain list items should be able to hold a TODO item. Unfortunately this | ||
| 3372 | has so many technical problems that I will only consider this change for | ||
| 3373 | the next major release (5.0). | ||
| 3374 | @item | ||
| 3264 | The remote-editing commands in the agenda buffer cannot be undone with | 3375 | The remote-editing commands in the agenda buffer cannot be undone with |
| 3265 | @code{undo} called from within the agenda buffer. But you can go to | 3376 | @code{undo} called from within the agenda buffer. But you can go to |
| 3266 | the corresponding buffer (using @key{TAB} or @key{RET} and execute | 3377 | the corresponding buffer (using @key{TAB} or @key{RET} and execute |
| @@ -3276,11 +3387,9 @@ the text properties are lost when the fancy-diary-display is used. | |||
| 3276 | However, from Org-mode's timeline and agenda buffers (created with | 3387 | However, from Org-mode's timeline and agenda buffers (created with |
| 3277 | @kbd{C-c C-r} and @kbd{C-c a}), things do work correctly. | 3388 | @kbd{C-c C-r} and @kbd{C-c a}), things do work correctly. |
| 3278 | @item | 3389 | @item |
| 3279 | Linux should also have a default viewer application, using mailcap. | 3390 | You can only make a single word boldface or italic. To emphasize |
| 3280 | Maybe we can use GNUS or VM mime code? Or dired's guessing commands? | 3391 | several words in a row, each much have the emphasize markers, like in |
| 3281 | Any hints (or even patches) are appreciated. | 3392 | @samp{*three* *bold* *words*}. |
| 3282 | @item | ||
| 3283 | When you write @samp{x = a /b/ c}, b will be exported in italics. | ||
| 3284 | @item | 3393 | @item |
| 3285 | The exporters work well, but could be made more efficient. | 3394 | The exporters work well, but could be made more efficient. |
| 3286 | @end itemize | 3395 | @end itemize |
| @@ -3353,6 +3462,9 @@ to GNUS. | |||
| 3353 | @item | 3462 | @item |
| 3354 | Roland Winkler pointed out that additional keybindings are needed to | 3463 | Roland Winkler pointed out that additional keybindings are needed to |
| 3355 | use Org-mode on a tty. | 3464 | use Org-mode on a tty. |
| 3465 | @item | ||
| 3466 | Piotr Zielinski wrote @file{org-mouse.el} and pointed out to me that | ||
| 3467 | Emacs 22 can be made to follow links using mouse-1 clicks. | ||
| 3356 | @c @item | 3468 | @c @item |
| 3357 | @c Nic Ferrier and Christian Egli implemented XML export. | 3469 | @c Nic Ferrier and Christian Egli implemented XML export. |
| 3358 | @end itemize | 3470 | @end itemize |
diff --git a/src/ChangeLog b/src/ChangeLog index 4176e2f29c8..6edf4d43587 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,8 +1,87 @@ | |||
| 1 | 2006-03-02 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * frame.h (struct frame): New member n_tool_bar_rows. | ||
| 4 | |||
| 5 | * xdisp.c: Minimize the unpleasent visual impact of the requirement | ||
| 6 | that non-toolkit tool-bars must occupy an integral number of screen | ||
| 7 | lines, by distributing the rows evenly over the tool-bar screen area. | ||
| 8 | (Vtool_bar_border): New variable. | ||
| 9 | (syms_of_xdisp): DEFVAR_LISP it. | ||
| 10 | (display_tool_bar_line): Add HEIGHT arg for desired row height. Make | ||
| 11 | tool-bar row the desired height. Use default face for border below | ||
| 12 | tool-bar. | ||
| 13 | (tool_bar_lines_needed): Add N_ROWS arg. Use it to return number of | ||
| 14 | actual tool-bar rows. | ||
| 15 | (redisplay_tool_bar): Calculate f->n_tool_bar_rows initially. | ||
| 16 | Adjust the height of the tool-bar rows to fill tool-bar screen area. | ||
| 17 | (redisplay_tool_bar): Calculate f->n_tool_bar_rows when tool-bar area | ||
| 18 | is resized. | ||
| 19 | |||
| 20 | 2006-03-01 Luc Teirlinck <teirllm@auburn.edu> | ||
| 21 | |||
| 22 | * search.c (Fregexp_quote): Do not precede a literal `]' with two | ||
| 23 | backslashes to try to make clear that it has a literal meaning; it | ||
| 24 | does not do that. (It could close a character alternative | ||
| 25 | containing a backslash.) | ||
| 26 | |||
| 27 | 2006-02-28 Chong Yidong <cyd@stupidchicken.com> | ||
| 28 | |||
| 29 | * xselect.c (x_catch_errors_unwind): New function. | ||
| 30 | (x_reply_selection_request): Put x_uncatch_errors in an unwind. | ||
| 31 | (Fx_get_atom_name): Call x_uncatch_errors earlier. | ||
| 32 | |||
| 33 | * window.c (Qscroll_up, Qscroll_down): New syms. | ||
| 34 | (window_scroll_pixel_based): Make preserve_y static to avoid | ||
| 35 | getting point stuck when scrolling 1 line. | ||
| 36 | |||
| 37 | 2006-02-26 Chong Yidong <cyd@stupidchicken.com> | ||
| 38 | |||
| 39 | * xterm.h, xterm.c (x_uncatch_errors): Delete unneccessary | ||
| 40 | argument. | ||
| 41 | |||
| 42 | * xterm.c: (x_load_font, x_term_init, XTmouse_position) | ||
| 43 | (handle_one_xevent, x_connection_closed, x_list_fonts): No arg for | ||
| 44 | x_uncatch_errors. | ||
| 45 | |||
| 46 | * xselect.c (x_own_selection, x_decline_selection_request) | ||
| 47 | (x_reply_selection_request, x_get_foreign_selection) | ||
| 48 | (Fx_get_atom_name, Fx_send_client_event): Likewise. | ||
| 49 | |||
| 50 | * xfns.c (x_real_positions, x_set_mouse_color, Fx_focus_frame): | ||
| 51 | Likewise. | ||
| 52 | |||
| 53 | 2006-02-26 Luc Teirlinck <teirllm@auburn.edu> | ||
| 54 | |||
| 55 | * lread.c: Declare Vload_file_rep_suffixes instead of | ||
| 56 | deleted variable default_suffixes. | ||
| 57 | (Fget_load_suffixes): New function. | ||
| 58 | (Fload): Use Fget_load_suffixes and Vload_file_rep_suffixes. | ||
| 59 | No longer use deleted variable default_suffixes. Update docstring. | ||
| 60 | (syms_of_lread): defsubr Sget_load_suffixes. | ||
| 61 | Expand `load-suffixes' docstring. | ||
| 62 | Delete default_suffixes and DEFVAR_LISP the new variable | ||
| 63 | `load-file-rep-suffixes'. | ||
| 64 | |||
| 65 | * w32.c (check_windows_init_file): Use Fget_load_suffixes instead | ||
| 66 | of Vload_suffixes. | ||
| 67 | |||
| 68 | * lisp.h: EXFUN Fget_load_suffixes. | ||
| 69 | Extern Vload_file_rep_suffixes. | ||
| 70 | |||
| 71 | * eval.c (specpdl_ptr): Remove volatile qualifier for consistency | ||
| 72 | with lisp.h. | ||
| 73 | |||
| 74 | 2006-02-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 75 | |||
| 76 | * lisp.h (struct specbinding, specpdl_ptr): Remove the volatile | ||
| 77 | qualifier which was trying to avoid the bug that was fixed by | ||
| 78 | yesterday's changes to xterm.c. | ||
| 79 | |||
| 1 | 2006-02-25 Chong Yidong <cyd@stupidchicken.com> | 80 | 2006-02-25 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 81 | ||
| 3 | * xterm.h (x_catch_errors) Return value changed to void. | 82 | * xterm.h (x_catch_errors) Return value changed to void. |
| 4 | (x_uncatch_errors): Unused count argument deleted. | 83 | (x_uncatch_errors): Delete unused count argument. |
| 5 | 84 | ||
| 6 | * xterm.c (x_catch_errors): Don't use record_unwind_protect, since | 85 | * xterm.c (x_catch_errors): Don't use record_unwind_protect, since |
| 7 | it can be called in a signal handler. | 86 | it can be called in a signal handler. |
| 8 | (x_catch_errors_unwind): Function deleted. | 87 | (x_catch_errors_unwind): Function deleted. |
diff --git a/src/eval.c b/src/eval.c index 06d53c907b4..a84948981f4 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -117,7 +117,7 @@ struct specbinding *specpdl; | |||
| 117 | 117 | ||
| 118 | /* Pointer to first unused element in specpdl. */ | 118 | /* Pointer to first unused element in specpdl. */ |
| 119 | 119 | ||
| 120 | volatile struct specbinding *specpdl_ptr; | 120 | struct specbinding *specpdl_ptr; |
| 121 | 121 | ||
| 122 | /* Maximum size allowed for specpdl allocation */ | 122 | /* Maximum size allowed for specpdl allocation */ |
| 123 | 123 | ||
diff --git a/src/frame.h b/src/frame.h index 51530ee2dbf..a77e49ace73 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -222,6 +222,7 @@ struct frame | |||
| 222 | /* Margin at the top of the frame. Used to display the tool-bar. */ | 222 | /* Margin at the top of the frame. Used to display the tool-bar. */ |
| 223 | int tool_bar_lines; | 223 | int tool_bar_lines; |
| 224 | 224 | ||
| 225 | int n_tool_bar_rows; | ||
| 225 | int n_tool_bar_items; | 226 | int n_tool_bar_items; |
| 226 | 227 | ||
| 227 | /* A buffer for decode_mode_line. */ | 228 | /* A buffer for decode_mode_line. */ |
diff --git a/src/lisp.h b/src/lisp.h index 9cec643a078..d13400b8050 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1754,13 +1754,13 @@ typedef Lisp_Object (*specbinding_func) P_ ((Lisp_Object)); | |||
| 1754 | 1754 | ||
| 1755 | struct specbinding | 1755 | struct specbinding |
| 1756 | { | 1756 | { |
| 1757 | volatile Lisp_Object symbol, old_value; | 1757 | Lisp_Object symbol, old_value; |
| 1758 | volatile specbinding_func func; | 1758 | specbinding_func func; |
| 1759 | Lisp_Object unused; /* Dividing by 16 is faster than by 12 */ | 1759 | Lisp_Object unused; /* Dividing by 16 is faster than by 12 */ |
| 1760 | }; | 1760 | }; |
| 1761 | 1761 | ||
| 1762 | extern struct specbinding *specpdl; | 1762 | extern struct specbinding *specpdl; |
| 1763 | extern volatile struct specbinding *specpdl_ptr; | 1763 | extern struct specbinding *specpdl_ptr; |
| 1764 | extern int specpdl_size; | 1764 | extern int specpdl_size; |
| 1765 | 1765 | ||
| 1766 | extern EMACS_INT max_specpdl_size; | 1766 | extern EMACS_INT max_specpdl_size; |
| @@ -2638,6 +2638,7 @@ EXFUN (Fread_from_string, 3); | |||
| 2638 | EXFUN (Fintern, 2); | 2638 | EXFUN (Fintern, 2); |
| 2639 | EXFUN (Fintern_soft, 2); | 2639 | EXFUN (Fintern_soft, 2); |
| 2640 | EXFUN (Fload, 5); | 2640 | EXFUN (Fload, 5); |
| 2641 | EXFUN (Fget_load_suffixes, 0); | ||
| 2641 | EXFUN (Fget_file_char, 0); | 2642 | EXFUN (Fget_file_char, 0); |
| 2642 | EXFUN (Fread_char, 2); | 2643 | EXFUN (Fread_char, 2); |
| 2643 | EXFUN (Fread_event, 2); | 2644 | EXFUN (Fread_event, 2); |
| @@ -2649,7 +2650,7 @@ extern Lisp_Object oblookup P_ ((Lisp_Object, const char *, int, int)); | |||
| 2649 | #define LOADHIST_ATTACH(x) \ | 2650 | #define LOADHIST_ATTACH(x) \ |
| 2650 | if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list) | 2651 | if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list) |
| 2651 | extern Lisp_Object Vcurrent_load_list; | 2652 | extern Lisp_Object Vcurrent_load_list; |
| 2652 | extern Lisp_Object Vload_history, Vload_suffixes; | 2653 | extern Lisp_Object Vload_history, Vload_suffixes, Vload_file_rep_suffixes; |
| 2653 | extern int openp P_ ((Lisp_Object, Lisp_Object, Lisp_Object, | 2654 | extern int openp P_ ((Lisp_Object, Lisp_Object, Lisp_Object, |
| 2654 | Lisp_Object *, Lisp_Object)); | 2655 | Lisp_Object *, Lisp_Object)); |
| 2655 | extern int isfloat_string P_ ((char *)); | 2656 | extern int isfloat_string P_ ((char *)); |
diff --git a/src/lread.c b/src/lread.c index ef45f4663ea..e2f9d81d059 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -106,7 +106,7 @@ int load_in_progress; | |||
| 106 | Lisp_Object Vsource_directory; | 106 | Lisp_Object Vsource_directory; |
| 107 | 107 | ||
| 108 | /* Search path and suffixes for files to be loaded. */ | 108 | /* Search path and suffixes for files to be loaded. */ |
| 109 | Lisp_Object Vload_path, Vload_suffixes, default_suffixes; | 109 | Lisp_Object Vload_path, Vload_suffixes, Vload_file_rep_suffixes; |
| 110 | 110 | ||
| 111 | /* File name of user's init file. */ | 111 | /* File name of user's init file. */ |
| 112 | Lisp_Object Vuser_init_file; | 112 | Lisp_Object Vuser_init_file; |
| @@ -832,28 +832,64 @@ load_error_handler (data) | |||
| 832 | return Qnil; | 832 | return Qnil; |
| 833 | } | 833 | } |
| 834 | 834 | ||
| 835 | DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, | ||
| 836 | doc: /* Return the suffixes that `load' should try if a suffix is \ | ||
| 837 | required. | ||
| 838 | This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) | ||
| 839 | () | ||
| 840 | { | ||
| 841 | Lisp_Object lst = Qnil, suffixes = Vload_suffixes, suffix, ext; | ||
| 842 | while (CONSP (suffixes)) | ||
| 843 | { | ||
| 844 | Lisp_Object exts = Vload_file_rep_suffixes; | ||
| 845 | suffix = XCAR (suffixes); | ||
| 846 | suffixes = XCDR (suffixes); | ||
| 847 | while (CONSP (exts)) | ||
| 848 | { | ||
| 849 | ext = XCAR (exts); | ||
| 850 | exts = XCDR (exts); | ||
| 851 | lst = Fcons (concat2 (suffix, ext), lst); | ||
| 852 | } | ||
| 853 | } | ||
| 854 | return Fnreverse (lst); | ||
| 855 | } | ||
| 856 | |||
| 835 | DEFUN ("load", Fload, Sload, 1, 5, 0, | 857 | DEFUN ("load", Fload, Sload, 1, 5, 0, |
| 836 | doc: /* Execute a file of Lisp code named FILE. | 858 | doc: /* Execute a file of Lisp code named FILE. |
| 837 | First try FILE with `.elc' appended, then try with `.el', | 859 | First try FILE with `.elc' appended, then try with `.el', |
| 838 | then try FILE unmodified (the exact suffixes are determined by | 860 | then try FILE unmodified (the exact suffixes in the exact order are |
| 839 | `load-suffixes'). Environment variable references in FILE | 861 | determined by `load-suffixes'). Environment variable references in |
| 840 | are replaced with their values by calling `substitute-in-file-name'. | 862 | FILE are replaced with their values by calling `substitute-in-file-name'. |
| 841 | This function searches the directories in `load-path'. | 863 | This function searches the directories in `load-path'. |
| 864 | |||
| 842 | If optional second arg NOERROR is non-nil, | 865 | If optional second arg NOERROR is non-nil, |
| 843 | report no error if FILE doesn't exist. | 866 | report no error if FILE doesn't exist. |
| 844 | Print messages at start and end of loading unless | 867 | Print messages at start and end of loading unless |
| 845 | optional third arg NOMESSAGE is non-nil. | 868 | optional third arg NOMESSAGE is non-nil. |
| 846 | If optional fourth arg NOSUFFIX is non-nil, don't try adding | 869 | If optional fourth arg NOSUFFIX is non-nil, don't try adding |
| 847 | suffixes `.elc' or `.el' to the specified name FILE. | 870 | suffixes `.elc' or `.el' to the specified name FILE. |
| 848 | If optional fifth arg MUST-SUFFIX is non-nil, insist on | 871 | If optional fifth arg MUST-SUFFIX is non-nil, insist on |
| 849 | the suffix `.elc' or `.el'; don't accept just FILE unless | 872 | the suffix `.elc' or `.el'; don't accept just FILE unless |
| 850 | it ends in one of those suffixes or includes a directory name. | 873 | it ends in one of those suffixes or includes a directory name. |
| 874 | |||
| 875 | If this function fails to find a file, it may look for different | ||
| 876 | representations of that file before trying another file. | ||
| 877 | It does so by adding the non-empty suffixes in `load-file-rep-suffixes' | ||
| 878 | to the file name. Emacs uses this feature mainly to find compressed | ||
| 879 | versions of files when Auto Compression mode is enabled. | ||
| 880 | |||
| 881 | The exact suffixes that this function tries out, in the exact order, | ||
| 882 | are given by the value of the variable `load-file-rep-suffixes' if | ||
| 883 | NOSUFFIX is non-nil and by the return value of the function | ||
| 884 | `get-load-suffixes' if MUST-SUFFIX is non-nil. If both NOSUFFIX and | ||
| 885 | MUST-SUFFIX are nil, this function first tries out the latter suffixes | ||
| 886 | and then the former. | ||
| 851 | 887 | ||
| 852 | Loading a file records its definitions, and its `provide' and | 888 | Loading a file records its definitions, and its `provide' and |
| 853 | `require' calls, in an element of `load-history' whose | 889 | `require' calls, in an element of `load-history' whose |
| 854 | car is the file name loaded. See `load-history'. | 890 | car is the file name loaded. See `load-history'. |
| 855 | 891 | ||
| 856 | Return t if file exists. */) | 892 | Return t if the file exists and loads successfully. */) |
| 857 | (file, noerror, nomessage, nosuffix, must_suffix) | 893 | (file, noerror, nomessage, nosuffix, must_suffix) |
| 858 | Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; | 894 | Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; |
| 859 | { | 895 | { |
| @@ -930,9 +966,9 @@ Return t if file exists. */) | |||
| 930 | 966 | ||
| 931 | fd = openp (Vload_path, file, | 967 | fd = openp (Vload_path, file, |
| 932 | (!NILP (nosuffix) ? Qnil | 968 | (!NILP (nosuffix) ? Qnil |
| 933 | : !NILP (must_suffix) ? Vload_suffixes | 969 | : !NILP (must_suffix) ? Fget_load_suffixes () |
| 934 | : Fappend (2, (tmp[0] = Vload_suffixes, | 970 | : Fappend (2, (tmp[0] = Fget_load_suffixes (), |
| 935 | tmp[1] = default_suffixes, | 971 | tmp[1] = Vload_file_rep_suffixes, |
| 936 | tmp))), | 972 | tmp))), |
| 937 | &found, Qnil); | 973 | &found, Qnil); |
| 938 | UNGCPRO; | 974 | UNGCPRO; |
| @@ -1303,7 +1339,7 @@ openp (path, str, suffixes, storeptr, predicate) | |||
| 1303 | fn = (char *) alloca (fn_size = 100 + want_size); | 1339 | fn = (char *) alloca (fn_size = 100 + want_size); |
| 1304 | 1340 | ||
| 1305 | /* Loop over suffixes. */ | 1341 | /* Loop over suffixes. */ |
| 1306 | for (tail = NILP (suffixes) ? default_suffixes : suffixes; | 1342 | for (tail = NILP (suffixes) ? Fcons (build_string (""), Qnil) : suffixes; |
| 1307 | CONSP (tail); tail = XCDR (tail)) | 1343 | CONSP (tail); tail = XCDR (tail)) |
| 1308 | { | 1344 | { |
| 1309 | int lsuffix = SBYTES (XCAR (tail)); | 1345 | int lsuffix = SBYTES (XCAR (tail)); |
| @@ -3979,6 +4015,7 @@ syms_of_lread () | |||
| 3979 | defsubr (&Sintern); | 4015 | defsubr (&Sintern); |
| 3980 | defsubr (&Sintern_soft); | 4016 | defsubr (&Sintern_soft); |
| 3981 | defsubr (&Sunintern); | 4017 | defsubr (&Sunintern); |
| 4018 | defsubr (&Sget_load_suffixes); | ||
| 3982 | defsubr (&Sload); | 4019 | defsubr (&Sload); |
| 3983 | defsubr (&Seval_buffer); | 4020 | defsubr (&Seval_buffer); |
| 3984 | defsubr (&Seval_region); | 4021 | defsubr (&Seval_region); |
| @@ -4040,13 +4077,27 @@ Initialized based on EMACSLOADPATH environment variable, if any, | |||
| 4040 | otherwise to default specified by file `epaths.h' when Emacs was built. */); | 4077 | otherwise to default specified by file `epaths.h' when Emacs was built. */); |
| 4041 | 4078 | ||
| 4042 | DEFVAR_LISP ("load-suffixes", &Vload_suffixes, | 4079 | DEFVAR_LISP ("load-suffixes", &Vload_suffixes, |
| 4043 | doc: /* *List of suffixes to try for files to load. | 4080 | doc: /* List of suffixes for (compiled or source) Emacs Lisp files. |
| 4044 | This list should not include the empty string. */); | 4081 | This list should not include the empty string. |
| 4082 | `load' and related functions try to append these suffixes, in order, | ||
| 4083 | to the specified file name if a Lisp suffix is allowed or required. */); | ||
| 4045 | Vload_suffixes = Fcons (build_string (".elc"), | 4084 | Vload_suffixes = Fcons (build_string (".elc"), |
| 4046 | Fcons (build_string (".el"), Qnil)); | 4085 | Fcons (build_string (".el"), Qnil)); |
| 4086 | DEFVAR_LISP ("load-file-rep-suffixes", &Vload_file_rep_suffixes, | ||
| 4087 | doc: /* List of suffixes that indicate representations of \ | ||
| 4088 | the same file. | ||
| 4089 | This list should normally start with the empty string. | ||
| 4090 | |||
| 4091 | Enabling Auto Compression mode appends the suffixes in | ||
| 4092 | `jka-compr-load-suffixes' to this list and disabling Auto Compression | ||
| 4093 | mode removes them again. `load' and related functions use this list to | ||
| 4094 | determine whether they should look for compressed versions of a file | ||
| 4095 | and, if so, which suffixes they should try to append to the file name | ||
| 4096 | in order to do so. However, if you want to customize which suffixes | ||
| 4097 | the loading functions recognize as compression suffixes, you should | ||
| 4098 | customize `jka-compr-load-suffixes' rather than the present variable. */); | ||
| 4047 | /* We don't use empty_string because it's not initialized yet. */ | 4099 | /* We don't use empty_string because it's not initialized yet. */ |
| 4048 | default_suffixes = Fcons (build_string (""), Qnil); | 4100 | Vload_file_rep_suffixes = Fcons (build_string (""), Qnil); |
| 4049 | staticpro (&default_suffixes); | ||
| 4050 | 4101 | ||
| 4051 | DEFVAR_BOOL ("load-in-progress", &load_in_progress, | 4102 | DEFVAR_BOOL ("load-in-progress", &load_in_progress, |
| 4052 | doc: /* Non-nil iff inside of `load'. */); | 4103 | doc: /* Non-nil iff inside of `load'. */); |
diff --git a/src/search.c b/src/search.c index 239957e1552..dfde3280240 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -3042,7 +3042,7 @@ DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, | |||
| 3042 | 3042 | ||
| 3043 | for (; in != end; in++) | 3043 | for (; in != end; in++) |
| 3044 | { | 3044 | { |
| 3045 | if (*in == '[' || *in == ']' | 3045 | if (*in == '[' |
| 3046 | || *in == '*' || *in == '.' || *in == '\\' | 3046 | || *in == '*' || *in == '.' || *in == '\\' |
| 3047 | || *in == '?' || *in == '+' | 3047 | || *in == '?' || *in == '+' |
| 3048 | || *in == '^' || *in == '$') | 3048 | || *in == '^' || *in == '$') |
| @@ -3888,7 +3888,7 @@ check_windows_init_file () | |||
| 3888 | objs[1] = decode_env_path (0, (getenv ("EMACSLOADPATH"))); | 3888 | objs[1] = decode_env_path (0, (getenv ("EMACSLOADPATH"))); |
| 3889 | full_load_path = Fappend (2, objs); | 3889 | full_load_path = Fappend (2, objs); |
| 3890 | init_file = build_string ("term/w32-win"); | 3890 | init_file = build_string ("term/w32-win"); |
| 3891 | fd = openp (full_load_path, init_file, Vload_suffixes, NULL, Qnil); | 3891 | fd = openp (full_load_path, init_file, Fget_load_suffixes (), NULL, Qnil); |
| 3892 | if (fd < 0) | 3892 | if (fd < 0) |
| 3893 | { | 3893 | { |
| 3894 | Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil); | 3894 | Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil); |
diff --git a/src/window.c b/src/window.c index e4c8d0612cb..3e94885a810 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -50,6 +50,7 @@ Boston, MA 02110-1301, USA. */ | |||
| 50 | 50 | ||
| 51 | 51 | ||
| 52 | Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p; | 52 | Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p; |
| 53 | Lisp_Object Qscroll_up, Qscroll_down; | ||
| 53 | Lisp_Object Qwindow_size_fixed; | 54 | Lisp_Object Qwindow_size_fixed; |
| 54 | extern Lisp_Object Qleft_margin, Qright_margin; | 55 | extern Lisp_Object Qleft_margin, Qright_margin; |
| 55 | 56 | ||
| @@ -4721,9 +4722,9 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4721 | struct text_pos start; | 4722 | struct text_pos start; |
| 4722 | Lisp_Object tem; | 4723 | Lisp_Object tem; |
| 4723 | int this_scroll_margin; | 4724 | int this_scroll_margin; |
| 4724 | int preserve_y; | ||
| 4725 | /* True if we fiddled the window vscroll field without really scrolling. */ | 4725 | /* True if we fiddled the window vscroll field without really scrolling. */ |
| 4726 | int vscrolled = 0; | 4726 | int vscrolled = 0; |
| 4727 | static int preserve_y = -1; | ||
| 4727 | 4728 | ||
| 4728 | SET_TEXT_POS_FROM_MARKER (start, w->start); | 4729 | SET_TEXT_POS_FROM_MARKER (start, w->start); |
| 4729 | 4730 | ||
| @@ -4787,9 +4788,18 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4787 | point in the same window line as it is now, so get that line. */ | 4788 | point in the same window line as it is now, so get that line. */ |
| 4788 | if (!NILP (Vscroll_preserve_screen_position)) | 4789 | if (!NILP (Vscroll_preserve_screen_position)) |
| 4789 | { | 4790 | { |
| 4790 | start_display (&it, w, start); | 4791 | /* We preserve the goal pixel coordinate across consecutive |
| 4791 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); | 4792 | calls to scroll-up or scroll-down. This avoids the |
| 4792 | preserve_y = it.current_y; | 4793 | possibility of point becoming "stuck" on a tall line when |
| 4794 | scrolling by one line. */ | ||
| 4795 | if (preserve_y < 0 | ||
| 4796 | || (current_kboard->Vlast_command != Qscroll_up | ||
| 4797 | && current_kboard->Vlast_command != Qscroll_down)) | ||
| 4798 | { | ||
| 4799 | start_display (&it, w, start); | ||
| 4800 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); | ||
| 4801 | preserve_y = it.current_y; | ||
| 4802 | } | ||
| 4793 | } | 4803 | } |
| 4794 | else | 4804 | else |
| 4795 | preserve_y = -1; | 4805 | preserve_y = -1; |
| @@ -4926,10 +4936,9 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4926 | { | 4936 | { |
| 4927 | /* If we have a header line, take account of it. | 4937 | /* If we have a header line, take account of it. |
| 4928 | This is necessary because we set it.current_y to 0, above. */ | 4938 | This is necessary because we set it.current_y to 0, above. */ |
| 4929 | if (WINDOW_WANTS_HEADER_LINE_P (w)) | 4939 | move_it_to (&it, -1, -1, |
| 4930 | preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w); | 4940 | preserve_y - (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ), |
| 4931 | 4941 | -1, MOVE_TO_Y); | |
| 4932 | move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y); | ||
| 4933 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); | 4942 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); |
| 4934 | } | 4943 | } |
| 4935 | else | 4944 | else |
| @@ -4983,15 +4992,9 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4983 | { | 4992 | { |
| 4984 | SET_TEXT_POS_FROM_MARKER (start, w->start); | 4993 | SET_TEXT_POS_FROM_MARKER (start, w->start); |
| 4985 | start_display (&it, w, start); | 4994 | start_display (&it, w, start); |
| 4986 | #if 0 /* It's wrong to subtract this here | 4995 | /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT |
| 4987 | because we called start_display again | 4996 | here because we called start_display again and did not |
| 4988 | and did not alter it.current_y this time. */ | 4997 | alter it.current_y this time. */ |
| 4989 | |||
| 4990 | /* If we have a header line, take account of it. */ | ||
| 4991 | if (WINDOW_WANTS_HEADER_LINE_P (w)) | ||
| 4992 | preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w); | ||
| 4993 | #endif | ||
| 4994 | |||
| 4995 | move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y); | 4998 | move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y); |
| 4996 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); | 4999 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); |
| 4997 | } | 5000 | } |
| @@ -6988,6 +6991,12 @@ init_window () | |||
| 6988 | void | 6991 | void |
| 6989 | syms_of_window () | 6992 | syms_of_window () |
| 6990 | { | 6993 | { |
| 6994 | Qscroll_up = intern ("scroll-up"); | ||
| 6995 | staticpro (&Qscroll_up); | ||
| 6996 | |||
| 6997 | Qscroll_down = intern ("scroll-down"); | ||
| 6998 | staticpro (&Qscroll_down); | ||
| 6999 | |||
| 6991 | Qwindow_size_fixed = intern ("window-size-fixed"); | 7000 | Qwindow_size_fixed = intern ("window-size-fixed"); |
| 6992 | staticpro (&Qwindow_size_fixed); | 7001 | staticpro (&Qwindow_size_fixed); |
| 6993 | Fset (Qwindow_size_fixed, Qnil); | 7002 | Fset (Qwindow_size_fixed, Qnil); |
diff --git a/src/xdisp.c b/src/xdisp.c index 8c19b0976c8..7cdaf4f746c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -270,6 +270,12 @@ int auto_raise_tool_bar_buttons_p; | |||
| 270 | 270 | ||
| 271 | int make_cursor_line_fully_visible_p; | 271 | int make_cursor_line_fully_visible_p; |
| 272 | 272 | ||
| 273 | /* Margin below tool bar in pixels. 0 or nil means no margin. | ||
| 274 | If value is `internal-border-width' or `border-width', | ||
| 275 | the corresponding frame parameter is used. */ | ||
| 276 | |||
| 277 | Lisp_Object Vtool_bar_border; | ||
| 278 | |||
| 273 | /* Margin around tool bar buttons in pixels. */ | 279 | /* Margin around tool bar buttons in pixels. */ |
| 274 | 280 | ||
| 275 | Lisp_Object Vtool_bar_button_margin; | 281 | Lisp_Object Vtool_bar_button_margin; |
| @@ -855,7 +861,7 @@ static void store_mode_line_noprop_char P_ ((char)); | |||
| 855 | static int store_mode_line_noprop P_ ((const unsigned char *, int, int)); | 861 | static int store_mode_line_noprop P_ ((const unsigned char *, int, int)); |
| 856 | static void x_consider_frame_title P_ ((Lisp_Object)); | 862 | static void x_consider_frame_title P_ ((Lisp_Object)); |
| 857 | static void handle_stop P_ ((struct it *)); | 863 | static void handle_stop P_ ((struct it *)); |
| 858 | static int tool_bar_lines_needed P_ ((struct frame *)); | 864 | static int tool_bar_lines_needed P_ ((struct frame *, int *)); |
| 859 | static int single_display_spec_intangible_p P_ ((Lisp_Object)); | 865 | static int single_display_spec_intangible_p P_ ((Lisp_Object)); |
| 860 | static void ensure_echo_area_buffers P_ ((void)); | 866 | static void ensure_echo_area_buffers P_ ((void)); |
| 861 | static Lisp_Object unwind_with_echo_area_buffer P_ ((Lisp_Object)); | 867 | static Lisp_Object unwind_with_echo_area_buffer P_ ((Lisp_Object)); |
| @@ -966,7 +972,7 @@ static int in_ellipses_for_invisible_text_p P_ ((struct display_pos *, | |||
| 966 | static void update_tool_bar P_ ((struct frame *, int)); | 972 | static void update_tool_bar P_ ((struct frame *, int)); |
| 967 | static void build_desired_tool_bar_string P_ ((struct frame *f)); | 973 | static void build_desired_tool_bar_string P_ ((struct frame *f)); |
| 968 | static int redisplay_tool_bar P_ ((struct frame *)); | 974 | static int redisplay_tool_bar P_ ((struct frame *)); |
| 969 | static void display_tool_bar_line P_ ((struct it *)); | 975 | static void display_tool_bar_line P_ ((struct it *, int)); |
| 970 | static void notice_overwritten_cursor P_ ((struct window *, | 976 | static void notice_overwritten_cursor P_ ((struct window *, |
| 971 | enum glyph_row_area, | 977 | enum glyph_row_area, |
| 972 | int, int, int, int)); | 978 | int, int, int, int)); |
| @@ -9530,11 +9536,17 @@ build_desired_tool_bar_string (f) | |||
| 9530 | } | 9536 | } |
| 9531 | 9537 | ||
| 9532 | 9538 | ||
| 9533 | /* Display one line of the tool-bar of frame IT->f. */ | 9539 | /* Display one line of the tool-bar of frame IT->f. |
| 9540 | |||
| 9541 | HEIGHT specifies the desired height of the tool-bar line. | ||
| 9542 | If the actual height of the glyph row is less than HEIGHT, the | ||
| 9543 | row's height is increased to HEIGHT, and the icons are centered | ||
| 9544 | vertically in the new height. */ | ||
| 9534 | 9545 | ||
| 9535 | static void | 9546 | static void |
| 9536 | display_tool_bar_line (it) | 9547 | display_tool_bar_line (it, height) |
| 9537 | struct it *it; | 9548 | struct it *it; |
| 9549 | int height; | ||
| 9538 | { | 9550 | { |
| 9539 | struct glyph_row *row = it->glyph_row; | 9551 | struct glyph_row *row = it->glyph_row; |
| 9540 | int max_x = it->last_visible_x; | 9552 | int max_x = it->last_visible_x; |
| @@ -9590,11 +9602,22 @@ display_tool_bar_line (it) | |||
| 9590 | out:; | 9602 | out:; |
| 9591 | 9603 | ||
| 9592 | row->displays_text_p = row->used[TEXT_AREA] != 0; | 9604 | row->displays_text_p = row->used[TEXT_AREA] != 0; |
| 9605 | /* Use default face for the border below the tool bar. */ | ||
| 9606 | if (!row->displays_text_p) | ||
| 9607 | it->face_id = DEFAULT_FACE_ID; | ||
| 9593 | extend_face_to_end_of_line (it); | 9608 | extend_face_to_end_of_line (it); |
| 9594 | last = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1; | 9609 | last = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1; |
| 9595 | last->right_box_line_p = 1; | 9610 | last->right_box_line_p = 1; |
| 9596 | if (last == row->glyphs[TEXT_AREA]) | 9611 | if (last == row->glyphs[TEXT_AREA]) |
| 9597 | last->left_box_line_p = 1; | 9612 | last->left_box_line_p = 1; |
| 9613 | |||
| 9614 | /* Make line the desired height and center it vertically. */ | ||
| 9615 | if ((height -= it->max_ascent + it->max_descent) > 0) | ||
| 9616 | { | ||
| 9617 | it->max_ascent += height / 2; | ||
| 9618 | it->max_descent += (height + 1) / 2; | ||
| 9619 | } | ||
| 9620 | |||
| 9598 | compute_line_metrics (it); | 9621 | compute_line_metrics (it); |
| 9599 | 9622 | ||
| 9600 | /* If line is empty, make it occupy the rest of the tool-bar. */ | 9623 | /* If line is empty, make it occupy the rest of the tool-bar. */ |
| @@ -9618,11 +9641,13 @@ display_tool_bar_line (it) | |||
| 9618 | 9641 | ||
| 9619 | 9642 | ||
| 9620 | /* Value is the number of screen lines needed to make all tool-bar | 9643 | /* Value is the number of screen lines needed to make all tool-bar |
| 9621 | items of frame F visible. */ | 9644 | items of frame F visible. The number of actual rows needed is |
| 9645 | returned in *N_ROWS if non-NULL. */ | ||
| 9622 | 9646 | ||
| 9623 | static int | 9647 | static int |
| 9624 | tool_bar_lines_needed (f) | 9648 | tool_bar_lines_needed (f, n_rows) |
| 9625 | struct frame *f; | 9649 | struct frame *f; |
| 9650 | int *n_rows; | ||
| 9626 | { | 9651 | { |
| 9627 | struct window *w = XWINDOW (f->tool_bar_window); | 9652 | struct window *w = XWINDOW (f->tool_bar_window); |
| 9628 | struct it it; | 9653 | struct it it; |
| @@ -9638,9 +9663,12 @@ tool_bar_lines_needed (f) | |||
| 9638 | { | 9663 | { |
| 9639 | it.glyph_row = w->desired_matrix->rows; | 9664 | it.glyph_row = w->desired_matrix->rows; |
| 9640 | clear_glyph_row (it.glyph_row); | 9665 | clear_glyph_row (it.glyph_row); |
| 9641 | display_tool_bar_line (&it); | 9666 | display_tool_bar_line (&it, 0); |
| 9642 | } | 9667 | } |
| 9643 | 9668 | ||
| 9669 | if (n_rows) | ||
| 9670 | *n_rows = it.vpos; | ||
| 9671 | |||
| 9644 | return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f); | 9672 | return (it.current_y + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f); |
| 9645 | } | 9673 | } |
| 9646 | 9674 | ||
| @@ -9669,7 +9697,7 @@ DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed, | |||
| 9669 | if (f->n_tool_bar_items) | 9697 | if (f->n_tool_bar_items) |
| 9670 | { | 9698 | { |
| 9671 | build_desired_tool_bar_string (f); | 9699 | build_desired_tool_bar_string (f); |
| 9672 | nlines = tool_bar_lines_needed (f); | 9700 | nlines = tool_bar_lines_needed (f, NULL); |
| 9673 | } | 9701 | } |
| 9674 | } | 9702 | } |
| 9675 | 9703 | ||
| @@ -9714,9 +9742,50 @@ redisplay_tool_bar (f) | |||
| 9714 | build_desired_tool_bar_string (f); | 9742 | build_desired_tool_bar_string (f); |
| 9715 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); | 9743 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); |
| 9716 | 9744 | ||
| 9745 | if (f->n_tool_bar_rows == 0) | ||
| 9746 | { | ||
| 9747 | (void)tool_bar_lines_needed (f, &f->n_tool_bar_rows); | ||
| 9748 | if (f->n_tool_bar_rows == 0) | ||
| 9749 | f->n_tool_bar_rows = -1; | ||
| 9750 | } | ||
| 9751 | |||
| 9717 | /* Display as many lines as needed to display all tool-bar items. */ | 9752 | /* Display as many lines as needed to display all tool-bar items. */ |
| 9718 | while (it.current_y < it.last_visible_y) | 9753 | |
| 9719 | display_tool_bar_line (&it); | 9754 | if (f->n_tool_bar_rows > 0) |
| 9755 | { | ||
| 9756 | int border, rows, height, extra; | ||
| 9757 | |||
| 9758 | if (INTEGERP (Vtool_bar_border)) | ||
| 9759 | border = XINT (Vtool_bar_border); | ||
| 9760 | else if (EQ (Vtool_bar_border, Qinternal_border_width)) | ||
| 9761 | border = FRAME_INTERNAL_BORDER_WIDTH (f); | ||
| 9762 | else if (EQ (Vtool_bar_border, Qborder_width)) | ||
| 9763 | border = f->border_width; | ||
| 9764 | else | ||
| 9765 | border = 0; | ||
| 9766 | if (border < 0) | ||
| 9767 | border = 0; | ||
| 9768 | |||
| 9769 | rows = f->n_tool_bar_rows; | ||
| 9770 | height = (it.last_visible_y - border) / rows; | ||
| 9771 | extra = it.last_visible_y - border - height * rows; | ||
| 9772 | |||
| 9773 | while (it.current_y < it.last_visible_y) | ||
| 9774 | { | ||
| 9775 | int h = 0; | ||
| 9776 | if (extra > 0 && rows-- > 0) | ||
| 9777 | { | ||
| 9778 | h = (extra + rows - 1) / rows; | ||
| 9779 | extra -= h; | ||
| 9780 | } | ||
| 9781 | display_tool_bar_line (&it, height + h); | ||
| 9782 | } | ||
| 9783 | } | ||
| 9784 | else | ||
| 9785 | { | ||
| 9786 | while (it.current_y < it.last_visible_y) | ||
| 9787 | display_tool_bar_line (&it, 0); | ||
| 9788 | } | ||
| 9720 | 9789 | ||
| 9721 | /* It doesn't make much sense to try scrolling in the tool-bar | 9790 | /* It doesn't make much sense to try scrolling in the tool-bar |
| 9722 | window, so don't do it. */ | 9791 | window, so don't do it. */ |
| @@ -9749,7 +9818,7 @@ redisplay_tool_bar (f) | |||
| 9749 | /* Resize windows as needed by changing the `tool-bar-lines' | 9818 | /* Resize windows as needed by changing the `tool-bar-lines' |
| 9750 | frame parameter. */ | 9819 | frame parameter. */ |
| 9751 | if (change_height_p | 9820 | if (change_height_p |
| 9752 | && (nlines = tool_bar_lines_needed (f), | 9821 | && (nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows), |
| 9753 | nlines != WINDOW_TOTAL_LINES (w))) | 9822 | nlines != WINDOW_TOTAL_LINES (w))) |
| 9754 | { | 9823 | { |
| 9755 | extern Lisp_Object Qtool_bar_lines; | 9824 | extern Lisp_Object Qtool_bar_lines; |
| @@ -23817,6 +23886,14 @@ otherwise. */); | |||
| 23817 | doc: /* *Non-nil means to scroll (recenter) cursor line if it is not fully visible. */); | 23886 | doc: /* *Non-nil means to scroll (recenter) cursor line if it is not fully visible. */); |
| 23818 | make_cursor_line_fully_visible_p = 1; | 23887 | make_cursor_line_fully_visible_p = 1; |
| 23819 | 23888 | ||
| 23889 | DEFVAR_LISP ("tool-bar-border", &Vtool_bar_border, | ||
| 23890 | doc: /* *Border below tool-bar in pixels. | ||
| 23891 | If an integer, use it as the height of the border. | ||
| 23892 | If it is one of `internal-border-width' or `border-width', use the | ||
| 23893 | value of the corresponding frame parameter. | ||
| 23894 | Otherwise, no border is added below the tool-bar. */); | ||
| 23895 | Vtool_bar_border = Qinternal_border_width; | ||
| 23896 | |||
| 23820 | DEFVAR_LISP ("tool-bar-button-margin", &Vtool_bar_button_margin, | 23897 | DEFVAR_LISP ("tool-bar-button-margin", &Vtool_bar_button_margin, |
| 23821 | doc: /* *Margin around tool-bar buttons in pixels. | 23898 | doc: /* *Margin around tool-bar buttons in pixels. |
| 23822 | If an integer, use that for both horizontal and vertical margins. | 23899 | If an integer, use that for both horizontal and vertical margins. |
diff --git a/src/xfns.c b/src/xfns.c index 2ad80fb95fa..bf4b29a005f 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -667,7 +667,7 @@ x_real_positions (f, xptr, yptr) | |||
| 667 | had_errors = x_had_errors_p (FRAME_X_DISPLAY (f)); | 667 | had_errors = x_had_errors_p (FRAME_X_DISPLAY (f)); |
| 668 | } | 668 | } |
| 669 | 669 | ||
| 670 | x_uncatch_errors (FRAME_X_DISPLAY (f)); | 670 | x_uncatch_errors (); |
| 671 | 671 | ||
| 672 | UNBLOCK_INPUT; | 672 | UNBLOCK_INPUT; |
| 673 | 673 | ||
| @@ -1022,7 +1022,7 @@ x_set_mouse_color (f, arg, oldval) | |||
| 1022 | 1022 | ||
| 1023 | /* Check and report errors with the above calls. */ | 1023 | /* Check and report errors with the above calls. */ |
| 1024 | x_check_errors (dpy, "can't set cursor shape: %s"); | 1024 | x_check_errors (dpy, "can't set cursor shape: %s"); |
| 1025 | x_uncatch_errors (dpy); | 1025 | x_uncatch_errors (); |
| 1026 | 1026 | ||
| 1027 | { | 1027 | { |
| 1028 | XColor fore_color, back_color; | 1028 | XColor fore_color, back_color; |
| @@ -3427,7 +3427,7 @@ FRAME nil means use the selected frame. */) | |||
| 3427 | x_catch_errors (dpy); | 3427 | x_catch_errors (dpy); |
| 3428 | XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 3428 | XSetInputFocus (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 3429 | RevertToParent, CurrentTime); | 3429 | RevertToParent, CurrentTime); |
| 3430 | x_uncatch_errors (dpy); | 3430 | x_uncatch_errors (); |
| 3431 | UNBLOCK_INPUT; | 3431 | UNBLOCK_INPUT; |
| 3432 | 3432 | ||
| 3433 | return Qnil; | 3433 | return Qnil; |
diff --git a/src/xselect.c b/src/xselect.c index 6efa625543e..30739c74331 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -55,6 +55,7 @@ static void x_decline_selection_request P_ ((struct input_event *)); | |||
| 55 | static Lisp_Object x_selection_request_lisp_error P_ ((Lisp_Object)); | 55 | static Lisp_Object x_selection_request_lisp_error P_ ((Lisp_Object)); |
| 56 | static Lisp_Object queue_selection_requests_unwind P_ ((Lisp_Object)); | 56 | static Lisp_Object queue_selection_requests_unwind P_ ((Lisp_Object)); |
| 57 | static Lisp_Object some_frame_on_display P_ ((struct x_display_info *)); | 57 | static Lisp_Object some_frame_on_display P_ ((struct x_display_info *)); |
| 58 | static Lisp_Object x_catch_errors_unwind P_ ((Lisp_Object)); | ||
| 58 | static void x_reply_selection_request P_ ((struct input_event *, int, | 59 | static void x_reply_selection_request P_ ((struct input_event *, int, |
| 59 | unsigned char *, int, Atom)); | 60 | unsigned char *, int, Atom)); |
| 60 | static int waiting_for_other_props_on_window P_ ((Display *, Window)); | 61 | static int waiting_for_other_props_on_window P_ ((Display *, Window)); |
| @@ -410,7 +411,7 @@ x_own_selection (selection_name, selection_value) | |||
| 410 | x_catch_errors (display); | 411 | x_catch_errors (display); |
| 411 | XSetSelectionOwner (display, selection_atom, selecting_window, time); | 412 | XSetSelectionOwner (display, selection_atom, selecting_window, time); |
| 412 | x_check_errors (display, "Can't set selection: %s"); | 413 | x_check_errors (display, "Can't set selection: %s"); |
| 413 | x_uncatch_errors (display); | 414 | x_uncatch_errors (); |
| 414 | UNBLOCK_INPUT; | 415 | UNBLOCK_INPUT; |
| 415 | 416 | ||
| 416 | /* Now update the local cache */ | 417 | /* Now update the local cache */ |
| @@ -586,7 +587,7 @@ x_decline_selection_request (event) | |||
| 586 | x_catch_errors (reply.display); | 587 | x_catch_errors (reply.display); |
| 587 | XSendEvent (reply.display, reply.requestor, False, 0L, (XEvent *) &reply); | 588 | XSendEvent (reply.display, reply.requestor, False, 0L, (XEvent *) &reply); |
| 588 | XFlush (reply.display); | 589 | XFlush (reply.display); |
| 589 | x_uncatch_errors (reply.display); | 590 | x_uncatch_errors (); |
| 590 | UNBLOCK_INPUT; | 591 | UNBLOCK_INPUT; |
| 591 | } | 592 | } |
| 592 | 593 | ||
| @@ -611,6 +612,15 @@ x_selection_request_lisp_error (ignore) | |||
| 611 | x_decline_selection_request (x_selection_current_request); | 612 | x_decline_selection_request (x_selection_current_request); |
| 612 | return Qnil; | 613 | return Qnil; |
| 613 | } | 614 | } |
| 615 | |||
| 616 | static Lisp_Object | ||
| 617 | x_catch_errors_unwind (dummy) | ||
| 618 | Lisp_Object dummy; | ||
| 619 | { | ||
| 620 | BLOCK_INPUT; | ||
| 621 | x_uncatch_errors (); | ||
| 622 | UNBLOCK_INPUT; | ||
| 623 | } | ||
| 614 | 624 | ||
| 615 | 625 | ||
| 616 | /* This stuff is so that INCR selections are reentrant (that is, so we can | 626 | /* This stuff is so that INCR selections are reentrant (that is, so we can |
| @@ -703,8 +713,11 @@ x_reply_selection_request (event, format, data, size, type) | |||
| 703 | if (reply.property == None) | 713 | if (reply.property == None) |
| 704 | reply.property = reply.target; | 714 | reply.property = reply.target; |
| 705 | 715 | ||
| 706 | /* #### XChangeProperty can generate BadAlloc, and we must handle it! */ | ||
| 707 | BLOCK_INPUT; | 716 | BLOCK_INPUT; |
| 717 | /* The protected block contains wait_for_property_change, which can | ||
| 718 | run random lisp code (process handlers) or signal. Therefore, we | ||
| 719 | put the x_uncatch_errors call in an unwind. */ | ||
| 720 | record_unwind_protect (x_catch_errors_unwind, Qnil); | ||
| 708 | x_catch_errors (display); | 721 | x_catch_errors (display); |
| 709 | 722 | ||
| 710 | #ifdef TRACE_SELECTION | 723 | #ifdef TRACE_SELECTION |
| @@ -858,9 +871,8 @@ x_reply_selection_request (event, format, data, size, type) | |||
| 858 | UNBLOCK to enter the event loop and get possible errors delivered, | 871 | UNBLOCK to enter the event loop and get possible errors delivered, |
| 859 | and then BLOCK again because x_uncatch_errors requires it. */ | 872 | and then BLOCK again because x_uncatch_errors requires it. */ |
| 860 | BLOCK_INPUT; | 873 | BLOCK_INPUT; |
| 861 | 874 | /* This calls x_uncatch_errors. */ | |
| 862 | unbind_to (count, Qnil); | 875 | unbind_to (count, Qnil); |
| 863 | x_uncatch_errors (display); | ||
| 864 | UNBLOCK_INPUT; | 876 | UNBLOCK_INPUT; |
| 865 | } | 877 | } |
| 866 | 878 | ||
| @@ -1370,7 +1382,7 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp) | |||
| 1370 | Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol); | 1382 | Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol); |
| 1371 | Atom type_atom; | 1383 | Atom type_atom; |
| 1372 | int secs, usecs; | 1384 | int secs, usecs; |
| 1373 | int count; | 1385 | int count = SPECPDL_INDEX (); |
| 1374 | Lisp_Object frame; | 1386 | Lisp_Object frame; |
| 1375 | 1387 | ||
| 1376 | if (CONSP (target_type)) | 1388 | if (CONSP (target_type)) |
| @@ -1392,6 +1404,10 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp) | |||
| 1392 | 1404 | ||
| 1393 | BLOCK_INPUT; | 1405 | BLOCK_INPUT; |
| 1394 | 1406 | ||
| 1407 | /* The protected block contains wait_reading_process_output, which | ||
| 1408 | can run random lisp code (process handlers) or signal. | ||
| 1409 | Therefore, we put the x_uncatch_errors call in an unwind. */ | ||
| 1410 | record_unwind_protect (x_catch_errors_unwind, Qnil); | ||
| 1395 | x_catch_errors (display); | 1411 | x_catch_errors (display); |
| 1396 | 1412 | ||
| 1397 | TRACE2 ("Get selection %s, type %s", | 1413 | TRACE2 ("Get selection %s, type %s", |
| @@ -1409,8 +1425,6 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp) | |||
| 1409 | 1425 | ||
| 1410 | frame = some_frame_on_display (dpyinfo); | 1426 | frame = some_frame_on_display (dpyinfo); |
| 1411 | 1427 | ||
| 1412 | count = SPECPDL_INDEX (); | ||
| 1413 | |||
| 1414 | /* If the display no longer has frames, we can't expect | 1428 | /* If the display no longer has frames, we can't expect |
| 1415 | to get many more selection requests from it, so don't | 1429 | to get many more selection requests from it, so don't |
| 1416 | bother trying to queue them. */ | 1430 | bother trying to queue them. */ |
| @@ -1432,9 +1446,10 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp) | |||
| 1432 | TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply))); | 1446 | TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply))); |
| 1433 | 1447 | ||
| 1434 | BLOCK_INPUT; | 1448 | BLOCK_INPUT; |
| 1449 | if (x_had_errors_p (display)) | ||
| 1450 | error ("Cannot get selection"); | ||
| 1451 | /* This calls x_uncatch_errors. */ | ||
| 1435 | unbind_to (count, Qnil); | 1452 | unbind_to (count, Qnil); |
| 1436 | x_check_errors (display, "Cannot get selection: %s"); | ||
| 1437 | x_uncatch_errors (display); | ||
| 1438 | UNBLOCK_INPUT; | 1453 | UNBLOCK_INPUT; |
| 1439 | 1454 | ||
| 1440 | if (NILP (XCAR (reading_selection_reply))) | 1455 | if (NILP (XCAR (reading_selection_reply))) |
| @@ -2655,6 +2670,7 @@ If the value is 0 or the atom is not known, return the empty string. */) | |||
| 2655 | Lisp_Object ret = Qnil; | 2670 | Lisp_Object ret = Qnil; |
| 2656 | Display *dpy = FRAME_X_DISPLAY (f); | 2671 | Display *dpy = FRAME_X_DISPLAY (f); |
| 2657 | Atom atom; | 2672 | Atom atom; |
| 2673 | int had_errors; | ||
| 2658 | 2674 | ||
| 2659 | if (INTEGERP (value)) | 2675 | if (INTEGERP (value)) |
| 2660 | atom = (Atom) XUINT (value); | 2676 | atom = (Atom) XUINT (value); |
| @@ -2667,14 +2683,13 @@ If the value is 0 or the atom is not known, return the empty string. */) | |||
| 2667 | 2683 | ||
| 2668 | BLOCK_INPUT; | 2684 | BLOCK_INPUT; |
| 2669 | x_catch_errors (dpy); | 2685 | x_catch_errors (dpy); |
| 2670 | |||
| 2671 | name = atom ? XGetAtomName (dpy, atom) : ""; | 2686 | name = atom ? XGetAtomName (dpy, atom) : ""; |
| 2687 | had_errors = x_had_errors_p (dpy); | ||
| 2688 | x_uncatch_errors (); | ||
| 2672 | 2689 | ||
| 2673 | if (! x_had_errors_p (dpy)) | 2690 | if (!had_errors) |
| 2674 | ret = make_string (name, strlen (name)); | 2691 | ret = make_string (name, strlen (name)); |
| 2675 | 2692 | ||
| 2676 | x_uncatch_errors (dpy); | ||
| 2677 | |||
| 2678 | if (atom && name) XFree (name); | 2693 | if (atom && name) XFree (name); |
| 2679 | if (NILP (ret)) ret = make_string ("", 0); | 2694 | if (NILP (ret)) ret = make_string ("", 0); |
| 2680 | 2695 | ||
| @@ -2849,7 +2864,7 @@ are ignored. */) | |||
| 2849 | XSendEvent (dpyinfo->display, wdest, propagate, mask, &event); | 2864 | XSendEvent (dpyinfo->display, wdest, propagate, mask, &event); |
| 2850 | XFlush (dpyinfo->display); | 2865 | XFlush (dpyinfo->display); |
| 2851 | } | 2866 | } |
| 2852 | x_uncatch_errors (dpyinfo->display); | 2867 | x_uncatch_errors (); |
| 2853 | UNBLOCK_INPUT; | 2868 | UNBLOCK_INPUT; |
| 2854 | 2869 | ||
| 2855 | return Qnil; | 2870 | return Qnil; |
diff --git a/src/xterm.c b/src/xterm.c index ea12b4eba9f..1f497f1f738 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -326,7 +326,7 @@ void x_delete_display P_ ((struct x_display_info *)); | |||
| 326 | 326 | ||
| 327 | static int x_io_error_quitter P_ ((Display *)); | 327 | static int x_io_error_quitter P_ ((Display *)); |
| 328 | void x_catch_errors P_ ((Display *)); | 328 | void x_catch_errors P_ ((Display *)); |
| 329 | void x_uncatch_errors P_ ((Display *)); | 329 | void x_uncatch_errors P_ ((void)); |
| 330 | void x_lower_frame P_ ((struct frame *)); | 330 | void x_lower_frame P_ ((struct frame *)); |
| 331 | void x_scroll_bar_clear P_ ((struct frame *)); | 331 | void x_scroll_bar_clear P_ ((struct frame *)); |
| 332 | int x_had_errors_p P_ ((Display *)); | 332 | int x_had_errors_p P_ ((Display *)); |
| @@ -3877,7 +3877,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time) | |||
| 3877 | if (x_had_errors_p (FRAME_X_DISPLAY (*fp))) | 3877 | if (x_had_errors_p (FRAME_X_DISPLAY (*fp))) |
| 3878 | f1 = 0; | 3878 | f1 = 0; |
| 3879 | 3879 | ||
| 3880 | x_uncatch_errors (FRAME_X_DISPLAY (*fp)); | 3880 | x_uncatch_errors (); |
| 3881 | 3881 | ||
| 3882 | /* If not, is it one of our scroll bars? */ | 3882 | /* If not, is it one of our scroll bars? */ |
| 3883 | if (! f1) | 3883 | if (! f1) |
| @@ -5803,7 +5803,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 5803 | /* This is needed to detect the error | 5803 | /* This is needed to detect the error |
| 5804 | if there is an error. */ | 5804 | if there is an error. */ |
| 5805 | XSync (d, False); | 5805 | XSync (d, False); |
| 5806 | x_uncatch_errors (d); | 5806 | x_uncatch_errors (); |
| 5807 | } | 5807 | } |
| 5808 | /* Not certain about handling scroll bars here */ | 5808 | /* Not certain about handling scroll bars here */ |
| 5809 | #endif /* 0 */ | 5809 | #endif /* 0 */ |
| @@ -7585,19 +7585,16 @@ x_catch_errors (dpy) | |||
| 7585 | DPY should be the display that was passed to x_catch_errors. */ | 7585 | DPY should be the display that was passed to x_catch_errors. */ |
| 7586 | 7586 | ||
| 7587 | void | 7587 | void |
| 7588 | x_uncatch_errors (dpy) | 7588 | x_uncatch_errors () |
| 7589 | Display *dpy; | ||
| 7590 | { | 7589 | { |
| 7591 | struct x_error_message_stack *tmp; | 7590 | struct x_error_message_stack *tmp; |
| 7592 | 7591 | ||
| 7593 | eassert (x_error_message && dpy == x_error_message->dpy); | ||
| 7594 | |||
| 7595 | /* The display may have been closed before this function is called. | 7592 | /* The display may have been closed before this function is called. |
| 7596 | Check if it is still open before calling XSync. */ | 7593 | Check if it is still open before calling XSync. */ |
| 7597 | if (x_display_info_for_display (dpy) != 0) | 7594 | if (x_display_info_for_display (x_error_message->dpy) != 0) |
| 7598 | { | 7595 | { |
| 7599 | BLOCK_INPUT; | 7596 | BLOCK_INPUT; |
| 7600 | XSync (dpy, False); | 7597 | XSync (x_error_message->dpy, False); |
| 7601 | UNBLOCK_INPUT; | 7598 | UNBLOCK_INPUT; |
| 7602 | } | 7599 | } |
| 7603 | 7600 | ||
| @@ -7622,7 +7619,7 @@ x_check_errors (dpy, format) | |||
| 7622 | { | 7619 | { |
| 7623 | char string[X_ERROR_MESSAGE_SIZE]; | 7620 | char string[X_ERROR_MESSAGE_SIZE]; |
| 7624 | bcopy (x_error_message->string, string, X_ERROR_MESSAGE_SIZE); | 7621 | bcopy (x_error_message->string, string, X_ERROR_MESSAGE_SIZE); |
| 7625 | x_uncatch_errors (dpy); | 7622 | x_uncatch_errors (); |
| 7626 | error (format, string); | 7623 | error (format, string); |
| 7627 | } | 7624 | } |
| 7628 | } | 7625 | } |
| @@ -7782,7 +7779,7 @@ x_connection_closed (dpy, error_message) | |||
| 7782 | if (dpyinfo) | 7779 | if (dpyinfo) |
| 7783 | x_delete_display (dpyinfo); | 7780 | x_delete_display (dpyinfo); |
| 7784 | 7781 | ||
| 7785 | x_uncatch_errors (dpy); | 7782 | x_uncatch_errors (); |
| 7786 | 7783 | ||
| 7787 | if (x_display_list == 0) | 7784 | if (x_display_list == 0) |
| 7788 | { | 7785 | { |
| @@ -9525,7 +9522,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 9525 | } | 9522 | } |
| 9526 | } | 9523 | } |
| 9527 | 9524 | ||
| 9528 | x_uncatch_errors (dpy); | 9525 | x_uncatch_errors (); |
| 9529 | UNBLOCK_INPUT; | 9526 | UNBLOCK_INPUT; |
| 9530 | 9527 | ||
| 9531 | if (names) | 9528 | if (names) |
| @@ -9626,7 +9623,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 9626 | thisinfo = NULL; | 9623 | thisinfo = NULL; |
| 9627 | x_clear_errors (dpy); | 9624 | x_clear_errors (dpy); |
| 9628 | } | 9625 | } |
| 9629 | x_uncatch_errors (dpy); | 9626 | x_uncatch_errors (); |
| 9630 | UNBLOCK_INPUT; | 9627 | UNBLOCK_INPUT; |
| 9631 | 9628 | ||
| 9632 | if (thisinfo) | 9629 | if (thisinfo) |
| @@ -9829,7 +9826,7 @@ x_load_font (f, fontname, size) | |||
| 9829 | font = NULL; | 9826 | font = NULL; |
| 9830 | x_clear_errors (FRAME_X_DISPLAY (f)); | 9827 | x_clear_errors (FRAME_X_DISPLAY (f)); |
| 9831 | } | 9828 | } |
| 9832 | x_uncatch_errors (FRAME_X_DISPLAY (f)); | 9829 | x_uncatch_errors (); |
| 9833 | UNBLOCK_INPUT; | 9830 | UNBLOCK_INPUT; |
| 9834 | if (!font) | 9831 | if (!font) |
| 9835 | return NULL; | 9832 | return NULL; |
| @@ -10769,7 +10766,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10769 | abort (); | 10766 | abort (); |
| 10770 | if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) | 10767 | if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) |
| 10771 | XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); | 10768 | XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); |
| 10772 | x_uncatch_errors (dpy); | 10769 | x_uncatch_errors (); |
| 10773 | } | 10770 | } |
| 10774 | #endif | 10771 | #endif |
| 10775 | #endif | 10772 | #endif |
diff --git a/src/xterm.h b/src/xterm.h index b92a27979dd..ea79d91564f 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -963,7 +963,7 @@ void x_iconify_frame P_ ((struct frame *)); | |||
| 963 | void x_wm_set_size_hint P_ ((struct frame *, long, int)); | 963 | void x_wm_set_size_hint P_ ((struct frame *, long, int)); |
| 964 | void x_catch_errors P_ ((Display *)); | 964 | void x_catch_errors P_ ((Display *)); |
| 965 | int x_had_errors_p P_ ((Display *)); | 965 | int x_had_errors_p P_ ((Display *)); |
| 966 | void x_uncatch_errors P_ ((Display *)); | 966 | void x_uncatch_errors P_ ((void)); |
| 967 | void x_check_errors P_ ((Display *, char *)); | 967 | void x_check_errors P_ ((Display *, char *)); |
| 968 | int x_text_icon P_ ((struct frame *, char *)); | 968 | int x_text_icon P_ ((struct frame *, char *)); |
| 969 | int x_bitmap_icon P_ ((struct frame *, Lisp_Object)); | 969 | int x_bitmap_icon P_ ((struct frame *, Lisp_Object)); |
| @@ -980,7 +980,7 @@ extern int x_bitmap_icon P_ ((struct frame *, Lisp_Object)); | |||
| 980 | extern void x_catch_errors P_ ((Display *)); | 980 | extern void x_catch_errors P_ ((Display *)); |
| 981 | extern void x_check_errors P_ ((Display *, char *)); | 981 | extern void x_check_errors P_ ((Display *, char *)); |
| 982 | extern int x_had_errors_p P_ ((Display *)); | 982 | extern int x_had_errors_p P_ ((Display *)); |
| 983 | extern void x_uncatch_errors P_ ((Display *)); | 983 | extern void x_uncatch_errors P_ ((void)); |
| 984 | extern void x_set_window_size P_ ((struct frame *, int, int, int)); | 984 | extern void x_set_window_size P_ ((struct frame *, int, int, int)); |
| 985 | extern void x_set_mouse_position P_ ((struct frame *, int, int)); | 985 | extern void x_set_mouse_position P_ ((struct frame *, int, int)); |
| 986 | extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int)); | 986 | extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int)); |