diff options
| author | Karoly Lorentey | 2004-10-31 02:05:24 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-10-31 02:05:24 +0000 |
| commit | e0bc17abe6979d607e8de4684dddb96e53c60065 (patch) | |
| tree | b7cb7bc5df9f12138937fd958cdf4b9c2d19ee3a | |
| parent | f158167a84475d5fc41931531406821e6413afd7 (diff) | |
| parent | 707994d2626cf0f01c3ece4028d73835068d64dc (diff) | |
| download | emacs-e0bc17abe6979d607e8de4684dddb96e53c60065.tar.gz emacs-e0bc17abe6979d607e8de4684dddb96e53c60065.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-639
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-640
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-641
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-642
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-643
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-644
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-645
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-646
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-647
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-648
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-649
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-651
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-652
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-59
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-60
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-61
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-62
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-63
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-263
79 files changed, 1605 insertions, 940 deletions
| @@ -99,6 +99,12 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types. | |||
| 99 | * Changes in Emacs 21.4 | 99 | * Changes in Emacs 21.4 |
| 100 | 100 | ||
| 101 | +++ | 101 | +++ |
| 102 | ** `set-auto-mode' now gives the interpreter magic line (if present) | ||
| 103 | precedence over the file name. Likewise an <?xml or <!DOCTYPE declaration | ||
| 104 | will give the buffer XML or SGML mode, unless the file name leads to a mode in | ||
| 105 | `xml-based-modes'. | ||
| 106 | |||
| 107 | +++ | ||
| 102 | ** New function `looking-back' checks whether a regular expression matches | 108 | ** New function `looking-back' checks whether a regular expression matches |
| 103 | the text before point. Specifying the LIMIT argument bounds how far | 109 | the text before point. Specifying the LIMIT argument bounds how far |
| 104 | back the match can start; this is a way to keep it from taking too long. | 110 | back the match can start; this is a way to keep it from taking too long. |
| @@ -864,6 +870,9 @@ coding system now also encodes characters from most of Emacs's | |||
| 864 | one-dimensional internal charsets, specifically the ISO-8859 ones. | 870 | one-dimensional internal charsets, specifically the ISO-8859 ones. |
| 865 | The utf-16 coding system is affected similarly. | 871 | The utf-16 coding system is affected similarly. |
| 866 | 872 | ||
| 873 | ** New variable `utf-translate-cjk-unicode-range' controls which | ||
| 874 | Unicode characters to translate in `utf-translate-cjk-mode'. | ||
| 875 | |||
| 867 | ** iso-10646-1 (`Unicode') fonts can be used to display any range of | 876 | ** iso-10646-1 (`Unicode') fonts can be used to display any range of |
| 868 | characters encodable by the utf-8 coding system. Just specify the | 877 | characters encodable by the utf-8 coding system. Just specify the |
| 869 | fontset appropriately. | 878 | fontset appropriately. |
| @@ -2289,6 +2298,11 @@ configuration files. | |||
| 2289 | 2298 | ||
| 2290 | * Lisp Changes in Emacs 21.4 | 2299 | * Lisp Changes in Emacs 21.4 |
| 2291 | 2300 | ||
| 2301 | +++ | ||
| 2302 | ** An interactive specification may now use the code letter 'U' to get | ||
| 2303 | the up-event that was discarded in case the last key sequence read for a | ||
| 2304 | previous 'k' or 'K' argument was a down-event; otherwise nil is used. | ||
| 2305 | |||
| 2292 | ** Function `translate-region' accepts also a char-table as TABLE | 2306 | ** Function `translate-region' accepts also a char-table as TABLE |
| 2293 | argument. | 2307 | argument. |
| 2294 | 2308 | ||
| @@ -3092,11 +3106,13 @@ KEEP-MARGINS which will preserve the window's current margin, fringe, | |||
| 3092 | and scroll-bar settings if non-nil. | 3106 | and scroll-bar settings if non-nil. |
| 3093 | 3107 | ||
| 3094 | +++ | 3108 | +++ |
| 3095 | ** Renamed file hooks to follow the convention: | 3109 | ** Renamed hooks to better follow the naming convention: |
| 3096 | find-file-hooks to find-file-hook, | 3110 | find-file-hooks to find-file-hook, |
| 3097 | find-file-not-found-hooks to find-file-not-found-functions, | 3111 | find-file-not-found-hooks to find-file-not-found-functions, |
| 3098 | write-file-hooks to write-file-functions, | 3112 | write-file-hooks to write-file-functions, |
| 3099 | write-contents-hooks to write-contents-functions. | 3113 | write-contents-hooks to write-contents-functions, |
| 3114 | x-lost-selection-hooks to x-lost-selection-functions, | ||
| 3115 | x-sent-selection-hooks to x-sent-selection-functions. | ||
| 3100 | Marked local-write-file-hooks as obsolete (use the LOCAL arg of `add-hook'). | 3116 | Marked local-write-file-hooks as obsolete (use the LOCAL arg of `add-hook'). |
| 3101 | 3117 | ||
| 3102 | +++ | 3118 | +++ |
diff --git a/etc/compilation.txt b/etc/compilation.txt index ff86583299d..bae217e8323 100644 --- a/etc/compilation.txt +++ b/etc/compilation.txt | |||
| @@ -108,6 +108,24 @@ symbol: epc | |||
| 108 | Error 24 at (2:progran.f90) : syntax error | 108 | Error 24 at (2:progran.f90) : syntax error |
| 109 | 109 | ||
| 110 | 110 | ||
| 111 | * Fortran checker | ||
| 112 | |||
| 113 | symbols: ftnchek-file ftnchek-line-file ftnchek-line | ||
| 114 | |||
| 115 | File average.f: | ||
| 116 | |||
| 117 | Warning in module COMPAV: Variables may be used before set: | ||
| 118 | SUM used at line 14 | ||
| 119 | SUM set at line 14 | ||
| 120 | |||
| 121 | Warning near line 16 col 20: integer quotient expr I/J converted to real | ||
| 122 | |||
| 123 | Dummy arg W in module SUBA line 8 file arrayclash.f is array | ||
| 124 | L4 used at line 55 file test/assign.f; never set | ||
| 125 | Warning near line 10 file arrayclash.f: Module contains no executable | ||
| 126 | Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit | ||
| 127 | |||
| 128 | |||
| 111 | * IAR Systems C Compiler | 129 | * IAR Systems C Compiler |
| 112 | 130 | ||
| 113 | symbol: iar | 131 | symbol: iar |
| @@ -125,7 +143,7 @@ foo.c(3:8) : warning EDC0833: Implicit return statement encountered. | |||
| 125 | foo.c(5:5) : error EDC0350: Syntax error. | 143 | foo.c(5:5) : error EDC0350: Syntax error. |
| 126 | 144 | ||
| 127 | 145 | ||
| 128 | * Ultrix MIPS RISC CC & DEC AXP OSF/1 cc & IRIX 5.2 | 146 | * Ultrix MIPS RISC CC, DEC AXP OSF/1 cc, IRIX 5.2 & NAG Fortran |
| 129 | 147 | ||
| 130 | symbol: irix | 148 | symbol: irix |
| 131 | 149 | ||
| @@ -136,6 +154,7 @@ cfe: Warning 712: foo.c, line 2: illegal combination of pointer and ... | |||
| 136 | cfe: Warning 600: xfe.c: 170: Not in a conditional directive while ... | 154 | cfe: Warning 600: xfe.c: 170: Not in a conditional directive while ... |
| 137 | /usr/lib/cmplrs/cc/cfe: Error: foo.c: 1: blah blah | 155 | /usr/lib/cmplrs/cc/cfe: Error: foo.c: 1: blah blah |
| 138 | /usr/lib/cmplrs/cc/cfe: warning: foo.c: 1: blah blah | 156 | /usr/lib/cmplrs/cc/cfe: warning: foo.c: 1: blah blah |
| 157 | foo bar: baz.f, line 27: ... | ||
| 139 | 158 | ||
| 140 | 159 | ||
| 141 | * Java Exception & Valgrind (memory debugger for x86 GNU/Linux) | 160 | * Java Exception & Valgrind (memory debugger for x86 GNU/Linux) |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e99856fe5f3..c22ab994eff 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,221 @@ | |||
| 1 | 2004-10-30 Simon Josefsson <jas@extundo.com> | ||
| 2 | |||
| 3 | * progmodes/autoconf.el (autoconf-font-lock-keywords): Recognize | ||
| 4 | AS_* too. | ||
| 5 | |||
| 6 | 2004-10-29 Simon Josefsson <jas@extundo.com> | ||
| 7 | |||
| 8 | * subr.el (read-passwd): Move back from password.el. | ||
| 9 | |||
| 10 | * password.el: Remove, not ready yet. | ||
| 11 | |||
| 12 | 2004-10-29 Andreas Schwab <schwab@suse.de> | ||
| 13 | |||
| 14 | * speedbar.el (speedbar-frame-parameters): Improve customize type. | ||
| 15 | |||
| 16 | 2004-10-29 Sam Steingold <sds@gnu.org> | ||
| 17 | |||
| 18 | * mouse.el (mouse-show-mark): Replace the last occurrence of | ||
| 19 | x-lost-selection-hooks with x-lost-selection-functions. | ||
| 20 | |||
| 21 | 2004-10-28 Stefan <monnier@iro.umontreal.ca> | ||
| 22 | |||
| 23 | * mouse.el (mouse-show-mark): Adjust to new name and don't assume | ||
| 24 | x-lost-selection-functions is bound. | ||
| 25 | |||
| 26 | * mouse-sel.el (mouse-sel-mode): | ||
| 27 | * emacs-lisp/lselect.el: Adjust to new names for | ||
| 28 | x-(lost|sent)-selection-functions. | ||
| 29 | |||
| 30 | * subr.el (x-lost-selection-hooks, x-sent-selection-hooks): | ||
| 31 | New obsolete aliases of x-lost-selection-functions and | ||
| 32 | x-sent-selection-functions. | ||
| 33 | |||
| 34 | 2004-10-28 Kim F. Storm <storm@cua.dk> | ||
| 35 | |||
| 36 | * imenu.el (imenu-scanning-message): Remove. | ||
| 37 | (imenu-progress-message): Make it a no-op. | ||
| 38 | |||
| 39 | 2004-10-28 John Paul Wallington <jpw@gnu.org> | ||
| 40 | |||
| 41 | * files.el (set-auto-mode): Call `throw' correctly. | ||
| 42 | |||
| 43 | 2004-10-28 Juri Linkov <juri@jurta.org> | ||
| 44 | |||
| 45 | * info.el (Info-file-list-for-emacs): Add ("Info" . "info") | ||
| 46 | to search `Info-...' commands in `info' manual. | ||
| 47 | (Info-goto-emacs-command-node, Info-goto-emacs-key-command-node): | ||
| 48 | Add 'info-file "emacs" property. | ||
| 49 | (Info-find-emacs-command-nodes): Fix index line number regexp. | ||
| 50 | Set real line number (instead of fake 0) in first element of the | ||
| 51 | returned list. | ||
| 52 | (Info-goto-emacs-command-node): Use line number of first element | ||
| 53 | to set point in the first found Info node. | ||
| 54 | |||
| 55 | * progmodes/grep.el (grep-regexp-alist): Move match highlighting | ||
| 56 | code to `grep-mode-font-lock-keywords'. | ||
| 57 | (grep-mode-font-lock-keywords): Delete grep markers instead | ||
| 58 | of making them invisible. | ||
| 59 | |||
| 60 | 2004-10-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 61 | |||
| 62 | * mail/emacsbug.el (report-emacs-bug): Insert x-server-vendor | ||
| 63 | and x-server-version in bug report. | ||
| 64 | |||
| 65 | 2004-10-28 Daniel Pfeiffer <occitan@esperanto.org> | ||
| 66 | |||
| 67 | * files.el (set-auto-mode-0): New function. | ||
| 68 | (set-auto-mode): Use it to handle aliased modes and to | ||
| 69 | be consistent between C-x C-f and C-x C-w. | ||
| 70 | |||
| 71 | 2004-10-28 Kenichi Handa <handa@m17n.org> | ||
| 72 | |||
| 73 | * international/utf-8.el (utf-translate-cjk-charsets): Add | ||
| 74 | katakana-jisx0201. | ||
| 75 | |||
| 76 | * international/subst-jis.el: Add data for JISX0201. | ||
| 77 | |||
| 78 | 2004-10-27 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 79 | |||
| 80 | * obsolete/hilit19.el (hilit-mode): New function. | ||
| 81 | Move all the toplevel side-effecting stuff into it, so that loading | ||
| 82 | hilit19 doesn't mess everything up any more. | ||
| 83 | |||
| 84 | 2004-10-27 Richard M. Stallman <rms@gnu.org> | ||
| 85 | |||
| 86 | * add-log.el (add-change-log-entry): Set up mailing address | ||
| 87 | and full name later, and don't alter add-log-mailing-address | ||
| 88 | or add-log-full-name. | ||
| 89 | |||
| 90 | * elide-head.el (elide-head): Change error to message. | ||
| 91 | (elide-head-show): Likewise. | ||
| 92 | |||
| 93 | * apropos.el (apropos-macrop): Doc fix. | ||
| 94 | |||
| 95 | * mouse.el (mouse-show-mark): Do most processing the same | ||
| 96 | regardless of transient-mark-mode. | ||
| 97 | |||
| 98 | * shadowfile.el (shadow-copy-files): Use interactive-p | ||
| 99 | only to control whether to print a message. | ||
| 100 | |||
| 101 | * tar-mode.el (tar-mode): Use write-contents-functions, | ||
| 102 | not write-contents-hooks. | ||
| 103 | |||
| 104 | * eshell/em-unix.el (eshell-du-sum-directory): Don't use | ||
| 105 | directory-sep-char. | ||
| 106 | |||
| 107 | 2004-10-27 Richard M. Stallman <rms@gnu.org> | ||
| 108 | |||
| 109 | * strokes.el (strokes-unload-hook): Fix previous change. | ||
| 110 | |||
| 111 | * type-break.el (type-break-run-at-time): Always use run-at-time; | ||
| 112 | forget the alternatives. | ||
| 113 | (type-break-cancel-function-timers): Always use cancel-function-timers; | ||
| 114 | forget the alternatives. | ||
| 115 | |||
| 116 | * pcomplete.el (pcomplete-entries): Don't use directory-sep-char. | ||
| 117 | |||
| 118 | 2004-10-27 Kenichi Handa <handa@m17n.org> | ||
| 119 | |||
| 120 | * international/subst-jis.el: Use utf-translate-cjk-substitutable-p. | ||
| 121 | |||
| 122 | * international/subst-gb2312.el: Likewise. | ||
| 123 | |||
| 124 | * international/subst-big5.el: Likewise. | ||
| 125 | |||
| 126 | * international/subst-ksc.el: Likewise. | ||
| 127 | |||
| 128 | * international/utf-8.el (utf-translate-cjk-unicode-range-string): | ||
| 129 | New variable. | ||
| 130 | (utf-translate-cjk-set-unicode-range): New function. | ||
| 131 | (utf-translate-cjk-unicode-range): Make it customizable. | ||
| 132 | (utf-8-post-read-conversion): | ||
| 133 | Use utf-translate-cjk-unicode-range-string. | ||
| 134 | (ccl-decode-mule-utf-8): Check utf-subst-table-for-decode for more | ||
| 135 | Unicode ranges. | ||
| 136 | |||
| 137 | 2004-10-26 Daniel Pfeiffer <occitan@esperanto.org> | ||
| 138 | |||
| 139 | * files.el (auto-mode-alist): Add pod, js, xbm and xpm and group | ||
| 140 | trivial variants to shorten the list. | ||
| 141 | (xml-based-modes): New var. | ||
| 142 | (set-auto-mode): Give interpreter-mode-alist or <?xml or <!DOCTYPE | ||
| 143 | declaration higher priority than auto-mode-alist. | ||
| 144 | |||
| 145 | * find-file.el (cc-other-file-alist): Bring it in line with | ||
| 146 | cc-mode's auto-mode-alist entries and use \' instead of $. | ||
| 147 | |||
| 148 | * textmodes/sgml-mode.el (sgml-mode): Fix imenu-generic-expression | ||
| 149 | and add "Id" and "Name" submenus to it. | ||
| 150 | |||
| 151 | * imenu.el (imenu--generic-function): Skip matches in comments. | ||
| 152 | |||
| 153 | 2004-10-26 Jay Belanger <belanger@truman.edu> | ||
| 154 | |||
| 155 | * calc/calc.el (calc,full-calc, calc-quit, calc-keypad) | ||
| 156 | (full-calc-keypad, calc-trail-display): Use an extra argument | ||
| 157 | instead of `interactive-p'. | ||
| 158 | |||
| 159 | * calc/calc-misc.el (calc-other-window): Use an extra argument | ||
| 160 | instead of `interactive-p'. | ||
| 161 | |||
| 162 | * calc/calc-rewr.el (calc-match): Use an extra argument instead of | ||
| 163 | `interactive-p'. | ||
| 164 | |||
| 165 | 2004-10-26 Kim F. Storm <storm@cua.dk> | ||
| 166 | |||
| 167 | * help.el (describe-key): Describe both down-event and up-event | ||
| 168 | for a mouse click. | ||
| 169 | |||
| 170 | 2004-10-26 Richard M. Stallman <rms@gnu.org> | ||
| 171 | |||
| 172 | * woman.el (woman): Don't call interactive-p. | ||
| 173 | |||
| 174 | * pcomplete.el (pcomplete): Instead of interactive-p, | ||
| 175 | use an arg set non-nil by the interactive spec. | ||
| 176 | |||
| 177 | * menu-bar.el (menu-bar-make-toggle): Instead of interactive-p, | ||
| 178 | use an arg set non-nil by the interactive spec. | ||
| 179 | |||
| 180 | * man.el (Man-cleanup-manpage): Instead of interactive-p, | ||
| 181 | use an arg set non-nil by the interactive spec. | ||
| 182 | |||
| 183 | 2004-10-26 Pavel Kobiakov <pk_at_work@yahoo.com> | ||
| 184 | |||
| 185 | * progmodes/flymake.el (flymake-split-string): | ||
| 186 | Use `flymake-split-string-remove-empty-edges' in any case. | ||
| 187 | |||
| 188 | 2004-10-26 Masatake YAMATO <jet@gyve.org> | ||
| 189 | |||
| 190 | * progmodes/flymake.el (flymake-err-line-patterns): | ||
| 191 | Use `compilation-error-regexp-alist-alist' instead of | ||
| 192 | `compilation-error-regexp-alist'. | ||
| 193 | |||
| 194 | 2004-10-25 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 195 | |||
| 196 | * textmodes/tex-mode.el (tex-font-lock-keywords-1): Fix up the spurious | ||
| 197 | verbatim face on the \ of \end{verbatim}. | ||
| 198 | |||
| 199 | 2004-10-25 Jay Belanger <belanger@truman.edu> | ||
| 200 | |||
| 201 | * calc/calc-incom.el (calc-digit-dots): Inhibit read-only before | ||
| 202 | erasing minibuffer. | ||
| 203 | |||
| 204 | 2004-10-25 Simon Josefsson <jas@extundo.com> | ||
| 205 | |||
| 206 | * subr.el (read-passwd): Move to net/password.el. | ||
| 207 | |||
| 208 | * net/password.el (read-passwd): Add. Autoload it. | ||
| 209 | |||
| 210 | 2004-10-25 Kai Grossjohann <kai.grossjohann@gmx.net> | ||
| 211 | |||
| 212 | * mouse-sel.el (mouse-sel-mode): Specify custom group. | ||
| 213 | |||
| 214 | * simple.el (process-file): Fix logic. | ||
| 215 | |||
| 1 | 2004-10-24 Luc Teirlinck <teirllm@auburn.edu> | 216 | 2004-10-24 Luc Teirlinck <teirllm@auburn.edu> |
| 2 | 217 | ||
| 3 | * indent.el (set-left-margin, set-right-margin): Delete redundant | 218 | * indent.el (set-left-margin, set-right-margin): Delete redundant code. |
| 4 | code. | ||
| 5 | (increase-right-margin): Remove erroneous call to `interactive-p'. | 219 | (increase-right-margin): Remove erroneous call to `interactive-p'. |
| 6 | 220 | ||
| 7 | 2004-10-24 Kim F. Storm <storm@cua.dk> | 221 | 2004-10-24 Kim F. Storm <storm@cua.dk> |
| @@ -22,24 +236,23 @@ | |||
| 22 | 236 | ||
| 23 | 2004-10-24 Masatake YAMATO <jet@gyve.org> | 237 | 2004-10-24 Masatake YAMATO <jet@gyve.org> |
| 24 | 238 | ||
| 25 | * progmodes/gdb-ui.el (gdb-assembler-font-lock-keywords): Handle | 239 | * progmodes/gdb-ui.el (gdb-assembler-font-lock-keywords): |
| 26 | periods and underscores in a function name. | 240 | Handle periods and underscores in a function name. |
| 27 | Remove the address fontification. | 241 | Remove the address fontification. |
| 28 | 242 | ||
| 29 | 2004-10-24 Masatake YAMATO <jet@gyve.org> | 243 | 2004-10-24 Masatake YAMATO <jet@gyve.org> |
| 30 | 244 | ||
| 31 | * progmodes/asm-mode.el (asm-font-lock-keywords): Use | 245 | * progmodes/asm-mode.el (asm-font-lock-keywords): |
| 32 | font-lock-variable-name-face for registers. | 246 | Use font-lock-variable-name-face for registers. |
| 33 | 247 | ||
| 34 | 2004-10-24 Nick Roberts <nickrob@snap.net.nz> | 248 | 2004-10-24 Nick Roberts <nickrob@snap.net.nz> |
| 35 | 249 | ||
| 36 | * progmodes/gdb-ui.el (gdb-get-create-buffer): Allow modes to run | 250 | * progmodes/gdb-ui.el (gdb-get-create-buffer): Allow modes to run |
| 37 | kill-all-local-variables. | 251 | kill-all-local-variables. |
| 38 | (gdb-breakpoints-mode, gdb-frames-mode, gdb-threads-mode) | 252 | (gdb-breakpoints-mode, gdb-frames-mode, gdb-threads-mode) |
| 39 | (gdb-registers-mode, gdb-locals-mode, gdb-assembler-mode): Use | 253 | (gdb-registers-mode, gdb-locals-mode, gdb-assembler-mode): |
| 40 | kill-all-local-variables and provide mode-hooks. | 254 | Use kill-all-local-variables and provide mode-hooks. |
| 41 | (gdb-assembler-font-lock-keywords): New font lock keywords | 255 | (gdb-assembler-font-lock-keywords): New font lock keywords definition. |
| 42 | definition. | ||
| 43 | (gdb-assembler-mode): Use 'gdb-assembler-font-lock-keywords'. | 256 | (gdb-assembler-mode): Use 'gdb-assembler-font-lock-keywords'. |
| 44 | Suggested by Masatake YAMATO <jet@gyve.org>. | 257 | Suggested by Masatake YAMATO <jet@gyve.org>. |
| 45 | 258 | ||
| @@ -84,13 +297,16 @@ | |||
| 84 | 2004-10-21 Jay Belanger <belanger@truman.edu> | 297 | 2004-10-21 Jay Belanger <belanger@truman.edu> |
| 85 | 298 | ||
| 86 | * calc/calc-aent.el (calc-alg-ent-map, calc-alg-ent-esc-map): | 299 | * calc/calc-aent.el (calc-alg-ent-map, calc-alg-ent-esc-map): |
| 87 | Declared these variables with defvar. | 300 | Declare these variables with defvar. |
| 88 | 301 | ||
| 89 | * calc/calc-aent.el (calc-do-alg-entry): Since `calc-alg-ent-map' | 302 | * calc/calc-aent.el (calc-do-alg-entry): Since `calc-alg-ent-map' |
| 90 | is bound, only check to see if it is bound. | 303 | is bound, only check to see if it is bound. |
| 91 | 304 | ||
| 92 | 2004-10-21 Stefan Monnier <monnier@iro.umontreal.ca> | 305 | 2004-10-21 Stefan Monnier <monnier@iro.umontreal.ca> |
| 93 | 306 | ||
| 307 | * textmodes/tex-mode.el (tex-compilation-parse-errors): | ||
| 308 | Don't output messages. | ||
| 309 | |||
| 94 | * calc/calc-help.el (calc-describe-bindings): Fix last change. | 310 | * calc/calc-help.el (calc-describe-bindings): Fix last change. |
| 95 | 311 | ||
| 96 | 2004-10-21 John Paul Wallington <jpw@gnu.org> | 312 | 2004-10-21 John Paul Wallington <jpw@gnu.org> |
diff --git a/lisp/add-log.el b/lisp/add-log.el index 26faea2ddc3..ae135b2bfb3 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el | |||
| @@ -471,20 +471,6 @@ Today's date is calculated according to `change-log-time-zone-rule' if | |||
| 471 | non-nil, otherwise in local time." | 471 | non-nil, otherwise in local time." |
| 472 | (interactive (list current-prefix-arg | 472 | (interactive (list current-prefix-arg |
| 473 | (prompt-for-change-log-name))) | 473 | (prompt-for-change-log-name))) |
| 474 | (or add-log-full-name | ||
| 475 | (setq add-log-full-name (user-full-name))) | ||
| 476 | (or add-log-mailing-address | ||
| 477 | (setq add-log-mailing-address user-mail-address)) | ||
| 478 | (if whoami | ||
| 479 | (progn | ||
| 480 | (setq add-log-full-name (read-input "Full name: " add-log-full-name)) | ||
| 481 | ;; Note that some sites have room and phone number fields in | ||
| 482 | ;; full name which look silly when inserted. Rather than do | ||
| 483 | ;; anything about that here, let user give prefix argument so that | ||
| 484 | ;; s/he can edit the full name field in prompter if s/he wants. | ||
| 485 | (setq add-log-mailing-address | ||
| 486 | (read-input "Mailing address: " add-log-mailing-address)))) | ||
| 487 | |||
| 488 | (let* ((defun (add-log-current-defun)) | 474 | (let* ((defun (add-log-current-defun)) |
| 489 | (version (and change-log-version-info-enabled | 475 | (version (and change-log-version-info-enabled |
| 490 | (change-log-version-number-search))) | 476 | (change-log-version-number-search))) |
| @@ -495,7 +481,19 @@ non-nil, otherwise in local time." | |||
| 495 | (file-name (expand-file-name (find-change-log file-name buffer-file))) | 481 | (file-name (expand-file-name (find-change-log file-name buffer-file))) |
| 496 | ;; Set ITEM to the file name to use in the new item. | 482 | ;; Set ITEM to the file name to use in the new item. |
| 497 | (item (add-log-file-name buffer-file file-name)) | 483 | (item (add-log-file-name buffer-file file-name)) |
| 498 | bound) | 484 | bound |
| 485 | (full-name (or add-log-full-name (user-full-name))) | ||
| 486 | (mailing-address (or add-log-mailing-address user-mail-address))) | ||
| 487 | |||
| 488 | (if whoami | ||
| 489 | (progn | ||
| 490 | (setq full-name (read-input "Full name: " full-name)) | ||
| 491 | ;; Note that some sites have room and phone number fields in | ||
| 492 | ;; full name which look silly when inserted. Rather than do | ||
| 493 | ;; anything about that here, let user give prefix argument so that | ||
| 494 | ;; s/he can edit the full name field in prompter if s/he wants. | ||
| 495 | (setq mailing-address | ||
| 496 | (read-input "Mailing address: " mailing-address)))) | ||
| 499 | 497 | ||
| 500 | (unless (equal file-name buffer-file-name) | 498 | (unless (equal file-name buffer-file-name) |
| 501 | (if (or other-window (window-dedicated-p (selected-window))) | 499 | (if (or other-window (window-dedicated-p (selected-window))) |
| @@ -515,11 +513,11 @@ non-nil, otherwise in local time." | |||
| 515 | ;; Advance into first entry if it is usable; else make new one. | 513 | ;; Advance into first entry if it is usable; else make new one. |
| 516 | (let ((new-entries (mapcar (lambda (addr) | 514 | (let ((new-entries (mapcar (lambda (addr) |
| 517 | (concat (funcall add-log-time-format) | 515 | (concat (funcall add-log-time-format) |
| 518 | " " add-log-full-name | 516 | " " full-name |
| 519 | " <" addr ">")) | 517 | " <" addr ">")) |
| 520 | (if (consp add-log-mailing-address) | 518 | (if (consp mailing-address) |
| 521 | add-log-mailing-address | 519 | mailing-address |
| 522 | (list add-log-mailing-address))))) | 520 | (list mailing-address))))) |
| 523 | (if (and (not add-log-always-start-new-record) | 521 | (if (and (not add-log-always-start-new-record) |
| 524 | (let ((hit nil)) | 522 | (let ((hit nil)) |
| 525 | (dolist (entry new-entries hit) | 523 | (dolist (entry new-entries hit) |
diff --git a/lisp/apropos.el b/lisp/apropos.el index e5904e73b71..8bfaa3ad592 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el | |||
| @@ -875,7 +875,7 @@ If non-nil TEXT is a string that will be printed as a heading." | |||
| 875 | 875 | ||
| 876 | 876 | ||
| 877 | (defun apropos-macrop (symbol) | 877 | (defun apropos-macrop (symbol) |
| 878 | "T if SYMBOL is a Lisp macro." | 878 | "Return t if SYMBOL is a Lisp macro." |
| 879 | (and (fboundp symbol) | 879 | (and (fboundp symbol) |
| 880 | (consp (setq symbol | 880 | (consp (setq symbol |
| 881 | (symbol-function symbol))) | 881 | (symbol-function symbol))) |
diff --git a/lisp/calc/calc-incom.el b/lisp/calc/calc-incom.el index b8bb7ab4f9a..7dc7f08b4bd 100644 --- a/lisp/calc/calc-incom.el +++ b/lisp/calc/calc-incom.el | |||
| @@ -183,7 +183,8 @@ | |||
| 183 | (if calc-prev-prev-char | 183 | (if calc-prev-prev-char |
| 184 | (calcDigit-nondigit) | 184 | (calcDigit-nondigit) |
| 185 | (setq calc-digit-value nil) | 185 | (setq calc-digit-value nil) |
| 186 | (erase-buffer) | 186 | (let ((inhibit-read-only t)) |
| 187 | (erase-buffer)) | ||
| 187 | (exit-minibuffer))) | 188 | (exit-minibuffer))) |
| 188 | ;; just ignore extra decimal point, anticipating ".." | 189 | ;; just ignore extra decimal point, anticipating ".." |
| 189 | (delete-backward-char 1))) | 190 | (delete-backward-char 1))) |
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index c01d37e6848..159b1ee3178 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el | |||
| @@ -130,9 +130,9 @@ Calc user interface as before (either M-# C or M-# K; initially M-# C)." | |||
| 130 | "Now using full screen for Calc" | 130 | "Now using full screen for Calc" |
| 131 | "Now using partial screen for Calc")))) | 131 | "Now using partial screen for Calc")))) |
| 132 | 132 | ||
| 133 | (defun calc-other-window () | 133 | (defun calc-other-window (&optional interactive) |
| 134 | "Invoke the Calculator in another window." | 134 | "Invoke the Calculator in another window." |
| 135 | (interactive) | 135 | (interactive "p") |
| 136 | (if (memq major-mode '(calc-mode calc-trail-mode)) | 136 | (if (memq major-mode '(calc-mode calc-trail-mode)) |
| 137 | (progn | 137 | (progn |
| 138 | (other-window 1) | 138 | (other-window 1) |
| @@ -141,7 +141,7 @@ Calc user interface as before (either M-# C or M-# K; initially M-# C)." | |||
| 141 | (if (get-buffer-window "*Calculator*") | 141 | (if (get-buffer-window "*Calculator*") |
| 142 | (calc-quit) | 142 | (calc-quit) |
| 143 | (let ((win (selected-window))) | 143 | (let ((win (selected-window))) |
| 144 | (calc nil win (interactive-p)))))) | 144 | (calc nil win interactive))))) |
| 145 | 145 | ||
| 146 | (defun another-calc () | 146 | (defun another-calc () |
| 147 | "Create another, independent Calculator buffer." | 147 | "Create another, independent Calculator buffer." |
diff --git a/lisp/calc/calc-rewr.el b/lisp/calc/calc-rewr.el index 51cffb753fc..47b48bd88d8 100644 --- a/lisp/calc/calc-rewr.el +++ b/lisp/calc/calc-rewr.el | |||
| @@ -143,15 +143,15 @@ | |||
| 143 | (calc-pop-push-record-list n "rwrt" (list expr))) | 143 | (calc-pop-push-record-list n "rwrt" (list expr))) |
| 144 | (calc-handle-whys))) | 144 | (calc-handle-whys))) |
| 145 | 145 | ||
| 146 | (defun calc-match (pat) | 146 | (defun calc-match (pat &optional interactive) |
| 147 | (interactive "sPattern: \n") | 147 | (interactive "sPattern: \np") |
| 148 | (calc-slow-wrapper | 148 | (calc-slow-wrapper |
| 149 | (let (n expr) | 149 | (let (n expr) |
| 150 | (if (or (null pat) (equal pat "") (equal pat "$")) | 150 | (if (or (null pat) (equal pat "") (equal pat "$")) |
| 151 | (setq expr (calc-top-n 2) | 151 | (setq expr (calc-top-n 2) |
| 152 | pat (calc-top-n 1) | 152 | pat (calc-top-n 1) |
| 153 | n 2) | 153 | n 2) |
| 154 | (if (interactive-p) (setq calc-previous-alg-entry pat)) | 154 | (if interactive (setq calc-previous-alg-entry pat)) |
| 155 | (setq pat (if (stringp pat) (math-read-expr pat) pat)) | 155 | (setq pat (if (stringp pat) (math-read-expr pat) pat)) |
| 156 | (if (eq (car-safe pat) 'error) | 156 | (if (eq (car-safe pat) 'error) |
| 157 | (error "Bad format in expression: %s" (nth 1 pat))) | 157 | (error "Bad format in expression: %s" (nth 1 pat))) |
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index c1669f78f08..4ace5fb6780 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el | |||
| @@ -1142,7 +1142,7 @@ commands given here will actually operate on the *Calculator* stack." | |||
| 1142 | ;;;###autoload | 1142 | ;;;###autoload |
| 1143 | (defun calc (&optional arg full-display interactive) | 1143 | (defun calc (&optional arg full-display interactive) |
| 1144 | "The Emacs Calculator. Full documentation is listed under \"calc-mode\"." | 1144 | "The Emacs Calculator. Full documentation is listed under \"calc-mode\"." |
| 1145 | (interactive "P") | 1145 | (interactive "P\ni\np") |
| 1146 | (if arg | 1146 | (if arg |
| 1147 | (unless (eq arg 0) | 1147 | (unless (eq arg 0) |
| 1148 | (calc-extensions) | 1148 | (calc-extensions) |
| @@ -1188,17 +1188,16 @@ commands given here will actually operate on the *Calculator* stack." | |||
| 1188 | (window-point full-display) | 1188 | (window-point full-display) |
| 1189 | (select-window full-display)) | 1189 | (select-window full-display)) |
| 1190 | (calc-check-defines) | 1190 | (calc-check-defines) |
| 1191 | (when (and calc-said-hello | 1191 | (when (and calc-said-hello interactive) |
| 1192 | (or (interactive-p) interactive)) | ||
| 1193 | (sit-for 2) | 1192 | (sit-for 2) |
| 1194 | (message "")) | 1193 | (message "")) |
| 1195 | (setq calc-said-hello t))))) | 1194 | (setq calc-said-hello t))))) |
| 1196 | 1195 | ||
| 1197 | ;;;###autoload | 1196 | ;;;###autoload |
| 1198 | (defun full-calc () | 1197 | (defun full-calc (&optional interactive) |
| 1199 | "Invoke the Calculator and give it a full-sized window." | 1198 | "Invoke the Calculator and give it a full-sized window." |
| 1200 | (interactive) | 1199 | (interactive "p") |
| 1201 | (calc nil t (interactive-p))) | 1200 | (calc nil t interactive)) |
| 1202 | 1201 | ||
| 1203 | (defun calc-same-interface (arg) | 1202 | (defun calc-same-interface (arg) |
| 1204 | "Invoke the Calculator using the most recent interface (calc or calc-keypad)." | 1203 | "Invoke the Calculator using the most recent interface (calc or calc-keypad)." |
| @@ -1215,8 +1214,8 @@ commands given here will actually operate on the *Calculator* stack." | |||
| 1215 | (calc arg calc-full-mode t)))))) | 1214 | (calc arg calc-full-mode t)))))) |
| 1216 | 1215 | ||
| 1217 | 1216 | ||
| 1218 | (defun calc-quit (&optional non-fatal) | 1217 | (defun calc-quit (&optional non-fatal interactive) |
| 1219 | (interactive) | 1218 | (interactive "i\np") |
| 1220 | (and calc-standalone-flag (not non-fatal) | 1219 | (and calc-standalone-flag (not non-fatal) |
| 1221 | (save-buffers-kill-emacs nil)) | 1220 | (save-buffers-kill-emacs nil)) |
| 1222 | (if (and (equal (buffer-name) "*Gnuplot Trail*") | 1221 | (if (and (equal (buffer-name) "*Gnuplot Trail*") |
| @@ -1226,7 +1225,7 @@ commands given here will actually operate on the *Calculator* stack." | |||
| 1226 | (calc-edit-cancel) | 1225 | (calc-edit-cancel) |
| 1227 | (if (eq major-mode 'MacEdit-mode) | 1226 | (if (eq major-mode 'MacEdit-mode) |
| 1228 | (MacEdit-cancel-edit) | 1227 | (MacEdit-cancel-edit) |
| 1229 | (if (and (interactive-p) | 1228 | (if (and interactive |
| 1230 | calc-embedded-info | 1229 | calc-embedded-info |
| 1231 | (eq (current-buffer) (aref calc-embedded-info 0))) | 1230 | (eq (current-buffer) (aref calc-embedded-info 0))) |
| 1232 | (calc-embedded nil) | 1231 | (calc-embedded nil) |
| @@ -1266,22 +1265,22 @@ or a list containing a character position and an error message in string form." | |||
| 1266 | (calc-do-calc-eval str separator args)) | 1265 | (calc-do-calc-eval str separator args)) |
| 1267 | 1266 | ||
| 1268 | ;;;###autoload | 1267 | ;;;###autoload |
| 1269 | (defun calc-keypad () | 1268 | (defun calc-keypad (&optional interactive) |
| 1270 | "Invoke the Calculator in \"visual keypad\" mode. | 1269 | "Invoke the Calculator in \"visual keypad\" mode. |
| 1271 | This is most useful in the X window system. | 1270 | This is most useful in the X window system. |
| 1272 | In this mode, click on the Calc \"buttons\" using the left mouse button. | 1271 | In this mode, click on the Calc \"buttons\" using the left mouse button. |
| 1273 | Or, position the cursor manually and do M-x calc-keypad-press." | 1272 | Or, position the cursor manually and do M-x calc-keypad-press." |
| 1274 | (interactive) | 1273 | (interactive "p") |
| 1275 | (calc-extensions) | 1274 | (calc-extensions) |
| 1276 | (calc-do-keypad calc-full-mode (interactive-p))) | 1275 | (calc-do-keypad calc-full-mode interactive)) |
| 1277 | 1276 | ||
| 1278 | ;;;###autoload | 1277 | ;;;###autoload |
| 1279 | (defun full-calc-keypad () | 1278 | (defun full-calc-keypad (&optional interactive) |
| 1280 | "Invoke the Calculator in full-screen \"visual keypad\" mode. | 1279 | "Invoke the Calculator in full-screen \"visual keypad\" mode. |
| 1281 | See calc-keypad for details." | 1280 | See calc-keypad for details." |
| 1282 | (interactive) | 1281 | (interactive "p") |
| 1283 | (calc-extensions) | 1282 | (calc-extensions) |
| 1284 | (calc-do-keypad t (interactive-p))) | 1283 | (calc-do-keypad t interactive)) |
| 1285 | 1284 | ||
| 1286 | 1285 | ||
| 1287 | (defvar calc-aborted-prefix nil) | 1286 | (defvar calc-aborted-prefix nil) |
| @@ -1802,8 +1801,8 @@ If mouse is pressed in Calc window, push cut buffer contents onto the stack." | |||
| 1802 | val) | 1801 | val) |
| 1803 | 1802 | ||
| 1804 | 1803 | ||
| 1805 | (defun calc-trail-display (flag &optional no-refresh) | 1804 | (defun calc-trail-display (flag &optional no-refresh interactive) |
| 1806 | (interactive "P") | 1805 | (interactive "P\ni\np") |
| 1807 | (let ((win (get-buffer-window (calc-trail-buffer)))) | 1806 | (let ((win (get-buffer-window (calc-trail-buffer)))) |
| 1808 | (if (setq calc-display-trail | 1807 | (if (setq calc-display-trail |
| 1809 | (not (if flag (memq flag '(nil 0)) win))) | 1808 | (not (if flag (memq flag '(nil 0)) win))) |
| @@ -1817,7 +1816,7 @@ If mouse is pressed in Calc window, push cut buffer contents onto the stack." | |||
| 1817 | (setq overlay-arrow-string calc-trail-overlay | 1816 | (setq overlay-arrow-string calc-trail-overlay |
| 1818 | overlay-arrow-position calc-trail-pointer) | 1817 | overlay-arrow-position calc-trail-pointer) |
| 1819 | (or no-refresh | 1818 | (or no-refresh |
| 1820 | (if (interactive-p) | 1819 | (if interactive |
| 1821 | (calc-do-refresh) | 1820 | (calc-do-refresh) |
| 1822 | (calc-refresh)))))) | 1821 | (calc-refresh)))))) |
| 1823 | (if win | 1822 | (if win |
| @@ -1825,7 +1824,7 @@ If mouse is pressed in Calc window, push cut buffer contents onto the stack." | |||
| 1825 | (delete-window win) | 1824 | (delete-window win) |
| 1826 | (calc-wrapper | 1825 | (calc-wrapper |
| 1827 | (or no-refresh | 1826 | (or no-refresh |
| 1828 | (if (interactive-p) | 1827 | (if interactive |
| 1829 | (calc-do-refresh) | 1828 | (calc-do-refresh) |
| 1830 | (calc-refresh)))))))) | 1829 | (calc-refresh)))))))) |
| 1831 | calc-trail-buffer) | 1830 | calc-trail-buffer) |
diff --git a/lisp/elide-head.el b/lisp/elide-head.el index 8fc8e12a3fb..fed6ecee7af 100644 --- a/lisp/elide-head.el +++ b/lisp/elide-head.el | |||
| @@ -98,7 +98,7 @@ This is suitable as an entry on `find-file-hook' or appropriate mode hooks." | |||
| 98 | (if rest (setq rest (cdr rest)))) | 98 | (if rest (setq rest (cdr rest)))) |
| 99 | (if (not (and beg end)) | 99 | (if (not (and beg end)) |
| 100 | (if (interactive-p) | 100 | (if (interactive-p) |
| 101 | (error "No header found")) | 101 | (message "No header found")) |
| 102 | (goto-char beg) | 102 | (goto-char beg) |
| 103 | (end-of-line) | 103 | (end-of-line) |
| 104 | (if (overlayp elide-head-overlay) | 104 | (if (overlayp elide-head-overlay) |
| @@ -115,7 +115,7 @@ This is suitable as an entry on `find-file-hook' or appropriate mode hooks." | |||
| 115 | (overlay-buffer elide-head-overlay)) | 115 | (overlay-buffer elide-head-overlay)) |
| 116 | (delete-overlay elide-head-overlay) | 116 | (delete-overlay elide-head-overlay) |
| 117 | (if (interactive-p) | 117 | (if (interactive-p) |
| 118 | (error "No header hidden")))) | 118 | (message "No header hidden")))) |
| 119 | 119 | ||
| 120 | (provide 'elide-head) | 120 | (provide 'elide-head) |
| 121 | 121 | ||
diff --git a/lisp/emacs-lisp/lselect.el b/lisp/emacs-lisp/lselect.el index b292eefbaec..42dad0c48d8 100644 --- a/lisp/emacs-lisp/lselect.el +++ b/lisp/emacs-lisp/lselect.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; lselect.el --- Lucid interface to X Selections | 1 | ;;; lselect.el --- Lucid interface to X Selections |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1990, 1993 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1990, 1993, 2004 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Maintainer: FSF | 5 | ;; Maintainer: FSF |
| 6 | ;; Keywords: emulations | 6 | ;; Keywords: emulations |
| @@ -146,7 +146,7 @@ secondary selection instead of the primary selection." | |||
| 146 | (x-disown-selection-internal (if secondary-p 'SECONDARY 'PRIMARY))) | 146 | (x-disown-selection-internal (if secondary-p 'SECONDARY 'PRIMARY))) |
| 147 | 147 | ||
| 148 | (defun x-dehilight-selection (selection) | 148 | (defun x-dehilight-selection (selection) |
| 149 | "for use as a value of x-lost-selection-hooks." | 149 | "for use as a value of `x-lost-selection-functions'." |
| 150 | (cond ((eq selection 'PRIMARY) | 150 | (cond ((eq selection 'PRIMARY) |
| 151 | (if primary-selection-extent | 151 | (if primary-selection-extent |
| 152 | (let ((inhibit-quit t)) | 152 | (let ((inhibit-quit t)) |
| @@ -160,23 +160,23 @@ secondary selection instead of the primary selection." | |||
| 160 | (setq secondary-selection-extent nil))))) | 160 | (setq secondary-selection-extent nil))))) |
| 161 | nil) | 161 | nil) |
| 162 | 162 | ||
| 163 | (setq x-lost-selection-hooks 'x-dehilight-selection) | 163 | (setq x-lost-selection-functions 'x-dehilight-selection) |
| 164 | 164 | ||
| 165 | (defun x-notice-selection-requests (selection type successful) | 165 | (defun x-notice-selection-requests (selection type successful) |
| 166 | "for possible use as the value of x-sent-selection-hooks." | 166 | "for possible use as the value of `x-sent-selection-functions'." |
| 167 | (if (not successful) | 167 | (if (not successful) |
| 168 | (message "Selection request failed to convert %s to %s" | 168 | (message "Selection request failed to convert %s to %s" |
| 169 | selection type) | 169 | selection type) |
| 170 | (message "Sent selection %s as %s" selection type))) | 170 | (message "Sent selection %s as %s" selection type))) |
| 171 | 171 | ||
| 172 | (defun x-notice-selection-failures (selection type successful) | 172 | (defun x-notice-selection-failures (selection type successful) |
| 173 | "for possible use as the value of x-sent-selection-hooks." | 173 | "for possible use as the value of `x-sent-selection-functions'." |
| 174 | (or successful | 174 | (or successful |
| 175 | (message "Selection request failed to convert %s to %s" | 175 | (message "Selection request failed to convert %s to %s" |
| 176 | selection type))) | 176 | selection type))) |
| 177 | 177 | ||
| 178 | ;(setq x-sent-selection-hooks 'x-notice-selection-requests) | 178 | ;(setq x-sent-selection-functions 'x-notice-selection-requests) |
| 179 | ;(setq x-sent-selection-hooks 'x-notice-selection-failures) | 179 | ;(setq x-sent-selection-functions 'x-notice-selection-failures) |
| 180 | 180 | ||
| 181 | 181 | ||
| 182 | ;; Random utility functions | 182 | ;; Random utility functions |
| @@ -232,5 +232,5 @@ the kill ring or the Clipboard." | |||
| 232 | 232 | ||
| 233 | (provide 'lselect) | 233 | (provide 'lselect) |
| 234 | 234 | ||
| 235 | ;;; arch-tag: 92fa54d4-c5d1-4e9b-ad58-cf1e13930556 | 235 | ;; arch-tag: 92fa54d4-c5d1-4e9b-ad58-cf1e13930556 |
| 236 | ;;; lselect.el ends here | 236 | ;;; lselect.el ends here |
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index fb3c537936f..00411c8ca4c 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | ;;; cua-base.el --- emulate CUA key bindings | 1 | ;;; cua-base.el --- emulate CUA key bindings |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1997,98,99,200,01,02,03,04 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 |
| 4 | ;; Free Software Foundation, Inc. | ||
| 4 | 5 | ||
| 5 | ;; Author: Kim F. Storm <storm@cua.dk> | 6 | ;; Author: Kim F. Storm <storm@cua.dk> |
| 6 | ;; Keywords: keyboard emulation convenience cua | 7 | ;; Keywords: keyboard emulation convenience cua |
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index ce30cec6604..d932916d8c9 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el | |||
| @@ -799,7 +799,7 @@ external command." | |||
| 799 | (size 0.0)) | 799 | (size 0.0)) |
| 800 | (while entries | 800 | (while entries |
| 801 | (unless (string-match "\\`\\.\\.?\\'" (caar entries)) | 801 | (unless (string-match "\\`\\.\\.?\\'" (caar entries)) |
| 802 | (let* ((entry (concat path (char-to-string directory-sep-char) | 802 | (let* ((entry (concat path "/" |
| 803 | (caar entries))) | 803 | (caar entries))) |
| 804 | (symlink (and (stringp (cadr (car entries))) | 804 | (symlink (and (stringp (cadr (car entries))) |
| 805 | (cadr (car entries))))) | 805 | (cadr (car entries))))) |
diff --git a/lisp/files.el b/lisp/files.el index 7c06316a487..26f0ed608a2 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1645,41 +1645,35 @@ in that case, this function acts as if `enable-local-variables' were t." | |||
| 1645 | (mapc | 1645 | (mapc |
| 1646 | (lambda (elt) | 1646 | (lambda (elt) |
| 1647 | (cons (purecopy (car elt)) (cdr elt))) | 1647 | (cons (purecopy (car elt)) (cdr elt))) |
| 1648 | '(("\\.te?xt\\'" . text-mode) | 1648 | '(;; do this first, so that .html.pl is Polish html, not Perl |
| 1649 | ("\\.tex\\'" . tex-mode) | 1649 | ("\\.s?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode) |
| 1650 | ("\\.te?xt\\'" . text-mode) | ||
| 1651 | ("\\.[tT]e[xX]\\'" . tex-mode) | ||
| 1650 | ("\\.ins\\'" . tex-mode) ;Installation files for TeX packages. | 1652 | ("\\.ins\\'" . tex-mode) ;Installation files for TeX packages. |
| 1651 | ("\\.ltx\\'" . latex-mode) | 1653 | ("\\.ltx\\'" . latex-mode) |
| 1652 | ("\\.dtx\\'" . doctex-mode) | 1654 | ("\\.dtx\\'" . doctex-mode) |
| 1653 | ("\\.el\\'" . emacs-lisp-mode) | 1655 | ("\\.el\\'" . emacs-lisp-mode) |
| 1654 | ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode) | 1656 | ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode) |
| 1655 | ("\\.l\\'" . lisp-mode) | 1657 | ("\\.l\\'" . lisp-mode) |
| 1656 | ("\\.lisp\\'" . lisp-mode) | 1658 | ("\\.li?sp\\'" . lisp-mode) |
| 1657 | ("\\.f\\'" . fortran-mode) | 1659 | ("\\.[fF]\\'" . fortran-mode) |
| 1658 | ("\\.F\\'" . fortran-mode) | ||
| 1659 | ("\\.for\\'" . fortran-mode) | 1660 | ("\\.for\\'" . fortran-mode) |
| 1660 | ("\\.p\\'" . pascal-mode) | 1661 | ("\\.p\\'" . pascal-mode) |
| 1661 | ("\\.pas\\'" . pascal-mode) | 1662 | ("\\.pas\\'" . pascal-mode) |
| 1662 | ("\\.ad[abs]\\'" . ada-mode) | 1663 | ("\\.ad[abs]\\'" . ada-mode) |
| 1663 | ("\\.ad[bs].dg\\'" . ada-mode) | 1664 | ("\\.ad[bs].dg\\'" . ada-mode) |
| 1664 | ("\\.\\([pP]\\([Llm]\\|erl\\)\\|al\\)\\'" . perl-mode) | 1665 | ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode) |
| 1665 | ("\\.s?html?\\'" . html-mode) | ||
| 1666 | ("\\.mk\\'" . makefile-mode) | 1666 | ("\\.mk\\'" . makefile-mode) |
| 1667 | ("\\(M\\|m\\|GNUm\\)akefile\\'" . makefile-mode) | 1667 | ("\\([Mm]\\|GNUm\\)akep*file\\'" . makefile-mode) |
| 1668 | ("\\.am\\'" . makefile-mode) ;For Automake. | 1668 | ("\\.am\\'" . makefile-mode) ;For Automake. |
| 1669 | ;; Less common extensions come here | 1669 | ;; Less common extensions come here |
| 1670 | ;; so more common ones above are found faster. | 1670 | ;; so more common ones above are found faster. |
| 1671 | ("\\.texinfo\\'" . texinfo-mode) | 1671 | ("\\.texinfo\\'" . texinfo-mode) |
| 1672 | ("\\.te?xi\\'" . texinfo-mode) | 1672 | ("\\.te?xi\\'" . texinfo-mode) |
| 1673 | ("\\.s\\'" . asm-mode) | 1673 | ("\\.[sS]\\'" . asm-mode) |
| 1674 | ("\\.S\\'" . asm-mode) | ||
| 1675 | ("\\.asm\\'" . asm-mode) | 1674 | ("\\.asm\\'" . asm-mode) |
| 1676 | ("ChangeLog\\'" . change-log-mode) | 1675 | ("[cC]hange\\.?[lL]og?\\'" . change-log-mode) |
| 1677 | ("change\\.log\\'" . change-log-mode) | 1676 | ("[cC]hange[lL]og\\.[0-9]+\\'" . change-log-mode) |
| 1678 | ("changelo\\'" . change-log-mode) | ||
| 1679 | ("ChangeLog\\.[0-9]+\\'" . change-log-mode) | ||
| 1680 | ;; for MSDOS and MS-Windows (which are case-insensitive) | ||
| 1681 | ("changelog\\'" . change-log-mode) | ||
| 1682 | ("changelog\\.[0-9]+\\'" . change-log-mode) | ||
| 1683 | ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode) | 1677 | ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode) |
| 1684 | ("\\.scm\\.[0-9]*\\'" . scheme-mode) | 1678 | ("\\.scm\\.[0-9]*\\'" . scheme-mode) |
| 1685 | ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode) | 1679 | ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode) |
| @@ -1688,36 +1682,28 @@ in that case, this function acts as if `enable-local-variables' were t." | |||
| 1688 | ("\\(/\\|\\`\\)\\.\\(bash_logout\\|shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode) | 1682 | ("\\(/\\|\\`\\)\\.\\(bash_logout\\|shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode) |
| 1689 | ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode) | 1683 | ("\\(/\\|\\`\\)\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode) |
| 1690 | ("\\.m?spec\\'" . sh-mode) | 1684 | ("\\.m?spec\\'" . sh-mode) |
| 1691 | ("\\.mm\\'" . nroff-mode) | 1685 | ("\\.m[mes]\\'" . nroff-mode) |
| 1692 | ("\\.me\\'" . nroff-mode) | ||
| 1693 | ("\\.ms\\'" . nroff-mode) | ||
| 1694 | ("\\.man\\'" . nroff-mode) | 1686 | ("\\.man\\'" . nroff-mode) |
| 1695 | ("\\.TeX\\'" . tex-mode) | ||
| 1696 | ("\\.sty\\'" . latex-mode) | 1687 | ("\\.sty\\'" . latex-mode) |
| 1697 | ("\\.cls\\'" . latex-mode) ;LaTeX 2e class | 1688 | ("\\.cl[so]\\'" . latex-mode) ;LaTeX 2e class option |
| 1698 | ("\\.clo\\'" . latex-mode) ;LaTeX 2e class option | ||
| 1699 | ("\\.bbl\\'" . latex-mode) | 1689 | ("\\.bbl\\'" . latex-mode) |
| 1700 | ("\\.bib\\'" . bibtex-mode) | 1690 | ("\\.bib\\'" . bibtex-mode) |
| 1701 | ("\\.sql\\'" . sql-mode) | 1691 | ("\\.sql\\'" . sql-mode) |
| 1702 | ("\\.m4\\'" . m4-mode) | 1692 | ("\\.m[4c]\\'" . m4-mode) |
| 1703 | ("\\.mc\\'" . m4-mode) | ||
| 1704 | ("\\.mf\\'" . metafont-mode) | 1693 | ("\\.mf\\'" . metafont-mode) |
| 1705 | ("\\.mp\\'" . metapost-mode) | 1694 | ("\\.mp\\'" . metapost-mode) |
| 1706 | ("\\.vhdl?\\'" . vhdl-mode) | 1695 | ("\\.vhdl?\\'" . vhdl-mode) |
| 1707 | ("\\.article\\'" . text-mode) | 1696 | ("\\.article\\'" . text-mode) |
| 1708 | ("\\.letter\\'" . text-mode) | 1697 | ("\\.letter\\'" . text-mode) |
| 1709 | ("\\.tcl\\'" . tcl-mode) | 1698 | ("\\.i?tcl\\'" . tcl-mode) |
| 1710 | ("\\.exp\\'" . tcl-mode) | 1699 | ("\\.exp\\'" . tcl-mode) |
| 1711 | ("\\.itcl\\'" . tcl-mode) | ||
| 1712 | ("\\.itk\\'" . tcl-mode) | 1700 | ("\\.itk\\'" . tcl-mode) |
| 1713 | ("\\.icn\\'" . icon-mode) | 1701 | ("\\.icn\\'" . icon-mode) |
| 1714 | ("\\.sim\\'" . simula-mode) | 1702 | ("\\.sim\\'" . simula-mode) |
| 1715 | ("\\.mss\\'" . scribe-mode) | 1703 | ("\\.mss\\'" . scribe-mode) |
| 1716 | ("\\.f90\\'" . f90-mode) | 1704 | ("\\.f9[05]\\'" . f90-mode) |
| 1717 | ("\\.f95\\'" . f90-mode) | ||
| 1718 | ("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode | 1705 | ("\\.indent\\.pro\\'" . fundamental-mode) ; to avoid idlwave-mode |
| 1719 | ("\\.pro\\'" . idlwave-mode) | 1706 | ("\\.pro\\'" . idlwave-mode) |
| 1720 | ("\\.lsp\\'" . lisp-mode) | ||
| 1721 | ("\\.prolog\\'" . prolog-mode) | 1707 | ("\\.prolog\\'" . prolog-mode) |
| 1722 | ("\\.tar\\'" . tar-mode) | 1708 | ("\\.tar\\'" . tar-mode) |
| 1723 | ("\\.\\(arc\\|zip\\|lzh\\|zoo\\|ear\\|jar\\|war\\)\\'" . archive-mode) | 1709 | ("\\.\\(arc\\|zip\\|lzh\\|zoo\\|ear\\|jar\\|war\\)\\'" . archive-mode) |
| @@ -1733,10 +1719,11 @@ in that case, this function acts as if `enable-local-variables' were t." | |||
| 1733 | ("\\`/tmp/fol/" . text-mode) | 1719 | ("\\`/tmp/fol/" . text-mode) |
| 1734 | ("\\.oak\\'" . scheme-mode) | 1720 | ("\\.oak\\'" . scheme-mode) |
| 1735 | ("\\.sgml?\\'" . sgml-mode) | 1721 | ("\\.sgml?\\'" . sgml-mode) |
| 1736 | ("\\.xml\\'" . sgml-mode) | 1722 | ("\\.x[ms]l\\'" . xml-mode) |
| 1737 | ("\\.xsl\\'" . sgml-mode) | ||
| 1738 | ("\\.dtd\\'" . sgml-mode) | 1723 | ("\\.dtd\\'" . sgml-mode) |
| 1739 | ("\\.ds\\(ss\\)?l\\'" . dsssl-mode) | 1724 | ("\\.ds\\(ss\\)?l\\'" . dsssl-mode) |
| 1725 | ("\\.js\\'" . java-mode) ; javascript-mode would be better | ||
| 1726 | ("\\.x[bp]m\\'" . c-mode) | ||
| 1740 | ;; .emacs or .gnus or .viper following a directory delimiter in | 1727 | ;; .emacs or .gnus or .viper following a directory delimiter in |
| 1741 | ;; Unix, MSDOG or VMS syntax. | 1728 | ;; Unix, MSDOG or VMS syntax. |
| 1742 | ("[]>:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode) | 1729 | ("[]>:/\\]\\..*\\(emacs\\|gnus\\|viper\\)\\'" . emacs-lisp-mode) |
| @@ -1760,7 +1747,7 @@ in that case, this function acts as if `enable-local-variables' were t." | |||
| 1760 | ;; or .#<file>.<rev>-<rev> or VC's <file>.~<rev>~. | 1747 | ;; or .#<file>.<rev>-<rev> or VC's <file>.~<rev>~. |
| 1761 | ;; Using mode nil rather than `ignore' would let the search continue | 1748 | ;; Using mode nil rather than `ignore' would let the search continue |
| 1762 | ;; through this list (with the shortened name) rather than start over. | 1749 | ;; through this list (with the shortened name) rather than start over. |
| 1763 | ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" ignore t) | 1750 | ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t) |
| 1764 | ;; The following should come after the ChangeLog pattern | 1751 | ;; The following should come after the ChangeLog pattern |
| 1765 | ;; for the sake of ChangeLog.1, etc. | 1752 | ;; for the sake of ChangeLog.1, etc. |
| 1766 | ;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too. | 1753 | ;; and after the .scm.[0-9] and CVS' <file>.<rev> patterns too. |
| @@ -1849,12 +1836,20 @@ be interpreted by the interpreter matched by the second group of the | |||
| 1849 | regular expression. The mode is then determined as the mode associated | 1836 | regular expression. The mode is then determined as the mode associated |
| 1850 | with that interpreter in `interpreter-mode-alist'.") | 1837 | with that interpreter in `interpreter-mode-alist'.") |
| 1851 | 1838 | ||
| 1852 | (defun set-auto-mode (&optional just-from-file-name) | 1839 | (defvar xml-based-modes '(html-mode) |
| 1840 | "Modes that override an XML declaration. | ||
| 1841 | When `set-auto-mode' sees an <?xml or <!DOCTYPE declaration, that | ||
| 1842 | buffer will be in some XML mode. If `auto-mode-alist' associates | ||
| 1843 | the file with one of the modes in this list, that mode will be | ||
| 1844 | used. Else `xml-mode' or `sgml-mode' is used.") | ||
| 1845 | |||
| 1846 | (defun set-auto-mode (&optional keep-mode-if-same) | ||
| 1853 | "Select major mode appropriate for current buffer. | 1847 | "Select major mode appropriate for current buffer. |
| 1854 | This checks for a -*- mode tag in the buffer's text, | 1848 | This checks for a -*- mode tag in the buffer's text, checks the |
| 1855 | compares the filename against the entries in `auto-mode-alist', | 1849 | interpreter that runs this file against `interpreter-mode-alist', |
| 1856 | or checks the interpreter that runs this file against | 1850 | looks for an <?xml or <!DOCTYPE declaration (see |
| 1857 | `interpreter-mode-alist'. | 1851 | `xml-based-modes'), or compares the filename against the entries |
| 1852 | in `auto-mode-alist'. | ||
| 1858 | 1853 | ||
| 1859 | It does not check for the `mode:' local variable in the | 1854 | It does not check for the `mode:' local variable in the |
| 1860 | Local Variables section of the file; for that, use `hack-local-variables'. | 1855 | Local Variables section of the file; for that, use `hack-local-variables'. |
| @@ -1862,14 +1857,16 @@ Local Variables section of the file; for that, use `hack-local-variables'. | |||
| 1862 | If `enable-local-variables' is nil, this function does not check for a | 1857 | If `enable-local-variables' is nil, this function does not check for a |
| 1863 | -*- mode tag. | 1858 | -*- mode tag. |
| 1864 | 1859 | ||
| 1865 | If the optional argument JUST-FROM-FILE-NAME is non-nil, | 1860 | If the optional argument KEEP-MODE-IF-SAME is non-nil, then we |
| 1866 | then we do not set anything but the major mode, | 1861 | only set the major mode, if that would change it." |
| 1867 | and we don't even do that unless it would come from the file name." | ||
| 1868 | ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*- | 1862 | ;; Look for -*-MODENAME-*- or -*- ... mode: MODENAME; ... -*- |
| 1869 | (let (end done modes) | 1863 | (let (end done mode modes xml) |
| 1864 | ;; Find a -*- mode tag | ||
| 1870 | (save-excursion | 1865 | (save-excursion |
| 1871 | (goto-char (point-min)) | 1866 | (goto-char (point-min)) |
| 1872 | (skip-chars-forward " \t\n") | 1867 | (skip-chars-forward " \t\n") |
| 1868 | ;; While we're at this point, check xml for later. | ||
| 1869 | (setq xml (looking-at "<\\?xml \\|<!DOCTYPE")) | ||
| 1873 | (and enable-local-variables | 1870 | (and enable-local-variables |
| 1874 | (setq end (set-auto-mode-1)) | 1871 | (setq end (set-auto-mode-1)) |
| 1875 | (if (save-excursion (search-forward ":" end t)) | 1872 | (if (save-excursion (search-forward ":" end t)) |
| @@ -1891,62 +1888,71 @@ and we don't even do that unless it would come from the file name." | |||
| 1891 | (push (intern (concat (downcase (buffer-substring (point) end)) | 1888 | (push (intern (concat (downcase (buffer-substring (point) end)) |
| 1892 | "-mode")) | 1889 | "-mode")) |
| 1893 | modes)))) | 1890 | modes)))) |
| 1894 | ;; If we found modes to use, invoke them now, | 1891 | ;; If we found modes to use, invoke them now, outside the save-excursion. |
| 1895 | ;; outside the save-excursion. | 1892 | (if modes |
| 1896 | (unless just-from-file-name | 1893 | (catch 'nop |
| 1897 | (dolist (mode (nreverse modes)) | 1894 | (dolist (mode (nreverse modes)) |
| 1898 | (if (not (functionp mode)) | 1895 | (if (not (functionp mode)) |
| 1899 | (message "Ignoring unknown mode `%s'" mode) | 1896 | (message "Ignoring unknown mode `%s'" mode) |
| 1900 | (setq done t) | 1897 | (setq done t) |
| 1901 | (funcall mode)))) | 1898 | (or (set-auto-mode-0 mode) |
| 1902 | ;; If we didn't find a mode from a -*- line, try using the file name. | 1899 | (throw 'nop nil))))) |
| 1900 | ;; If we didn't, look for an interpreter specified in the first line. | ||
| 1901 | ;; As a special case, allow for things like "#!/bin/env perl", which | ||
| 1902 | ;; finds the interpreter anywhere in $PATH. | ||
| 1903 | (setq mode (save-excursion | ||
| 1904 | (goto-char (point-min)) | ||
| 1905 | (if (looking-at auto-mode-interpreter-regexp) | ||
| 1906 | (match-string 2) | ||
| 1907 | "")) | ||
| 1908 | ;; Map interpreter name to a mode, signalling we're done at the | ||
| 1909 | ;; same time. | ||
| 1910 | done (assoc (file-name-nondirectory mode) | ||
| 1911 | interpreter-mode-alist)) | ||
| 1912 | ;; If we found an interpreter mode to use, invoke it now. | ||
| 1913 | (if done (set-auto-mode-0 (cdr done)))) | ||
| 1903 | (if (and (not done) buffer-file-name) | 1914 | (if (and (not done) buffer-file-name) |
| 1904 | (let ((name buffer-file-name) | 1915 | (let ((name buffer-file-name)) |
| 1905 | (keep-going t)) | ||
| 1906 | ;; Remove backup-suffixes from file name. | 1916 | ;; Remove backup-suffixes from file name. |
| 1907 | (setq name (file-name-sans-versions name)) | 1917 | (setq name (file-name-sans-versions name)) |
| 1908 | (while keep-going | 1918 | (while name |
| 1909 | (setq keep-going nil) | 1919 | ;; Find first matching alist entry. |
| 1910 | (let ((alist auto-mode-alist) | 1920 | (let ((case-fold-search |
| 1911 | (mode nil)) | 1921 | (memq system-type '(vax-vms windows-nt cygwin)))) |
| 1912 | ;; Find first matching alist entry. | 1922 | (if (and (setq mode (assoc-default name auto-mode-alist |
| 1913 | (let ((case-fold-search | 1923 | 'string-match)) |
| 1914 | (memq system-type '(vax-vms windows-nt cygwin)))) | 1924 | (consp mode) |
| 1915 | (while (and (not mode) alist) | 1925 | (cadr mode)) |
| 1916 | (if (string-match (car (car alist)) name) | 1926 | (setq mode (car mode) |
| 1917 | (if (and (consp (cdr (car alist))) | 1927 | name (substring name 0 (match-beginning 0))) |
| 1918 | (nth 2 (car alist))) | 1928 | (setq name))) |
| 1919 | (setq mode (car (cdr (car alist))) | 1929 | (when mode |
| 1920 | name (substring name 0 (match-beginning 0)) | 1930 | (if xml (or (memq mode xml-based-modes) |
| 1921 | keep-going t) | 1931 | (setq mode 'xml-mode))) |
| 1922 | (setq mode (cdr (car alist)) | 1932 | (set-auto-mode-0 mode) |
| 1923 | keep-going nil))) | 1933 | (setq done t))))) |
| 1924 | (setq alist (cdr alist)))) | 1934 | (and xml |
| 1925 | (if mode | 1935 | (not done) |
| 1926 | ;; When JUST-FROM-FILE-NAME is set, | 1936 | (set-auto-mode-0 'xml-mode)))) |
| 1927 | ;; we are working on behalf of set-visited-file-name. | 1937 | |
| 1928 | ;; In that case, if the major mode specified is the | 1938 | |
| 1929 | ;; same one we already have, don't actually reset it. | 1939 | ;; When `keep-mode-if-same' is set, we are working on behalf of |
| 1930 | ;; We don't want to lose minor modes such as Font Lock. | 1940 | ;; set-visited-file-name. In that case, if the major mode specified is the |
| 1931 | (unless (and just-from-file-name (eq mode major-mode)) | 1941 | ;; same one we already have, don't actually reset it. We don't want to lose |
| 1932 | (funcall mode)) | 1942 | ;; minor modes such as Font Lock. |
| 1933 | ;; If we can't deduce a mode from the file name, | 1943 | (defun set-auto-mode-0 (mode) |
| 1934 | ;; look for an interpreter specified in the first line. | 1944 | "Apply MODE and return it. |
| 1935 | ;; As a special case, allow for things like "#!/bin/env perl", | 1945 | If `keep-mode-if-same' is non-nil MODE is chased of any aliases and |
| 1936 | ;; which finds the interpreter anywhere in $PATH. | 1946 | compared to current major mode. If they are the same, do nothing |
| 1937 | (let ((interpreter | 1947 | and return nil." |
| 1938 | (save-excursion | 1948 | (when keep-mode-if-same |
| 1939 | (goto-char (point-min)) | 1949 | (while (symbolp (symbol-function mode)) |
| 1940 | (if (looking-at auto-mode-interpreter-regexp) | 1950 | (setq mode (symbol-function mode))) |
| 1941 | (match-string 2) | 1951 | (if (eq mode major-mode) |
| 1942 | ""))) | 1952 | (setq mode))) |
| 1943 | elt) | 1953 | (when mode |
| 1944 | ;; Map interpreter name to a mode. | 1954 | (funcall mode) |
| 1945 | (setq elt (assoc (file-name-nondirectory interpreter) | 1955 | mode)) |
| 1946 | interpreter-mode-alist)) | ||
| 1947 | (unless just-from-file-name | ||
| 1948 | (if elt | ||
| 1949 | (funcall (cdr elt)))))))))))) | ||
| 1950 | 1956 | ||
| 1951 | 1957 | ||
| 1952 | (defun set-auto-mode-1 () | 1958 | (defun set-auto-mode-1 () |
| @@ -2157,7 +2163,7 @@ is specified, returning t if it is specified." | |||
| 2157 | (error "Local variables entry is missing the suffix"))) | 2163 | (error "Local variables entry is missing the suffix"))) |
| 2158 | (forward-line 1)) | 2164 | (forward-line 1)) |
| 2159 | (goto-char (point-min)) | 2165 | (goto-char (point-min)) |
| 2160 | 2166 | ||
| 2161 | (while (not (eobp)) | 2167 | (while (not (eobp)) |
| 2162 | ;; Find the variable name; strip whitespace. | 2168 | ;; Find the variable name; strip whitespace. |
| 2163 | (skip-chars-forward " \t") | 2169 | (skip-chars-forward " \t") |
diff --git a/lisp/find-file.el b/lisp/find-file.el index 4805d08400b..d85d2ab0f51 100644 --- a/lisp/find-file.el +++ b/lisp/find-file.el | |||
| @@ -57,7 +57,7 @@ | |||
| 57 | ;; format above can be changed to include a function to be called when the | 57 | ;; format above can be changed to include a function to be called when the |
| 58 | ;; current file matches the regexp: | 58 | ;; current file matches the regexp: |
| 59 | ;; | 59 | ;; |
| 60 | ;; '(("\\.cc$" cc-function) | 60 | ;; '(("\\.cc$" cc--function) |
| 61 | ;; ("\\.hh$" hh-function)) | 61 | ;; ("\\.hh$" hh-function)) |
| 62 | ;; | 62 | ;; |
| 63 | ;; These functions must return a list consisting of the possible names of the | 63 | ;; These functions must return a list consisting of the possible names of the |
| @@ -239,22 +239,26 @@ the preceding slash. The star represents all the subdirectories except | |||
| 239 | :group 'ff) | 239 | :group 'ff) |
| 240 | 240 | ||
| 241 | (defcustom cc-other-file-alist | 241 | (defcustom cc-other-file-alist |
| 242 | '( | 242 | '(("\\.cc\\'" (".hh" ".h")) |
| 243 | ("\\.cc$" (".hh" ".h")) | 243 | ("\\.hh\\'" (".cc" ".C")) |
| 244 | ("\\.hh$" (".cc" ".C")) | ||
| 245 | 244 | ||
| 246 | ("\\.c$" (".h")) | 245 | ("\\.c\\'" (".h")) |
| 247 | ("\\.h$" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp")) | 246 | ("\\.h\\'" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp")) |
| 248 | 247 | ||
| 249 | ("\\.C$" (".H" ".hh" ".h")) | 248 | ("\\.C\\'" (".H" ".hh" ".h")) |
| 250 | ("\\.H$" (".C" ".CC")) | 249 | ("\\.H\\'" (".C" ".CC")) |
| 251 | 250 | ||
| 252 | ("\\.CC$" (".HH" ".H" ".hh" ".h")) | 251 | ("\\.CC\\'" (".HH" ".H" ".hh" ".h")) |
| 253 | ("\\.HH$" (".CC")) | 252 | ("\\.HH\\'" (".CC")) |
| 254 | 253 | ||
| 255 | ("\\.cxx$" (".hh" ".h")) | 254 | ("\\.c\\+\\+\\'" (".h++" ".hh" ".h")) |
| 256 | ("\\.cpp$" (".hh" ".h")) | 255 | ("\\.h\\+\\+\\'" (".c++")) |
| 257 | ) | 256 | |
| 257 | ("\\.cpp\\'" (".hpp" ".hh" ".h")) | ||
| 258 | ("\\.hpp\\'" (".cpp")) | ||
| 259 | |||
| 260 | ("\\.cxx\\'" (".hxx" ".hh" ".h")) | ||
| 261 | ("\\.hxx\\'" (".cxx"))) | ||
| 258 | "*Alist of extensions to find given the current file's extension. | 262 | "*Alist of extensions to find given the current file's extension. |
| 259 | 263 | ||
| 260 | This list should contain the most used extensions before the others, | 264 | This list should contain the most used extensions before the others, |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2a4b0a80398..2c658a4c562 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,39 @@ | |||
| 1 | 2004-10-29 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * mm-util.el (mm-coding-system-priorities): Prefer iso-8859-1 than | ||
| 4 | iso-2022-jp even in the Japanese language environment. Suggested | ||
| 5 | by Jason Rumney <jasonr@gnu.org>. | ||
| 6 | |||
| 7 | 2004-10-28 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 8 | |||
| 9 | * gnus-sum.el (gnus-update-summary-mark-positions): Allow users to | ||
| 10 | use the same characters as the dummy marks; make it free from | ||
| 11 | getting affected by the language environment. | ||
| 12 | (gnus-summary-read-group-1): Update mark positions only when the | ||
| 13 | format spec is updated. | ||
| 14 | |||
| 15 | * gnus-spec.el (gnus-update-format-specifications): Return a list | ||
| 16 | of updated types. | ||
| 17 | |||
| 18 | 2004-10-26 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 19 | |||
| 20 | * nnspool.el (nnspool-spool-directory): Use news-path if the | ||
| 21 | news-directory variable is not bound. | ||
| 22 | |||
| 23 | * gnus-group.el (gnus-group-line-format-alist): Convert the value | ||
| 24 | of gnus-tmp-news-method into string if it may be passed to | ||
| 25 | gnus-correct-length which takes only a string argument. | ||
| 26 | |||
| 27 | 2004-10-25 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 28 | |||
| 29 | * html2text.el (html2text-buffer-head): Removed. Use `goto-char' | ||
| 30 | instead. | ||
| 31 | |||
| 32 | 2004-10-24 Kevin Greiner <kevin.greiner@compsol.cc> | ||
| 33 | |||
| 34 | * gnus-start.el (gnus-convert-old-newsrc): Fixed numeric | ||
| 35 | comparison on string. | ||
| 36 | |||
| 1 | 2004-10-21 Katsumi Yamaoka <yamaoka@jpl.org> | 37 | 2004-10-21 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 38 | ||
| 3 | * mm-view.el (mm-display-inline-fontify): Inhibit font-lock when | 39 | * mm-view.el (mm-display-inline-fontify): Inhibit font-lock when |
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index f3b2f91cd5e..c55264b22de 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el | |||
| @@ -491,7 +491,10 @@ simple manner.") | |||
| 491 | (?O gnus-tmp-moderated-string ?s) | 491 | (?O gnus-tmp-moderated-string ?s) |
| 492 | (?p gnus-tmp-process-marked ?c) | 492 | (?p gnus-tmp-process-marked ?c) |
| 493 | (?s gnus-tmp-news-server ?s) | 493 | (?s gnus-tmp-news-server ?s) |
| 494 | (?n gnus-tmp-news-method ?s) | 494 | (?n ,(if (featurep 'xemacs) |
| 495 | '(symbol-name gnus-tmp-news-method) | ||
| 496 | 'gnus-tmp-news-method) | ||
| 497 | ?s) | ||
| 495 | (?P gnus-group-indentation ?s) | 498 | (?P gnus-group-indentation ?s) |
| 496 | (?E gnus-tmp-group-icon ?s) | 499 | (?E gnus-tmp-group-icon ?s) |
| 497 | (?B gnus-tmp-summary-live ?c) | 500 | (?B gnus-tmp-summary-live ?c) |
diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el index 690fc7e026a..dc93fef5176 100644 --- a/lisp/gnus/gnus-spec.el +++ b/lisp/gnus/gnus-spec.el | |||
| @@ -183,7 +183,8 @@ text properties. This is only needed on XEmacs, as FSF Emacs does this anyway." | |||
| 183 | (insert (gnus-pp-to-string spec)))) | 183 | (insert (gnus-pp-to-string spec)))) |
| 184 | 184 | ||
| 185 | (defun gnus-update-format-specifications (&optional force &rest types) | 185 | (defun gnus-update-format-specifications (&optional force &rest types) |
| 186 | "Update all (necessary) format specifications." | 186 | "Update all (necessary) format specifications. |
| 187 | Return a list of updated types." | ||
| 187 | ;; Make the indentation array. | 188 | ;; Make the indentation array. |
| 188 | ;; See whether all the stored info needs to be flushed. | 189 | ;; See whether all the stored info needs to be flushed. |
| 189 | (when (or force | 190 | (when (or force |
| @@ -195,13 +196,12 @@ text properties. This is only needed on XEmacs, as FSF Emacs does this anyway." | |||
| 195 | (setq gnus-format-specs nil)) | 196 | (setq gnus-format-specs nil)) |
| 196 | 197 | ||
| 197 | ;; Go through all the formats and see whether they need updating. | 198 | ;; Go through all the formats and see whether they need updating. |
| 198 | (let (new-format entry type val) | 199 | (let (new-format entry type val updated) |
| 199 | (while (setq type (pop types)) | 200 | (while (setq type (pop types)) |
| 200 | ;; Jump to the proper buffer to find out the value of the | 201 | ;; Jump to the proper buffer to find out the value of the |
| 201 | ;; variable, if possible. (It may be buffer-local.) | 202 | ;; variable, if possible. (It may be buffer-local.) |
| 202 | (save-excursion | 203 | (save-excursion |
| 203 | (let ((buffer (intern (format "gnus-%s-buffer" type))) | 204 | (let ((buffer (intern (format "gnus-%s-buffer" type)))) |
| 204 | val) | ||
| 205 | (when (and (boundp buffer) | 205 | (when (and (boundp buffer) |
| 206 | (setq val (symbol-value buffer)) | 206 | (setq val (symbol-value buffer)) |
| 207 | (gnus-buffer-exists-p val)) | 207 | (gnus-buffer-exists-p val)) |
| @@ -231,10 +231,12 @@ text properties. This is only needed on XEmacs, as FSF Emacs does this anyway." | |||
| 231 | (setcar (cdr entry) val) | 231 | (setcar (cdr entry) val) |
| 232 | (setcar entry new-format)) | 232 | (setcar entry new-format)) |
| 233 | (push (list type new-format val) gnus-format-specs)) | 233 | (push (list type new-format val) gnus-format-specs)) |
| 234 | (set (intern (format "gnus-%s-line-format-spec" type)) val))))) | 234 | (set (intern (format "gnus-%s-line-format-spec" type)) val) |
| 235 | (push type updated)))) | ||
| 235 | 236 | ||
| 236 | (unless (assq 'version gnus-format-specs) | 237 | (unless (assq 'version gnus-format-specs) |
| 237 | (push (cons 'version emacs-version) gnus-format-specs))) | 238 | (push (cons 'version emacs-version) gnus-format-specs)) |
| 239 | updated)) | ||
| 238 | 240 | ||
| 239 | (defvar gnus-mouse-face-0 'highlight) | 241 | (defvar gnus-mouse-face-0 'highlight) |
| 240 | (defvar gnus-mouse-face-1 'highlight) | 242 | (defvar gnus-mouse-face-1 'highlight) |
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index c6445b460ff..971124ba831 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el | |||
| @@ -2225,7 +2225,8 @@ If FORCE is non-nil, the .newsrc file is read." | |||
| 2225 | (defun gnus-convert-old-newsrc () | 2225 | (defun gnus-convert-old-newsrc () |
| 2226 | "Convert old newsrc formats into the current format, if needed." | 2226 | "Convert old newsrc formats into the current format, if needed." |
| 2227 | (let ((fcv (and gnus-newsrc-file-version | 2227 | (let ((fcv (and gnus-newsrc-file-version |
| 2228 | (gnus-continuum-version gnus-newsrc-file-version)))) | 2228 | (gnus-continuum-version gnus-newsrc-file-version))) |
| 2229 | (gcv (gnus-continuum-version))) | ||
| 2229 | (when fcv | 2230 | (when fcv |
| 2230 | ;; A newsrc file was loaded. | 2231 | ;; A newsrc file was loaded. |
| 2231 | (let (prompt-displayed | 2232 | (let (prompt-displayed |
| @@ -2259,7 +2260,7 @@ If FORCE is non-nil, the .newsrc file is read." | |||
| 2259 | ;; Perform converters to bring older version up to date. | 2260 | ;; Perform converters to bring older version up to date. |
| 2260 | (when (and converters (< fcv (caar converters))) | 2261 | (when (and converters (< fcv (caar converters))) |
| 2261 | (while (and converters (< fcv (caar converters)) | 2262 | (while (and converters (< fcv (caar converters)) |
| 2262 | (<= (caar converters) gnus-version)) | 2263 | (<= (caar converters) gcv)) |
| 2263 | (let* ((converter-spec (pop converters)) | 2264 | (let* ((converter-spec (pop converters)) |
| 2264 | (convert-to (nth 1 converter-spec)) | 2265 | (convert-to (nth 1 converter-spec)) |
| 2265 | (load-from (nth 2 converter-spec)) | 2266 | (load-from (nth 2 converter-spec)) |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 14ad9c99a3b..6ce2f55e2b7 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -3225,43 +3225,54 @@ buffer that was in action when the last article was fetched." | |||
| 3225 | (save-excursion | 3225 | (save-excursion |
| 3226 | (when (gnus-buffer-exists-p gnus-summary-buffer) | 3226 | (when (gnus-buffer-exists-p gnus-summary-buffer) |
| 3227 | (set-buffer gnus-summary-buffer)) | 3227 | (set-buffer gnus-summary-buffer)) |
| 3228 | (let ((gnus-replied-mark 129) | 3228 | (let ((spec gnus-summary-line-format-spec) |
| 3229 | (gnus-score-below-mark 130) | 3229 | pos) |
| 3230 | (gnus-score-over-mark 130) | ||
| 3231 | (gnus-undownloaded-mark 131) | ||
| 3232 | (spec gnus-summary-line-format-spec) | ||
| 3233 | gnus-visual pos) | ||
| 3234 | (save-excursion | 3230 | (save-excursion |
| 3235 | (gnus-set-work-buffer) | 3231 | (gnus-set-work-buffer) |
| 3236 | (let ((gnus-summary-line-format-spec spec) | 3232 | (let ((gnus-tmp-unread ?Z) |
| 3233 | (gnus-replied-mark ?Z) | ||
| 3234 | (gnus-score-below-mark ?Z) | ||
| 3235 | (gnus-score-over-mark ?Z) | ||
| 3236 | (gnus-undownloaded-mark ?Z) | ||
| 3237 | (gnus-summary-line-format-spec spec) | ||
| 3237 | (gnus-newsgroup-downloadable '(0)) | 3238 | (gnus-newsgroup-downloadable '(0)) |
| 3238 | marks) | 3239 | (header [0 "" "" "05 Apr 2001 23:33:09 +0400" "" "" 0 0 "" nil]) |
| 3239 | (insert ?\200 "\200" ?\201 "\201" ?\202 "\202" ?\203 "\203") | 3240 | case-fold-search ignores) |
| 3240 | (while (not (bobp)) | 3241 | ;; Here, all marks are bound to Z. |
| 3241 | (push (buffer-substring (1- (point)) (point)) marks) | 3242 | (gnus-summary-insert-line header |
| 3242 | (backward-char)) | 3243 | 0 nil t gnus-tmp-unread t nil "" nil 1) |
| 3244 | (goto-char (point-min)) | ||
| 3245 | ;; Memorize the positions of the same characters as dummy marks. | ||
| 3246 | (while (re-search-forward "[A-D]" nil t) | ||
| 3247 | (push (point) ignores)) | ||
| 3243 | (erase-buffer) | 3248 | (erase-buffer) |
| 3244 | (gnus-summary-insert-line | 3249 | ;; We use A-D as dummy marks in order to know column positions |
| 3245 | [0 "" "" "05 Apr 2001 23:33:09 +0400" "" "" 0 0 "" nil] | 3250 | ;; where marks should be inserted. |
| 3246 | 0 nil t 128 t nil "" nil 1) | 3251 | (setq gnus-tmp-unread ?A |
| 3252 | gnus-replied-mark ?B | ||
| 3253 | gnus-score-below-mark ?C | ||
| 3254 | gnus-score-over-mark ?C | ||
| 3255 | gnus-undownloaded-mark ?D) | ||
| 3256 | (gnus-summary-insert-line header | ||
| 3257 | 0 nil t gnus-tmp-unread t nil "" nil 1) | ||
| 3258 | ;; Ignore characters which aren't dummy marks. | ||
| 3259 | (dolist (p ignores) | ||
| 3260 | (delete-region (goto-char (1- p)) p) | ||
| 3261 | (insert ?Z)) | ||
| 3247 | (goto-char (point-min)) | 3262 | (goto-char (point-min)) |
| 3248 | (setq pos (list (cons 'unread | 3263 | (setq pos (list (cons 'unread |
| 3249 | (and (or (search-forward (nth 0 marks) nil t) | 3264 | (and (search-forward "A" nil t) |
| 3250 | (search-forward (nth 1 marks) nil t)) | ||
| 3251 | (- (point) (point-min) 1))))) | 3265 | (- (point) (point-min) 1))))) |
| 3252 | (goto-char (point-min)) | 3266 | (goto-char (point-min)) |
| 3253 | (push (cons 'replied (and (or (search-forward (nth 2 marks) nil t) | 3267 | (push (cons 'replied (and (search-forward "B" nil t) |
| 3254 | (search-forward (nth 3 marks) nil t)) | ||
| 3255 | (- (point) (point-min) 1))) | 3268 | (- (point) (point-min) 1))) |
| 3256 | pos) | 3269 | pos) |
| 3257 | (goto-char (point-min)) | 3270 | (goto-char (point-min)) |
| 3258 | (push (cons 'score (and (or (search-forward (nth 4 marks) nil t) | 3271 | (push (cons 'score (and (search-forward "C" nil t) |
| 3259 | (search-forward (nth 5 marks) nil t)) | ||
| 3260 | (- (point) (point-min) 1))) | 3272 | (- (point) (point-min) 1))) |
| 3261 | pos) | 3273 | pos) |
| 3262 | (goto-char (point-min)) | 3274 | (goto-char (point-min)) |
| 3263 | (push (cons 'download (and (or (search-forward (nth 6 marks) nil t) | 3275 | (push (cons 'download (and (search-forward "D" nil t) |
| 3264 | (search-forward (nth 7 marks) nil t)) | ||
| 3265 | (- (point) (point-min) 1))) | 3276 | (- (point) (point-min) 1))) |
| 3266 | pos))) | 3277 | pos))) |
| 3267 | (setq gnus-summary-mark-positions pos)))) | 3278 | (setq gnus-summary-mark-positions pos)))) |
| @@ -3559,9 +3570,11 @@ If NO-DISPLAY, don't generate a summary buffer." | |||
| 3559 | (gnus-active gnus-newsgroup-name))) | 3570 | (gnus-active gnus-newsgroup-name))) |
| 3560 | ;; You can change the summary buffer in some way with this hook. | 3571 | ;; You can change the summary buffer in some way with this hook. |
| 3561 | (gnus-run-hooks 'gnus-select-group-hook) | 3572 | (gnus-run-hooks 'gnus-select-group-hook) |
| 3562 | (gnus-update-format-specifications | 3573 | (when (memq 'summary (gnus-update-format-specifications |
| 3563 | nil 'summary 'summary-mode 'summary-dummy) | 3574 | nil 'summary 'summary-mode 'summary-dummy)) |
| 3564 | (gnus-update-summary-mark-positions) | 3575 | ;; The format specification for the summary line was updated, |
| 3576 | ;; so we need to update the mark positions as well. | ||
| 3577 | (gnus-update-summary-mark-positions)) | ||
| 3565 | ;; Do score processing. | 3578 | ;; Do score processing. |
| 3566 | (when gnus-use-scoring | 3579 | (when gnus-use-scoring |
| 3567 | (gnus-possibly-score-headers)) | 3580 | (gnus-possibly-score-headers)) |
diff --git a/lisp/gnus/html2text.el b/lisp/gnus/html2text.el index 6f1ef3b0289..31d1869c695 100644 --- a/lisp/gnus/html2text.el +++ b/lisp/gnus/html2text.el | |||
| @@ -116,12 +116,6 @@ formatting, and then moved afterward.") | |||
| 116 | ;; <Utility functions> | 116 | ;; <Utility functions> |
| 117 | ;; | 117 | ;; |
| 118 | 118 | ||
| 119 | (defun html2text-buffer-head () | ||
| 120 | (if (string= mode-name "Article") | ||
| 121 | (beginning-of-buffer) | ||
| 122 | (beginning-of-buffer) | ||
| 123 | ) | ||
| 124 | ) | ||
| 125 | 119 | ||
| 126 | (defun html2text-replace-string (from-string to-string p1 p2) | 120 | (defun html2text-replace-string (from-string to-string p1 p2) |
| 127 | (goto-char p1) | 121 | (goto-char p1) |
| @@ -432,11 +426,11 @@ formatting, and then moved afterward.") | |||
| 432 | "This _tries_ to fix up the paragraphs - this is done in quite a ad-hook | 426 | "This _tries_ to fix up the paragraphs - this is done in quite a ad-hook |
| 433 | fashion, quite close to pure guess-work. It does work in some cases though." | 427 | fashion, quite close to pure guess-work. It does work in some cases though." |
| 434 | (interactive) | 428 | (interactive) |
| 435 | (html2text-buffer-head) | 429 | (goto-char (point-min)) |
| 436 | (replace-regexp "^<br>$" "") | 430 | (replace-regexp "^<br>$" "") |
| 437 | ;; Removing lonely <br> on a single line, if they are left intact we | 431 | ;; Removing lonely <br> on a single line, if they are left intact we |
| 438 | ;; dont have any paragraphs at all. | 432 | ;; dont have any paragraphs at all. |
| 439 | (html2text-buffer-head) | 433 | (goto-char (point-min)) |
| 440 | (while (not (eobp)) | 434 | (while (not (eobp)) |
| 441 | (let ((p1 (point))) | 435 | (let ((p1 (point))) |
| 442 | (forward-paragraph 1) | 436 | (forward-paragraph 1) |
| @@ -462,7 +456,7 @@ fashion, quite close to pure guess-work. It does work in some cases though." | |||
| 462 | See the documentation for that variable." | 456 | See the documentation for that variable." |
| 463 | (interactive) | 457 | (interactive) |
| 464 | (dolist (tag tag-list) | 458 | (dolist (tag tag-list) |
| 465 | (html2text-buffer-head) | 459 | (goto-char (point-min)) |
| 466 | (while (re-search-forward (format "\\(</?%s[^>]*>\\)" tag) (point-max) t) | 460 | (while (re-search-forward (format "\\(</?%s[^>]*>\\)" tag) (point-max) t) |
| 467 | (delete-region (match-beginning 0) (match-end 0))))) | 461 | (delete-region (match-beginning 0) (match-end 0))))) |
| 468 | 462 | ||
| @@ -472,7 +466,7 @@ See the documentation for that variable." | |||
| 472 | (dolist (tag-and-function html2text-format-tag-list) | 466 | (dolist (tag-and-function html2text-format-tag-list) |
| 473 | (let ((tag (car tag-and-function)) | 467 | (let ((tag (car tag-and-function)) |
| 474 | (function (cdr tag-and-function))) | 468 | (function (cdr tag-and-function))) |
| 475 | (html2text-buffer-head) | 469 | (goto-char (point-min)) |
| 476 | (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag) | 470 | (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag) |
| 477 | (point-max) t) | 471 | (point-max) t) |
| 478 | (let ((p1) | 472 | (let ((p1) |
| @@ -497,7 +491,7 @@ See the documentation for that variable." | |||
| 497 | "See the variable \"html2text-replace-list\" for documentation" | 491 | "See the variable \"html2text-replace-list\" for documentation" |
| 498 | (interactive) | 492 | (interactive) |
| 499 | (dolist (e html2text-replace-list) | 493 | (dolist (e html2text-replace-list) |
| 500 | (html2text-buffer-head) | 494 | (goto-char (point-min)) |
| 501 | (let ((old-string (car e)) | 495 | (let ((old-string (car e)) |
| 502 | (new-string (cdr e))) | 496 | (new-string (cdr e))) |
| 503 | (html2text-replace-string old-string new-string (point-min) (point-max)) | 497 | (html2text-replace-string old-string new-string (point-min) (point-max)) |
| @@ -511,7 +505,7 @@ See the documentation for that variable." | |||
| 511 | (dolist (tag-and-function html2text-format-single-element-list) | 505 | (dolist (tag-and-function html2text-format-single-element-list) |
| 512 | (let ((tag (car tag-and-function)) | 506 | (let ((tag (car tag-and-function)) |
| 513 | (function (cdr tag-and-function))) | 507 | (function (cdr tag-and-function))) |
| 514 | (html2text-buffer-head) | 508 | (goto-char (point-min)) |
| 515 | (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag) | 509 | (while (re-search-forward (format "\\(<%s\\( [^>]*\\)?>\\)" tag) |
| 516 | (point-max) t) | 510 | (point-max) t) |
| 517 | (let ((p1) | 511 | (let ((p1) |
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index c608820c8ed..b68b4ec584c 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el | |||
| @@ -302,9 +302,10 @@ Valid elements include: | |||
| 302 | (if (boundp 'current-language-environment) | 302 | (if (boundp 'current-language-environment) |
| 303 | (let ((lang (symbol-value 'current-language-environment))) | 303 | (let ((lang (symbol-value 'current-language-environment))) |
| 304 | (cond ((string= lang "Japanese") | 304 | (cond ((string= lang "Japanese") |
| 305 | ;; Japanese users may prefer iso-2022-jp to shift-jis. | 305 | ;; Japanese users prefer iso-2022-jp to euc-japan or |
| 306 | '(iso-2022-jp iso-2022-jp-2 japanese-shift-jis | 306 | ;; shift_jis, however iso-8859-1 should be used when |
| 307 | iso-latin-1 utf-8))))) | 307 | ;; there are only ASCII text and Latin-1 characters. |
| 308 | '(iso-8859-1 iso-2022-jp iso-2022-jp-2 shift_jis utf-8))))) | ||
| 308 | "Preferred coding systems for encoding outgoing messages. | 309 | "Preferred coding systems for encoding outgoing messages. |
| 309 | 310 | ||
| 310 | More than one suitable coding system may be found for some text. | 311 | More than one suitable coding system may be found for some text. |
diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el index 9a08cdfe71c..d54897a7750 100644 --- a/lisp/gnus/nnspool.el +++ b/lisp/gnus/nnspool.el | |||
| @@ -44,7 +44,10 @@ This is most commonly `inews' or `injnews'.") | |||
| 44 | "Switches for nnspool-request-post to pass to `inews' for posting news. | 44 | "Switches for nnspool-request-post to pass to `inews' for posting news. |
| 45 | If you are using Cnews, you probably should set this variable to nil.") | 45 | If you are using Cnews, you probably should set this variable to nil.") |
| 46 | 46 | ||
| 47 | (defvoo nnspool-spool-directory (file-name-as-directory news-directory) | 47 | (defvoo nnspool-spool-directory |
| 48 | (file-name-as-directory (if (boundp 'news-directory) | ||
| 49 | (symbol-value 'news-directory) | ||
| 50 | news-path)) | ||
| 48 | "Local news spool directory.") | 51 | "Local news spool directory.") |
| 49 | 52 | ||
| 50 | (defvoo nnspool-nov-directory (concat nnspool-spool-directory "over.view/") | 53 | (defvoo nnspool-nov-directory (concat nnspool-spool-directory "over.view/") |
diff --git a/lisp/help.el b/lisp/help.el index c27bcc49055..ee35d007639 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -573,14 +573,14 @@ the last key hit are used." | |||
| 573 | (if (symbolp defn) defn (prin1-to-string defn))))))))) | 573 | (if (symbolp defn) defn (prin1-to-string defn))))))))) |
| 574 | 574 | ||
| 575 | 575 | ||
| 576 | (defun describe-key (key &optional untranslated) | 576 | (defun describe-key (key &optional untranslated up-event) |
| 577 | "Display documentation of the function invoked by KEY. | 577 | "Display documentation of the function invoked by KEY. |
| 578 | KEY should be a key sequence--when calling from a program, | 578 | KEY should be a key sequence--when calling from a program, |
| 579 | pass a string or a vector. | 579 | pass a string or a vector. |
| 580 | If non-nil UNTRANSLATED is a vector of the untranslated events. | 580 | If non-nil UNTRANSLATED is a vector of the untranslated events. |
| 581 | It can also be a number in which case the untranslated events from | 581 | It can also be a number in which case the untranslated events from |
| 582 | the last key hit are used." | 582 | the last key hit are used." |
| 583 | (interactive "kDescribe key: \np") | 583 | (interactive "kDescribe key: \np\nU") |
| 584 | (if (numberp untranslated) | 584 | (if (numberp untranslated) |
| 585 | (setq untranslated (this-single-command-raw-keys))) | 585 | (setq untranslated (this-single-command-raw-keys))) |
| 586 | (save-excursion | 586 | (save-excursion |
| @@ -608,6 +608,17 @@ the last key hit are used." | |||
| 608 | (prin1 defn) | 608 | (prin1 defn) |
| 609 | (princ "\n which is ") | 609 | (princ "\n which is ") |
| 610 | (describe-function-1 defn) | 610 | (describe-function-1 defn) |
| 611 | (when up-event | ||
| 612 | (let ((defn (or (string-key-binding up-event) (key-binding up-event)))) | ||
| 613 | (unless (or (null defn) (integerp defn) (equal defn 'undefined)) | ||
| 614 | (princ "\n\n-------------- up event ---------------\n\n") | ||
| 615 | (princ (key-description up-event)) | ||
| 616 | (if (windowp window) | ||
| 617 | (princ " at that spot")) | ||
| 618 | (princ " runs the command ") | ||
| 619 | (prin1 defn) | ||
| 620 | (princ "\n which is ") | ||
| 621 | (describe-function-1 defn)))) | ||
| 611 | (print-help-return-message))))))) | 622 | (print-help-return-message))))))) |
| 612 | 623 | ||
| 613 | 624 | ||
diff --git a/lisp/imenu.el b/lisp/imenu.el index 6859c0c74c7..7c775dc6337 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -62,6 +62,8 @@ | |||
| 62 | 62 | ||
| 63 | ;;; Code: | 63 | ;;; Code: |
| 64 | 64 | ||
| 65 | (require 'newcomment) | ||
| 66 | |||
| 65 | (eval-when-compile (require 'cl)) | 67 | (eval-when-compile (require 'cl)) |
| 66 | 68 | ||
| 67 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 69 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -159,16 +161,17 @@ element should come before the second. The arguments are cons cells; | |||
| 159 | :type 'integer | 161 | :type 'integer |
| 160 | :group 'imenu) | 162 | :group 'imenu) |
| 161 | 163 | ||
| 162 | (defcustom imenu-scanning-message "Scanning buffer for index (%3d%%)" | 164 | ;; No longer used. KFS 2004-10-27 |
| 163 | "*Progress message during the index scanning of the buffer. | 165 | ;; (defcustom imenu-scanning-message "Scanning buffer for index (%3d%%)" |
| 164 | If non-nil, user gets a message during the scanning of the buffer. | 166 | ;; "*Progress message during the index scanning of the buffer. |
| 165 | 167 | ;; If non-nil, user gets a message during the scanning of the buffer. | |
| 166 | Relevant only if the mode-specific function that creates the buffer | 168 | ;; |
| 167 | index use `imenu-progress-message', and not useful if that is fast, in | 169 | ;; Relevant only if the mode-specific function that creates the buffer |
| 168 | which case you might as well set this to nil." | 170 | ;; index use `imenu-progress-message', and not useful if that is fast, in |
| 169 | :type '(choice string | 171 | ;; which case you might as well set this to nil." |
| 170 | (const :tag "None" nil)) | 172 | ;; :type '(choice string |
| 171 | :group 'imenu) | 173 | ;; (const :tag "None" nil)) |
| 174 | ;; :group 'imenu) | ||
| 172 | 175 | ||
| 173 | (defcustom imenu-space-replacement "." | 176 | (defcustom imenu-space-replacement "." |
| 174 | "*The replacement string for spaces in index names. | 177 | "*The replacement string for spaces in index names. |
| @@ -298,16 +301,22 @@ The function in this variable is called when selecting a normal index-item.") | |||
| 298 | ;; is calculated. | 301 | ;; is calculated. |
| 299 | ;; PREVPOS is the variable in which we store the last position displayed. | 302 | ;; PREVPOS is the variable in which we store the last position displayed. |
| 300 | (defmacro imenu-progress-message (prevpos &optional relpos reverse) | 303 | (defmacro imenu-progress-message (prevpos &optional relpos reverse) |
| 301 | `(and | 304 | |
| 302 | imenu-scanning-message | 305 | ;; Made obsolete/empty, as computers are now faster than the eye, and |
| 303 | (let ((pos ,(if relpos | 306 | ;; it had problems updating the messages correctly, and could shadow |
| 304 | relpos | 307 | ;; more important messages/prompts in the minibuffer. KFS 2004-10-27. |
| 305 | `(imenu--relative-position ,reverse)))) | 308 | |
| 306 | (if ,(if relpos t | 309 | ;; `(and |
| 307 | `(> pos (+ 5 ,prevpos))) | 310 | ;; imenu-scanning-message |
| 308 | (progn | 311 | ;; (let ((pos ,(if relpos |
| 309 | (message imenu-scanning-message pos) | 312 | ;; relpos |
| 310 | (setq ,prevpos pos)))))) | 313 | ;; `(imenu--relative-position ,reverse)))) |
| 314 | ;; (if ,(if relpos t | ||
| 315 | ;; `(> pos (+ 5 ,prevpos))) | ||
| 316 | ;; (progn | ||
| 317 | ;; (message imenu-scanning-message pos) | ||
| 318 | ;; (setq ,prevpos pos))))) | ||
| 319 | ) | ||
| 311 | 320 | ||
| 312 | 321 | ||
| 313 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 322 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -763,7 +772,7 @@ the alist look like: | |||
| 763 | (INDEX-NAME . INDEX-POSITION) | 772 | (INDEX-NAME . INDEX-POSITION) |
| 764 | or like: | 773 | or like: |
| 765 | (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...) | 774 | (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...) |
| 766 | They may also be nested index alists like: | 775 | They may also be nested index alists like: |
| 767 | (INDEX-NAME . INDEX-ALIST) | 776 | (INDEX-NAME . INDEX-ALIST) |
| 768 | depending on PATTERNS." | 777 | depending on PATTERNS." |
| 769 | 778 | ||
| @@ -796,32 +805,37 @@ depending on PATTERNS." | |||
| 796 | (regexp (nth 1 pat)) | 805 | (regexp (nth 1 pat)) |
| 797 | (index (nth 2 pat)) | 806 | (index (nth 2 pat)) |
| 798 | (function (nth 3 pat)) | 807 | (function (nth 3 pat)) |
| 799 | (rest (nthcdr 4 pat))) | 808 | (rest (nthcdr 4 pat)) |
| 809 | cs) | ||
| 800 | ;; Go backwards for convenience of adding items in order. | 810 | ;; Go backwards for convenience of adding items in order. |
| 801 | (goto-char (point-max)) | 811 | (goto-char (point-max)) |
| 802 | (while (re-search-backward regexp nil t) | 812 | (while (re-search-backward regexp nil t) |
| 803 | (imenu-progress-message prev-pos nil t) | 813 | (goto-char (match-end index)) |
| 804 | (setq beg (match-beginning index)) | 814 | (setq beg (match-beginning index)) |
| 805 | ;; Add this sort of submenu only when we've found an | 815 | (if (setq cs (save-match-data (comment-beginning))) |
| 806 | ;; item for it, avoiding empty, duff menus. | 816 | (goto-char cs) ; skip this one, it's in a comment |
| 807 | (unless (assoc menu-title index-alist) | 817 | (goto-char beg) |
| 808 | (push (list menu-title) index-alist)) | 818 | (imenu-progress-message prev-pos nil t) |
| 809 | (if imenu-use-markers | 819 | ;; Add this sort of submenu only when we've found an |
| 810 | (setq beg (copy-marker beg))) | 820 | ;; item for it, avoiding empty, duff menus. |
| 811 | (let ((item | 821 | (unless (assoc menu-title index-alist) |
| 812 | (if function | 822 | (push (list menu-title) index-alist)) |
| 813 | (nconc (list (match-string-no-properties index) | 823 | (if imenu-use-markers |
| 814 | beg function) | 824 | (setq beg (copy-marker beg))) |
| 815 | rest) | 825 | (let ((item |
| 816 | (cons (match-string-no-properties index) | 826 | (if function |
| 817 | beg))) | 827 | (nconc (list (match-string-no-properties index) |
| 818 | ;; This is the desired submenu, | 828 | beg function) |
| 819 | ;; starting with its title (or nil). | 829 | rest) |
| 820 | (menu (assoc menu-title index-alist))) | 830 | (cons (match-string-no-properties index) |
| 821 | ;; Insert the item unless it is already present. | 831 | beg))) |
| 822 | (unless (member item (cdr menu)) | 832 | ;; This is the desired submenu, |
| 823 | (setcdr menu | 833 | ;; starting with its title (or nil). |
| 824 | (cons item (cdr menu)))))))) | 834 | (menu (assoc menu-title index-alist))) |
| 835 | ;; Insert the item unless it is already present. | ||
| 836 | (unless (member item (cdr menu)) | ||
| 837 | (setcdr menu | ||
| 838 | (cons item (cdr menu))))))))) | ||
| 825 | (set-syntax-table old-table))) | 839 | (set-syntax-table old-table))) |
| 826 | (imenu-progress-message prev-pos 100 t) | 840 | (imenu-progress-message prev-pos 100 t) |
| 827 | ;; Sort each submenu by position. | 841 | ;; Sort each submenu by position. |
diff --git a/lisp/info.el b/lisp/info.el index 4fc7b5c9cf7..2e0ddd0fb02 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -1980,7 +1980,7 @@ Because of ambiguities, this should be concatenated with something like | |||
| 1980 | (if (match-beginning 5) | 1980 | (if (match-beginning 5) |
| 1981 | (string-to-number (match-string 5)) | 1981 | (string-to-number (match-string 5)) |
| 1982 | (buffer-substring (match-beginning 0) (1- (match-beginning 1))))) | 1982 | (buffer-substring (match-beginning 0) (1- (match-beginning 1))))) |
| 1983 | ;;; Comment out the next line to use names of cross-references: | 1983 | ;;; Uncomment next line to use names of cross-references in non-index nodes: |
| 1984 | ;;; (setq Info-point-loc | 1984 | ;;; (setq Info-point-loc |
| 1985 | ;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1)))) | 1985 | ;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1)))) |
| 1986 | ) | 1986 | ) |
| @@ -3214,7 +3214,7 @@ Allowed only if variable `Info-enable-edit' is non-nil." | |||
| 3214 | (message "Tags may have changed. Use Info-tagify if necessary"))) | 3214 | (message "Tags may have changed. Use Info-tagify if necessary"))) |
| 3215 | 3215 | ||
| 3216 | (defvar Info-file-list-for-emacs | 3216 | (defvar Info-file-list-for-emacs |
| 3217 | '("ediff" "eudc" "forms" "gnus" "info" ("mh" . "mh-e") | 3217 | '("ediff" "eudc" "forms" "gnus" "info" ("Info" . "info") ("mh" . "mh-e") |
| 3218 | "sc" "message" ("dired" . "dired-x") "viper" "vip" "idlwave" | 3218 | "sc" "message" ("dired" . "dired-x") "viper" "vip" "idlwave" |
| 3219 | ("c" . "ccmode") ("c++" . "ccmode") ("objc" . "ccmode") | 3219 | ("c" . "ccmode") ("c++" . "ccmode") ("objc" . "ccmode") |
| 3220 | ("java" . "ccmode") ("idl" . "ccmode") ("pike" . "ccmode") | 3220 | ("java" . "ccmode") ("idl" . "ccmode") ("pike" . "ccmode") |
| @@ -3245,11 +3245,13 @@ The `info-file' property of COMMAND says which Info manual to search. | |||
| 3245 | If COMMAND has no property, the variable `Info-file-list-for-emacs' | 3245 | If COMMAND has no property, the variable `Info-file-list-for-emacs' |
| 3246 | defines heuristics for which Info manual to try. | 3246 | defines heuristics for which Info manual to try. |
| 3247 | The locations are of the format used in `Info-history', i.e. | 3247 | The locations are of the format used in `Info-history', i.e. |
| 3248 | \(FILENAME NODENAME BUFFERPOS\)." | 3248 | \(FILENAME NODENAME BUFFERPOS\), where BUFFERPOS is the line number |
| 3249 | (let ((where '()) | 3249 | in the first element of the returned list (which is treated specially in |
| 3250 | `Info-goto-emacs-command-node'), and 0 for the rest elements of a list." | ||
| 3251 | (let ((where '()) line-number | ||
| 3250 | (cmd-desc (concat "^\\* +" (regexp-quote (symbol-name command)) | 3252 | (cmd-desc (concat "^\\* +" (regexp-quote (symbol-name command)) |
| 3251 | "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\." | 3253 | "\\( <[0-9]+>\\)?:\\s *\\(.*\\)\\." |
| 3252 | "\\([ \t]*(line[ \t]*[0-9]*)\\)?$")) | 3254 | "\\(?:[ \t\n]+(line +\\([0-9]+\\))\\)?")) |
| 3253 | (info-file "emacs")) ;default | 3255 | (info-file "emacs")) ;default |
| 3254 | ;; Determine which info file this command is documented in. | 3256 | ;; Determine which info file this command is documented in. |
| 3255 | (if (get command 'info-file) | 3257 | (if (get command 'info-file) |
| @@ -3288,11 +3290,17 @@ The locations are of the format used in `Info-history', i.e. | |||
| 3288 | (cons (list Info-current-file | 3290 | (cons (list Info-current-file |
| 3289 | (match-string-no-properties 2) | 3291 | (match-string-no-properties 2) |
| 3290 | 0) | 3292 | 0) |
| 3291 | where))) | 3293 | where)) |
| 3294 | (setq line-number (and (match-beginning 3) | ||
| 3295 | (string-to-number (match-string 3))))) | ||
| 3292 | (and (setq nodes (cdr nodes) node (car nodes)))) | 3296 | (and (setq nodes (cdr nodes) node (car nodes)))) |
| 3293 | (Info-goto-node node))) | 3297 | (Info-goto-node node))) |
| 3294 | where)) | 3298 | (if (and line-number where) |
| 3299 | (cons (list (nth 0 (car where)) (nth 1 (car where)) line-number) | ||
| 3300 | (cdr where)) | ||
| 3301 | where))) | ||
| 3295 | 3302 | ||
| 3303 | ;;;###autoload (put 'Info-goto-emacs-command-node 'info-file "emacs") | ||
| 3296 | ;;;###autoload | 3304 | ;;;###autoload |
| 3297 | (defun Info-goto-emacs-command-node (command) | 3305 | (defun Info-goto-emacs-command-node (command) |
| 3298 | "Go to the Info node in the Emacs manual for command COMMAND. | 3306 | "Go to the Info node in the Emacs manual for command COMMAND. |
| @@ -3316,9 +3324,11 @@ COMMAND must be a symbol or string." | |||
| 3316 | ;; Bind Info-history to nil, to prevent the last Index node | 3324 | ;; Bind Info-history to nil, to prevent the last Index node |
| 3317 | ;; visited by Info-find-emacs-command-nodes from being | 3325 | ;; visited by Info-find-emacs-command-nodes from being |
| 3318 | ;; pushed onto the history. | 3326 | ;; pushed onto the history. |
| 3319 | (let ((Info-history nil) (Info-history-list nil)) | 3327 | (let ((Info-history nil) (Info-history-list nil) |
| 3320 | (Info-find-node (car (car where)) | 3328 | (line-number (nth 2 (car where)))) |
| 3321 | (car (cdr (car where))))) | 3329 | (Info-find-node (nth 0 (car where)) (nth 1 (car where))) |
| 3330 | (if (and (integerp line-number) (> line-number 0)) | ||
| 3331 | (forward-line (1- line-number)))) | ||
| 3322 | (if (> num-matches 1) | 3332 | (if (> num-matches 1) |
| 3323 | (progn | 3333 | (progn |
| 3324 | ;; (car where) will be pushed onto Info-history | 3334 | ;; (car where) will be pushed onto Info-history |
| @@ -3332,6 +3342,7 @@ COMMAND must be a symbol or string." | |||
| 3332 | (if (> num-matches 2) "them" "it"))))) | 3342 | (if (> num-matches 2) "them" "it"))))) |
| 3333 | (error "Couldn't find documentation for %s" command)))) | 3343 | (error "Couldn't find documentation for %s" command)))) |
| 3334 | 3344 | ||
| 3345 | ;;;###autoload (put 'Info-goto-emacs-key-command-node 'info-file "emacs") | ||
| 3335 | ;;;###autoload | 3346 | ;;;###autoload |
| 3336 | (defun Info-goto-emacs-key-command-node (key) | 3347 | (defun Info-goto-emacs-key-command-node (key) |
| 3337 | "Go to the node in the Emacs manual which describes the command bound to KEY. | 3348 | "Go to the node in the Emacs manual which describes the command bound to KEY. |
diff --git a/lisp/international/subst-big5.el b/lisp/international/subst-big5.el index f2004b07544..9a17974ab01 100644 --- a/lisp/international/subst-big5.el +++ b/lisp/international/subst-big5.el | |||
| @@ -32,9 +32,9 @@ | |||
| 32 | (lambda (pair) | 32 | (lambda (pair) |
| 33 | (let ((unicode (car pair)) | 33 | (let ((unicode (car pair)) |
| 34 | (char (cadr pair))) | 34 | (char (cadr pair))) |
| 35 | (if (or (and (>= unicode #x2e80) (<= unicode #xd7a3)) | 35 | ;; exclude non-supporting components from decode table |
| 36 | (and (>= unicode #xff00) (<= unicode #xffef))) | 36 | (if (utf-translate-cjk-substitutable-p unicode) |
| 37 | (puthash unicode char ucs-unicode-to-mule-cjk)) | 37 | (puthash unicode char ucs-unicode-to-mule-cjk)) |
| 38 | (puthash char unicode ucs-mule-cjk-to-unicode))) | 38 | (puthash char unicode ucs-mule-cjk-to-unicode))) |
| 39 | '((#xa7 ?¡±) | 39 | '((#xa7 ?¡±) |
| 40 | (#xaf ?¡Â) | 40 | (#xaf ?¡Â) |
diff --git a/lisp/international/subst-gb2312.el b/lisp/international/subst-gb2312.el index dba26c9bd5c..446420490c5 100644 --- a/lisp/international/subst-gb2312.el +++ b/lisp/international/subst-gb2312.el | |||
| @@ -32,9 +32,9 @@ | |||
| 32 | (lambda (pair) | 32 | (lambda (pair) |
| 33 | (let ((unicode (car pair)) | 33 | (let ((unicode (car pair)) |
| 34 | (char (cadr pair))) | 34 | (char (cadr pair))) |
| 35 | (if (or (and (>= unicode #x2e80) (<= unicode #xd7a3)) | 35 | ;; exclude non-supporting components from decode table |
| 36 | (and (>= unicode #xff00) (<= unicode #xffef))) | 36 | (if (utf-translate-cjk-substitutable-p unicode) |
| 37 | (puthash unicode char ucs-unicode-to-mule-cjk)) | 37 | (puthash unicode char ucs-unicode-to-mule-cjk)) |
| 38 | (puthash char unicode ucs-mule-cjk-to-unicode))) | 38 | (puthash char unicode ucs-mule-cjk-to-unicode))) |
| 39 | '((#xa4 ?¡è) | 39 | '((#xa4 ?¡è) |
| 40 | (#xa7 ?¡ì) | 40 | (#xa7 ?¡ì) |
diff --git a/lisp/international/subst-jis.el b/lisp/international/subst-jis.el index edd01c0a0b3..2dfe3297ba0 100644 --- a/lisp/international/subst-jis.el +++ b/lisp/international/subst-jis.el | |||
| @@ -45,11 +45,11 @@ | |||
| 45 | (mapc | 45 | (mapc |
| 46 | (lambda (pair) | 46 | (lambda (pair) |
| 47 | (let ((unicode (car pair)) | 47 | (let ((unicode (car pair)) |
| 48 | (char (cadr pair))) | 48 | (char (cadr pair)) |
| 49 | ;; exclude non-CJK components from decode table | 49 | (tail utf-translate-cjk-unicode-range)) |
| 50 | (if (or (and (>= unicode #x2e80) (<= unicode #xd7a3)) | 50 | ;; exclude non-supporting components from decode table |
| 51 | (and (>= unicode #xff00) (<= unicode #xffef))) | 51 | (if (utf-translate-cjk-substitutable-p unicode) |
| 52 | (puthash unicode char ucs-unicode-to-mule-cjk)) | 52 | (puthash unicode char ucs-unicode-to-mule-cjk)) |
| 53 | (puthash char unicode ucs-mule-cjk-to-unicode))) | 53 | (puthash char unicode ucs-mule-cjk-to-unicode))) |
| 54 | '( | 54 | '( |
| 55 | ;; jisx0208 | 55 | ;; jisx0208 |
| @@ -13001,7 +13001,73 @@ | |||
| 13001 | (#x9fa2 ?íá) | 13001 | (#x9fa2 ?íá) |
| 13002 | (#x9fa3 ?íâ) | 13002 | (#x9fa3 ?íâ) |
| 13003 | (#x9fa5 ?íã) | 13003 | (#x9fa5 ?íã) |
| 13004 | (#xff5e ?¢·))) | 13004 | (#xff5e ?¢·) |
| 13005 | |||
| 13006 | ;; jisx0201 | ||
| 13007 | (#xFF61 ?Ž¡) | ||
| 13008 | (#xFF62 ?\Ž¢) | ||
| 13009 | (#xFF63 ?\Ž£) | ||
| 13010 | (#xFF64 ?ޤ) | ||
| 13011 | (#xFF65 ?Ž¥) | ||
| 13012 | (#xFF66 ?ަ) | ||
| 13013 | (#xFF67 ?ާ) | ||
| 13014 | (#xFF68 ?ލ) | ||
| 13015 | (#xFF69 ?Ž©) | ||
| 13016 | (#xFF6A ?Žª) | ||
| 13017 | (#xFF6B ?Ž«) | ||
| 13018 | (#xFF6C ?ެ) | ||
| 13019 | (#xFF6D ?Ž) | ||
| 13020 | (#xFF6E ?Ž®) | ||
| 13021 | (#xFF6F ?ޝ) | ||
| 13022 | (#xFF70 ?ް) | ||
| 13023 | (#xFF71 ?ޱ) | ||
| 13024 | (#xFF72 ?޲) | ||
| 13025 | (#xFF73 ?޳) | ||
| 13026 | (#xFF74 ?Ž´) | ||
| 13027 | (#xFF75 ?޵) | ||
| 13028 | (#xFF76 ?޶) | ||
| 13029 | (#xFF77 ?Ž·) | ||
| 13030 | (#xFF78 ?ޏ) | ||
| 13031 | (#xFF79 ?޹) | ||
| 13032 | (#xFF7A ?Žº) | ||
| 13033 | (#xFF7B ?Ž») | ||
| 13034 | (#xFF7C ?޼) | ||
| 13035 | (#xFF7D ?޽) | ||
| 13036 | (#xFF7E ?޾) | ||
| 13037 | (#xFF7F ?Ž¿) | ||
| 13038 | (#xFF80 ?ŽÀ) | ||
| 13039 | (#xFF81 ?ŽÁ) | ||
| 13040 | (#xFF82 ?ŽÂ) | ||
| 13041 | (#xFF83 ?ŽÃ) | ||
| 13042 | (#xFF84 ?ŽÄ) | ||
| 13043 | (#xFF85 ?ŽÅ) | ||
| 13044 | (#xFF86 ?ŽÆ) | ||
| 13045 | (#xFF87 ?ŽÇ) | ||
| 13046 | (#xFF88 ?ŽÈ) | ||
| 13047 | (#xFF89 ?ŽÉ) | ||
| 13048 | (#xFF8A ?ŽÊ) | ||
| 13049 | (#xFF8B ?ŽË) | ||
| 13050 | (#xFF8C ?ŽÌ) | ||
| 13051 | (#xFF8D ?ŽÍ) | ||
| 13052 | (#xFF8E ?ŽÎ) | ||
| 13053 | (#xFF8F ?ŽÏ) | ||
| 13054 | (#xFF90 ?ŽÐ) | ||
| 13055 | (#xFF91 ?ŽÑ) | ||
| 13056 | (#xFF92 ?ŽÒ) | ||
| 13057 | (#xFF93 ?ŽÓ) | ||
| 13058 | (#xFF94 ?ŽÔ) | ||
| 13059 | (#xFF95 ?ŽÕ) | ||
| 13060 | (#xFF96 ?ŽÖ) | ||
| 13061 | (#xFF97 ?Ž×) | ||
| 13062 | (#xFF98 ?ŽØ) | ||
| 13063 | (#xFF99 ?ŽÙ) | ||
| 13064 | (#xFF9A ?ŽÚ) | ||
| 13065 | (#xFF9B ?ŽÛ) | ||
| 13066 | (#xFF9C ?ŽÜ) | ||
| 13067 | (#xFF9D ?ŽÝ) | ||
| 13068 | (#xFF9E ?ŽÞ) | ||
| 13069 | (#xFF9F ?Žß) | ||
| 13070 | )) | ||
| 13005 | 13071 | ||
| 13006 | ;;; arch-tag: 7f320453-b293-4159-af5e-6f0bab03048c | 13072 | ;;; arch-tag: 7f320453-b293-4159-af5e-6f0bab03048c |
| 13007 | ;;; subst-jis.el ends here | 13073 | ;;; subst-jis.el ends here |
diff --git a/lisp/international/subst-ksc.el b/lisp/international/subst-ksc.el index 9f4b329b675..3cc339bbf8b 100644 --- a/lisp/international/subst-ksc.el +++ b/lisp/international/subst-ksc.el | |||
| @@ -31,9 +31,9 @@ | |||
| 31 | (lambda (pair) | 31 | (lambda (pair) |
| 32 | (let ((unicode (car pair)) | 32 | (let ((unicode (car pair)) |
| 33 | (char (cadr pair))) | 33 | (char (cadr pair))) |
| 34 | (if (or (and (>= unicode #x2e80) (<= unicode #xd7a3)) | 34 | ;; exclude non-supporting components from decode table |
| 35 | (and (>= unicode #xff00) (<= unicode #xffef))) | 35 | (if (utf-translate-cjk-substitutable-p unicode) |
| 36 | (puthash unicode char ucs-unicode-to-mule-cjk)) | 36 | (puthash unicode char ucs-unicode-to-mule-cjk)) |
| 37 | (puthash char unicode ucs-mule-cjk-to-unicode))) | 37 | (puthash char unicode ucs-mule-cjk-to-unicode))) |
| 38 | '((#xa1 ?¢®) | 38 | '((#xa1 ?¢®) |
| 39 | (#xa4 ?¢´) | 39 | (#xa4 ?¢´) |
diff --git a/lisp/international/utf-8.el b/lisp/international/utf-8.el index 5a7acee0f0e..ed658eb3ddf 100644 --- a/lisp/international/utf-8.el +++ b/lisp/international/utf-8.el | |||
| @@ -194,13 +194,88 @@ Setting this variable outside customize has no effect." | |||
| 194 | (defconst utf-translate-cjk-charsets '(chinese-gb2312 | 194 | (defconst utf-translate-cjk-charsets '(chinese-gb2312 |
| 195 | chinese-big5-1 chinese-big5-2 | 195 | chinese-big5-1 chinese-big5-2 |
| 196 | japanese-jisx0208 japanese-jisx0212 | 196 | japanese-jisx0208 japanese-jisx0212 |
| 197 | katakana-jisx0201 | ||
| 197 | korean-ksc5601) | 198 | korean-ksc5601) |
| 198 | "List of charsets supported by `utf-translate-cjk-mode'.") | 199 | "List of charsets supported by `utf-translate-cjk-mode'.") |
| 199 | 200 | ||
| 200 | (defconst utf-translate-cjk-unicode-range | 201 | (defvar utf-translate-cjk-lang-env nil |
| 201 | '((#x2e80 . #xd7a3) | 202 | "Language environment in which tables for `utf-translate-cjk-mode' is loaded. |
| 202 | (#xff00 . #xffef)) | 203 | The value nil means that the tables are not yet loaded.") |
| 203 | "List of Unicode code ranges supported by `utf-translate-cjk-mode'.") | 204 | |
| 205 | (defvar utf-translate-cjk-unicode-range) | ||
| 206 | |||
| 207 | ;; String generated from utf-translate-cjk-unicode-range. It is | ||
| 208 | ;; suitable for an argument to skip-chars-forward. | ||
| 209 | (defvar utf-translate-cjk-unicode-range-string nil) | ||
| 210 | |||
| 211 | (defun utf-translate-cjk-set-unicode-range (range) | ||
| 212 | (setq utf-translate-cjk-unicode-range range) | ||
| 213 | (setq utf-translate-cjk-unicode-range-string | ||
| 214 | (let ((decode-char-no-trans | ||
| 215 | #'(lambda (x) | ||
| 216 | (cond ((< x #x100) (make-char 'latin-iso8859-1 x)) | ||
| 217 | ((< x #x2500) | ||
| 218 | (setq x (- x #x100)) | ||
| 219 | (make-char 'mule-unicode-0100-24ff | ||
| 220 | (+ (/ x 96) 32) (+ (% x 96) 32))) | ||
| 221 | ((< x #x3400) | ||
| 222 | (setq x (- x #x2500)) | ||
| 223 | (make-char 'mule-unicode-2500-33ff | ||
| 224 | (+ (/ x 96) 32) (+ (% x 96) 32))) | ||
| 225 | (t | ||
| 226 | (setq x (- x #xe000)) | ||
| 227 | (make-char 'mule-unicode-e000-ffff | ||
| 228 | (+ (/ x 96) 32) (+ (% x 96) 32)))))) | ||
| 229 | ranges from to) | ||
| 230 | (dolist (elt range) | ||
| 231 | (setq from (max #xA0 (car elt)) to (min #xffff (cdr elt))) | ||
| 232 | (if (and (>= to #x3400) (< to #xE000)) | ||
| 233 | (setq to #x33FF)) | ||
| 234 | (cond ((< from #x100) | ||
| 235 | (if (>= to #xE000) | ||
| 236 | (setq ranges (cons (cons #xE000 to) ranges) | ||
| 237 | to #x33FF)) | ||
| 238 | (if (>= to #x2500) | ||
| 239 | (setq ranges (cons (cons #x2500 to) ranges) | ||
| 240 | to #x24FF)) | ||
| 241 | (if (>= to #x100) | ||
| 242 | (setq ranges (cons (cons #x100 to) ranges) | ||
| 243 | to #xFF))) | ||
| 244 | ((< from #x2500) | ||
| 245 | (if (>= to #xE000) | ||
| 246 | (setq ranges (cons (cons #xE000 to) ranges) | ||
| 247 | to #x33FF)) | ||
| 248 | (if (>= to #x2500) | ||
| 249 | (setq ranges (cons (cons #x2500 to) ranges) | ||
| 250 | to #x24FF))) | ||
| 251 | ((< from #x3400) | ||
| 252 | (if (>= to #xE000) | ||
| 253 | (setq ranges (cons (cons #xE000 to) ranges) | ||
| 254 | to #x33FF)))) | ||
| 255 | (if (<= from to) | ||
| 256 | (setq ranges (cons (cons from to) ranges)))) | ||
| 257 | (mapconcat #'(lambda (x) | ||
| 258 | (format "%c-%c" | ||
| 259 | (funcall decode-char-no-trans (car x)) | ||
| 260 | (funcall decode-char-no-trans (cdr x)))) | ||
| 261 | ranges ""))) | ||
| 262 | ;; These forces loading and settting tables for | ||
| 263 | ;; utf-translate-cjk-mode. | ||
| 264 | (setq utf-translate-cjk-lang-env nil | ||
| 265 | ucs-mule-cjk-to-unicode (make-hash-table :test 'eq) | ||
| 266 | ucs-unicode-to-mule-cjk (make-hash-table :test 'eq))) | ||
| 267 | |||
| 268 | (defcustom utf-translate-cjk-unicode-range '((#x2e80 . #xd7a3) | ||
| 269 | (#xff00 . #xffef)) | ||
| 270 | "List of Unicode code ranges supported by `utf-translate-cjk-mode'. | ||
| 271 | Setting this variable directly does not take effect; | ||
| 272 | use either \\[customize] or the function | ||
| 273 | `utf-translate-cjk-set-unicode-range'." | ||
| 274 | :version "21.4" | ||
| 275 | :type '(repeat (cons integer integer)) | ||
| 276 | :set (lambda (symbol value) | ||
| 277 | (utf-translate-cjk-set-unicode-range value)) | ||
| 278 | :group 'mule) | ||
| 204 | 279 | ||
| 205 | ;; Return non-nil if CODE-POINT is in `utf-translate-cjk-unicode-range'. | 280 | ;; Return non-nil if CODE-POINT is in `utf-translate-cjk-unicode-range'. |
| 206 | (defsubst utf-translate-cjk-substitutable-p (code-point) | 281 | (defsubst utf-translate-cjk-substitutable-p (code-point) |
| @@ -213,10 +288,6 @@ Setting this variable outside customize has no effect." | |||
| 213 | (setq elt nil))) | 288 | (setq elt nil))) |
| 214 | elt)) | 289 | elt)) |
| 215 | 290 | ||
| 216 | (defvar utf-translate-cjk-lang-env nil | ||
| 217 | "Language environment in which tables for `utf-translate-cjk-mode' is loaded. | ||
| 218 | The value nil means that the tables are not yet loaded.") | ||
| 219 | |||
| 220 | (defun utf-translate-cjk-load-tables () | 291 | (defun utf-translate-cjk-load-tables () |
| 221 | "Load tables for `utf-translate-cjk-mode'." | 292 | "Load tables for `utf-translate-cjk-mode'." |
| 222 | ;; Fixme: Allow the use of the CJK charsets to be | 293 | ;; Fixme: Allow the use of the CJK charsets to be |
| @@ -425,25 +496,32 @@ by the above coding systems, you can customize the user option | |||
| 425 | ;; 2-byte encoding 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx | 496 | ;; 2-byte encoding 00000yyyyyxxxxxx = 110yyyyy 10xxxxxx |
| 426 | ((r1 &= #x3F) | 497 | ((r1 &= #x3F) |
| 427 | (r1 |= ((r0 & #x1F) << 6)) | 498 | (r1 |= ((r0 & #x1F) << 6)) |
| 428 | ;; Now r2 holds scalar value. We don't have to check | 499 | ;; Now r1 holds scalar value. We don't have to check |
| 429 | ;; `overlong sequence' because r0 >= 0xC2. | 500 | ;; `overlong sequence' because r0 >= 0xC2. |
| 430 | 501 | ||
| 431 | (if (r1 >= 256) | 502 | (if (r1 >= 256) |
| 432 | ;; mule-unicode-0100-24ff (< 0800) | 503 | ;; mule-unicode-0100-24ff (< 0800) |
| 433 | ((r0 = ,(charset-id 'mule-unicode-0100-24ff)) | 504 | ((r0 = r1) |
| 434 | (r1 -= #x0100) | 505 | (lookup-integer utf-subst-table-for-decode r0 r1) |
| 435 | (r2 = (((r1 / 96) + 32) << 7)) | 506 | (if (r7 == 0) |
| 436 | (r1 %= 96) | 507 | ((r0 = ,(charset-id 'mule-unicode-0100-24ff)) |
| 437 | (r1 += (r2 + 32)) | 508 | (r1 -= #x0100) |
| 438 | (translate-character | 509 | (r2 = (((r1 / 96) + 32) << 7)) |
| 439 | utf-translation-table-for-decode r0 r1) | 510 | (r1 %= 96) |
| 511 | (r1 += (r2 + 32)) | ||
| 512 | (translate-character | ||
| 513 | utf-translation-table-for-decode r0 r1))) | ||
| 440 | (write-multibyte-character r0 r1) | 514 | (write-multibyte-character r0 r1) |
| 441 | (read r0) | 515 | (read r0) |
| 442 | (repeat)) | 516 | (repeat)) |
| 443 | (if (r1 >= 160) | 517 | (if (r1 >= 160) |
| 444 | ;; latin-iso8859-1 | 518 | ;; latin-iso8859-1 |
| 445 | ((r1 -= 128) | 519 | ((r0 = r1) |
| 446 | (write-multibyte-character r6 r1) | 520 | (lookup-integer utf-subst-table-for-decode r0 r1) |
| 521 | (if (r7 == 0) | ||
| 522 | ((r1 -= 128) | ||
| 523 | (write-multibyte-character r6 r1)) | ||
| 524 | ((write-multibyte-character r0 r1))) | ||
| 447 | (read r0) | 525 | (read r0) |
| 448 | (repeat)) | 526 | (repeat)) |
| 449 | ;; eight-bit-control | 527 | ;; eight-bit-control |
| @@ -482,13 +560,16 @@ by the above coding systems, you can customize the user option | |||
| 482 | 560 | ||
| 483 | (if (r3 < #x2500) | 561 | (if (r3 < #x2500) |
| 484 | ;; mule-unicode-0100-24ff (>= 0800) | 562 | ;; mule-unicode-0100-24ff (>= 0800) |
| 485 | ((r0 = ,(charset-id 'mule-unicode-0100-24ff)) | 563 | ((r0 = r3) |
| 486 | (r3 -= #x0100) | 564 | (lookup-integer utf-subst-table-for-decode r0 r1) |
| 487 | (r3 //= 96) | 565 | (if (r7 == 0) |
| 488 | (r1 = (r7 + 32)) | 566 | ((r0 = ,(charset-id 'mule-unicode-0100-24ff)) |
| 489 | (r1 += ((r3 + 32) << 7)) | 567 | (r3 -= #x0100) |
| 490 | (translate-character | 568 | (r3 //= 96) |
| 491 | utf-translation-table-for-decode r0 r1) | 569 | (r1 = (r7 + 32)) |
| 570 | (r1 += ((r3 + 32) << 7)) | ||
| 571 | (translate-character | ||
| 572 | utf-translation-table-for-decode r0 r1))) | ||
| 492 | (write-multibyte-character r0 r1) | 573 | (write-multibyte-character r0 r1) |
| 493 | (read r0) | 574 | (read r0) |
| 494 | (repeat))) | 575 | (repeat))) |
| @@ -874,17 +955,17 @@ Also compose particular scripts if `utf-8-compose-scripts' is non-nil." | |||
| 874 | hash-table ch) | 955 | hash-table ch) |
| 875 | (set-buffer-multibyte t) | 956 | (set-buffer-multibyte t) |
| 876 | (when utf-translate-cjk-mode | 957 | (when utf-translate-cjk-mode |
| 877 | (if (not utf-translate-cjk-lang-env) | 958 | (unless utf-translate-cjk-lang-env |
| 878 | ;; Check these characters: | 959 | ;; Check these characters in utf-translate-cjk-range. |
| 879 | ;; "U+2e80-U+33ff", "U+ff00-U+ffef" | 960 | ;; We may have to translate them to CJK charsets. |
| 880 | ;; We may have to translate them to CJK charsets. | 961 | (skip-chars-forward |
| 881 | (let ((range2 "$,29@(B-$,2G$,3r`(B-$,3u/(B")) | 962 | (concat range utf-translate-cjk-unicode-range-string)) |
| 882 | (skip-chars-forward (concat range range2)) | 963 | (unless (eobp) |
| 883 | (unless (eobp) | 964 | (utf-translate-cjk-load-tables) |
| 884 | (utf-translate-cjk-load-tables) | 965 | (setq range |
| 885 | (setq range (concat range range2))) | 966 | (concat range utf-translate-cjk-unicode-range-string))) |
| 886 | (setq hash-table (get 'utf-subst-table-for-decode | 967 | (setq hash-table (get 'utf-subst-table-for-decode |
| 887 | 'translation-hash-table))))) | 968 | 'translation-hash-table)))) |
| 888 | (while (and (skip-chars-forward range) | 969 | (while (and (skip-chars-forward range) |
| 889 | (not (eobp))) | 970 | (not (eobp))) |
| 890 | (setq ch (following-char)) | 971 | (setq ch (following-char)) |
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index e93f76c3042..c5579b3c0db 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el | |||
| @@ -128,6 +128,9 @@ usually do not have translators to read other languages for them.\n\n") | |||
| 128 | (insert "\n\n\n") | 128 | (insert "\n\n\n") |
| 129 | 129 | ||
| 130 | (insert "In " (emacs-version) "\n") | 130 | (insert "In " (emacs-version) "\n") |
| 131 | (if (fboundp 'x-server-vendor) | ||
| 132 | (insert "Distributor `" (x-server-vendor) "', version " | ||
| 133 | (mapconcat 'number-to-string (x-server-version) ".") "\n")) | ||
| 131 | (if (and system-configuration-options | 134 | (if (and system-configuration-options |
| 132 | (not (equal system-configuration-options ""))) | 135 | (not (equal system-configuration-options ""))) |
| 133 | (insert "configured using `configure " | 136 | (insert "configured using `configure " |
diff --git a/lisp/man.el b/lisp/man.el index cbfae21e44b..afd183fa720 100644 --- a/lisp/man.el +++ b/lisp/man.el | |||
| @@ -893,12 +893,15 @@ header file(#include <foo.h>) and files in FILES" | |||
| 893 | 'Man-target-string (match-string target-pos) | 893 | 'Man-target-string (match-string target-pos) |
| 894 | ))))) | 894 | ))))) |
| 895 | 895 | ||
| 896 | (defun Man-cleanup-manpage () | 896 | (defun Man-cleanup-manpage (&optional interactive) |
| 897 | "Remove overstriking and underlining from the current buffer." | 897 | "Remove overstriking and underlining from the current buffer. |
| 898 | (interactive) | 898 | Normally skip any jobs that should have been done by the sed script, |
| 899 | but when called interactively, do those jobs even if the sed | ||
| 900 | script would have done them." | ||
| 901 | (interactive "p") | ||
| 899 | (message "Please wait: cleaning up the %s man page..." | 902 | (message "Please wait: cleaning up the %s man page..." |
| 900 | Man-arguments) | 903 | Man-arguments) |
| 901 | (if (or (interactive-p) (not Man-sed-script)) | 904 | (if (or interactive (not Man-sed-script)) |
| 902 | (progn | 905 | (progn |
| 903 | (goto-char (point-min)) | 906 | (goto-char (point-min)) |
| 904 | (while (search-forward "_\b" nil t) (backward-delete-char 2)) | 907 | (while (search-forward "_\b" nil t) (backward-delete-char 2)) |
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 17deeff4619..22840896c17 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -596,10 +596,12 @@ PROPS are additional properties." | |||
| 596 | 596 | ||
| 597 | (defmacro menu-bar-make-toggle (name variable doc message help &rest body) | 597 | (defmacro menu-bar-make-toggle (name variable doc message help &rest body) |
| 598 | `(progn | 598 | `(progn |
| 599 | (defun ,name () | 599 | (defun ,name (&optional interactively) |
| 600 | ,(concat "Toggle whether to " (downcase (substring help 0 1)) | 600 | ,(concat "Toggle whether to " (downcase (substring help 0 1)) |
| 601 | (substring help 1) ".") | 601 | (substring help 1) ".\ |
| 602 | (interactive) | 602 | In an interactive call, record this option as a candidate for saving |
| 603 | by \"Save Options\" in Custom buffers.") | ||
| 604 | (interactive "p") | ||
| 603 | (if ,(if body `(progn . ,body) | 605 | (if ,(if body `(progn . ,body) |
| 604 | `(progn | 606 | `(progn |
| 605 | (custom-load-symbol ',variable) | 607 | (custom-load-symbol ',variable) |
| @@ -612,7 +614,7 @@ PROPS are additional properties." | |||
| 612 | ;; a variable is set interactively, as the purpose is to mark it as | 614 | ;; a variable is set interactively, as the purpose is to mark it as |
| 613 | ;; a candidate for "Save Options", and we do not want to save options | 615 | ;; a candidate for "Save Options", and we do not want to save options |
| 614 | ;; the user have already set explicitly in his init file. | 616 | ;; the user have already set explicitly in his init file. |
| 615 | (if (interactive-p) (customize-mark-as-set ',variable))) | 617 | (if interactively (customize-mark-as-set ',variable))) |
| 616 | '(menu-item ,doc ,name | 618 | '(menu-item ,doc ,name |
| 617 | :help ,help | 619 | :help ,help |
| 618 | :button (:toggle . (and (default-boundp ',variable) | 620 | :button (:toggle . (and (default-boundp ',variable) |
diff --git a/lisp/mouse-sel.el b/lisp/mouse-sel.el index f9b90fbfc6a..4f3741a5213 100644 --- a/lisp/mouse-sel.el +++ b/lisp/mouse-sel.el | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | ;;; mouse-sel.el --- multi-click selection support for Emacs 19 | 1 | ;;; mouse-sel.el --- multi-click selection support for Emacs 19 |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1993,1994,1995,2001,2002 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1993, 1994, 1995, 2001, 2002, 2004 |
| 4 | ;; Free Software Foundation, Inc. | ||
| 4 | 5 | ||
| 5 | ;; Author: Mike Williams <mdub@bigfoot.com> | 6 | ;; Author: Mike Williams <mdub@bigfoot.com> |
| 6 | ;; Keywords: mouse | 7 | ;; Keywords: mouse |
| @@ -240,9 +241,10 @@ to the kill ring. Pressing mouse-1 or mouse-3 kills it. | |||
| 240 | & mouse-3, but operate on the X secondary selection rather than the | 241 | & mouse-3, but operate on the X secondary selection rather than the |
| 241 | primary selection and region." | 242 | primary selection and region." |
| 242 | :global t | 243 | :global t |
| 244 | :group 'mouse-sel | ||
| 243 | (if mouse-sel-mode | 245 | (if mouse-sel-mode |
| 244 | (progn | 246 | (progn |
| 245 | (add-hook 'x-lost-selection-hooks 'mouse-sel-lost-selection-hook) | 247 | (add-hook 'x-lost-selection-functions 'mouse-sel-lost-selection-hook) |
| 246 | (when mouse-sel-default-bindings | 248 | (when mouse-sel-default-bindings |
| 247 | ;; Save original bindings and replace them with new ones. | 249 | ;; Save original bindings and replace them with new ones. |
| 248 | (setq mouse-sel-original-bindings | 250 | (setq mouse-sel-original-bindings |
| @@ -262,7 +264,7 @@ primary selection and region." | |||
| 262 | interprogram-paste-function nil)))) | 264 | interprogram-paste-function nil)))) |
| 263 | 265 | ||
| 264 | ;; Restore original bindings | 266 | ;; Restore original bindings |
| 265 | (remove-hook 'x-lost-selection-hooks 'mouse-sel-lost-selection-hook) | 267 | (remove-hook 'x-lost-selection-functions 'mouse-sel-lost-selection-hook) |
| 266 | (dolist (binding mouse-sel-original-bindings) | 268 | (dolist (binding mouse-sel-original-bindings) |
| 267 | (global-set-key (car binding) (cdr binding))) | 269 | (global-set-key (car binding) (cdr binding))) |
| 268 | ;; Restore the old values of these variables, | 270 | ;; Restore the old values of these variables, |
| @@ -711,5 +713,5 @@ If `mouse-yank-at-point' is non-nil, insert at point instead." | |||
| 711 | 713 | ||
| 712 | (provide 'mouse-sel) | 714 | (provide 'mouse-sel) |
| 713 | 715 | ||
| 714 | ;;; arch-tag: 86e6c73f-deaa-48d3-a24e-c565fda1f7d7 | 716 | ;; arch-tag: 86e6c73f-deaa-48d3-a24e-c565fda1f7d7 |
| 715 | ;;; mouse-sel.el ends here | 717 | ;;; mouse-sel.el ends here |
diff --git a/lisp/mouse.el b/lisp/mouse.el index abf62a97836..8f05324d84d 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -1025,54 +1025,56 @@ If MODE is 2 then do the same for lines." | |||
| 1025 | "List of keys which shall cause the mouse region to be deleted.") | 1025 | "List of keys which shall cause the mouse region to be deleted.") |
| 1026 | 1026 | ||
| 1027 | (defun mouse-show-mark () | 1027 | (defun mouse-show-mark () |
| 1028 | (if transient-mark-mode | 1028 | (let ((inhibit-quit t) |
| 1029 | (delete-overlay mouse-drag-overlay) | 1029 | (echo-keystrokes 0) |
| 1030 | (let ((inhibit-quit t) | 1030 | event events key ignore |
| 1031 | (echo-keystrokes 0) | 1031 | (x-lost-selection-functions |
| 1032 | event events key ignore | 1032 | (when (boundp 'x-lost-selection-functions) |
| 1033 | x-lost-selection-hooks) | 1033 | (copy-sequence x-lost-selection-functions)))) |
| 1034 | (add-hook 'x-lost-selection-hooks | 1034 | (add-hook 'x-lost-selection-functions |
| 1035 | (lambda (seltype) | 1035 | (lambda (seltype) |
| 1036 | (if (eq seltype 'PRIMARY) | 1036 | (when (eq seltype 'PRIMARY) |
| 1037 | (progn (setq ignore t) | 1037 | (setq ignore t) |
| 1038 | (throw 'mouse-show-mark t))))) | 1038 | (throw 'mouse-show-mark t)))) |
| 1039 | (move-overlay mouse-drag-overlay (point) (mark t)) | 1039 | (if transient-mark-mode |
| 1040 | (catch 'mouse-show-mark | 1040 | (delete-overlay mouse-drag-overlay) |
| 1041 | ;; In this loop, execute scroll bar and switch-frame events. | 1041 | (move-overlay mouse-drag-overlay (point) (mark t))) |
| 1042 | ;; Also ignore down-events that are undefined. | 1042 | (catch 'mouse-show-mark |
| 1043 | (while (progn (setq event (read-event)) | 1043 | ;; In this loop, execute scroll bar and switch-frame events. |
| 1044 | (setq events (append events (list event))) | 1044 | ;; Also ignore down-events that are undefined. |
| 1045 | (setq key (apply 'vector events)) | 1045 | (while (progn (setq event (read-event)) |
| 1046 | (or (and (consp event) | 1046 | (setq events (append events (list event))) |
| 1047 | (eq (car event) 'switch-frame)) | 1047 | (setq key (apply 'vector events)) |
| 1048 | (and (consp event) | 1048 | (or (and (consp event) |
| 1049 | (eq (posn-point (event-end event)) | 1049 | (eq (car event) 'switch-frame)) |
| 1050 | 'vertical-scroll-bar)) | 1050 | (and (consp event) |
| 1051 | (and (memq 'down (event-modifiers event)) | 1051 | (eq (posn-point (event-end event)) |
| 1052 | (not (key-binding key)) | 1052 | 'vertical-scroll-bar)) |
| 1053 | (not (mouse-undouble-last-event events)) | 1053 | (and (memq 'down (event-modifiers event)) |
| 1054 | (not (member key mouse-region-delete-keys))))) | 1054 | (not (key-binding key)) |
| 1055 | (and (consp event) | 1055 | (not (mouse-undouble-last-event events)) |
| 1056 | (or (eq (car event) 'switch-frame) | 1056 | (not (member key mouse-region-delete-keys))))) |
| 1057 | (eq (posn-point (event-end event)) | 1057 | (and (consp event) |
| 1058 | 'vertical-scroll-bar)) | 1058 | (or (eq (car event) 'switch-frame) |
| 1059 | (let ((keys (vector 'vertical-scroll-bar event))) | 1059 | (eq (posn-point (event-end event)) |
| 1060 | (and (key-binding keys) | 1060 | 'vertical-scroll-bar)) |
| 1061 | (progn | 1061 | (let ((keys (vector 'vertical-scroll-bar event))) |
| 1062 | (call-interactively (key-binding keys) | 1062 | (and (key-binding keys) |
| 1063 | nil keys) | 1063 | (progn |
| 1064 | (setq events nil))))))) | 1064 | (call-interactively (key-binding keys) |
| 1065 | ;; If we lost the selection, just turn off the highlighting. | 1065 | nil keys) |
| 1066 | (if ignore | 1066 | (setq events nil))))))) |
| 1067 | nil | 1067 | ;; If we lost the selection, just turn off the highlighting. |
| 1068 | ;; For certain special keys, delete the region. | 1068 | (unless ignore |
| 1069 | (if (member key mouse-region-delete-keys) | 1069 | ;; For certain special keys, delete the region. |
| 1070 | (delete-region (overlay-start mouse-drag-overlay) | 1070 | (if (member key mouse-region-delete-keys) |
| 1071 | (overlay-end mouse-drag-overlay)) | 1071 | (delete-region (overlay-start mouse-drag-overlay) |
| 1072 | ;; Otherwise, unread the key so it gets executed normally. | 1072 | (overlay-end mouse-drag-overlay)) |
| 1073 | (setq unread-command-events | 1073 | ;; Otherwise, unread the key so it gets executed normally. |
| 1074 | (nconc events unread-command-events)))) | 1074 | (setq unread-command-events |
| 1075 | (setq quit-flag nil) | 1075 | (nconc events unread-command-events)))) |
| 1076 | (setq quit-flag nil) | ||
| 1077 | (unless transient-mark-mode | ||
| 1076 | (delete-overlay mouse-drag-overlay)))) | 1078 | (delete-overlay mouse-drag-overlay)))) |
| 1077 | 1079 | ||
| 1078 | (defun mouse-set-mark (click) | 1080 | (defun mouse-set-mark (click) |
diff --git a/lisp/net/password.el b/lisp/net/password.el deleted file mode 100644 index e8be612ecca..00000000000 --- a/lisp/net/password.el +++ /dev/null | |||
| @@ -1,128 +0,0 @@ | |||
| 1 | ;;; password.el --- Read passwords from user, possibly using a password cache. | ||
| 2 | |||
| 3 | ;; Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Simon Josefsson <simon@josefsson.org> | ||
| 6 | ;; Created: 2003-12-21 | ||
| 7 | ;; Keywords: password cache passphrase key | ||
| 8 | |||
| 9 | ;; This file is part of GNU Emacs. | ||
| 10 | |||
| 11 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation; either version 2, or (at your option) | ||
| 14 | ;; any later version. | ||
| 15 | |||
| 16 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | |||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | ||
| 23 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
| 24 | ;; Boston, MA 02111-1307, USA. | ||
| 25 | |||
| 26 | ;;; Commentary: | ||
| 27 | |||
| 28 | ;; Greatly influenced by pgg.el written by Daiki Ueno, with timer | ||
| 29 | ;; fixes for XEmacs by Katsumi Yamaoka. In fact, this is mostly just | ||
| 30 | ;; a rip-off. | ||
| 31 | ;; | ||
| 32 | ;; (password-read "Password? " "test") | ||
| 33 | ;; ;; Minibuffer prompt for password. | ||
| 34 | ;; => "foo" | ||
| 35 | ;; | ||
| 36 | ;; (password-cache-add "test" "foo") | ||
| 37 | ;; => nil | ||
| 38 | |||
| 39 | ;; Note the previous two can be replaced with: | ||
| 40 | ;; (password-read-and-add "Password? " "test") | ||
| 41 | ;; ;; Minibuffer prompt for password. | ||
| 42 | ;; => "foo" | ||
| 43 | ;; ;; "foo" is now cached with key "test" | ||
| 44 | |||
| 45 | |||
| 46 | ;; (password-read "Password? " "test") | ||
| 47 | ;; ;; No minibuffer prompt | ||
| 48 | ;; => "foo" | ||
| 49 | ;; | ||
| 50 | ;; (password-read "Password? " "test") | ||
| 51 | ;; ;; No minibuffer prompt | ||
| 52 | ;; => "foo" | ||
| 53 | ;; | ||
| 54 | ;; ;; Wait `password-cache-expiry' seconds. | ||
| 55 | ;; | ||
| 56 | ;; (password-read "Password? " "test") | ||
| 57 | ;; ;; Minibuffer prompt for password is back. | ||
| 58 | ;; => "foo" | ||
| 59 | |||
| 60 | ;;; Code: | ||
| 61 | |||
| 62 | (when (featurep 'xemacs) | ||
| 63 | (require 'run-at-time)) | ||
| 64 | |||
| 65 | (eval-when-compile | ||
| 66 | (require 'cl)) | ||
| 67 | |||
| 68 | (defcustom password-cache t | ||
| 69 | "Whether to cache passwords." | ||
| 70 | :group 'password | ||
| 71 | :type 'boolean) | ||
| 72 | |||
| 73 | (defcustom password-cache-expiry 16 | ||
| 74 | "How many seconds passwords are cached, or nil to disable expiring. | ||
| 75 | Whether passwords are cached at all is controlled by `password-cache'." | ||
| 76 | :group 'password | ||
| 77 | :type '(choice (const :tag "Never" nil) | ||
| 78 | (integer :tag "Seconds"))) | ||
| 79 | |||
| 80 | (defvar password-data (make-vector 7 0)) | ||
| 81 | |||
| 82 | (defun password-read (prompt &optional key) | ||
| 83 | "Read password, for use with KEY, from user, or from cache if wanted. | ||
| 84 | KEY indicate the purpose of the password, so the cache can | ||
| 85 | separate passwords. The cache is not used if KEY is nil. It is | ||
| 86 | typically a string. | ||
| 87 | The variable `password-cache' control whether the cache is used." | ||
| 88 | (or (and password-cache | ||
| 89 | key | ||
| 90 | (symbol-value (intern-soft key password-data))) | ||
| 91 | (read-passwd prompt))) | ||
| 92 | |||
| 93 | (defun password-read-and-add (prompt &optional key) | ||
| 94 | "Read password, for use with KEY, from user, or from cache if wanted. | ||
| 95 | Then store the password in the cache. Uses `password-read' and | ||
| 96 | `password-cache-add'." | ||
| 97 | (let ((password (password-read prompt key))) | ||
| 98 | (when (and password key) | ||
| 99 | (password-cache-add key password)) | ||
| 100 | password)) | ||
| 101 | |||
| 102 | (defun password-cache-remove (key) | ||
| 103 | "Remove password indexed by KEY from password cache. | ||
| 104 | This is typically run be a timer setup from `password-cache-add', | ||
| 105 | but can be invoked at any time to forcefully remove passwords | ||
| 106 | from the cache. This may be useful when it has been detected | ||
| 107 | that a password is invalid, so that `password-read' query the | ||
| 108 | user again." | ||
| 109 | (let ((password (symbol-value (intern-soft key password-data)))) | ||
| 110 | (when password | ||
| 111 | (fillarray password ?_) | ||
| 112 | (unintern key password-data)))) | ||
| 113 | |||
| 114 | (defun password-cache-add (key password) | ||
| 115 | "Add password to cache. | ||
| 116 | The password is removed by a timer after `password-cache-expiry' | ||
| 117 | seconds." | ||
| 118 | (set (intern key password-data) password) | ||
| 119 | (when password-cache-expiry | ||
| 120 | (run-at-time password-cache-expiry nil | ||
| 121 | #'password-cache-remove | ||
| 122 | key)) | ||
| 123 | nil) | ||
| 124 | |||
| 125 | (provide 'password) | ||
| 126 | |||
| 127 | ;;; arch-tag: ab160494-16c8-4c68-a4a1-73eebf6686e5 | ||
| 128 | ;;; password.el ends here | ||
diff --git a/lisp/obsolete/hilit19.el b/lisp/obsolete/hilit19.el index 4d8af4b5a2b..a5fd33adcaa 100644 --- a/lisp/obsolete/hilit19.el +++ b/lisp/obsolete/hilit19.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; hilit19.el --- customizable highlighting for Emacs 19 | 1 | ;;; hilit19.el --- customizable highlighting for Emacs 19 |
| 2 | 2 | ||
| 3 | ;; Copyright (c) 1993, 1994, 2001 Free Software Foundation, Inc. | 3 | ;; Copyright (c) 1993, 1994, 2001, 2004 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Jonathan Stigelman <stig@hackvan.com> | 5 | ;; Author: Jonathan Stigelman <stig@hackvan.com> |
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -397,8 +397,6 @@ See the hilit-lookup-face-create documentation for valid face names.") | |||
| 397 | If hilit19 is dumped into emacs at your site, you may have to set this in | 397 | If hilit19 is dumped into emacs at your site, you may have to set this in |
| 398 | your init file.") | 398 | your init file.") |
| 399 | 399 | ||
| 400 | (eval-when-compile (setq byte-optimize t)) | ||
| 401 | |||
| 402 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 400 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 403 | ;; Use this to report bugs: | 401 | ;; Use this to report bugs: |
| 404 | 402 | ||
| @@ -945,47 +943,61 @@ the entire buffer is forced." | |||
| 945 | ;; Initialization. | 943 | ;; Initialization. |
| 946 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 944 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 947 | 945 | ||
| 948 | (and (not hilit-inhibit-rebinding) | 946 | (define-minor-mode hilit-mode |
| 949 | (progn | 947 | "Obsolete minor mode. Use `global-font-lock-mode' instead." |
| 950 | (substitute-key-definition 'yank 'hilit-yank | 948 | :global t |
| 951 | (current-global-map)) | 949 | |
| 952 | (substitute-key-definition 'yank-pop 'hilit-yank-pop | 950 | (unless (and hilit-inhibit-rebinding hilit-mode) |
| 953 | (current-global-map)) | 951 | (substitute-key-definition |
| 954 | (substitute-key-definition 'recenter 'hilit-recenter | 952 | (if hilit-mode 'yank 'hilit-yank) |
| 955 | (current-global-map)))) | 953 | (if hilit-mode 'hilit-yank 'yank) |
| 956 | 954 | (current-global-map)) | |
| 957 | (global-set-key [?\C-\S-l] 'hilit-repaint-command) | 955 | (substitute-key-definition |
| 958 | 956 | (if hilit-mode 'yank-pop 'hilit-yank-pop) | |
| 959 | (add-hook 'find-file-hook 'hilit-find-file-hook t) | 957 | (if hilit-mode 'hilit-yank-pop 'yank-pop) |
| 958 | (current-global-map)) | ||
| 959 | (substitute-key-definition | ||
| 960 | (if hilit-mode 'recenter 'hilit-recenter) | ||
| 961 | (if hilit-mode 'hilit-recenter 'recenter) | ||
| 962 | (current-global-map))) | ||
| 963 | |||
| 964 | (if hilit-mode | ||
| 965 | (global-set-key [?\C-\S-l] 'hilit-repaint-command) | ||
| 966 | (global-unset-key [?\C-\S-l])) | ||
| 967 | |||
| 968 | (if hilit-mode | ||
| 969 | (add-hook 'find-file-hook 'hilit-find-file-hook t) | ||
| 970 | (remove-hook 'find-file-hook 'hilit-find-file-hook)) | ||
| 971 | |||
| 972 | (unless (and hilit-inhibit-hooks hilit-mode) | ||
| 973 | (condition-case c | ||
| 974 | (progn | ||
| 975 | |||
| 976 | ;; BUFFER highlights... | ||
| 977 | (mapcar (lambda (hook) | ||
| 978 | (if hilit-mode | ||
| 979 | (add-hook hook 'hilit-rehighlight-buffer-quietly) | ||
| 980 | (remove-hook hook 'hilit-rehighlight-buffer-quietly))) | ||
| 981 | '( | ||
| 982 | Info-selection-hook | ||
| 983 | |||
| 984 | ;; runs too early vm-summary-mode-hooks | ||
| 985 | vm-summary-pointer-hook | ||
| 986 | vm-preview-message-hook | ||
| 987 | vm-show-message-hook | ||
| 988 | |||
| 989 | rmail-show-message-hook | ||
| 990 | mail-setup-hook | ||
| 991 | mh-show-mode-hook | ||
| 992 | |||
| 993 | dired-after-readin-hook | ||
| 994 | )) | ||
| 995 | ) | ||
| 996 | (error (message "Error loading highlight hooks: %s" c) | ||
| 997 | (ding) (sit-for 1))))) | ||
| 960 | 998 | ||
| 961 | (eval-when-compile (require 'gnus)) ; no compilation gripes | 999 | (eval-when-compile (require 'gnus)) ; no compilation gripes |
| 962 | 1000 | ||
| 963 | (and (not hilit-inhibit-hooks) | ||
| 964 | (condition-case c | ||
| 965 | (progn | ||
| 966 | |||
| 967 | ;; BUFFER highlights... | ||
| 968 | (mapcar (function | ||
| 969 | (lambda (hook) | ||
| 970 | (add-hook hook 'hilit-rehighlight-buffer-quietly))) | ||
| 971 | '( | ||
| 972 | Info-selection-hook | ||
| 973 | |||
| 974 | ;; runs too early vm-summary-mode-hooks | ||
| 975 | vm-summary-pointer-hook | ||
| 976 | vm-preview-message-hook | ||
| 977 | vm-show-message-hook | ||
| 978 | |||
| 979 | rmail-show-message-hook | ||
| 980 | mail-setup-hook | ||
| 981 | mh-show-mode-hook | ||
| 982 | |||
| 983 | dired-after-readin-hook | ||
| 984 | )) | ||
| 985 | ) | ||
| 986 | (error (message "Error loading highlight hooks: %s" c) | ||
| 987 | (ding) (sit-for 1)))) | ||
| 988 | |||
| 989 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1001 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 990 | ;; Default patterns for various modes. | 1002 | ;; Default patterns for various modes. |
| 991 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1003 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -1510,5 +1522,5 @@ number of backslashes." | |||
| 1510 | 1522 | ||
| 1511 | (provide 'hilit19) | 1523 | (provide 'hilit19) |
| 1512 | 1524 | ||
| 1513 | ;;; arch-tag: db99739a-4837-41ee-ad02-3baced8ae71d | 1525 | ;; arch-tag: db99739a-4837-41ee-ad02-3baced8ae71d |
| 1514 | ;;; hilit19.el ends here | 1526 | ;;; hilit19.el ends here |
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 1260867f7c6..f4b796dd1a7 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el | |||
| @@ -150,7 +150,7 @@ This mirrors the optional behavior of tcsh." | |||
| 150 | :type 'boolean | 150 | :type 'boolean |
| 151 | :group 'pcomplete) | 151 | :group 'pcomplete) |
| 152 | 152 | ||
| 153 | (defcustom pcomplete-suffix-list (list directory-sep-char ?:) | 153 | (defcustom pcomplete-suffix-list (list ?/ ?:) |
| 154 | "*A list of characters which constitute a proper suffix." | 154 | "*A list of characters which constitute a proper suffix." |
| 155 | :type '(repeat character) | 155 | :type '(repeat character) |
| 156 | :group 'pcomplete) | 156 | :group 'pcomplete) |
| @@ -347,12 +347,12 @@ modified to be an empty string, or the desired separation string." | |||
| 347 | ;;; User Functions: | 347 | ;;; User Functions: |
| 348 | 348 | ||
| 349 | ;;;###autoload | 349 | ;;;###autoload |
| 350 | (defun pcomplete () | 350 | (defun pcomplete (&optional interactively) |
| 351 | "Support extensible programmable completion. | 351 | "Support extensible programmable completion. |
| 352 | To use this function, just bind the TAB key to it, or add it to your | 352 | To use this function, just bind the TAB key to it, or add it to your |
| 353 | completion functions list (it should occur fairly early in the list)." | 353 | completion functions list (it should occur fairly early in the list)." |
| 354 | (interactive) | 354 | (interactive "p") |
| 355 | (if (and (interactive-p) | 355 | (if (and interactively |
| 356 | pcomplete-cycle-completions | 356 | pcomplete-cycle-completions |
| 357 | pcomplete-current-completions | 357 | pcomplete-current-completions |
| 358 | (memq last-command '(pcomplete | 358 | (memq last-command '(pcomplete |
| @@ -740,7 +740,7 @@ component, `default-directory' is used as the basis for completion." | |||
| 740 | (function | 740 | (function |
| 741 | (lambda (file) | 741 | (lambda (file) |
| 742 | (if (eq (aref file (1- (length file))) | 742 | (if (eq (aref file (1- (length file))) |
| 743 | directory-sep-char) | 743 | ?/) |
| 744 | (and pcomplete-dir-ignore | 744 | (and pcomplete-dir-ignore |
| 745 | (string-match pcomplete-dir-ignore file)) | 745 | (string-match pcomplete-dir-ignore file)) |
| 746 | (and pcomplete-file-ignore | 746 | (and pcomplete-file-ignore |
| @@ -757,11 +757,11 @@ component, `default-directory' is used as the basis for completion." | |||
| 757 | ;; since . is earlier in the ASCII alphabet than | 757 | ;; since . is earlier in the ASCII alphabet than |
| 758 | ;; / | 758 | ;; / |
| 759 | (let ((left (if (eq (aref l (1- (length l))) | 759 | (let ((left (if (eq (aref l (1- (length l))) |
| 760 | directory-sep-char) | 760 | ?/) |
| 761 | (substring l 0 (1- (length l))) | 761 | (substring l 0 (1- (length l))) |
| 762 | l)) | 762 | l)) |
| 763 | (right (if (eq (aref r (1- (length r))) | 763 | (right (if (eq (aref r (1- (length r))) |
| 764 | directory-sep-char) | 764 | ?/) |
| 765 | (substring r 0 (1- (length r))) | 765 | (substring r 0 (1- (length r))) |
| 766 | r))) | 766 | r))) |
| 767 | (if above-cutoff | 767 | (if above-cutoff |
diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el index 5bdb1fb25eb..ec83e33b10d 100644 --- a/lisp/progmodes/autoconf.el +++ b/lisp/progmodes/autoconf.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; autoconf.el --- mode for editing Autoconf configure.in files | 1 | ;;; autoconf.el --- mode for editing Autoconf configure.in files |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2000, 2003 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Dave Love <fx@gnu.org> | 5 | ;; Author: Dave Love <fx@gnu.org> |
| 6 | ;; Keywords: languages | 6 | ;; Keywords: languages |
| @@ -49,7 +49,7 @@ | |||
| 49 | "AC_\\(SUBST\\|DEFINE\\(_UNQUOTED\\)?\\)(\\(\\sw+\\)") | 49 | "AC_\\(SUBST\\|DEFINE\\(_UNQUOTED\\)?\\)(\\(\\sw+\\)") |
| 50 | 50 | ||
| 51 | (defvar autoconf-font-lock-keywords | 51 | (defvar autoconf-font-lock-keywords |
| 52 | `(("A[CHM]_\\sw+" . font-lock-keyword-face) | 52 | `(("A[CHMS]_\\sw+" . font-lock-keyword-face) |
| 53 | (,autoconf-definition-regexp | 53 | (,autoconf-definition-regexp |
| 54 | 3 font-lock-function-name-face) | 54 | 3 font-lock-function-name-face) |
| 55 | ;; Are any other M4 keywords really appropriate for configure.in, | 55 | ;; Are any other M4 keywords really appropriate for configure.in, |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 0dc73e96664..223455e9872 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -181,6 +181,16 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) | |||
| 181 | (epc | 181 | (epc |
| 182 | "^Error [0-9]+ at (\\([0-9]+\\):\\([^)\n]+\\))" 2 1) | 182 | "^Error [0-9]+ at (\\([0-9]+\\):\\([^)\n]+\\))" 2 1) |
| 183 | 183 | ||
| 184 | (ftnchek-file | ||
| 185 | "^File \\(.+\\.f\\):$" | ||
| 186 | 1 nil nil 0) | ||
| 187 | (ftnchek-line-file | ||
| 188 | "\\(^Warning .* \\)?line \\([0-9]+\\)\\(?: col \\([0-9]+\\)\\)? file \\(.+\\.f\\)" | ||
| 189 | 4 2 3 (1) nil (1 'default nil t)) | ||
| 190 | (ftnchek-line | ||
| 191 | "\\(?:^\\(Warning\\) .* \\)?line \\([0-9]+\\)\\(?: col \\([0-9]+\\)\\)?" | ||
| 192 | nil 2 3 (1) nil (1 (compilation-face '(1)) nil t)) | ||
| 193 | |||
| 184 | (iar | 194 | (iar |
| 185 | "^\"\\(.*\\)\",\\([0-9]+\\)\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[0-9]+\\]:" | 195 | "^\"\\(.*\\)\",\\([0-9]+\\)\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[0-9]+\\]:" |
| 186 | 1 2 nil (3)) | 196 | 1 2 nil (3)) |
| @@ -191,8 +201,8 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) | |||
| 191 | 201 | ||
| 192 | ;; fixme: should be `mips' | 202 | ;; fixme: should be `mips' |
| 193 | (irix | 203 | (irix |
| 194 | "^[-[:alnum:]_/]+: \\(?:[sS]evere\\|[eE]rror\\|[wW]arnin\\(g\\)\\|[iI]nf\\(o\\)\\)[0-9 ]*:\ | 204 | "^[-[:alnum:]_/ ]+: \\(?:\\(?:[sS]evere\\|[eE]rror\\|[wW]arnin\\(g\\)\\|[iI]nf\\(o\\)\\)[0-9 ]*: \\)?\ |
| 195 | \\([^,\" \n\t]+\\)\\(?:, line\\|:\\) \\([0-9]+\\):" 3 4 nil (1 . 2)) | 205 | \\([^,\" \n\t]+\\)\\(?:, line\\|:\\) \\([0-9]+\\):" 3 4 nil (1 . 2)) |
| 196 | 206 | ||
| 197 | (java | 207 | (java |
| 198 | "^\\(?:[ \t]+at \\|==[0-9]+== +\\(?:at\\|b\\(y\\)\\)\\).+(\\([^()\n]+\\):\\([0-9]+\\))$" 2 3 nil (1)) | 208 | "^\\(?:[ \t]+at \\|==[0-9]+== +\\(?:at\\|b\\(y\\)\\)\\).+(\\([^()\n]+\\):\\([0-9]+\\))$" 2 3 nil (1)) |
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 2cd62eeecee..3ccea967bc5 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -94,7 +94,7 @@ | |||
| 94 | (defun flymake-split-string(str pattern) | 94 | (defun flymake-split-string(str pattern) |
| 95 | (cond | 95 | (cond |
| 96 | ((equal flymake-emacs 'xemacs) (flymake-split-string-remove-empty-edges str pattern)) | 96 | ((equal flymake-emacs 'xemacs) (flymake-split-string-remove-empty-edges str pattern)) |
| 97 | (t (split-string str pattern)) | 97 | (t (flymake-split-string-remove-empty-edges str pattern)) |
| 98 | ) | 98 | ) |
| 99 | ) | 99 | ) |
| 100 | 100 | ||
| @@ -1243,7 +1243,8 @@ Whenether a buffer for master-file-name exists, use it as a source instead of re | |||
| 1243 | (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" | 1243 | (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" |
| 1244 | 2 4 nil 5) | 1244 | 2 4 nil 5) |
| 1245 | ) | 1245 | ) |
| 1246 | compilation-error-regexp-alist) | 1246 | ;; compilation-error-regexp-alist) |
| 1247 | (mapcar (lambda (x) (cdr x)) compilation-error-regexp-alist-alist)) | ||
| 1247 | "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)" | 1248 | "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)" |
| 1248 | ) | 1249 | ) |
| 1249 | ;(defcustom flymake-err-line-patterns | 1250 | ;(defcustom flymake-err-line-patterns |
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 64f8808c7f1..1486ec7e5cf 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -25,28 +25,28 @@ | |||
| 25 | 25 | ||
| 26 | ;;; Commentary: | 26 | ;;; Commentary: |
| 27 | 27 | ||
| 28 | ;; This mode acts as a graphical user interface to GDB. You can interact with | 28 | ;; This mode acts as a graphical user interface to GDB. You can interact with |
| 29 | ;; GDB through the GUD buffer in the usual way, but there are also further | 29 | ;; GDB through the GUD buffer in the usual way, but there are also further |
| 30 | ;; buffers which control the execution and describe the state of your program. | 30 | ;; buffers which control the execution and describe the state of your program. |
| 31 | ;; It separates the input/output of your program from that of GDB, if | 31 | ;; It separates the input/output of your program from that of GDB, if |
| 32 | ;; required, and watches expressions in the speedbar. It also uses features of | 32 | ;; required, and watches expressions in the speedbar. It also uses features of |
| 33 | ;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar | 33 | ;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar |
| 34 | ;; (see the GDB Graphical Interface section in the Emacs info manual). | 34 | ;; (see the GDB Graphical Interface section in the Emacs info manual). |
| 35 | 35 | ||
| 36 | ;; Start the debugger with M-x gdba. | 36 | ;; Start the debugger with M-x gdba. |
| 37 | 37 | ||
| 38 | ;; This file has evolved from gdba.el from GDB 5.0 written by Tom Lord and Jim | 38 | ;; This file has evolved from gdba.el from GDB 5.0 written by Tom Lord and Jim |
| 39 | ;; Kingdon and uses GDB's annotation interface. You don't need to know about | 39 | ;; Kingdon and uses GDB's annotation interface. You don't need to know about |
| 40 | ;; annotations to use this mode as a debugger, but if you are interested | 40 | ;; annotations to use this mode as a debugger, but if you are interested |
| 41 | ;; developing the mode itself, then see the Annotations section in the GDB | 41 | ;; developing the mode itself, then see the Annotations section in the GDB |
| 42 | ;; info manual. | 42 | ;; info manual. |
| 43 | ;; | 43 | ;; |
| 44 | ;; GDB developers plan to make the annotation interface obsolete. A new | 44 | ;; GDB developers plan to make the annotation interface obsolete. A new |
| 45 | ;; interface called GDB/MI (machine interface) has been designed to replace | 45 | ;; interface called GDB/MI (machine interface) has been designed to replace |
| 46 | ;; it. Some GDB/MI commands are used in this file through the CLI command | 46 | ;; it. Some GDB/MI commands are used in this file through the CLI command |
| 47 | ;; 'interpreter mi <mi-command>'. A file called gdb-mi.el is included in the | 47 | ;; 'interpreter mi <mi-command>'. A file called gdb-mi.el is included in the |
| 48 | ;; GDB repository for future releases (6.2 onwards) that uses GDB/MI as the | 48 | ;; GDB repository for future releases (6.2 onwards) that uses GDB/MI as the |
| 49 | ;; primary interface to GDB. It is still under development and is part of a | 49 | ;; primary interface to GDB. It is still under development and is part of a |
| 50 | ;; process to migrate Emacs from annotations to GDB/MI. | 50 | ;; process to migrate Emacs from annotations to GDB/MI. |
| 51 | ;; | 51 | ;; |
| 52 | ;; Known Bugs: | 52 | ;; Known Bugs: |
| @@ -63,7 +63,7 @@ | |||
| 63 | (defvar gdb-current-language nil) | 63 | (defvar gdb-current-language nil) |
| 64 | (defvar gdb-view-source t "Non-nil means that source code can be viewed.") | 64 | (defvar gdb-view-source t "Non-nil means that source code can be viewed.") |
| 65 | (defvar gdb-selected-view 'source "Code type that user wishes to view.") | 65 | (defvar gdb-selected-view 'source "Code type that user wishes to view.") |
| 66 | (defvar gdb-var-list nil "List of variables in watch window") | 66 | (defvar gdb-var-list nil "List of variables in watch window.") |
| 67 | (defvar gdb-var-changed nil "Non-nil means that gdb-var-list has changed.") | 67 | (defvar gdb-var-changed nil "Non-nil means that gdb-var-list has changed.") |
| 68 | (defvar gdb-buffer-type nil) | 68 | (defvar gdb-buffer-type nil) |
| 69 | (defvar gdb-overlay-arrow-position nil) | 69 | (defvar gdb-overlay-arrow-position nil) |
| @@ -85,12 +85,12 @@ other with the source file with the main routine of the inferior. | |||
| 85 | If `gdb-many-windows' is t, regardless of the value of | 85 | If `gdb-many-windows' is t, regardless of the value of |
| 86 | `gdb-show-main', the layout below will appear unless | 86 | `gdb-show-main', the layout below will appear unless |
| 87 | `gdb-use-inferior-io-buffer' is nil when the source buffer | 87 | `gdb-use-inferior-io-buffer' is nil when the source buffer |
| 88 | occupies the full width of the frame. Keybindings are given in | 88 | occupies the full width of the frame. Keybindings are given in |
| 89 | relevant buffer. | 89 | relevant buffer. |
| 90 | 90 | ||
| 91 | Watch expressions appear in the speedbar/slowbar. | 91 | Watch expressions appear in the speedbar/slowbar. |
| 92 | 92 | ||
| 93 | The following interactive lisp functions help control operation : | 93 | The following commands help control operation : |
| 94 | 94 | ||
| 95 | `gdb-many-windows' - Toggle the number of windows gdb uses. | 95 | `gdb-many-windows' - Toggle the number of windows gdb uses. |
| 96 | `gdb-restore-windows' - To restore the window layout. | 96 | `gdb-restore-windows' - To restore the window layout. |
| @@ -120,8 +120,7 @@ detailed description of this mode. | |||
| 120 | RET gdb-frames-select | SPC gdb-toggle-breakpoint | 120 | RET gdb-frames-select | SPC gdb-toggle-breakpoint |
| 121 | | RET gdb-goto-breakpoint | 121 | | RET gdb-goto-breakpoint |
| 122 | | d gdb-delete-breakpoint | 122 | | d gdb-delete-breakpoint |
| 123 | --------------------------------------------------------------------- | 123 | ---------------------------------------------------------------------" |
| 124 | " | ||
| 125 | ;; | 124 | ;; |
| 126 | (interactive (list (gud-query-cmdline 'gdba))) | 125 | (interactive (list (gud-query-cmdline 'gdba))) |
| 127 | ;; | 126 | ;; |
| @@ -210,8 +209,7 @@ detailed description of this mode. | |||
| 210 | (run-hooks 'gdba-mode-hook)) | 209 | (run-hooks 'gdba-mode-hook)) |
| 211 | 210 | ||
| 212 | (defcustom gdb-use-colon-colon-notation nil | 211 | (defcustom gdb-use-colon-colon-notation nil |
| 213 | "Non-nil means use FUNCTION::VARIABLE format to display variables in the | 212 | "If non-nil use FUN::VAR format to display variables in the speedbar." ; |
| 214 | speedbar." | ||
| 215 | :type 'boolean | 213 | :type 'boolean |
| 216 | :group 'gud) | 214 | :group 'gud) |
| 217 | 215 | ||
| @@ -376,7 +374,7 @@ speedbar." | |||
| 376 | (setq gdb-var-changed t)))))) | 374 | (setq gdb-var-changed t)))))) |
| 377 | 375 | ||
| 378 | (defun gdb-edit-value (text token indent) | 376 | (defun gdb-edit-value (text token indent) |
| 379 | "Assign a value to a variable displayed in the speedbar" | 377 | "Assign a value to a variable displayed in the speedbar." |
| 380 | (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) | 378 | (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) |
| 381 | (varnum (cadr var)) (value)) | 379 | (varnum (cadr var)) (value)) |
| 382 | (setq value (read-string "New value: ")) | 380 | (setq value (read-string "New value: ")) |
| @@ -389,8 +387,8 @@ speedbar." | |||
| 389 | 'ignore)))) | 387 | 'ignore)))) |
| 390 | 388 | ||
| 391 | (defcustom gdb-show-changed-values t | 389 | (defcustom gdb-show-changed-values t |
| 392 | "Non-nil means use font-lock-warning-face to display values that have | 390 | "If non-nil highlight values that have recently changed in the speedbar. |
| 393 | recently changed in the speedbar." | 391 | The highlighting is done with `font-lock-warning-face'." |
| 394 | :type 'boolean | 392 | :type 'boolean |
| 395 | :group 'gud) | 393 | :group 'gud) |
| 396 | 394 | ||
| @@ -422,23 +420,23 @@ INDENT is the current indentation depth." | |||
| 422 | "The disposition of the output of the current gdb command. | 420 | "The disposition of the output of the current gdb command. |
| 423 | Possible values are these symbols: | 421 | Possible values are these symbols: |
| 424 | 422 | ||
| 425 | user -- gdb output should be copied to the GUD buffer | 423 | `user' -- gdb output should be copied to the GUD buffer |
| 426 | for the user to see. | 424 | for the user to see. |
| 427 | 425 | ||
| 428 | inferior -- gdb output should be copied to the inferior-io buffer | 426 | `inferior' -- gdb output should be copied to the inferior-io buffer |
| 429 | 427 | ||
| 430 | pre-emacs -- output should be ignored util the post-prompt | 428 | `pre-emacs' -- output should be ignored util the post-prompt |
| 431 | annotation is received. Then the output-sink | 429 | annotation is received. Then the output-sink |
| 432 | becomes:... | 430 | becomes:... |
| 433 | emacs -- output should be collected in the partial-output-buffer | 431 | `emacs' -- output should be collected in the partial-output-buffer |
| 434 | for subsequent processing by a command. This is the | 432 | for subsequent processing by a command. This is the |
| 435 | disposition of output generated by commands that | 433 | disposition of output generated by commands that |
| 436 | gdb mode sends to gdb on its own behalf. | 434 | gdb mode sends to gdb on its own behalf. |
| 437 | post-emacs -- ignore output until the prompt annotation is | 435 | `post-emacs' -- ignore output until the prompt annotation is |
| 438 | received, then go to USER disposition. | 436 | received, then go to USER disposition. |
| 439 | 437 | ||
| 440 | gdba (gdb-ui.el) uses all five values, gdbmi (gdb-mi.el) only two | 438 | gdba (gdb-ui.el) uses all five values, gdbmi (gdb-mi.el) only two |
| 441 | (user and emacs).") | 439 | \(`user' and `emacs').") |
| 442 | 440 | ||
| 443 | (defvar gdb-current-item nil | 441 | (defvar gdb-current-item nil |
| 444 | "The most recent command item sent to gdb.") | 442 | "The most recent command item sent to gdb.") |
| @@ -619,7 +617,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." | |||
| 619 | 617 | ||
| 620 | (defun gdb-send (proc string) | 618 | (defun gdb-send (proc string) |
| 621 | "A comint send filter for gdb. | 619 | "A comint send filter for gdb. |
| 622 | This filter may simply queue output for a later time." | 620 | This filter may simply queue input for a later time." |
| 623 | (if gud-running | 621 | (if gud-running |
| 624 | (process-send-string proc (concat string "\n")) | 622 | (process-send-string proc (concat string "\n")) |
| 625 | (gdb-enqueue-input (concat string "\n")))) | 623 | (gdb-enqueue-input (concat string "\n")))) |
| @@ -705,25 +703,25 @@ This filter may simply queue output for a later time." | |||
| 705 | (setq gdb-current-item item) | 703 | (setq gdb-current-item item) |
| 706 | (with-current-buffer gud-comint-buffer | 704 | (with-current-buffer gud-comint-buffer |
| 707 | (if (eq gud-minor-mode 'gdba) | 705 | (if (eq gud-minor-mode 'gdba) |
| 708 | (progn | 706 | (if (stringp item) |
| 709 | (if (stringp item) | ||
| 710 | (progn | ||
| 711 | (setq gdb-output-sink 'user) | ||
| 712 | (process-send-string (get-buffer-process gud-comint-buffer) item)) | ||
| 713 | (progn | 707 | (progn |
| 714 | (gdb-clear-partial-output) | 708 | (setq gdb-output-sink 'user) |
| 715 | (setq gdb-output-sink 'pre-emacs) | 709 | (process-send-string (get-buffer-process gud-comint-buffer) item)) |
| 716 | (process-send-string (get-buffer-process gud-comint-buffer) | 710 | (progn |
| 717 | (car item))))) | 711 | (gdb-clear-partial-output) |
| 718 | ; case: eq gud-minor-mode 'gdbmi | 712 | (setq gdb-output-sink 'pre-emacs) |
| 713 | (process-send-string (get-buffer-process gud-comint-buffer) | ||
| 714 | (car item)))) | ||
| 715 | ;; case: eq gud-minor-mode 'gdbmi | ||
| 719 | (gdb-clear-partial-output) | 716 | (gdb-clear-partial-output) |
| 720 | (setq gdb-output-sink 'emacs) | 717 | (setq gdb-output-sink 'emacs) |
| 721 | (process-send-string (get-buffer-process gud-comint-buffer) | 718 | (process-send-string (get-buffer-process gud-comint-buffer) |
| 722 | (car item))))) | 719 | (car item))))) |
| 723 | 720 | ||
| 724 | (defun gdb-pre-prompt (ignored) | 721 | (defun gdb-pre-prompt (ignored) |
| 725 | "An annotation handler for `pre-prompt'. This terminates the collection of | 722 | "An annotation handler for `pre-prompt'. |
| 726 | output from a previous command if that happens to be in effect." | 723 | This terminates the collection of output from a previous command if that |
| 724 | happens to be in effect." | ||
| 727 | (let ((sink gdb-output-sink)) | 725 | (let ((sink gdb-output-sink)) |
| 728 | (cond | 726 | (cond |
| 729 | ((eq sink 'user) t) | 727 | ((eq sink 'user) t) |
| @@ -761,8 +759,9 @@ This sends the next command (if any) to gdb." | |||
| 761 | (setq gdb-prompting t)) | 759 | (setq gdb-prompting t)) |
| 762 | 760 | ||
| 763 | (defun gdb-starting (ignored) | 761 | (defun gdb-starting (ignored) |
| 764 | "An annotation handler for `starting'. This says that I/O for the | 762 | "An annotation handler for `starting'. |
| 765 | subprocess is now the program being debugged, not GDB." | 763 | This says that I/O for the subprocess is now the program being debugged, |
| 764 | not GDB." | ||
| 766 | (let ((sink gdb-output-sink)) | 765 | (let ((sink gdb-output-sink)) |
| 767 | (cond | 766 | (cond |
| 768 | ((eq sink 'user) | 767 | ((eq sink 'user) |
| @@ -773,8 +772,9 @@ subprocess is now the program being debugged, not GDB." | |||
| 773 | (t (error "Unexpected `starting' annotation"))))) | 772 | (t (error "Unexpected `starting' annotation"))))) |
| 774 | 773 | ||
| 775 | (defun gdb-stopping (ignored) | 774 | (defun gdb-stopping (ignored) |
| 776 | "An annotation handler for `exited' and other annotations which say that I/O | 775 | "An annotation handler for `exited' and other annotations. |
| 777 | for the subprocess is now GDB, not the program being debugged." | 776 | They say that I/O for the subprocess is now GDB, not the program |
| 777 | being debugged." | ||
| 778 | (if gdb-use-inferior-io-buffer | 778 | (if gdb-use-inferior-io-buffer |
| 779 | (let ((sink gdb-output-sink)) | 779 | (let ((sink gdb-output-sink)) |
| 780 | (cond | 780 | (cond |
| @@ -792,8 +792,9 @@ for the subprocess is now GDB, not the program being debugged." | |||
| 792 | (t (error "Unexpected frame-begin annotation (%S)" sink))))) | 792 | (t (error "Unexpected frame-begin annotation (%S)" sink))))) |
| 793 | 793 | ||
| 794 | (defun gdb-stopped (ignored) | 794 | (defun gdb-stopped (ignored) |
| 795 | "An annotation handler for `stopped'. It is just like gdb-stopping, except | 795 | "An annotation handler for `stopped'. |
| 796 | that if we already set the output sink to 'user in gdb-stopping, that is fine." | 796 | It is just like `gdb-stopping', except that if we already set the output |
| 797 | sink to `user' in `gdb-stopping', that is fine." | ||
| 797 | (setq gud-running nil) | 798 | (setq gud-running nil) |
| 798 | (let ((sink gdb-output-sink)) | 799 | (let ((sink gdb-output-sink)) |
| 799 | (cond | 800 | (cond |
| @@ -803,8 +804,9 @@ that if we already set the output sink to 'user in gdb-stopping, that is fine." | |||
| 803 | (t (error "Unexpected stopped annotation"))))) | 804 | (t (error "Unexpected stopped annotation"))))) |
| 804 | 805 | ||
| 805 | (defun gdb-post-prompt (ignored) | 806 | (defun gdb-post-prompt (ignored) |
| 806 | "An annotation handler for `post-prompt'. This begins the collection of | 807 | "An annotation handler for `post-prompt'. |
| 807 | output from the current command if that happens to be appropriate." | 808 | This begins the collection of output from the current command if that |
| 809 | happens to be appropriate." | ||
| 808 | (if (not gdb-pending-triggers) | 810 | (if (not gdb-pending-triggers) |
| 809 | (progn | 811 | (progn |
| 810 | (gdb-get-current-frame) | 812 | (gdb-get-current-frame) |
| @@ -832,7 +834,7 @@ output from the current command if that happens to be appropriate." | |||
| 832 | (error "Phase error in gdb-post-prompt (got %s)" sink))))) | 834 | (error "Phase error in gdb-post-prompt (got %s)" sink))))) |
| 833 | 835 | ||
| 834 | (defun gud-gdba-marker-filter (string) | 836 | (defun gud-gdba-marker-filter (string) |
| 835 | "A gud marker filter for gdb. Handle a burst of output from GDB." | 837 | "A gud marker filter for gdb. Handle a burst of output from GDB." |
| 836 | (if gdb-enable-debug-log (push (cons 'recv string) gdb-debug-log)) | 838 | (if gdb-enable-debug-log (push (cons 'recv string) gdb-debug-log)) |
| 837 | ;; Recall the left over gud-marker-acc from last time | 839 | ;; Recall the left over gud-marker-acc from last time |
| 838 | (setq gud-marker-acc (concat gud-marker-acc string)) | 840 | (setq gud-marker-acc (concat gud-marker-acc string)) |
| @@ -1065,10 +1067,10 @@ static char *magick[] = { | |||
| 1065 | "PBM data used for disabled breakpoint icon.") | 1067 | "PBM data used for disabled breakpoint icon.") |
| 1066 | 1068 | ||
| 1067 | (defvar breakpoint-enabled-icon nil | 1069 | (defvar breakpoint-enabled-icon nil |
| 1068 | "Icon for enabled breakpoint in display margin") | 1070 | "Icon for enabled breakpoint in display margin.") |
| 1069 | 1071 | ||
| 1070 | (defvar breakpoint-disabled-icon nil | 1072 | (defvar breakpoint-disabled-icon nil |
| 1071 | "Icon for disabled breakpoint in display margin") | 1073 | "Icon for disabled breakpoint in display margin.") |
| 1072 | 1074 | ||
| 1073 | ;; Bitmap for breakpoint in fringe | 1075 | ;; Bitmap for breakpoint in fringe |
| 1074 | (define-fringe-bitmap 'breakpoint | 1076 | (define-fringe-bitmap 'breakpoint |
| @@ -1133,7 +1135,7 @@ static char *magick[] = { | |||
| 1133 | (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) | 1135 | (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) |
| 1134 | 1136 | ||
| 1135 | (defun gdb-mouse-toggle-breakpoint (event) | 1137 | (defun gdb-mouse-toggle-breakpoint (event) |
| 1136 | "Toggle breakpoint in left fringe/margin with mouse click" | 1138 | "Toggle breakpoint in left fringe/margin with mouse click." |
| 1137 | (interactive "e") | 1139 | (interactive "e") |
| 1138 | (mouse-minibuffer-check event) | 1140 | (mouse-minibuffer-check event) |
| 1139 | (let ((posn (event-end event))) | 1141 | (let ((posn (event-end event))) |
| @@ -1718,11 +1720,11 @@ static char *magick[] = { | |||
| 1718 | (other-window 1)) | 1720 | (other-window 1)) |
| 1719 | 1721 | ||
| 1720 | (defcustom gdb-many-windows nil | 1722 | (defcustom gdb-many-windows nil |
| 1721 | "Nil (the default value) means just pop up the GUD buffer | 1723 | "Nil means just pop up the GUD buffer unless `gdb-show-main' is t. |
| 1722 | unless `gdb-show-main' is t. In this case it starts with two | 1724 | In this case it starts with two windows: one displaying the GUD |
| 1723 | windows: one displaying the GUD buffer and the other with the | 1725 | buffer and the other with the source file with the main routine |
| 1724 | source file with the main routine of the inferior. Non-nil means | 1726 | of the inferior. Non-nil means display the layout shown for |
| 1725 | display the layout shown for `gdba'." | 1727 | `gdba'." |
| 1726 | :type 'boolean | 1728 | :type 'boolean |
| 1727 | :group 'gud) | 1729 | :group 'gud) |
| 1728 | 1730 | ||
| @@ -1760,8 +1762,8 @@ This arrangement depends on the value of `gdb-many-windows'." | |||
| 1760 | (other-window 1))) | 1762 | (other-window 1))) |
| 1761 | 1763 | ||
| 1762 | (defun gdb-reset () | 1764 | (defun gdb-reset () |
| 1763 | "Exit a debugging session cleanly by killing the gdb buffers and resetting | 1765 | "Exit a debugging session cleanly. |
| 1764 | the source buffers." | 1766 | Kills the gdb buffers and resets the source buffers." |
| 1765 | (dolist (buffer (buffer-list)) | 1767 | (dolist (buffer (buffer-list)) |
| 1766 | (unless (eq buffer gud-comint-buffer) | 1768 | (unless (eq buffer gud-comint-buffer) |
| 1767 | (with-current-buffer buffer | 1769 | (with-current-buffer buffer |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 4d9e05109a8..71927642a96 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; grep.el --- run compiler as inferior of Emacs, parse error messages | 1 | ;;; grep.el --- run compiler as inferior of Emacs, parse error messages |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 1999, 2001, 02, 2004 | 3 | ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; 2001, 2002, 2004 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Roland McGrath <roland@gnu.org> | 6 | ;; Author: Roland McGrath <roland@gnu.org> |
| 7 | ;; Maintainer: FSF | 7 | ;; Maintainer: FSF |
| @@ -252,21 +252,12 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 252 | \\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?[:) \t]" 1 (2 . 5) (4 . 6)) | 252 | \\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?[:) \t]" 1 (2 . 5) (4 . 6)) |
| 253 | ("^\\(.+?\\)[:(]+\\([0-9]+\\)\\([:)]\\).*?\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" | 253 | ("^\\(.+?\\)[:(]+\\([0-9]+\\)\\([:)]\\).*?\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" |
| 254 | 1 2 | 254 | 1 2 |
| 255 | ;; Calculate column positions (beg . end) of first grep match on a line | ||
| 255 | ((lambda () | 256 | ((lambda () |
| 256 | (setq compilation-error-screen-columns nil) | 257 | (setq compilation-error-screen-columns nil) |
| 257 | (- (match-beginning 5) (match-end 3) 8)) | 258 | (- (match-beginning 5) (match-end 3) 8)) |
| 258 | . | 259 | . |
| 259 | (lambda () (- (match-end 5) (match-end 3) 8))) | 260 | (lambda () (- (match-end 5) (match-end 3) 8)))) |
| 260 | nil nil | ||
| 261 | (4 (list 'face nil 'invisible t 'intangible t)) | ||
| 262 | (5 (list 'face compilation-column-face)) | ||
| 263 | (6 (list 'face nil 'invisible t 'intangible t)) | ||
| 264 | ;; highlight other matches on the same line | ||
| 265 | ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" | ||
| 266 | nil nil | ||
| 267 | (1 (list 'face nil 'invisible t 'intangible t)) | ||
| 268 | (2 (list 'face compilation-column-face) t) | ||
| 269 | (3 (list 'face nil 'invisible t 'intangible t)))) | ||
| 270 | ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) | 261 | ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) |
| 271 | "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") | 262 | "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") |
| 272 | 263 | ||
| @@ -294,7 +285,16 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 294 | ("^Grep \\(exited abnormally\\) with code \\([0-9]+\\).*" | 285 | ("^Grep \\(exited abnormally\\) with code \\([0-9]+\\).*" |
| 295 | (0 '(face nil message nil help-echo nil mouse-face nil) t) | 286 | (0 '(face nil message nil help-echo nil mouse-face nil) t) |
| 296 | (1 compilation-warning-face) | 287 | (1 compilation-warning-face) |
| 297 | (2 compilation-line-face))) | 288 | (2 compilation-line-face)) |
| 289 | ;; Highlight grep matches and delete markers | ||
| 290 | ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" | ||
| 291 | (2 compilation-column-face) | ||
| 292 | ((lambda (p)) | ||
| 293 | (progn | ||
| 294 | ;; Delete markers with `replace-match' because it updates | ||
| 295 | ;; the match-data, whereas `delete-region' would render it obsolete. | ||
| 296 | (replace-match "" t t nil 3) | ||
| 297 | (replace-match "" t t nil 1))))) | ||
| 298 | "Additional things to highlight in grep output. | 298 | "Additional things to highlight in grep output. |
| 299 | This gets tacked on the end of the generated expressions.") | 299 | This gets tacked on the end of the generated expressions.") |
| 300 | 300 | ||
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index f047223cbae..b3149500ae5 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el | |||
| @@ -518,8 +518,9 @@ Pending copies are stored in variable `shadow-files-to-copy', and in | |||
| 518 | `shadow-save-buffers-kill-emacs', so it is not usually necessary to | 518 | `shadow-save-buffers-kill-emacs', so it is not usually necessary to |
| 519 | call it manually." | 519 | call it manually." |
| 520 | (interactive "P") | 520 | (interactive "P") |
| 521 | (if (and (not shadow-files-to-copy) (interactive-p)) | 521 | (if (not shadow-files-to-copy) |
| 522 | (message "No files need to be shadowed.") | 522 | (if (interactive-p) |
| 523 | (message "No files need to be shadowed.")) | ||
| 523 | (save-excursion | 524 | (save-excursion |
| 524 | (map-y-or-n-p (function | 525 | (map-y-or-n-p (function |
| 525 | (lambda (pair) | 526 | (lambda (pair) |
diff --git a/lisp/simple.el b/lisp/simple.el index 34215a39c8b..2ce0cc57b15 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1901,13 +1901,13 @@ value passed." | |||
| 1901 | (if fh (apply fh 'process-file program infile buffer display args) | 1901 | (if fh (apply fh 'process-file program infile buffer display args) |
| 1902 | (when infile (setq lc (file-local-copy infile))) | 1902 | (when infile (setq lc (file-local-copy infile))) |
| 1903 | (setq stderr-file (when (and (consp buffer) (stringp (cadr buffer))) | 1903 | (setq stderr-file (when (and (consp buffer) (stringp (cadr buffer))) |
| 1904 | (make-temp-file "emacs")))) | 1904 | (make-temp-file "emacs"))) |
| 1905 | (prog1 | 1905 | (prog1 |
| 1906 | (apply 'call-process program | 1906 | (apply 'call-process program |
| 1907 | (or lc infile) | 1907 | (or lc infile) |
| 1908 | (if stderr-file (list (car buffer) stderr-file) buffer) | 1908 | (if stderr-file (list (car buffer) stderr-file) buffer) |
| 1909 | display args) | 1909 | display args) |
| 1910 | (when stderr-file (copy-file stderr-file (cadr buffer)))) | 1910 | (when stderr-file (copy-file stderr-file (cadr buffer))))) |
| 1911 | (when stderr-file (delete-file stderr-file)) | 1911 | (when stderr-file (delete-file stderr-file)) |
| 1912 | (when lc (delete-file lc))))) | 1912 | (when lc (delete-file lc))))) |
| 1913 | 1913 | ||
diff --git a/lisp/speedbar.el b/lisp/speedbar.el index db16f2f78f3..c182dffdba7 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el | |||
| @@ -354,7 +354,9 @@ Any parameter supported by a frame may be added. The parameter `height' | |||
| 354 | will be initialized to the height of the frame speedbar is | 354 | will be initialized to the height of the frame speedbar is |
| 355 | attached to and added to this list before the new frame is initialized." | 355 | attached to and added to this list before the new frame is initialized." |
| 356 | :group 'speedbar | 356 | :group 'speedbar |
| 357 | :type '(repeat (sexp :tag "Parameter:"))) | 357 | :type '(repeat (cons :format "%v" |
| 358 | (symbol :tag "Parameter") | ||
| 359 | (sexp :tag "Value")))) | ||
| 358 | 360 | ||
| 359 | ;; These values by Hrvoje Niksic <hniksic@srce.hr> | 361 | ;; These values by Hrvoje Niksic <hniksic@srce.hr> |
| 360 | (defcustom speedbar-frame-plist | 362 | (defcustom speedbar-frame-plist |
diff --git a/lisp/strokes.el b/lisp/strokes.el index 57f1e3355b2..f1121d1fee5 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el | |||
| @@ -1746,7 +1746,7 @@ Store XPM in buffer BUFNAME if supplied \(default is ` *strokes-xpm*'\)" | |||
| 1746 | (strokes-mode -1) | 1746 | (strokes-mode -1) |
| 1747 | (remove-hook 'kill-emacs-query-functions 'strokes-prompt-user-save-strokes)) | 1747 | (remove-hook 'kill-emacs-query-functions 'strokes-prompt-user-save-strokes)) |
| 1748 | 1748 | ||
| 1749 | (add-hooks 'strokes-unload-hook 'strokes-unload-hook) | 1749 | (add-hook 'strokes-unload-hook 'strokes-unload-hook) |
| 1750 | 1750 | ||
| 1751 | (run-hooks 'strokes-load-hook) | 1751 | (run-hooks 'strokes-load-hook) |
| 1752 | (provide 'strokes) | 1752 | (provide 'strokes) |
diff --git a/lisp/subr.el b/lisp/subr.el index a06b136b642..621aec8d571 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -817,6 +817,10 @@ is converted into a string by expressing it in decimal." | |||
| 817 | (make-obsolete-variable 'post-command-idle-delay | 817 | (make-obsolete-variable 'post-command-idle-delay |
| 818 | "use timers instead, with `run-with-idle-timer'." "before 19.34") | 818 | "use timers instead, with `run-with-idle-timer'." "before 19.34") |
| 819 | 819 | ||
| 820 | (defvaralias 'x-lost-selection-hooks 'x-lost-selection-functions) | ||
| 821 | (make-obsolete-variable 'x-lost-selection-hooks 'x-lost-selection-functions "21.4") | ||
| 822 | (defvaralias 'x-sent-selection-hooks 'x-sent-selection-functions) | ||
| 823 | (make-obsolete-variable 'x-sent-selection-hooks 'x-sent-selection-functions "21.4") | ||
| 820 | 824 | ||
| 821 | ;;;; Alternate names for functions - these are not being phased out. | 825 | ;;;; Alternate names for functions - these are not being phased out. |
| 822 | 826 | ||
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index 62686d026c1..42dcc0f7a26 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el | |||
| @@ -578,7 +578,7 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'. | |||
| 578 | ;; Prevent loss of data when saving the file. | 578 | ;; Prevent loss of data when saving the file. |
| 579 | (set (make-local-variable 'file-precious-flag) t) | 579 | (set (make-local-variable 'file-precious-flag) t) |
| 580 | (auto-save-mode 0) | 580 | (auto-save-mode 0) |
| 581 | (set (make-local-variable 'write-contents-hooks) '(tar-mode-write-file)) | 581 | (set (make-local-variable 'write-contents-functions) '(tar-mode-write-file)) |
| 582 | (widen) | 582 | (widen) |
| 583 | (if (and (boundp 'tar-header-offset) tar-header-offset) | 583 | (if (and (boundp 'tar-header-offset) tar-header-offset) |
| 584 | (narrow-to-region (point-min) (byte-to-position tar-header-offset)) | 584 | (narrow-to-region (point-min) (byte-to-position tar-header-offset)) |
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 6e7b2a9a51c..4ac96b2e4b0 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -453,10 +453,22 @@ Do \\[describe-key] on the following bindings to discover what they do. | |||
| 453 | ;; recognized. | 453 | ;; recognized. |
| 454 | (set (make-local-variable 'comment-start-skip) "\\(?:<!\\)?--[ \t]*") | 454 | (set (make-local-variable 'comment-start-skip) "\\(?:<!\\)?--[ \t]*") |
| 455 | (set (make-local-variable 'comment-end-skip) "[ \t]*--\\([ \t\n]*>\\)?") | 455 | (set (make-local-variable 'comment-end-skip) "[ \t]*--\\([ \t\n]*>\\)?") |
| 456 | ;; This definition probably is not useful in derived modes. | 456 | ;; This definition has an HTML leaning but probably fits well for other modes. |
| 457 | (set (make-local-variable 'imenu-generic-expression) | 457 | (setq imenu-generic-expression |
| 458 | (concat "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\(" | 458 | `((nil |
| 459 | sgml-name-re "\\)"))) | 459 | ,(concat "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\(" |
| 460 | sgml-name-re "\\)") | ||
| 461 | 2) | ||
| 462 | ("Id" | ||
| 463 | ,(concat "<[^>]+[ \t\n]+[Ii][Dd]=\\(['\"]" | ||
| 464 | (if sgml-xml-mode "" "?") | ||
| 465 | "\\)\\(" sgml-name-re "\\)\\1") | ||
| 466 | 2) | ||
| 467 | ("Name" | ||
| 468 | ,(concat "<[^>]+[ \t\n]+[Nn][Aa][Mm][Ee]=\\(['\"]" | ||
| 469 | (if sgml-xml-mode "" "?") | ||
| 470 | "\\)\\(" sgml-name-re "\\)\\1") | ||
| 471 | 2)))) | ||
| 460 | 472 | ||
| 461 | ;; Some programs (such as Glade 2) generate XML which has | 473 | ;; Some programs (such as Glade 2) generate XML which has |
| 462 | ;; -*- mode: xml -*-. | 474 | ;; -*- mode: xml -*-. |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 5c5e0a4d1c7..cb5bf24badd 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -468,6 +468,10 @@ An alternative value is \" . \", if you use a font with a narrow period." | |||
| 468 | ;; (arg "\\(?:{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)\\|\\\\[a-z*]+\\)")) | 468 | ;; (arg "\\(?:{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)\\|\\\\[a-z*]+\\)")) |
| 469 | (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")) | 469 | (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")) |
| 470 | (list | 470 | (list |
| 471 | ;; font-lock-syntactic-keywords causes the \ of \end{verbatim} to be | ||
| 472 | ;; highlighted as tex-verbatim-face. Let's undo that. | ||
| 473 | ;; This is ugly and brittle :-( --Stef | ||
| 474 | '("^\\(\\\\\\)end" (1 (get-text-property (match-end 1) 'face) t)) | ||
| 471 | ;; display $$ math $$ | 475 | ;; display $$ math $$ |
| 472 | ;; We only mark the match between $$ and $$ because the $$ delimiters | 476 | ;; We only mark the match between $$ and $$ because the $$ delimiters |
| 473 | ;; themselves have already been marked (along with $..$) by syntactic | 477 | ;; themselves have already been marked (along with $..$) by syntactic |
| @@ -619,6 +623,8 @@ An alternative value is \" . \", if you use a font with a narrow period." | |||
| 619 | ;; 2 - font-lock considers the preceding \n as being part of the | 623 | ;; 2 - font-lock considers the preceding \n as being part of the |
| 620 | ;; preceding line, so things gets screwed every time the previous | 624 | ;; preceding line, so things gets screwed every time the previous |
| 621 | ;; line is re-font-locked on its own. | 625 | ;; line is re-font-locked on its own. |
| 626 | ;; There's a hack in tex-font-lock-keywords-1 to remove the verbatim | ||
| 627 | ;; face from the \ but C-M-f still jumps to the wrong spot :-( --Stef | ||
| 622 | (,(concat "^\\(\\\\\\)end *{" verbs "}\\(.?\\)") (1 "|") (3 "<")) | 628 | (,(concat "^\\(\\\\\\)end *{" verbs "}\\(.?\\)") (1 "|") (3 "<")) |
| 623 | ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b") | 629 | ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b") |
| 624 | ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b") | 630 | ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b") |
diff --git a/lisp/type-break.el b/lisp/type-break.el index 253e1406f06..ec96ab09fe2 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el | |||
| @@ -1005,8 +1005,8 @@ FRAC should be the inverse of the fractional value; for example, a value of | |||
| 1005 | (setcar type-break-keystroke-threshold lower) | 1005 | (setcar type-break-keystroke-threshold lower) |
| 1006 | (setcdr type-break-keystroke-threshold upper) | 1006 | (setcdr type-break-keystroke-threshold upper) |
| 1007 | (if (interactive-p) | 1007 | (if (interactive-p) |
| 1008 | (message "min threshold: %d\tmax threshold: %d" lower upper) | 1008 | (message "min threshold: %d\tmax threshold: %d" lower upper)) |
| 1009 | type-break-keystroke-threshold))) | 1009 | type-break-keystroke-threshold)) |
| 1010 | 1010 | ||
| 1011 | 1011 | ||
| 1012 | ;;; misc functions | 1012 | ;;; misc functions |
| @@ -1103,37 +1103,12 @@ With optional non-nil ALL, force redisplay of all mode-lines." | |||
| 1103 | 1103 | ||
| 1104 | (defun type-break-run-at-time (time repeat function) | 1104 | (defun type-break-run-at-time (time repeat function) |
| 1105 | (condition-case nil (or (require 'timer) (require 'itimer)) (error nil)) | 1105 | (condition-case nil (or (require 'timer) (require 'itimer)) (error nil)) |
| 1106 | (cond ((fboundp 'run-at-time) | 1106 | (run-at-time time repeat function)) |
| 1107 | (run-at-time time repeat function)) | ||
| 1108 | ((fboundp 'start-timer) | ||
| 1109 | (let ((name (if (symbolp function) | ||
| 1110 | (symbol-name function) | ||
| 1111 | "type-break"))) | ||
| 1112 | (start-timer name function time repeat))) | ||
| 1113 | ((fboundp 'start-itimer) | ||
| 1114 | (let ((name (if (symbolp function) | ||
| 1115 | (symbol-name function) | ||
| 1116 | "type-break"))) | ||
| 1117 | (start-itimer name function time repeat))))) | ||
| 1118 | 1107 | ||
| 1119 | (defvar timer-dont-exit) | 1108 | (defvar timer-dont-exit) |
| 1120 | (defun type-break-cancel-function-timers (function) | 1109 | (defun type-break-cancel-function-timers (function) |
| 1121 | (cond ((fboundp 'cancel-function-timers) | 1110 | (let ((timer-dont-exit t)) |
| 1122 | (let ((timer-dont-exit t)) | 1111 | (cancel-function-timers function))) |
| 1123 | (cancel-function-timers function))) | ||
| 1124 | ((fboundp 'delete-timer) | ||
| 1125 | (let ((list timer-list)) | ||
| 1126 | (while list | ||
| 1127 | (and (eq (funcall 'timer-function (car list)) function) | ||
| 1128 | (delete-timer (car list))) | ||
| 1129 | (setq list (cdr list))))) | ||
| 1130 | ((fboundp 'delete-itimer) | ||
| 1131 | (with-no-warnings | ||
| 1132 | (let ((list itimer-list)) | ||
| 1133 | (while list | ||
| 1134 | (and (eq (funcall 'itimer-function (car list)) function) | ||
| 1135 | (delete-itimer (car list))) | ||
| 1136 | (setq list (cdr list)))))))) | ||
| 1137 | 1112 | ||
| 1138 | 1113 | ||
| 1139 | ;;; Demo wrappers | 1114 | ;;; Demo wrappers |
diff --git a/lisp/woman.el b/lisp/woman.el index cea1c61bcc4..610590a2972 100644 --- a/lisp/woman.el +++ b/lisp/woman.el | |||
| @@ -1132,7 +1132,7 @@ Used non-interactively, arguments are optional: if given then TOPIC | |||
| 1132 | should be a topic string and non-nil RE-CACHE forces re-caching." | 1132 | should be a topic string and non-nil RE-CACHE forces re-caching." |
| 1133 | (interactive (list nil current-prefix-arg)) | 1133 | (interactive (list nil current-prefix-arg)) |
| 1134 | ;; The following test is for non-interactive calls via gnudoit etc. | 1134 | ;; The following test is for non-interactive calls via gnudoit etc. |
| 1135 | (if (or (interactive-p) (not (stringp topic)) (string-match "\\S " topic)) | 1135 | (if (or (not (stringp topic)) (string-match "\\S " topic)) |
| 1136 | (let ((file-name (woman-file-name topic re-cache))) | 1136 | (let ((file-name (woman-file-name topic re-cache))) |
| 1137 | (if file-name | 1137 | (if file-name |
| 1138 | (woman-find-file file-name) | 1138 | (woman-find-file file-name) |
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 322a2e90eff..c47ad2f889d 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,32 @@ | |||
| 1 | 2004-10-29 Simon Josefsson <jas@extundo.com> | ||
| 2 | |||
| 3 | * minibuf.texi (Reading a Password): Revert. | ||
| 4 | |||
| 5 | 2004-10-28 Richard M. Stallman <rms@gnu.org> | ||
| 6 | |||
| 7 | * frames.texi (Display Feature Testing): Explain about "vendor". | ||
| 8 | |||
| 9 | 2004-10-27 Richard M. Stallman <rms@gnu.org> | ||
| 10 | |||
| 11 | * commands.texi (Interactive Codes): `N' uses numeric prefix, | ||
| 12 | not raw. Clarify `n'. | ||
| 13 | (Interactive Call): Rewrite interactive-p, focusing on when | ||
| 14 | and how to use it. | ||
| 15 | (Misc Events): Clarify previous change. | ||
| 16 | |||
| 17 | * advice.texi (Simple Advice): Clarify what job the example does. | ||
| 18 | (Around-Advice): Clarify ad-do-it. | ||
| 19 | (Activation of Advice): An option of ad-default-compilation-action | ||
| 20 | is `never', not `nil'. | ||
| 21 | |||
| 22 | 2004-10-26 Kim F. Storm <storm@cua.dk> | ||
| 23 | |||
| 24 | * commands.texi (Interactive Codes): Add U code letter. | ||
| 25 | |||
| 26 | 2004-10-25 Simon Josefsson <jas@extundo.com> | ||
| 27 | |||
| 28 | * minibuf.texi (Reading a Password): Add. | ||
| 29 | |||
| 1 | 2004-10-24 Jason Rumney <jasonr@gnu.org> | 30 | 2004-10-24 Jason Rumney <jasonr@gnu.org> |
| 2 | 31 | ||
| 3 | * commands.texi (Misc Events): Remove mouse-wheel. Add wheel-up | 32 | * commands.texi (Misc Events): Remove mouse-wheel. Add wheel-up |
diff --git a/lispref/advice.texi b/lispref/advice.texi index 46d4f96a35b..ae22fecc1fb 100644 --- a/lispref/advice.texi +++ b/lispref/advice.texi | |||
| @@ -51,7 +51,8 @@ is @code{nil}.) | |||
| 51 | 51 | ||
| 52 | Suppose you wanted to add a similar feature to @code{previous-line}, | 52 | Suppose you wanted to add a similar feature to @code{previous-line}, |
| 53 | which would insert a new line at the beginning of the buffer for the | 53 | which would insert a new line at the beginning of the buffer for the |
| 54 | command to move to. How could you do this? | 54 | command to move to (when @code{next-line-add-newlines} is |
| 55 | non-@code{nil}). How could you do this? | ||
| 55 | 56 | ||
| 56 | You could do it by redefining the whole function, but that is not | 57 | You could do it by redefining the whole function, but that is not |
| 57 | modular. The advice feature provides a cleaner alternative: you can | 58 | modular. The advice feature provides a cleaner alternative: you can |
| @@ -273,9 +274,9 @@ Its effect is to make sure that case is ignored in | |||
| 273 | searches when the original definition of @code{foo} is run. | 274 | searches when the original definition of @code{foo} is run. |
| 274 | 275 | ||
| 275 | @defvar ad-do-it | 276 | @defvar ad-do-it |
| 276 | This is not really a variable, but it is somewhat used like one | 277 | This is not really a variable, rather a place-holder that looks like a |
| 277 | in around-advice. It specifies the place to run the function's | 278 | variable. You use it in around-advice to specify the place to run the |
| 278 | original definition and other ``earlier'' around-advice. | 279 | function's original definition and other ``earlier'' around-advice. |
| 279 | @end defvar | 280 | @end defvar |
| 280 | 281 | ||
| 281 | If the around-advice does not use @code{ad-do-it}, then it does not run | 282 | If the around-advice does not use @code{ad-do-it}, then it does not run |
| @@ -360,10 +361,9 @@ advice. | |||
| 360 | This command activates all the advice defined for @var{function}. | 361 | This command activates all the advice defined for @var{function}. |
| 361 | @end deffn | 362 | @end deffn |
| 362 | 363 | ||
| 363 | To activate advice for a function whose advice is already active is not | 364 | Activating advice does nothing if @var{function}'s advice is already |
| 364 | a no-op. It is a useful operation which puts into effect any changes in | 365 | active. But if there is new advice, added since the previous time you |
| 365 | that function's advice since the previous activation of advice for that | 366 | activated advice for @var{function}, it activates the new advice. |
| 366 | function. | ||
| 367 | 367 | ||
| 368 | @deffn Command ad-deactivate function | 368 | @deffn Command ad-deactivate function |
| 369 | This command deactivates the advice for @var{function}. | 369 | This command deactivates the advice for @var{function}. |
| @@ -430,7 +430,7 @@ This variable controls whether to compile the combined definition | |||
| 430 | that results from activating advice for a function. | 430 | that results from activating advice for a function. |
| 431 | 431 | ||
| 432 | A value of @code{always} specifies to compile unconditionally. | 432 | A value of @code{always} specifies to compile unconditionally. |
| 433 | A value of @code{nil} specifies never compile the advice. | 433 | A value of @code{never} specifies never compile the advice. |
| 434 | 434 | ||
| 435 | A value of @code{maybe} specifies to compile if the byte-compiler is | 435 | A value of @code{maybe} specifies to compile if the byte-compiler is |
| 436 | already loaded. A value of @code{like-original} specifies to compile | 436 | already loaded. A value of @code{like-original} specifies to compile |
diff --git a/lispref/commands.texi b/lispref/commands.texi index 299c7bb61af..f1f94e11838 100644 --- a/lispref/commands.texi +++ b/lispref/commands.texi | |||
| @@ -360,6 +360,9 @@ until a command (or undefined command) is found in the current key | |||
| 360 | maps. The key sequence argument is represented as a string or vector. | 360 | maps. The key sequence argument is represented as a string or vector. |
| 361 | The cursor does not move into the echo area. Prompt. | 361 | The cursor does not move into the echo area. Prompt. |
| 362 | 362 | ||
| 363 | If the key sequence is a down-event, the following up-event is discarded, | ||
| 364 | but can be read via the @code{U} code character. | ||
| 365 | |||
| 363 | This kind of input is used by commands such as @code{describe-key} and | 366 | This kind of input is used by commands such as @code{describe-key} and |
| 364 | @code{global-set-key}. | 367 | @code{global-set-key}. |
| 365 | 368 | ||
| @@ -379,15 +382,14 @@ method, and returned as a string (@pxref{Input Methods,,, emacs, The GNU | |||
| 379 | Emacs Manual}). Prompt. | 382 | Emacs Manual}). Prompt. |
| 380 | 383 | ||
| 381 | @item n | 384 | @item n |
| 382 | A number read with the minibuffer. If the input is not a number, the | 385 | A number, read with the minibuffer. If the input is not a number, the |
| 383 | user is asked to try again. The prefix argument, if any, is not used. | 386 | user has to try again. @samp{n} never uses the prefix argument. |
| 384 | Prompt. | 387 | Prompt. |
| 385 | 388 | ||
| 386 | @item N | 389 | @item N |
| 387 | @cindex raw prefix argument usage | 390 | The numeric prefix argument; but if there is no prefix argument, read |
| 388 | The numeric prefix argument; but if there is no prefix argument, read a | 391 | a number as with @kbd{n}. The value is always a number. @xref{Prefix |
| 389 | number as with @kbd{n}. Requires a number. @xref{Prefix Command | 392 | Command Arguments}. Prompt. |
| 390 | Arguments}. Prompt. | ||
| 391 | 393 | ||
| 392 | @item p | 394 | @item p |
| 393 | @cindex numeric prefix argument usage | 395 | @cindex numeric prefix argument usage |
| @@ -395,6 +397,7 @@ The numeric prefix argument. (Note that this @samp{p} is lower case.) | |||
| 395 | No I/O. | 397 | No I/O. |
| 396 | 398 | ||
| 397 | @item P | 399 | @item P |
| 400 | @cindex raw prefix argument usage | ||
| 398 | The raw prefix argument. (Note that this @samp{P} is upper case.) No | 401 | The raw prefix argument. (Note that this @samp{P} is upper case.) No |
| 399 | I/O. | 402 | I/O. |
| 400 | 403 | ||
| @@ -416,6 +419,11 @@ character terminates the input. (Use @kbd{C-q} to include whitespace in | |||
| 416 | the string.) Other characters that normally terminate a symbol (e.g., | 419 | the string.) Other characters that normally terminate a symbol (e.g., |
| 417 | parentheses and brackets) do not do so here. Prompt. | 420 | parentheses and brackets) do not do so here. Prompt. |
| 418 | 421 | ||
| 422 | @item U | ||
| 423 | A key sequence or nil. May be used after a @code{k} or @code{K} | ||
| 424 | argument to get the up-event that was discarded in case the key | ||
| 425 | sequence read for that argument was a down-event. No I/O. | ||
| 426 | |||
| 419 | @item v | 427 | @item v |
| 420 | A variable declared to be a user option (i.e., satisfying the | 428 | A variable declared to be a user option (i.e., satisfying the |
| 421 | predicate @code{user-variable-p}). This reads the variable using | 429 | predicate @code{user-variable-p}). This reads the variable using |
| @@ -605,25 +613,23 @@ part of the prompt. | |||
| 605 | @end deffn | 613 | @end deffn |
| 606 | 614 | ||
| 607 | @defun interactive-p | 615 | @defun interactive-p |
| 608 | This function returns @code{t} if the containing function (the one whose | 616 | This function returns @code{t} if the containing function (the one |
| 609 | code includes the call to @code{interactive-p}) was called | 617 | whose code includes the call to @code{interactive-p}) was called in |
| 610 | interactively, with the function @code{call-interactively}. (It makes | 618 | direct response to user input. This means that it was called with the |
| 611 | no difference whether @code{call-interactively} was called from Lisp or | 619 | function @code{call-interactively}, and that a keyboard macro is |
| 612 | directly from the editor command loop.) If the containing function was | 620 | not running. |
| 613 | called by Lisp evaluation (or with @code{apply} or @code{funcall}), then | 621 | |
| 614 | it was not called interactively. | 622 | If the containing function was called by Lisp evaluation (or with |
| 623 | @code{apply} or @code{funcall}), then it was not called interactively. | ||
| 615 | @end defun | 624 | @end defun |
| 616 | 625 | ||
| 617 | The most common use of @code{interactive-p} is for deciding whether to | 626 | The most common use of @code{interactive-p} is for deciding whether |
| 618 | print an informative message. As a special exception, | 627 | to give the user additional visual feedback (such as by printing an |
| 619 | @code{interactive-p} returns @code{nil} whenever a keyboard macro is | 628 | informative message). For example: |
| 620 | being run. This is to suppress the informative messages and speed | ||
| 621 | execution of the macro. | ||
| 622 | |||
| 623 | For example: | ||
| 624 | 629 | ||
| 625 | @example | 630 | @example |
| 626 | @group | 631 | @group |
| 632 | ;; @r{Here's the usual way to use @code{interactive-p}.} | ||
| 627 | (defun foo () | 633 | (defun foo () |
| 628 | (interactive) | 634 | (interactive) |
| 629 | (when (interactive-p) | 635 | (when (interactive-p) |
| @@ -632,6 +638,7 @@ execution of the macro. | |||
| 632 | @end group | 638 | @end group |
| 633 | 639 | ||
| 634 | @group | 640 | @group |
| 641 | ;; @r{This function is just to illustrate the behavior.} | ||
| 635 | (defun bar () | 642 | (defun bar () |
| 636 | (interactive) | 643 | (interactive) |
| 637 | (setq foobar (list (foo) (interactive-p)))) | 644 | (setq foobar (list (foo) (interactive-p)))) |
| @@ -645,7 +652,7 @@ execution of the macro. | |||
| 645 | 652 | ||
| 646 | @group | 653 | @group |
| 647 | ;; @r{Type @kbd{M-x bar}.} | 654 | ;; @r{Type @kbd{M-x bar}.} |
| 648 | ;; @r{This does not print anything.} | 655 | ;; @r{This does not display a message.} |
| 649 | @end group | 656 | @end group |
| 650 | 657 | ||
| 651 | @group | 658 | @group |
| @@ -654,10 +661,11 @@ foobar | |||
| 654 | @end group | 661 | @end group |
| 655 | @end example | 662 | @end example |
| 656 | 663 | ||
| 657 | The other way to do this sort of job is to make the command take an | 664 | If you want to test @emph{only} whether the function was called |
| 658 | argument @code{print-message} which should be non-@code{nil} in an | 665 | using @code{call-interactively}, add an optional argument |
| 659 | interactive call, and use the @code{interactive} spec to make sure it is | 666 | @code{print-message} which should be non-@code{nil} in an interactive |
| 660 | non-@code{nil}. Here's how: | 667 | call, and use the @code{interactive} spec to make sure it is |
| 668 | non-@code{nil}. Here's an example: | ||
| 661 | 669 | ||
| 662 | @example | 670 | @example |
| 663 | (defun foo (&optional print-message) | 671 | (defun foo (&optional print-message) |
| @@ -667,10 +675,9 @@ non-@code{nil}. Here's how: | |||
| 667 | @end example | 675 | @end example |
| 668 | 676 | ||
| 669 | @noindent | 677 | @noindent |
| 670 | Defined in this way, the function does display the message when | 678 | Defined in this way, the function does display the message when called |
| 671 | called from a keyboard macro. | 679 | from a keyboard macro. We use @code{"p"} because the numeric prefix |
| 672 | 680 | argument is never @code{nil}. | |
| 673 | The numeric prefix argument, provided by @samp{p}, is never @code{nil}. | ||
| 674 | 681 | ||
| 675 | @node Command Loop Info | 682 | @node Command Loop Info |
| 676 | @comment node-name, next, previous, up | 683 | @comment node-name, next, previous, up |
| @@ -1505,16 +1512,17 @@ frame has already been made visible, Emacs has no work to do. | |||
| 1505 | @cindex @code{wheel-down} event | 1512 | @cindex @code{wheel-down} event |
| 1506 | @item (wheel-up @var{position}) | 1513 | @item (wheel-up @var{position}) |
| 1507 | @item (wheel-down @var{position}) | 1514 | @item (wheel-down @var{position}) |
| 1508 | This kind of event is generated by moving a wheel on a mouse. Its | 1515 | These kinds of event are generated by moving a mouse wheel. Their |
| 1509 | effect is typically a kind of scroll or zoom. | 1516 | usual meaning is a kind of scroll or zoom. |
| 1510 | 1517 | ||
| 1511 | The element @var{position} is a list describing the position of the | 1518 | The element @var{position} is a list describing the position of the |
| 1512 | event, in the same format as used in a mouse-click event. | 1519 | event, in the same format as used in a mouse-click event. |
| 1513 | 1520 | ||
| 1514 | This kind of event is generated only on some kinds of systems. On | 1521 | This kind of event is generated only on some kinds of systems. On some |
| 1515 | other systems, mouse-4 and mouse-5 may be used instead. For portable | 1522 | systems, @code{mouse-4} and @code{mouse-5} are used instead. For |
| 1516 | code, the variables @code{mouse-wheel-up-event} and | 1523 | portable code, use the variables @code{mouse-wheel-up-event} and |
| 1517 | @code{mouse-wheel-down-event} defined in @file{mwheel.el} can be used. | 1524 | @code{mouse-wheel-down-event} defined in @file{mwheel.el} to determine |
| 1525 | what event types to expect for the mouse wheel. | ||
| 1518 | 1526 | ||
| 1519 | @cindex @code{drag-n-drop} event | 1527 | @cindex @code{drag-n-drop} event |
| 1520 | @item (drag-n-drop @var{position} @var{files}) | 1528 | @item (drag-n-drop @var{position} @var{files}) |
diff --git a/lispref/frames.texi b/lispref/frames.texi index c2c488873a4..736115ef11e 100644 --- a/lispref/frames.texi +++ b/lispref/frames.texi | |||
| @@ -1980,12 +1980,18 @@ about X displays. | |||
| 1980 | @defun x-server-version &optional display | 1980 | @defun x-server-version &optional display |
| 1981 | This function returns the list of version numbers of the X server | 1981 | This function returns the list of version numbers of the X server |
| 1982 | running the display. The value is a list of three integers: the major | 1982 | running the display. The value is a list of three integers: the major |
| 1983 | and minor version numbers, and the vendor-specific release number. | 1983 | and minor version numbers of the X protocol, and the |
| 1984 | distributor-specific release number of the X server software itself. | ||
| 1984 | @end defun | 1985 | @end defun |
| 1985 | 1986 | ||
| 1986 | @defun x-server-vendor &optional display | 1987 | @defun x-server-vendor &optional display |
| 1987 | This function returns the ``vendor'' that provided the X server software | 1988 | This function returns the ``vendor'' that provided the X server |
| 1988 | (as a string). | 1989 | software (as a string). Really this means whoever distributes the X |
| 1990 | server. | ||
| 1991 | |||
| 1992 | When the developers of X labelled software distributors as | ||
| 1993 | ``vendors'', they showed their false assumption that no system could | ||
| 1994 | ever be developed and distributed noncommercially. | ||
| 1989 | @end defun | 1995 | @end defun |
| 1990 | 1996 | ||
| 1991 | @ignore | 1997 | @ignore |
diff --git a/nt/INSTALL b/nt/INSTALL index 09de93bca01..a96f182452c 100644 --- a/nt/INSTALL +++ b/nt/INSTALL | |||
| @@ -54,7 +54,9 @@ | |||
| 54 | 54 | ||
| 55 | In addition, using 4NT as your shell is known to fail the build process, | 55 | In addition, using 4NT as your shell is known to fail the build process, |
| 56 | at least for 4NT version 3.01. Use cmd.exe, the default NT shell, | 56 | at least for 4NT version 3.01. Use cmd.exe, the default NT shell, |
| 57 | instead. | 57 | instead. MSYS sh.exe also appears to cause various problems. If you have |
| 58 | MSYS installed, try "make SHELL=cmd.exe" to force the use of cmd.exe | ||
| 59 | instead of sh.exe. | ||
| 58 | 60 | ||
| 59 | sh exists no sh | 61 | sh exists no sh |
| 60 | 62 | ||
diff --git a/src/ChangeLog b/src/ChangeLog index 1490b34b4a9..8479a0f94ce 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,74 @@ | |||
| 1 | 2004-10-28 Will <will@glozer.net> | ||
| 2 | |||
| 3 | * macterm.c: allow user to assign key modifiers to the Mac Option | ||
| 4 | key via a 'mac-option-modifier' variable. | ||
| 5 | |||
| 6 | 2004-10-28 Stefan <monnier@iro.umontreal.ca> | ||
| 7 | |||
| 8 | * xselect.c (Vx_lost_selection_functions, Vx_sent_selection_functions): | ||
| 9 | Rename from Vx_lost_selection_hooks and Vx_sent_selection_hooks. | ||
| 10 | (x_handle_selection_request, x_handle_selection_clear) | ||
| 11 | (x_clear_frame_selections, syms_of_xselect): Adjust accordingly. | ||
| 12 | |||
| 13 | 2004-10-28 Richard M. Stallman <rms@gnu.org> | ||
| 14 | |||
| 15 | * w32fns.c (Fx_server_vendor, Fx_server_version): Doc fixes. | ||
| 16 | |||
| 17 | * xfns.c (Fx_server_vendor, Fx_server_version): Doc fixes. | ||
| 18 | |||
| 19 | 2004-10-27 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 20 | |||
| 21 | * syntax.c (scan_sexps_forward): Give precedence to a 2-char | ||
| 22 | comment-starter over a 1-char one. | ||
| 23 | |||
| 24 | 2004-10-27 Richard M. Stallman <rms@gnu.org> | ||
| 25 | |||
| 26 | * xdisp.c (get_next_display_element): In mode lines, | ||
| 27 | treat newline and tab like other control characters. | ||
| 28 | |||
| 29 | * editfns.c (Fmessage): Doc fix. | ||
| 30 | |||
| 31 | * indent.c (vmotion): When moving up, check the newline before. | ||
| 32 | Make prevline an int, not a Lisp_Object. | ||
| 33 | |||
| 34 | 2004-10-27 Kim F. Storm <storm@cua.dk> | ||
| 35 | |||
| 36 | * editfns.c (Fformat): Allocate discarded table with SAFE_ALLOCA. | ||
| 37 | Only allocate info and discarded tables once. | ||
| 38 | |||
| 39 | * lisp.h (USE_SAFE_ALLOCA): Add and init sa_must_free integer. | ||
| 40 | (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Increment it when malloc is used. | ||
| 41 | (SAFE_FREE): Test it to determine if we need to unwind to free. | ||
| 42 | Remove size arg. All users changed. | ||
| 43 | (SAFE_FREE_LISP) Remove. All users changed to use SAFE_FREE. | ||
| 44 | |||
| 45 | 2004-10-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 46 | |||
| 47 | * gtkutil.c: Put empty line between comment and function body. | ||
| 48 | (xg_destroy_widgets): Rename from remove_from_container. | ||
| 49 | Just destroy all widgets in list. Argument wcont removed. | ||
| 50 | (xg_update_menubar, xg_update_submenu): Call xg_destroy_widgets | ||
| 51 | instead of remove_from_container. | ||
| 52 | (xg_display_close, xg_create_tool_bar, update_frame_tool_bar) | ||
| 53 | (free_frame_tool_bar): Add comment. | ||
| 54 | |||
| 55 | * xfns.c (xic_create_xfontset): Check that FRAME_XIC_BASE_FONTNAME | ||
| 56 | is not NULL before strcmp. | ||
| 57 | |||
| 58 | 2004-10-26 Kim F. Storm <storm@cua.dk> | ||
| 59 | |||
| 60 | * callint.c (Fcall_interactively): Add 'U' code to get the | ||
| 61 | up-event discarded by a previous 'k' or 'K' argument. | ||
| 62 | |||
| 63 | 2004-10-26 David Kastrup <dak@gnu.org> | ||
| 64 | |||
| 65 | * buffer.c (syms_of_buffer): Fix a few typos. | ||
| 66 | |||
| 67 | 2004-10-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 68 | |||
| 69 | * xsmfns.c: Put empty line between comment and function body. | ||
| 70 | Use two spaces before comment end. | ||
| 71 | |||
| 1 | 2004-10-25 Kenichi Handa <handa@m17n.org> | 72 | 2004-10-25 Kenichi Handa <handa@m17n.org> |
| 2 | 73 | ||
| 3 | * fontset.c (fontset_pattern_regexp): Optimize for the case that | 74 | * fontset.c (fontset_pattern_regexp): Optimize for the case that |
| @@ -21,17 +92,17 @@ | |||
| 21 | 92 | ||
| 22 | 2004-10-21 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu> | 93 | 2004-10-21 K,Aa(Broly L$,1 q(Brentey <lorentey@elte.hu> |
| 23 | 94 | ||
| 24 | * xterm.h (x_output): New member `xic_base_fontname'. | 95 | * xterm.h (x_output): New member `xic_base_fontname'. |
| 25 | (FRAME_XIC_BASE_FONTNAME): New macro. | 96 | (FRAME_XIC_BASE_FONTNAME): New macro. |
| 26 | (xic_free_xfontset): Declare. | 97 | (xic_free_xfontset): Declare. |
| 27 | 98 | ||
| 28 | * xfns.c (xic_create_xfontset): Share fontsets between frames | 99 | * xfns.c (xic_create_xfontset): Share fontsets between frames |
| 29 | based on base_fontname. | 100 | based on base_fontname. |
| 30 | (xic_free_xfontset): New function. | 101 | (xic_free_xfontset): New function. |
| 31 | (free_frame_xic): Use it. | 102 | (free_frame_xic): Use it. |
| 32 | (xic_set_xfontset): Ditto. | 103 | (xic_set_xfontset): Ditto. |
| 33 | 104 | ||
| 34 | * xterm.c (xim_destroy_callback): Ditto. | 105 | * xterm.c (xim_destroy_callback): Ditto. |
| 35 | 106 | ||
| 36 | 107 | ||
| 37 | 2004-10-20 B. Anyos <banyos@freemail.hu> (tiny change) | 108 | 2004-10-20 B. Anyos <banyos@freemail.hu> (tiny change) |
| @@ -75,10 +146,10 @@ | |||
| 75 | 146 | ||
| 76 | * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left | 147 | * gtkutil.h (xg_update_scrollbar_pos): Remove arguments real_left |
| 77 | and canon_width. | 148 | and canon_width. |
| 78 | (xg_frame_cleared): Removed. | 149 | (xg_frame_cleared): Remove. |
| 79 | 150 | ||
| 80 | * gtkutil.c (xg_frame_cleared, xg_fixed_handle_expose, | 151 | * gtkutil.c (xg_frame_cleared, xg_fixed_handle_expose) |
| 81 | xg_find_top_left_in_fixed): Removed. | 152 | (xg_find_top_left_in_fixed): Remove. |
| 82 | (xg_create_scroll_bar): Put an event box widget between | 153 | (xg_create_scroll_bar): Put an event box widget between |
| 83 | the scroll bar widget and the edit widget. | 154 | the scroll bar widget and the edit widget. |
| 84 | (xg_show_scroll_bar): Show the parent widget (the event box). | 155 | (xg_show_scroll_bar): Show the parent widget (the event box). |
| @@ -87,11 +158,11 @@ | |||
| 87 | Move the parent (the event box) widget inside the fixed widget. | 158 | Move the parent (the event box) widget inside the fixed widget. |
| 88 | Move window clear to xterm.c. | 159 | Move window clear to xterm.c. |
| 89 | 160 | ||
| 90 | * gtkutil.h (xg_frame_cleared): Removed. | 161 | * gtkutil.h (xg_frame_cleared): Remove. |
| 91 | 162 | ||
| 92 | * xterm.c (x_clear_frame): Remove call to xg_frame_cleared | 163 | * xterm.c (x_clear_frame): Remove call to xg_frame_cleared |
| 93 | (x_scroll_bar_create, XTset_vertical_scroll_bar): Remove | 164 | (x_scroll_bar_create, XTset_vertical_scroll_bar): |
| 94 | arguments left and width to xg_update_scrollbar_pos. | 165 | Remove arguments left and width to xg_update_scrollbar_pos. |
| 95 | (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also. | 166 | (XTset_vertical_scroll_bar): Do x_clear_area for USE_GTK also. |
| 96 | 167 | ||
| 97 | 2004-10-19 Kenichi Handa <handa@m17n.org> | 168 | 2004-10-19 Kenichi Handa <handa@m17n.org> |
diff --git a/src/ChangeLog.8 b/src/ChangeLog.8 index 91fcdd1c899..a9465058194 100644 --- a/src/ChangeLog.8 +++ b/src/ChangeLog.8 | |||
| @@ -6,25 +6,25 @@ | |||
| 6 | 6 | ||
| 7 | 1999-12-31 William M. Perry <wmperry@aventail.com> | 7 | 1999-12-31 William M. Perry <wmperry@aventail.com> |
| 8 | 8 | ||
| 9 | * xfns.c (jpeg_format): Added the :data keyword | 9 | * xfns.c (jpeg_format): Add the :data keyword |
| 10 | (jpeg_image_p): JPEG is valid with :file _or_ :data | 10 | (jpeg_image_p): JPEG is valid with :file _or_ :data |
| 11 | (jpeg_memory_src): Defined new JPEG image source to read from a | 11 | (jpeg_memory_src): Define new JPEG image source to read from a |
| 12 | memory buffer. | 12 | memory buffer. |
| 13 | (jpeg_load): Pay attention to the :data keyword if specified. | 13 | (jpeg_load): Pay attention to the :data keyword if specified. |
| 14 | Instantiates a jpeg_memory_src instead of jpeg_stdio_src if found. | 14 | Instantiates a jpeg_memory_src instead of jpeg_stdio_src if found. |
| 15 | (png_format): Added the :data keyword | 15 | (png_format): Add the :data keyword |
| 16 | (png_image_p): PNG is valid with :file _or_ :data | 16 | (png_image_p): PNG is valid with :file _or_ :data |
| 17 | (png_read_from_memory): New PNG read function to read from a | 17 | (png_read_from_memory): New PNG read function to read from a |
| 18 | memory buffer. | 18 | memory buffer. |
| 19 | (png_load): Pay attention to the :data keyword if specified. | 19 | (png_load): Pay attention to the :data keyword if specified. |
| 20 | Use png_set_read_fn() instead of png_init_io() if specified. | 20 | Use png_set_read_fn() instead of png_init_io() if specified. |
| 21 | (tiff_format): Added the :data keyword for TIFF images. | 21 | (tiff_format): Add the :data keyword for TIFF images. |
| 22 | (tiff_image_p): TIFF is valid with :file _or_ :data | 22 | (tiff_image_p): TIFF is valid with :file _or_ :data |
| 23 | (tiff_read_from_memory): Defined new TIFF I/O functions to read | 23 | (tiff_read_from_memory): Define new TIFF I/O functions to read |
| 24 | from a memory buffer. | 24 | from a memory buffer. |
| 25 | (tiff_load): Pay attention to the :data keyword if specified. | 25 | (tiff_load): Pay attention to the :data keyword if specified. |
| 26 | Uses TIFFClientOpen() instead of TIFFOpen() if specified. | 26 | Uses TIFFClientOpen() instead of TIFFOpen() if specified. |
| 27 | (gif_format): Added the :data keyword | 27 | (gif_format): Add the :data keyword |
| 28 | (gif_image_p): GIF is valid with :file _or_ :data | 28 | (gif_image_p): GIF is valid with :file _or_ :data |
| 29 | (gif_read_from_memory): New GIF input function to read from a | 29 | (gif_read_from_memory): New GIF input function to read from a |
| 30 | memory buffer. | 30 | memory buffer. |
diff --git a/src/buffer.c b/src/buffer.c index b0368a842ca..b0c8c370931 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5812,21 +5812,21 @@ If the value of the variable is t, undo information is not recorded. */); | |||
| 5812 | doc: /* Non-nil means that Emacs should use caches to handle long lines more quickly. | 5812 | doc: /* Non-nil means that Emacs should use caches to handle long lines more quickly. |
| 5813 | 5813 | ||
| 5814 | Normally, the line-motion functions work by scanning the buffer for | 5814 | Normally, the line-motion functions work by scanning the buffer for |
| 5815 | newlines. Columnar operations (like move-to-column and | 5815 | newlines. Columnar operations (like `move-to-column' and |
| 5816 | compute-motion) also work by scanning the buffer, summing character | 5816 | `compute-motion') also work by scanning the buffer, summing character |
| 5817 | widths as they go. This works well for ordinary text, but if the | 5817 | widths as they go. This works well for ordinary text, but if the |
| 5818 | buffer's lines are very long (say, more than 500 characters), these | 5818 | buffer's lines are very long (say, more than 500 characters), these |
| 5819 | motion functions will take longer to execute. Emacs may also take | 5819 | motion functions will take longer to execute. Emacs may also take |
| 5820 | longer to update the display. | 5820 | longer to update the display. |
| 5821 | 5821 | ||
| 5822 | If cache-long-line-scans is non-nil, these motion functions cache the | 5822 | If `cache-long-line-scans' is non-nil, these motion functions cache the |
| 5823 | results of their scans, and consult the cache to avoid rescanning | 5823 | results of their scans, and consult the cache to avoid rescanning |
| 5824 | regions of the buffer until the text is modified. The caches are most | 5824 | regions of the buffer until the text is modified. The caches are most |
| 5825 | beneficial when they prevent the most searching---that is, when the | 5825 | beneficial when they prevent the most searching---that is, when the |
| 5826 | buffer contains long lines and large regions of characters with the | 5826 | buffer contains long lines and large regions of characters with the |
| 5827 | same, fixed screen width. | 5827 | same, fixed screen width. |
| 5828 | 5828 | ||
| 5829 | When cache-long-line-scans is non-nil, processing short lines will | 5829 | When `cache-long-line-scans' is non-nil, processing short lines will |
| 5830 | become slightly slower (because of the overhead of consulting the | 5830 | become slightly slower (because of the overhead of consulting the |
| 5831 | cache), and the caches will use memory roughly proportional to the | 5831 | cache), and the caches will use memory roughly proportional to the |
| 5832 | number of newlines and characters whose screen width varies. | 5832 | number of newlines and characters whose screen width varies. |
| @@ -5906,8 +5906,8 @@ Values are interpreted as follows: | |||
| 5906 | hollow display a hollow box cursor | 5906 | hollow display a hollow box cursor |
| 5907 | bar display a vertical bar cursor with default width | 5907 | bar display a vertical bar cursor with default width |
| 5908 | (bar . WIDTH) display a vertical bar cursor with width WIDTH | 5908 | (bar . WIDTH) display a vertical bar cursor with width WIDTH |
| 5909 | hbar display a horisontal bar cursor with default width | 5909 | hbar display a horizontal bar cursor with default width |
| 5910 | (hbar . WIDTH) display a horisontal bar cursor with width WIDTH | 5910 | (hbar . WIDTH) display a horizontal bar cursor with width WIDTH |
| 5911 | ANYTHING ELSE display a hollow box cursor. | 5911 | ANYTHING ELSE display a hollow box cursor. |
| 5912 | 5912 | ||
| 5913 | When the buffer is displayed in a nonselected window, | 5913 | When the buffer is displayed in a nonselected window, |
diff --git a/src/callint.c b/src/callint.c index 8b8cb032095..da88693cd78 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -110,6 +110,7 @@ P -- Prefix arg in raw form. Does not do I/O. | |||
| 110 | r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O. | 110 | r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O. |
| 111 | s -- Any string. Does not inherit the current input method. | 111 | s -- Any string. Does not inherit the current input method. |
| 112 | S -- Any symbol. | 112 | S -- Any symbol. |
| 113 | U -- Mouse up event discarded by a previous k or K argument. | ||
| 113 | v -- Variable name: symbol that is user-variable-p. | 114 | v -- Variable name: symbol that is user-variable-p. |
| 114 | x -- Lisp expression read but not evaluated. | 115 | x -- Lisp expression read but not evaluated. |
| 115 | X -- Lisp expression read and evaluated. | 116 | X -- Lisp expression read and evaluated. |
| @@ -268,6 +269,7 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) | |||
| 268 | Lisp_Object specs; | 269 | Lisp_Object specs; |
| 269 | Lisp_Object filter_specs; | 270 | Lisp_Object filter_specs; |
| 270 | Lisp_Object teml; | 271 | Lisp_Object teml; |
| 272 | Lisp_Object up_event; | ||
| 271 | Lisp_Object enable; | 273 | Lisp_Object enable; |
| 272 | int speccount = SPECPDL_INDEX (); | 274 | int speccount = SPECPDL_INDEX (); |
| 273 | 275 | ||
| @@ -289,7 +291,7 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) | |||
| 289 | char prompt1[100]; | 291 | char prompt1[100]; |
| 290 | char *tem1; | 292 | char *tem1; |
| 291 | int arg_from_tty = 0; | 293 | int arg_from_tty = 0; |
| 292 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 294 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
| 293 | int key_count; | 295 | int key_count; |
| 294 | int record_then_fail = 0; | 296 | int record_then_fail = 0; |
| 295 | 297 | ||
| @@ -328,6 +330,9 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) | |||
| 328 | The feature is not fully implemented. */ | 330 | The feature is not fully implemented. */ |
| 329 | filter_specs = Qnil; | 331 | filter_specs = Qnil; |
| 330 | 332 | ||
| 333 | /* If k or K discard an up-event, save it here so it can be retrieved with U */ | ||
| 334 | up_event = Qnil; | ||
| 335 | |||
| 331 | /* Decode the kind of function. Either handle it and return, | 336 | /* Decode the kind of function. Either handle it and return, |
| 332 | or go to `lose' if not interactive, or go to `retry' | 337 | or go to `lose' if not interactive, or go to `retry' |
| 333 | to specify a different function, or set either STRING or SPECS. */ | 338 | to specify a different function, or set either STRING or SPECS. */ |
| @@ -499,7 +504,7 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) | |||
| 499 | varies[i] = 0; | 504 | varies[i] = 0; |
| 500 | } | 505 | } |
| 501 | 506 | ||
| 502 | GCPRO4 (prefix_arg, function, *args, *visargs); | 507 | GCPRO5 (prefix_arg, function, *args, *visargs, up_event); |
| 503 | gcpro3.nvars = (count + 1); | 508 | gcpro3.nvars = (count + 1); |
| 504 | gcpro4.nvars = (count + 1); | 509 | gcpro4.nvars = (count + 1); |
| 505 | 510 | ||
| @@ -628,7 +633,7 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) | |||
| 628 | /* Ignore first element, which is the base key. */ | 633 | /* Ignore first element, which is the base key. */ |
| 629 | tem2 = Fmemq (intern ("down"), Fcdr (teml)); | 634 | tem2 = Fmemq (intern ("down"), Fcdr (teml)); |
| 630 | if (! NILP (tem2)) | 635 | if (! NILP (tem2)) |
| 631 | Fread_event (Qnil, Qnil); | 636 | up_event = Fread_event (Qnil, Qnil); |
| 632 | } | 637 | } |
| 633 | } | 638 | } |
| 634 | break; | 639 | break; |
| @@ -656,11 +661,21 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) | |||
| 656 | /* Ignore first element, which is the base key. */ | 661 | /* Ignore first element, which is the base key. */ |
| 657 | tem2 = Fmemq (intern ("down"), Fcdr (teml)); | 662 | tem2 = Fmemq (intern ("down"), Fcdr (teml)); |
| 658 | if (! NILP (tem2)) | 663 | if (! NILP (tem2)) |
| 659 | Fread_event (Qnil, Qnil); | 664 | up_event = Fread_event (Qnil, Qnil); |
| 660 | } | 665 | } |
| 661 | } | 666 | } |
| 662 | break; | 667 | break; |
| 663 | 668 | ||
| 669 | case 'U': /* Up event from last k or K */ | ||
| 670 | if (!NILP (up_event)) | ||
| 671 | { | ||
| 672 | args[i] = Fmake_vector (make_number (1), up_event); | ||
| 673 | up_event = Qnil; | ||
| 674 | teml = args[i]; | ||
| 675 | visargs[i] = Fkey_description (teml, Qnil); | ||
| 676 | } | ||
| 677 | break; | ||
| 678 | |||
| 664 | case 'e': /* The invoking event. */ | 679 | case 'e': /* The invoking event. */ |
| 665 | if (next_event >= key_count) | 680 | if (next_event >= key_count) |
| 666 | error ("%s must be bound to an event with parameters", | 681 | error ("%s must be bound to an event with parameters", |
diff --git a/src/casefiddle.c b/src/casefiddle.c index 25a5a3d12b8..51fc6444f49 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c | |||
| @@ -137,7 +137,7 @@ casify_object (flag, obj) | |||
| 137 | } | 137 | } |
| 138 | obj = make_multibyte_string (buf, SCHARS (obj), | 138 | obj = make_multibyte_string (buf, SCHARS (obj), |
| 139 | j_byte); | 139 | j_byte); |
| 140 | SAFE_FREE (bufsize); | 140 | SAFE_FREE (); |
| 141 | } | 141 | } |
| 142 | return obj; | 142 | return obj; |
| 143 | } | 143 | } |
diff --git a/src/charset.c b/src/charset.c index 8eeddd51c92..c03107a9c46 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -1673,7 +1673,7 @@ usage: (string &rest CHARACTERS) */) | |||
| 1673 | } | 1673 | } |
| 1674 | 1674 | ||
| 1675 | ret = make_string_from_bytes (buf, n, p - buf); | 1675 | ret = make_string_from_bytes (buf, n, p - buf); |
| 1676 | SAFE_FREE (bufsize); | 1676 | SAFE_FREE (); |
| 1677 | 1677 | ||
| 1678 | return ret; | 1678 | return ret; |
| 1679 | } | 1679 | } |
diff --git a/src/data.c b/src/data.c index 33b37376a49..92487f82ddb 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -2165,7 +2165,7 @@ bool-vector. IDX starts at 0. */) | |||
| 2165 | p1 = SDATA (array) + idxval_byte; | 2165 | p1 = SDATA (array) + idxval_byte; |
| 2166 | bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, | 2166 | bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, |
| 2167 | nbytes - (idxval_byte + prev_bytes)); | 2167 | nbytes - (idxval_byte + prev_bytes)); |
| 2168 | SAFE_FREE (nbytes); | 2168 | SAFE_FREE (); |
| 2169 | clear_string_char_byte_cache (); | 2169 | clear_string_char_byte_cache (); |
| 2170 | } | 2170 | } |
| 2171 | while (new_bytes--) | 2171 | while (new_bytes--) |
| @@ -2206,7 +2206,7 @@ bool-vector. IDX starts at 0. */) | |||
| 2206 | *p1++ = *p0++; | 2206 | *p1++ = *p0++; |
| 2207 | bcopy (str + idxval_byte + prev_bytes, p1, | 2207 | bcopy (str + idxval_byte + prev_bytes, p1, |
| 2208 | nbytes - (idxval_byte + prev_bytes)); | 2208 | nbytes - (idxval_byte + prev_bytes)); |
| 2209 | SAFE_FREE (nbytes); | 2209 | SAFE_FREE (); |
| 2210 | clear_string_char_byte_cache (); | 2210 | clear_string_char_byte_cache (); |
| 2211 | } | 2211 | } |
| 2212 | } | 2212 | } |
diff --git a/src/editfns.c b/src/editfns.c index 5b129a18a62..e83e53e9d24 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -2775,7 +2775,7 @@ It returns the number of characters changed. */) | |||
| 2775 | 2775 | ||
| 2776 | pos = XINT (start); | 2776 | pos = XINT (start); |
| 2777 | pos_byte = CHAR_TO_BYTE (pos); | 2777 | pos_byte = CHAR_TO_BYTE (pos); |
| 2778 | end_pos = XINT (end); | 2778 | end_pos = XINT (end); |
| 2779 | modify_region (current_buffer, pos, XINT (end)); | 2779 | modify_region (current_buffer, pos, XINT (end)); |
| 2780 | 2780 | ||
| 2781 | cnt = 0; | 2781 | cnt = 0; |
| @@ -3049,11 +3049,14 @@ static int message_length; | |||
| 3049 | 3049 | ||
| 3050 | DEFUN ("message", Fmessage, Smessage, 1, MANY, 0, | 3050 | DEFUN ("message", Fmessage, Smessage, 1, MANY, 0, |
| 3051 | doc: /* Print a one-line message at the bottom of the screen. | 3051 | doc: /* Print a one-line message at the bottom of the screen. |
| 3052 | The message also goes into the `*Messages*' buffer. | ||
| 3053 | \(In keyboard macros, that's all it does.) | ||
| 3054 | |||
| 3052 | The first argument is a format control string, and the rest are data | 3055 | The first argument is a format control string, and the rest are data |
| 3053 | to be formatted under control of the string. See `format' for details. | 3056 | to be formatted under control of the string. See `format' for details. |
| 3054 | 3057 | ||
| 3055 | If the first argument is nil, clear any existing message; let the | 3058 | If the first argument is nil, the function clears any existing message; |
| 3056 | minibuffer contents show. | 3059 | this lets the minibuffer contents show. See also `current-message'. |
| 3057 | 3060 | ||
| 3058 | usage: (message STRING &rest ARGS) */) | 3061 | usage: (message STRING &rest ARGS) */) |
| 3059 | (nargs, args) | 3062 | (nargs, args) |
| @@ -3268,7 +3271,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3268 | /* discarded[I] is 1 if byte I of the format | 3271 | /* discarded[I] is 1 if byte I of the format |
| 3269 | string was not copied into the output. | 3272 | string was not copied into the output. |
| 3270 | It is 2 if byte I was not the first byte of its character. */ | 3273 | It is 2 if byte I was not the first byte of its character. */ |
| 3271 | char *discarded; | 3274 | char *discarded = 0; |
| 3272 | 3275 | ||
| 3273 | /* Each element records, for one argument, | 3276 | /* Each element records, for one argument, |
| 3274 | the start and end bytepos in the output string, | 3277 | the start and end bytepos in the output string, |
| @@ -3319,11 +3322,13 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3319 | { | 3322 | { |
| 3320 | int nbytes = (nargs+1) * sizeof *info; | 3323 | int nbytes = (nargs+1) * sizeof *info; |
| 3321 | int i; | 3324 | int i; |
| 3322 | info = (struct info *) alloca (nbytes); | 3325 | if (!info) |
| 3326 | info = (struct info *) alloca (nbytes); | ||
| 3323 | bzero (info, nbytes); | 3327 | bzero (info, nbytes); |
| 3324 | for (i = 0; i <= nargs; i++) | 3328 | for (i = 0; i <= nargs; i++) |
| 3325 | info[i].start = -1; | 3329 | info[i].start = -1; |
| 3326 | discarded = (char *) alloca (SBYTES (args[0])); | 3330 | if (!discarded) |
| 3331 | SAFE_ALLOCA (discarded, char *, SBYTES (args[0])); | ||
| 3327 | bzero (discarded, SBYTES (args[0])); | 3332 | bzero (discarded, SBYTES (args[0])); |
| 3328 | } | 3333 | } |
| 3329 | 3334 | ||
| @@ -3684,7 +3689,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3684 | val = make_specified_string (buf, nchars, p - buf, multibyte); | 3689 | val = make_specified_string (buf, nchars, p - buf, multibyte); |
| 3685 | 3690 | ||
| 3686 | /* If we allocated BUF with malloc, free it too. */ | 3691 | /* If we allocated BUF with malloc, free it too. */ |
| 3687 | SAFE_FREE (total); | 3692 | SAFE_FREE (); |
| 3688 | 3693 | ||
| 3689 | /* If the format string has text properties, or any of the string | 3694 | /* If the format string has text properties, or any of the string |
| 3690 | arguments has text properties, set up text properties of the | 3695 | arguments has text properties, set up text properties of the |
| @@ -4056,7 +4061,7 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 4056 | bcopy (start2_addr, temp, len2_byte); | 4061 | bcopy (start2_addr, temp, len2_byte); |
| 4057 | bcopy (start1_addr, start1_addr + len2_byte, len1_byte); | 4062 | bcopy (start1_addr, start1_addr + len2_byte, len1_byte); |
| 4058 | bcopy (temp, start1_addr, len2_byte); | 4063 | bcopy (temp, start1_addr, len2_byte); |
| 4059 | SAFE_FREE (len2_byte); | 4064 | SAFE_FREE (); |
| 4060 | } | 4065 | } |
| 4061 | else | 4066 | else |
| 4062 | /* First region not smaller than second. */ | 4067 | /* First region not smaller than second. */ |
| @@ -4069,7 +4074,7 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 4069 | bcopy (start1_addr, temp, len1_byte); | 4074 | bcopy (start1_addr, temp, len1_byte); |
| 4070 | bcopy (start2_addr, start1_addr, len2_byte); | 4075 | bcopy (start2_addr, start1_addr, len2_byte); |
| 4071 | bcopy (temp, start1_addr + len2_byte, len1_byte); | 4076 | bcopy (temp, start1_addr + len2_byte, len1_byte); |
| 4072 | SAFE_FREE (len1_byte); | 4077 | SAFE_FREE (); |
| 4073 | } | 4078 | } |
| 4074 | graft_intervals_into_buffer (tmp_interval1, start1 + len2, | 4079 | graft_intervals_into_buffer (tmp_interval1, start1 + len2, |
| 4075 | len1, current_buffer, 0); | 4080 | len1, current_buffer, 0); |
| @@ -4105,7 +4110,7 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 4105 | bcopy (start1_addr, temp, len1_byte); | 4110 | bcopy (start1_addr, temp, len1_byte); |
| 4106 | bcopy (start2_addr, start1_addr, len2_byte); | 4111 | bcopy (start2_addr, start1_addr, len2_byte); |
| 4107 | bcopy (temp, start2_addr, len1_byte); | 4112 | bcopy (temp, start2_addr, len1_byte); |
| 4108 | SAFE_FREE (len1_byte); | 4113 | SAFE_FREE (); |
| 4109 | 4114 | ||
| 4110 | graft_intervals_into_buffer (tmp_interval1, start2, | 4115 | graft_intervals_into_buffer (tmp_interval1, start2, |
| 4111 | len1, current_buffer, 0); | 4116 | len1, current_buffer, 0); |
| @@ -4134,7 +4139,7 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 4134 | bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte); | 4139 | bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte); |
| 4135 | safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); | 4140 | safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); |
| 4136 | bcopy (temp, start1_addr, len2_byte); | 4141 | bcopy (temp, start1_addr, len2_byte); |
| 4137 | SAFE_FREE (len2_byte); | 4142 | SAFE_FREE (); |
| 4138 | 4143 | ||
| 4139 | graft_intervals_into_buffer (tmp_interval1, end2 - len1, | 4144 | graft_intervals_into_buffer (tmp_interval1, end2 - len1, |
| 4140 | len1, current_buffer, 0); | 4145 | len1, current_buffer, 0); |
| @@ -4165,7 +4170,7 @@ Transposing beyond buffer boundaries is an error. */) | |||
| 4165 | bcopy (start2_addr, start1_addr, len2_byte); | 4170 | bcopy (start2_addr, start1_addr, len2_byte); |
| 4166 | bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); | 4171 | bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); |
| 4167 | bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte); | 4172 | bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte); |
| 4168 | SAFE_FREE (len1_byte); | 4173 | SAFE_FREE (); |
| 4169 | 4174 | ||
| 4170 | graft_intervals_into_buffer (tmp_interval1, end2 - len1, | 4175 | graft_intervals_into_buffer (tmp_interval1, end2 - len1, |
| 4171 | len1, current_buffer, 0); | 4176 | len1, current_buffer, 0); |
| @@ -1012,7 +1012,7 @@ string_make_multibyte (string) | |||
| 1012 | 0, 1); | 1012 | 0, 1); |
| 1013 | 1013 | ||
| 1014 | ret = make_multibyte_string (buf, SCHARS (string), nbytes); | 1014 | ret = make_multibyte_string (buf, SCHARS (string), nbytes); |
| 1015 | SAFE_FREE (nbytes); | 1015 | SAFE_FREE (); |
| 1016 | 1016 | ||
| 1017 | return ret; | 1017 | return ret; |
| 1018 | } | 1018 | } |
| @@ -1046,7 +1046,7 @@ string_to_multibyte (string) | |||
| 1046 | str_to_multibyte (buf, nbytes, SBYTES (string)); | 1046 | str_to_multibyte (buf, nbytes, SBYTES (string)); |
| 1047 | 1047 | ||
| 1048 | ret = make_multibyte_string (buf, SCHARS (string), nbytes); | 1048 | ret = make_multibyte_string (buf, SCHARS (string), nbytes); |
| 1049 | SAFE_FREE (nbytes); | 1049 | SAFE_FREE (); |
| 1050 | 1050 | ||
| 1051 | return ret; | 1051 | return ret; |
| 1052 | } | 1052 | } |
| @@ -1073,7 +1073,7 @@ string_make_unibyte (string) | |||
| 1073 | 1, 0); | 1073 | 1, 0); |
| 1074 | 1074 | ||
| 1075 | ret = make_unibyte_string (buf, nchars); | 1075 | ret = make_unibyte_string (buf, nchars); |
| 1076 | SAFE_FREE (nchars); | 1076 | SAFE_FREE (); |
| 1077 | 1077 | ||
| 1078 | return ret; | 1078 | return ret; |
| 1079 | } | 1079 | } |
| @@ -3030,7 +3030,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */) | |||
| 3030 | args[i] = separator; | 3030 | args[i] = separator; |
| 3031 | 3031 | ||
| 3032 | ret = Fconcat (nargs, args); | 3032 | ret = Fconcat (nargs, args); |
| 3033 | SAFE_FREE_LISP (nargs); | 3033 | SAFE_FREE (); |
| 3034 | 3034 | ||
| 3035 | return ret; | 3035 | return ret; |
| 3036 | } | 3036 | } |
| @@ -3056,7 +3056,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */) | |||
| 3056 | mapcar1 (leni, args, function, sequence); | 3056 | mapcar1 (leni, args, function, sequence); |
| 3057 | 3057 | ||
| 3058 | ret = Flist (leni, args); | 3058 | ret = Flist (leni, args); |
| 3059 | SAFE_FREE_LISP (leni); | 3059 | SAFE_FREE (); |
| 3060 | 3060 | ||
| 3061 | return ret; | 3061 | return ret; |
| 3062 | } | 3062 | } |
| @@ -3763,7 +3763,7 @@ into shorter lines. */) | |||
| 3763 | if (encoded_length < 0) | 3763 | if (encoded_length < 0) |
| 3764 | { | 3764 | { |
| 3765 | /* The encoding wasn't possible. */ | 3765 | /* The encoding wasn't possible. */ |
| 3766 | SAFE_FREE (allength); | 3766 | SAFE_FREE (); |
| 3767 | error ("Multibyte character in data for base64 encoding"); | 3767 | error ("Multibyte character in data for base64 encoding"); |
| 3768 | } | 3768 | } |
| 3769 | 3769 | ||
| @@ -3771,7 +3771,7 @@ into shorter lines. */) | |||
| 3771 | and delete the old. (Insert first in order to preserve markers.) */ | 3771 | and delete the old. (Insert first in order to preserve markers.) */ |
| 3772 | SET_PT_BOTH (XFASTINT (beg), ibeg); | 3772 | SET_PT_BOTH (XFASTINT (beg), ibeg); |
| 3773 | insert (encoded, encoded_length); | 3773 | insert (encoded, encoded_length); |
| 3774 | SAFE_FREE (allength); | 3774 | SAFE_FREE (); |
| 3775 | del_range_byte (ibeg + encoded_length, iend + encoded_length, 1); | 3775 | del_range_byte (ibeg + encoded_length, iend + encoded_length, 1); |
| 3776 | 3776 | ||
| 3777 | /* If point was outside of the region, restore it exactly; else just | 3777 | /* If point was outside of the region, restore it exactly; else just |
| @@ -3820,12 +3820,12 @@ into shorter lines. */) | |||
| 3820 | if (encoded_length < 0) | 3820 | if (encoded_length < 0) |
| 3821 | { | 3821 | { |
| 3822 | /* The encoding wasn't possible. */ | 3822 | /* The encoding wasn't possible. */ |
| 3823 | SAFE_FREE (allength); | 3823 | SAFE_FREE (); |
| 3824 | error ("Multibyte character in data for base64 encoding"); | 3824 | error ("Multibyte character in data for base64 encoding"); |
| 3825 | } | 3825 | } |
| 3826 | 3826 | ||
| 3827 | encoded_string = make_unibyte_string (encoded, encoded_length); | 3827 | encoded_string = make_unibyte_string (encoded, encoded_length); |
| 3828 | SAFE_FREE (allength); | 3828 | SAFE_FREE (); |
| 3829 | 3829 | ||
| 3830 | return encoded_string; | 3830 | return encoded_string; |
| 3831 | } | 3831 | } |
| @@ -3962,7 +3962,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */ | |||
| 3962 | if (decoded_length < 0) | 3962 | if (decoded_length < 0) |
| 3963 | { | 3963 | { |
| 3964 | /* The decoding wasn't possible. */ | 3964 | /* The decoding wasn't possible. */ |
| 3965 | SAFE_FREE (allength); | 3965 | SAFE_FREE (); |
| 3966 | error ("Invalid base64 data"); | 3966 | error ("Invalid base64 data"); |
| 3967 | } | 3967 | } |
| 3968 | 3968 | ||
| @@ -3970,7 +3970,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */ | |||
| 3970 | and delete the old. (Insert first in order to preserve markers.) */ | 3970 | and delete the old. (Insert first in order to preserve markers.) */ |
| 3971 | TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg); | 3971 | TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg); |
| 3972 | insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0); | 3972 | insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0); |
| 3973 | SAFE_FREE (allength); | 3973 | SAFE_FREE (); |
| 3974 | 3974 | ||
| 3975 | /* Delete the original text. */ | 3975 | /* Delete the original text. */ |
| 3976 | del_range_both (PT, PT_BYTE, XFASTINT (end) + inserted_chars, | 3976 | del_range_both (PT, PT_BYTE, XFASTINT (end) + inserted_chars, |
| @@ -4014,7 +4014,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string, | |||
| 4014 | else | 4014 | else |
| 4015 | decoded_string = Qnil; | 4015 | decoded_string = Qnil; |
| 4016 | 4016 | ||
| 4017 | SAFE_FREE (length); | 4017 | SAFE_FREE (); |
| 4018 | if (!STRINGP (decoded_string)) | 4018 | if (!STRINGP (decoded_string)) |
| 4019 | error ("Invalid base64 data"); | 4019 | error ("Invalid base64 data"); |
| 4020 | 4020 | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index 8182ff45766..dc091c1a09b 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -48,6 +48,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 48 | #ifdef HAVE_GTK_MULTIDISPLAY | 48 | #ifdef HAVE_GTK_MULTIDISPLAY |
| 49 | 49 | ||
| 50 | /* Return the GdkDisplay that corresponds to the X display DPY. */ | 50 | /* Return the GdkDisplay that corresponds to the X display DPY. */ |
| 51 | |||
| 51 | static GdkDisplay * | 52 | static GdkDisplay * |
| 52 | xg_get_gdk_display (dpy) | 53 | xg_get_gdk_display (dpy) |
| 53 | Display *dpy; | 54 | Display *dpy; |
| @@ -58,6 +59,7 @@ xg_get_gdk_display (dpy) | |||
| 58 | /* When the GTK widget W is to be created on a display for F that | 59 | /* When the GTK widget W is to be created on a display for F that |
| 59 | is not the default display, set the display for W. | 60 | is not the default display, set the display for W. |
| 60 | W can be a GtkMenu or a GtkWindow widget. */ | 61 | W can be a GtkMenu or a GtkWindow widget. */ |
| 62 | |||
| 61 | static void | 63 | static void |
| 62 | xg_set_screen (w, f) | 64 | xg_set_screen (w, f) |
| 63 | GtkWidget *w; | 65 | GtkWidget *w; |
| @@ -80,6 +82,7 @@ xg_set_screen (w, f) | |||
| 80 | 82 | ||
| 81 | /* Make some defines so we can use the GTK 2.2 functions when | 83 | /* Make some defines so we can use the GTK 2.2 functions when |
| 82 | compiling with GTK 2.0. */ | 84 | compiling with GTK 2.0. */ |
| 85 | |||
| 83 | #define xg_set_screen(w, f) | 86 | #define xg_set_screen(w, f) |
| 84 | #define gdk_xid_table_lookup_for_display(dpy, w) gdk_xid_table_lookup (w) | 87 | #define gdk_xid_table_lookup_for_display(dpy, w) gdk_xid_table_lookup (w) |
| 85 | #define gdk_pixmap_foreign_new_for_display(dpy, p) gdk_pixmap_foreign_new (p) | 88 | #define gdk_pixmap_foreign_new_for_display(dpy, p) gdk_pixmap_foreign_new (p) |
| @@ -95,6 +98,7 @@ xg_set_screen (w, f) | |||
| 95 | Returns non-zero if display could be opened, zero if display could not | 98 | Returns non-zero if display could be opened, zero if display could not |
| 96 | be opened, and less than zero if the GTK version doesn't support | 99 | be opened, and less than zero if the GTK version doesn't support |
| 97 | multipe displays. */ | 100 | multipe displays. */ |
| 101 | |||
| 98 | int | 102 | int |
| 99 | xg_display_open (display_name, dpy) | 103 | xg_display_open (display_name, dpy) |
| 100 | char *display_name; | 104 | char *display_name; |
| @@ -115,6 +119,8 @@ xg_display_open (display_name, dpy) | |||
| 115 | } | 119 | } |
| 116 | 120 | ||
| 117 | 121 | ||
| 122 | /* Close display DPY. */ | ||
| 123 | |||
| 118 | void | 124 | void |
| 119 | xg_display_close (Display *dpy) | 125 | xg_display_close (Display *dpy) |
| 120 | { | 126 | { |
| @@ -176,6 +182,7 @@ static int malloc_cpt; | |||
| 176 | widget_value_free_list or by malloc:ing a new one. | 182 | widget_value_free_list or by malloc:ing a new one. |
| 177 | 183 | ||
| 178 | Return a pointer to the allocated structure. */ | 184 | Return a pointer to the allocated structure. */ |
| 185 | |||
| 179 | widget_value * | 186 | widget_value * |
| 180 | malloc_widget_value () | 187 | malloc_widget_value () |
| 181 | { | 188 | { |
| @@ -197,6 +204,7 @@ malloc_widget_value () | |||
| 197 | 204 | ||
| 198 | /* This is analogous to free. It frees only what was allocated | 205 | /* This is analogous to free. It frees only what was allocated |
| 199 | by malloc_widget_value, and no substructures. */ | 206 | by malloc_widget_value, and no substructures. */ |
| 207 | |||
| 200 | void | 208 | void |
| 201 | free_widget_value (wv) | 209 | free_widget_value (wv) |
| 202 | widget_value *wv; | 210 | widget_value *wv; |
| @@ -221,6 +229,7 @@ free_widget_value (wv) | |||
| 221 | 229 | ||
| 222 | /* Create and return the cursor to be used for popup menus and | 230 | /* Create and return the cursor to be used for popup menus and |
| 223 | scroll bars on display DPY. */ | 231 | scroll bars on display DPY. */ |
| 232 | |||
| 224 | GdkCursor * | 233 | GdkCursor * |
| 225 | xg_create_default_cursor (dpy) | 234 | xg_create_default_cursor (dpy) |
| 226 | Display *dpy; | 235 | Display *dpy; |
| @@ -239,6 +248,7 @@ xg_create_default_cursor (dpy) | |||
| 239 | WIDGET is used to find the GdkColormap to use for the GdkPixbuf. | 248 | WIDGET is used to find the GdkColormap to use for the GdkPixbuf. |
| 240 | If OLD_WIDGET is NULL, a new widget is constructed and returned. | 249 | If OLD_WIDGET is NULL, a new widget is constructed and returned. |
| 241 | If OLD_WIDGET is not NULL, that widget is modified. */ | 250 | If OLD_WIDGET is not NULL, that widget is modified. */ |
| 251 | |||
| 242 | static GtkWidget * | 252 | static GtkWidget * |
| 243 | xg_get_image_for_pixmap (f, img, widget, old_widget) | 253 | xg_get_image_for_pixmap (f, img, widget, old_widget) |
| 244 | FRAME_PTR f; | 254 | FRAME_PTR f; |
| @@ -373,6 +383,7 @@ xg_get_image_for_pixmap (f, img, widget, old_widget) | |||
| 373 | /* Set CURSOR on W and all widgets W contain. We must do like this | 383 | /* Set CURSOR on W and all widgets W contain. We must do like this |
| 374 | for scroll bars and menu because they create widgets internally, | 384 | for scroll bars and menu because they create widgets internally, |
| 375 | and it is those widgets that are visible. */ | 385 | and it is those widgets that are visible. */ |
| 386 | |||
| 376 | static void | 387 | static void |
| 377 | xg_set_cursor (w, cursor) | 388 | xg_set_cursor (w, cursor) |
| 378 | GtkWidget *w; | 389 | GtkWidget *w; |
| @@ -400,6 +411,7 @@ xg_set_cursor (w, cursor) | |||
| 400 | has expired by calling the GTK event loop. | 411 | has expired by calling the GTK event loop. |
| 401 | Also, when a menu is active, it has a small timeout before it | 412 | Also, when a menu is active, it has a small timeout before it |
| 402 | pops down the sub menu under it. */ | 413 | pops down the sub menu under it. */ |
| 414 | |||
| 403 | static void | 415 | static void |
| 404 | xg_process_timeouts (timer) | 416 | xg_process_timeouts (timer) |
| 405 | struct atimer *timer; | 417 | struct atimer *timer; |
| @@ -415,6 +427,7 @@ xg_process_timeouts (timer) | |||
| 415 | /* Start the xg_timer with an interval of 0.1 seconds, if not already started. | 427 | /* Start the xg_timer with an interval of 0.1 seconds, if not already started. |
| 416 | xg_process_timeouts is called when the timer expires. The timer | 428 | xg_process_timeouts is called when the timer expires. The timer |
| 417 | started is continuous, i.e. runs until xg_stop_timer is called. */ | 429 | started is continuous, i.e. runs until xg_stop_timer is called. */ |
| 430 | |||
| 418 | static void | 431 | static void |
| 419 | xg_start_timer () | 432 | xg_start_timer () |
| 420 | { | 433 | { |
| @@ -430,6 +443,7 @@ xg_start_timer () | |||
| 430 | } | 443 | } |
| 431 | 444 | ||
| 432 | /* Stop the xg_timer if started. */ | 445 | /* Stop the xg_timer if started. */ |
| 446 | |||
| 433 | static void | 447 | static void |
| 434 | xg_stop_timer () | 448 | xg_stop_timer () |
| 435 | { | 449 | { |
| @@ -441,6 +455,7 @@ xg_stop_timer () | |||
| 441 | } | 455 | } |
| 442 | 456 | ||
| 443 | /* Insert NODE into linked LIST. */ | 457 | /* Insert NODE into linked LIST. */ |
| 458 | |||
| 444 | static void | 459 | static void |
| 445 | xg_list_insert (xg_list_node *list, xg_list_node *node) | 460 | xg_list_insert (xg_list_node *list, xg_list_node *node) |
| 446 | { | 461 | { |
| @@ -453,6 +468,7 @@ xg_list_insert (xg_list_node *list, xg_list_node *node) | |||
| 453 | } | 468 | } |
| 454 | 469 | ||
| 455 | /* Remove NODE from linked LIST. */ | 470 | /* Remove NODE from linked LIST. */ |
| 471 | |||
| 456 | static void | 472 | static void |
| 457 | xg_list_remove (xg_list_node *list, xg_list_node *node) | 473 | xg_list_remove (xg_list_node *list, xg_list_node *node) |
| 458 | { | 474 | { |
| @@ -473,6 +489,7 @@ xg_list_remove (xg_list_node *list, xg_list_node *node) | |||
| 473 | utf8 or NULL, just return STR. | 489 | utf8 or NULL, just return STR. |
| 474 | If not, a new string is allocated and the caller must free the result | 490 | If not, a new string is allocated and the caller must free the result |
| 475 | with g_free. */ | 491 | with g_free. */ |
| 492 | |||
| 476 | static char * | 493 | static char * |
| 477 | get_utf8_string (str) | 494 | get_utf8_string (str) |
| 478 | char *str; | 495 | char *str; |
| @@ -496,6 +513,7 @@ get_utf8_string (str) | |||
| 496 | only way to get geometry position right if the user explicitly | 513 | only way to get geometry position right if the user explicitly |
| 497 | asked for a position when starting Emacs. | 514 | asked for a position when starting Emacs. |
| 498 | F is the frame we shall set geometry for. */ | 515 | F is the frame we shall set geometry for. */ |
| 516 | |||
| 499 | static void | 517 | static void |
| 500 | xg_set_geometry (f) | 518 | xg_set_geometry (f) |
| 501 | FRAME_PTR f; | 519 | FRAME_PTR f; |
| @@ -529,6 +547,7 @@ xg_set_geometry (f) | |||
| 529 | /* Resize the outer window of frame F after chainging the height. | 547 | /* Resize the outer window of frame F after chainging the height. |
| 530 | This happend when the menu bar or the tool bar is added or removed. | 548 | This happend when the menu bar or the tool bar is added or removed. |
| 531 | COLUMNS/ROWS is the size the edit area shall have after the resize. */ | 549 | COLUMNS/ROWS is the size the edit area shall have after the resize. */ |
| 550 | |||
| 532 | static void | 551 | static void |
| 533 | xg_resize_outer_widget (f, columns, rows) | 552 | xg_resize_outer_widget (f, columns, rows) |
| 534 | FRAME_PTR f; | 553 | FRAME_PTR f; |
| @@ -555,6 +574,7 @@ xg_resize_outer_widget (f, columns, rows) | |||
| 555 | manually. | 574 | manually. |
| 556 | F is the frame to resize. | 575 | F is the frame to resize. |
| 557 | PIXELWIDTH, PIXELHEIGHT is the new size in pixels. */ | 576 | PIXELWIDTH, PIXELHEIGHT is the new size in pixels. */ |
| 577 | |||
| 558 | void | 578 | void |
| 559 | xg_resize_widgets (f, pixelwidth, pixelheight) | 579 | xg_resize_widgets (f, pixelwidth, pixelheight) |
| 560 | FRAME_PTR f; | 580 | FRAME_PTR f; |
| @@ -591,6 +611,7 @@ xg_resize_widgets (f, pixelwidth, pixelheight) | |||
| 591 | 611 | ||
| 592 | 612 | ||
| 593 | /* Update our widget size to be COLS/ROWS characters for frame F. */ | 613 | /* Update our widget size to be COLS/ROWS characters for frame F. */ |
| 614 | |||
| 594 | void | 615 | void |
| 595 | xg_frame_set_char_size (f, cols, rows) | 616 | xg_frame_set_char_size (f, cols, rows) |
| 596 | FRAME_PTR f; | 617 | FRAME_PTR f; |
| @@ -630,6 +651,7 @@ xg_frame_set_char_size (f, cols, rows) | |||
| 630 | X Window that aren't accessible. | 651 | X Window that aren't accessible. |
| 631 | 652 | ||
| 632 | Return 0 if no widget match WDESC. */ | 653 | Return 0 if no widget match WDESC. */ |
| 654 | |||
| 633 | GtkWidget * | 655 | GtkWidget * |
| 634 | xg_win_to_widget (dpy, wdesc) | 656 | xg_win_to_widget (dpy, wdesc) |
| 635 | Display *dpy; | 657 | Display *dpy; |
| @@ -655,6 +677,7 @@ xg_win_to_widget (dpy, wdesc) | |||
| 655 | 677 | ||
| 656 | /* Fill in the GdkColor C so that it represents PIXEL. | 678 | /* Fill in the GdkColor C so that it represents PIXEL. |
| 657 | W is the widget that color will be used for. Used to find colormap. */ | 679 | W is the widget that color will be used for. Used to find colormap. */ |
| 680 | |||
| 658 | static void | 681 | static void |
| 659 | xg_pix_to_gcolor (w, pixel, c) | 682 | xg_pix_to_gcolor (w, pixel, c) |
| 660 | GtkWidget *w; | 683 | GtkWidget *w; |
| @@ -667,6 +690,7 @@ xg_pix_to_gcolor (w, pixel, c) | |||
| 667 | 690 | ||
| 668 | /* Create and set up the GTK widgets for frame F. | 691 | /* Create and set up the GTK widgets for frame F. |
| 669 | Return 0 if creation failed, non-zero otherwise. */ | 692 | Return 0 if creation failed, non-zero otherwise. */ |
| 693 | |||
| 670 | int | 694 | int |
| 671 | xg_create_frame_widgets (f) | 695 | xg_create_frame_widgets (f) |
| 672 | FRAME_PTR f; | 696 | FRAME_PTR f; |
| @@ -802,6 +826,7 @@ xg_create_frame_widgets (f) | |||
| 802 | that the window now has. | 826 | that the window now has. |
| 803 | If USER_POSITION is nonzero, we set the User Position | 827 | If USER_POSITION is nonzero, we set the User Position |
| 804 | flag (this is useful when FLAGS is 0). */ | 828 | flag (this is useful when FLAGS is 0). */ |
| 829 | |||
| 805 | void | 830 | void |
| 806 | x_wm_set_size_hint (f, flags, user_position) | 831 | x_wm_set_size_hint (f, flags, user_position) |
| 807 | FRAME_PTR f; | 832 | FRAME_PTR f; |
| @@ -900,6 +925,7 @@ x_wm_set_size_hint (f, flags, user_position) | |||
| 900 | keep the GTK and X colors in sync. | 925 | keep the GTK and X colors in sync. |
| 901 | F is the frame to change, | 926 | F is the frame to change, |
| 902 | BG is the pixel value to change to. */ | 927 | BG is the pixel value to change to. */ |
| 928 | |||
| 903 | void | 929 | void |
| 904 | xg_set_background_color (f, bg) | 930 | xg_set_background_color (f, bg) |
| 905 | FRAME_PTR f; | 931 | FRAME_PTR f; |
| @@ -923,6 +949,7 @@ xg_set_background_color (f, bg) | |||
| 923 | ***********************************************************************/ | 949 | ***********************************************************************/ |
| 924 | /* Return the dialog title to use for a dialog of type KEY. | 950 | /* Return the dialog title to use for a dialog of type KEY. |
| 925 | This is the encoding used by lwlib. We use the same for GTK. */ | 951 | This is the encoding used by lwlib. We use the same for GTK. */ |
| 952 | |||
| 926 | static char * | 953 | static char * |
| 927 | get_dialog_title (char key) | 954 | get_dialog_title (char key) |
| 928 | { | 955 | { |
| @@ -963,6 +990,7 @@ get_dialog_title (char key) | |||
| 963 | user_data is NULL (not used). | 990 | user_data is NULL (not used). |
| 964 | 991 | ||
| 965 | Returns TRUE to end propagation of event. */ | 992 | Returns TRUE to end propagation of event. */ |
| 993 | |||
| 966 | static gboolean | 994 | static gboolean |
| 967 | dialog_delete_callback (w, event, user_data) | 995 | dialog_delete_callback (w, event, user_data) |
| 968 | GtkWidget *w; | 996 | GtkWidget *w; |
| @@ -979,6 +1007,7 @@ dialog_delete_callback (w, event, user_data) | |||
| 979 | DEACTIVATE_CB is the callback to use when the dialog pops down. | 1007 | DEACTIVATE_CB is the callback to use when the dialog pops down. |
| 980 | 1008 | ||
| 981 | Returns the GTK dialog widget. */ | 1009 | Returns the GTK dialog widget. */ |
| 1010 | |||
| 982 | static GtkWidget * | 1011 | static GtkWidget * |
| 983 | create_dialog (wv, select_cb, deactivate_cb) | 1012 | create_dialog (wv, select_cb, deactivate_cb) |
| 984 | widget_value *wv; | 1013 | widget_value *wv; |
| @@ -1101,6 +1130,7 @@ enum | |||
| 1101 | a file dialog. | 1130 | a file dialog. |
| 1102 | W is the file dialog widget, | 1131 | W is the file dialog widget, |
| 1103 | ARG points to an integer where we record what has happend. */ | 1132 | ARG points to an integer where we record what has happend. */ |
| 1133 | |||
| 1104 | static void | 1134 | static void |
| 1105 | xg_file_sel_ok (w, arg) | 1135 | xg_file_sel_ok (w, arg) |
| 1106 | GtkWidget *w; | 1136 | GtkWidget *w; |
| @@ -1113,6 +1143,7 @@ xg_file_sel_ok (w, arg) | |||
| 1113 | a file dialog. | 1143 | a file dialog. |
| 1114 | W is the file dialog widget, | 1144 | W is the file dialog widget, |
| 1115 | ARG points to an integer where we record what has happend. */ | 1145 | ARG points to an integer where we record what has happend. */ |
| 1146 | |||
| 1116 | static void | 1147 | static void |
| 1117 | xg_file_sel_cancel (w, arg) | 1148 | xg_file_sel_cancel (w, arg) |
| 1118 | GtkWidget *w; | 1149 | GtkWidget *w; |
| @@ -1127,6 +1158,7 @@ xg_file_sel_cancel (w, arg) | |||
| 1127 | the dialog is popped down, but the dialog widget is not destroyed. | 1158 | the dialog is popped down, but the dialog widget is not destroyed. |
| 1128 | W is the file dialog widget, | 1159 | W is the file dialog widget, |
| 1129 | ARG points to an integer where we record what has happend. */ | 1160 | ARG points to an integer where we record what has happend. */ |
| 1161 | |||
| 1130 | static void | 1162 | static void |
| 1131 | xg_file_sel_destroy (w, arg) | 1163 | xg_file_sel_destroy (w, arg) |
| 1132 | GtkWidget *w; | 1164 | GtkWidget *w; |
| @@ -1144,6 +1176,7 @@ xg_file_sel_destroy (w, arg) | |||
| 1144 | 1176 | ||
| 1145 | Returns a file name or NULL if no file was selected. | 1177 | Returns a file name or NULL if no file was selected. |
| 1146 | The returned string must be freed by the caller. */ | 1178 | The returned string must be freed by the caller. */ |
| 1179 | |||
| 1147 | char * | 1180 | char * |
| 1148 | xg_get_file_name (f, prompt, default_filename, mustmatch_p) | 1181 | xg_get_file_name (f, prompt, default_filename, mustmatch_p) |
| 1149 | FRAME_PTR f; | 1182 | FRAME_PTR f; |
| @@ -1234,6 +1267,7 @@ static xg_list_node xg_menu_item_cb_list; | |||
| 1234 | 1267 | ||
| 1235 | Returns CL_DATA if CL_DATA is not NULL, or a pointer to a newly | 1268 | Returns CL_DATA if CL_DATA is not NULL, or a pointer to a newly |
| 1236 | allocated xg_menu_cb_data if CL_DATA is NULL. */ | 1269 | allocated xg_menu_cb_data if CL_DATA is NULL. */ |
| 1270 | |||
| 1237 | static xg_menu_cb_data * | 1271 | static xg_menu_cb_data * |
| 1238 | make_cl_data (cl_data, f, highlight_cb) | 1272 | make_cl_data (cl_data, f, highlight_cb) |
| 1239 | xg_menu_cb_data *cl_data; | 1273 | xg_menu_cb_data *cl_data; |
| @@ -1267,6 +1301,7 @@ make_cl_data (cl_data, f, highlight_cb) | |||
| 1267 | HIGHLIGHT_CB could change, there is no check that the same | 1301 | HIGHLIGHT_CB could change, there is no check that the same |
| 1268 | function is given when modifying a menu bar as was given when | 1302 | function is given when modifying a menu bar as was given when |
| 1269 | creating the menu bar. */ | 1303 | creating the menu bar. */ |
| 1304 | |||
| 1270 | static void | 1305 | static void |
| 1271 | update_cl_data (cl_data, f, highlight_cb) | 1306 | update_cl_data (cl_data, f, highlight_cb) |
| 1272 | xg_menu_cb_data *cl_data; | 1307 | xg_menu_cb_data *cl_data; |
| @@ -1284,6 +1319,7 @@ update_cl_data (cl_data, f, highlight_cb) | |||
| 1284 | 1319 | ||
| 1285 | /* Decrease reference count for CL_DATA. | 1320 | /* Decrease reference count for CL_DATA. |
| 1286 | If reference count is zero, free CL_DATA. */ | 1321 | If reference count is zero, free CL_DATA. */ |
| 1322 | |||
| 1287 | static void | 1323 | static void |
| 1288 | unref_cl_data (cl_data) | 1324 | unref_cl_data (cl_data) |
| 1289 | xg_menu_cb_data *cl_data; | 1325 | xg_menu_cb_data *cl_data; |
| @@ -1300,6 +1336,7 @@ unref_cl_data (cl_data) | |||
| 1300 | } | 1336 | } |
| 1301 | 1337 | ||
| 1302 | /* Function that marks all lisp data during GC. */ | 1338 | /* Function that marks all lisp data during GC. */ |
| 1339 | |||
| 1303 | void | 1340 | void |
| 1304 | xg_mark_data () | 1341 | xg_mark_data () |
| 1305 | { | 1342 | { |
| @@ -1321,6 +1358,7 @@ xg_mark_data () | |||
| 1321 | /* Callback called when a menu item is destroyed. Used to free data. | 1358 | /* Callback called when a menu item is destroyed. Used to free data. |
| 1322 | W is the widget that is being destroyed (not used). | 1359 | W is the widget that is being destroyed (not used). |
| 1323 | CLIENT_DATA points to the xg_menu_item_cb_data associated with the W. */ | 1360 | CLIENT_DATA points to the xg_menu_item_cb_data associated with the W. */ |
| 1361 | |||
| 1324 | static void | 1362 | static void |
| 1325 | menuitem_destroy_callback (w, client_data) | 1363 | menuitem_destroy_callback (w, client_data) |
| 1326 | GtkWidget *w; | 1364 | GtkWidget *w; |
| @@ -1340,6 +1378,7 @@ menuitem_destroy_callback (w, client_data) | |||
| 1340 | CLIENT_DATA points to the xg_menu_item_cb_data associated with the W. | 1378 | CLIENT_DATA points to the xg_menu_item_cb_data associated with the W. |
| 1341 | 1379 | ||
| 1342 | Returns FALSE to tell GTK to keep processing this event. */ | 1380 | Returns FALSE to tell GTK to keep processing this event. */ |
| 1381 | |||
| 1343 | static gboolean | 1382 | static gboolean |
| 1344 | menuitem_highlight_callback (w, event, client_data) | 1383 | menuitem_highlight_callback (w, event, client_data) |
| 1345 | GtkWidget *w; | 1384 | GtkWidget *w; |
| @@ -1364,6 +1403,7 @@ menuitem_highlight_callback (w, event, client_data) | |||
| 1364 | /* Callback called when a menu is destroyed. Used to free data. | 1403 | /* Callback called when a menu is destroyed. Used to free data. |
| 1365 | W is the widget that is being destroyed (not used). | 1404 | W is the widget that is being destroyed (not used). |
| 1366 | CLIENT_DATA points to the xg_menu_cb_data associated with W. */ | 1405 | CLIENT_DATA points to the xg_menu_cb_data associated with W. */ |
| 1406 | |||
| 1367 | static void | 1407 | static void |
| 1368 | menu_destroy_callback (w, client_data) | 1408 | menu_destroy_callback (w, client_data) |
| 1369 | GtkWidget *w; | 1409 | GtkWidget *w; |
| @@ -1379,6 +1419,7 @@ menu_destroy_callback (w, client_data) | |||
| 1379 | W is the widget that does the grab (not used). | 1419 | W is the widget that does the grab (not used). |
| 1380 | UNGRAB_P is TRUE if this is an ungrab, FALSE if it is a grab. | 1420 | UNGRAB_P is TRUE if this is an ungrab, FALSE if it is a grab. |
| 1381 | CLIENT_DATA is NULL (not used). */ | 1421 | CLIENT_DATA is NULL (not used). */ |
| 1422 | |||
| 1382 | static void | 1423 | static void |
| 1383 | menu_grab_callback (GtkWidget *widget, | 1424 | menu_grab_callback (GtkWidget *widget, |
| 1384 | gboolean ungrab_p, | 1425 | gboolean ungrab_p, |
| @@ -1398,6 +1439,7 @@ menu_grab_callback (GtkWidget *widget, | |||
| 1398 | must be non-NULL) and can be inserted into a menu item. | 1439 | must be non-NULL) and can be inserted into a menu item. |
| 1399 | 1440 | ||
| 1400 | Returns the GtkHBox. */ | 1441 | Returns the GtkHBox. */ |
| 1442 | |||
| 1401 | static GtkWidget * | 1443 | static GtkWidget * |
| 1402 | make_widget_for_menu_item (utf8_label, utf8_key) | 1444 | make_widget_for_menu_item (utf8_label, utf8_key) |
| 1403 | char *utf8_label; | 1445 | char *utf8_label; |
| @@ -1437,6 +1479,7 @@ make_widget_for_menu_item (utf8_label, utf8_key) | |||
| 1437 | 1479 | ||
| 1438 | Unfortunately, keys don't line up as nicely as in Motif, | 1480 | Unfortunately, keys don't line up as nicely as in Motif, |
| 1439 | but the MacOS X version doesn't either, so I guess that is OK. */ | 1481 | but the MacOS X version doesn't either, so I guess that is OK. */ |
| 1482 | |||
| 1440 | static GtkWidget * | 1483 | static GtkWidget * |
| 1441 | make_menu_item (utf8_label, utf8_key, item, group) | 1484 | make_menu_item (utf8_label, utf8_key, item, group) |
| 1442 | char *utf8_label; | 1485 | char *utf8_label; |
| @@ -1486,6 +1529,7 @@ make_menu_item (utf8_label, utf8_key, item, group) | |||
| 1486 | 1529 | ||
| 1487 | /* Return non-zero if LABEL specifies a separator (GTK only has one | 1530 | /* Return non-zero if LABEL specifies a separator (GTK only has one |
| 1488 | separator type) */ | 1531 | separator type) */ |
| 1532 | |||
| 1489 | static int | 1533 | static int |
| 1490 | xg_separator_p (char *label) | 1534 | xg_separator_p (char *label) |
| 1491 | { | 1535 | { |
| @@ -1534,6 +1578,7 @@ xg_separator_p (char *label) | |||
| 1534 | static int xg_detached_menus; | 1578 | static int xg_detached_menus; |
| 1535 | 1579 | ||
| 1536 | /* Returns non-zero if there are detached menus. */ | 1580 | /* Returns non-zero if there are detached menus. */ |
| 1581 | |||
| 1537 | int | 1582 | int |
| 1538 | xg_have_tear_offs () | 1583 | xg_have_tear_offs () |
| 1539 | { | 1584 | { |
| @@ -1544,6 +1589,7 @@ xg_have_tear_offs () | |||
| 1544 | decrease the xg_detached_menus count. | 1589 | decrease the xg_detached_menus count. |
| 1545 | WIDGET is the top level window that is removed (the parent of the menu). | 1590 | WIDGET is the top level window that is removed (the parent of the menu). |
| 1546 | CLIENT_DATA is not used. */ | 1591 | CLIENT_DATA is not used. */ |
| 1592 | |||
| 1547 | static void | 1593 | static void |
| 1548 | tearoff_remove (widget, client_data) | 1594 | tearoff_remove (widget, client_data) |
| 1549 | GtkWidget *widget; | 1595 | GtkWidget *widget; |
| @@ -1556,6 +1602,7 @@ tearoff_remove (widget, client_data) | |||
| 1556 | xg_detached_menus count. | 1602 | xg_detached_menus count. |
| 1557 | WIDGET is the GtkTearoffMenuItem. | 1603 | WIDGET is the GtkTearoffMenuItem. |
| 1558 | CLIENT_DATA is not used. */ | 1604 | CLIENT_DATA is not used. */ |
| 1605 | |||
| 1559 | static void | 1606 | static void |
| 1560 | tearoff_activate (widget, client_data) | 1607 | tearoff_activate (widget, client_data) |
| 1561 | GtkWidget *widget; | 1608 | GtkWidget *widget; |
| @@ -1585,6 +1632,7 @@ tearoff_activate (widget, client_data) | |||
| 1585 | in the group. On exit, *GROUP contains the radio item group. | 1632 | in the group. On exit, *GROUP contains the radio item group. |
| 1586 | 1633 | ||
| 1587 | Returns the created GtkWidget. */ | 1634 | Returns the created GtkWidget. */ |
| 1635 | |||
| 1588 | static GtkWidget * | 1636 | static GtkWidget * |
| 1589 | xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group) | 1637 | xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group) |
| 1590 | widget_value *item; | 1638 | widget_value *item; |
| @@ -1802,6 +1850,7 @@ create_menus (data, f, select_cb, deactivate_cb, highlight_cb, | |||
| 1802 | HIGHLIGHT_CB is the callback to call when entering/leaving menu items. | 1850 | HIGHLIGHT_CB is the callback to call when entering/leaving menu items. |
| 1803 | 1851 | ||
| 1804 | Returns the widget created. */ | 1852 | Returns the widget created. */ |
| 1853 | |||
| 1805 | GtkWidget * | 1854 | GtkWidget * |
| 1806 | xg_create_widget (type, name, f, val, | 1855 | xg_create_widget (type, name, f, val, |
| 1807 | select_cb, deactivate_cb, highlight_cb) | 1856 | select_cb, deactivate_cb, highlight_cb) |
| @@ -1859,6 +1908,7 @@ xg_create_widget (type, name, f, val, | |||
| 1859 | } | 1908 | } |
| 1860 | 1909 | ||
| 1861 | /* Return the label for menu item WITEM. */ | 1910 | /* Return the label for menu item WITEM. */ |
| 1911 | |||
| 1862 | static const char * | 1912 | static const char * |
| 1863 | xg_get_menu_item_label (witem) | 1913 | xg_get_menu_item_label (witem) |
| 1864 | GtkMenuItem *witem; | 1914 | GtkMenuItem *witem; |
| @@ -1868,6 +1918,7 @@ xg_get_menu_item_label (witem) | |||
| 1868 | } | 1918 | } |
| 1869 | 1919 | ||
| 1870 | /* Return non-zero if the menu item WITEM has the text LABEL. */ | 1920 | /* Return non-zero if the menu item WITEM has the text LABEL. */ |
| 1921 | |||
| 1871 | static int | 1922 | static int |
| 1872 | xg_item_label_same_p (witem, label) | 1923 | xg_item_label_same_p (witem, label) |
| 1873 | GtkMenuItem *witem; | 1924 | GtkMenuItem *witem; |
| @@ -1887,10 +1938,10 @@ xg_item_label_same_p (witem, label) | |||
| 1887 | return is_same; | 1938 | return is_same; |
| 1888 | } | 1939 | } |
| 1889 | 1940 | ||
| 1890 | /* Remove widgets in LIST from container WCONT. */ | 1941 | /* Destroy widgets in LIST. */ |
| 1942 | |||
| 1891 | static void | 1943 | static void |
| 1892 | remove_from_container (wcont, list) | 1944 | xg_destroy_widgets (list) |
| 1893 | GtkWidget *wcont; | ||
| 1894 | GList *list; | 1945 | GList *list; |
| 1895 | { | 1946 | { |
| 1896 | GList *iter; | 1947 | GList *iter; |
| @@ -1899,15 +1950,7 @@ remove_from_container (wcont, list) | |||
| 1899 | { | 1950 | { |
| 1900 | GtkWidget *w = GTK_WIDGET (iter->data); | 1951 | GtkWidget *w = GTK_WIDGET (iter->data); |
| 1901 | 1952 | ||
| 1902 | /* Add a ref to w so we can explicitly destroy it later. */ | 1953 | /* Destroying the widget will remove it from the container it is in. */ |
| 1903 | gtk_widget_ref (w); | ||
| 1904 | gtk_container_remove (GTK_CONTAINER (wcont), w); | ||
| 1905 | |||
| 1906 | /* If there is a menu under this widget that has been detached, | ||
| 1907 | there is a reference to it, and just removing w from the | ||
| 1908 | container does not destroy the submenu. By explicitly | ||
| 1909 | destroying w we make sure the submenu is destroyed, thus | ||
| 1910 | removing the detached window also if there was one. */ | ||
| 1911 | gtk_widget_destroy (w); | 1954 | gtk_widget_destroy (w); |
| 1912 | } | 1955 | } |
| 1913 | } | 1956 | } |
| @@ -1923,6 +1966,7 @@ remove_from_container (wcont, list) | |||
| 1923 | CL_DATA points to the callback data to be used for this menu bar. | 1966 | CL_DATA points to the callback data to be used for this menu bar. |
| 1924 | 1967 | ||
| 1925 | This function calls itself to walk through the menu bar names. */ | 1968 | This function calls itself to walk through the menu bar names. */ |
| 1969 | |||
| 1926 | static void | 1970 | static void |
| 1927 | xg_update_menubar (menubar, f, list, iter, pos, val, | 1971 | xg_update_menubar (menubar, f, list, iter, pos, val, |
| 1928 | select_cb, highlight_cb, cl_data) | 1972 | select_cb, highlight_cb, cl_data) |
| @@ -1941,7 +1985,7 @@ xg_update_menubar (menubar, f, list, iter, pos, val, | |||
| 1941 | else if (iter && ! val) | 1985 | else if (iter && ! val) |
| 1942 | { | 1986 | { |
| 1943 | /* Item(s) have been removed. Remove all remaining items. */ | 1987 | /* Item(s) have been removed. Remove all remaining items. */ |
| 1944 | remove_from_container (menubar, iter); | 1988 | xg_destroy_widgets (iter); |
| 1945 | 1989 | ||
| 1946 | /* All updated. */ | 1990 | /* All updated. */ |
| 1947 | val = 0; | 1991 | val = 0; |
| @@ -2095,6 +2139,7 @@ xg_update_menubar (menubar, f, list, iter, pos, val, | |||
| 2095 | SELECT_CB is the callback to use when a menu item is selected. | 2139 | SELECT_CB is the callback to use when a menu item is selected. |
| 2096 | HIGHLIGHT_CB is the callback to call when entering/leaving menu items. | 2140 | HIGHLIGHT_CB is the callback to call when entering/leaving menu items. |
| 2097 | CL_DATA is the data to set in the widget for menu invokation. */ | 2141 | CL_DATA is the data to set in the widget for menu invokation. */ |
| 2142 | |||
| 2098 | static void | 2143 | static void |
| 2099 | xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data) | 2144 | xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data) |
| 2100 | widget_value *val; | 2145 | widget_value *val; |
| @@ -2229,6 +2274,7 @@ xg_update_menu_item (val, w, select_cb, highlight_cb, cl_data) | |||
| 2229 | } | 2274 | } |
| 2230 | 2275 | ||
| 2231 | /* Update the toggle menu item W so it corresponds to VAL. */ | 2276 | /* Update the toggle menu item W so it corresponds to VAL. */ |
| 2277 | |||
| 2232 | static void | 2278 | static void |
| 2233 | xg_update_toggle_item (val, w) | 2279 | xg_update_toggle_item (val, w) |
| 2234 | widget_value *val; | 2280 | widget_value *val; |
| @@ -2238,6 +2284,7 @@ xg_update_toggle_item (val, w) | |||
| 2238 | } | 2284 | } |
| 2239 | 2285 | ||
| 2240 | /* Update the radio menu item W so it corresponds to VAL. */ | 2286 | /* Update the radio menu item W so it corresponds to VAL. */ |
| 2287 | |||
| 2241 | static void | 2288 | static void |
| 2242 | xg_update_radio_item (val, w) | 2289 | xg_update_radio_item (val, w) |
| 2243 | widget_value *val; | 2290 | widget_value *val; |
| @@ -2367,8 +2414,8 @@ xg_update_submenu (submenu, f, val, | |||
| 2367 | { | 2414 | { |
| 2368 | /* If we are adding new menu items below, we must remove from | 2415 | /* If we are adding new menu items below, we must remove from |
| 2369 | first radio button so that radio groups become correct. */ | 2416 | first radio button so that radio groups become correct. */ |
| 2370 | if (cur && first_radio) remove_from_container (submenu, first_radio); | 2417 | if (cur && first_radio) xg_destroy_widgets (first_radio); |
| 2371 | else remove_from_container (submenu, iter); | 2418 | else xg_destroy_widgets (iter); |
| 2372 | } | 2419 | } |
| 2373 | 2420 | ||
| 2374 | if (cur) | 2421 | if (cur) |
| @@ -2400,6 +2447,7 @@ xg_update_submenu (submenu, f, val, | |||
| 2400 | SELECT_CB is the callback to use when a menu item is selected. | 2447 | SELECT_CB is the callback to use when a menu item is selected. |
| 2401 | DEACTIVATE_CB is the callback to use when a sub menu is not shown anymore. | 2448 | DEACTIVATE_CB is the callback to use when a sub menu is not shown anymore. |
| 2402 | HIGHLIGHT_CB is the callback to call when entering/leaving menu items. */ | 2449 | HIGHLIGHT_CB is the callback to call when entering/leaving menu items. */ |
| 2450 | |||
| 2403 | void | 2451 | void |
| 2404 | xg_modify_menubar_widgets (menubar, f, val, deep_p, | 2452 | xg_modify_menubar_widgets (menubar, f, val, deep_p, |
| 2405 | select_cb, deactivate_cb, highlight_cb) | 2453 | select_cb, deactivate_cb, highlight_cb) |
| @@ -2544,12 +2592,14 @@ free_frame_menubar (f) | |||
| 2544 | 2592 | ||
| 2545 | /* Setting scroll bar values invokes the callback. Use this variable | 2593 | /* Setting scroll bar values invokes the callback. Use this variable |
| 2546 | to indicate that callback should do nothing. */ | 2594 | to indicate that callback should do nothing. */ |
| 2595 | |||
| 2547 | int xg_ignore_gtk_scrollbar; | 2596 | int xg_ignore_gtk_scrollbar; |
| 2548 | 2597 | ||
| 2549 | /* SET_SCROLL_BAR_X_WINDOW assumes the second argument fits in | 2598 | /* SET_SCROLL_BAR_X_WINDOW assumes the second argument fits in |
| 2550 | 32 bits. But we want to store pointers, and they may be larger | 2599 | 32 bits. But we want to store pointers, and they may be larger |
| 2551 | than 32 bits. Keep a mapping from integer index to widget pointers | 2600 | than 32 bits. Keep a mapping from integer index to widget pointers |
| 2552 | to get around the 32 bit limitation. */ | 2601 | to get around the 32 bit limitation. */ |
| 2602 | |||
| 2553 | static struct | 2603 | static struct |
| 2554 | { | 2604 | { |
| 2555 | GtkWidget **widgets; | 2605 | GtkWidget **widgets; |
| @@ -2558,9 +2608,11 @@ static struct | |||
| 2558 | } id_to_widget; | 2608 | } id_to_widget; |
| 2559 | 2609 | ||
| 2560 | /* Grow this much every time we need to allocate more */ | 2610 | /* Grow this much every time we need to allocate more */ |
| 2611 | |||
| 2561 | #define ID_TO_WIDGET_INCR 32 | 2612 | #define ID_TO_WIDGET_INCR 32 |
| 2562 | 2613 | ||
| 2563 | /* Store the widget pointer W in id_to_widget and return the integer index. */ | 2614 | /* Store the widget pointer W in id_to_widget and return the integer index. */ |
| 2615 | |||
| 2564 | static int | 2616 | static int |
| 2565 | xg_store_widget_in_map (w) | 2617 | xg_store_widget_in_map (w) |
| 2566 | GtkWidget *w; | 2618 | GtkWidget *w; |
| @@ -2599,6 +2651,7 @@ xg_store_widget_in_map (w) | |||
| 2599 | 2651 | ||
| 2600 | /* Remove pointer at IDX from id_to_widget. | 2652 | /* Remove pointer at IDX from id_to_widget. |
| 2601 | Called when scroll bar is destroyed. */ | 2653 | Called when scroll bar is destroyed. */ |
| 2654 | |||
| 2602 | static void | 2655 | static void |
| 2603 | xg_remove_widget_from_map (idx) | 2656 | xg_remove_widget_from_map (idx) |
| 2604 | int idx; | 2657 | int idx; |
| @@ -2611,6 +2664,7 @@ xg_remove_widget_from_map (idx) | |||
| 2611 | } | 2664 | } |
| 2612 | 2665 | ||
| 2613 | /* Get the widget pointer at IDX from id_to_widget. */ | 2666 | /* Get the widget pointer at IDX from id_to_widget. */ |
| 2667 | |||
| 2614 | static GtkWidget * | 2668 | static GtkWidget * |
| 2615 | xg_get_widget_from_map (idx) | 2669 | xg_get_widget_from_map (idx) |
| 2616 | int idx; | 2670 | int idx; |
| @@ -2623,6 +2677,7 @@ xg_get_widget_from_map (idx) | |||
| 2623 | 2677 | ||
| 2624 | /* Return the scrollbar id for X Window WID on display DPY. | 2678 | /* Return the scrollbar id for X Window WID on display DPY. |
| 2625 | Return -1 if WID not in id_to_widget. */ | 2679 | Return -1 if WID not in id_to_widget. */ |
| 2680 | |||
| 2626 | int | 2681 | int |
| 2627 | xg_get_scroll_id_for_window (dpy, wid) | 2682 | xg_get_scroll_id_for_window (dpy, wid) |
| 2628 | Display *dpy; | 2683 | Display *dpy; |
| @@ -2646,6 +2701,7 @@ xg_get_scroll_id_for_window (dpy, wid) | |||
| 2646 | /* Callback invoked when scroll bar WIDGET is destroyed. | 2701 | /* Callback invoked when scroll bar WIDGET is destroyed. |
| 2647 | DATA is the index into id_to_widget for WIDGET. | 2702 | DATA is the index into id_to_widget for WIDGET. |
| 2648 | We free pointer to last scroll bar values here and remove the index. */ | 2703 | We free pointer to last scroll bar values here and remove the index. */ |
| 2704 | |||
| 2649 | static void | 2705 | static void |
| 2650 | xg_gtk_scroll_destroy (widget, data) | 2706 | xg_gtk_scroll_destroy (widget, data) |
| 2651 | GtkWidget *widget; | 2707 | GtkWidget *widget; |
| @@ -2668,6 +2724,7 @@ xg_gtk_scroll_destroy (widget, data) | |||
| 2668 | 2724 | ||
| 2669 | Returns FALSE to tell GTK that it shall continue propagate the event | 2725 | Returns FALSE to tell GTK that it shall continue propagate the event |
| 2670 | to widgets. */ | 2726 | to widgets. */ |
| 2727 | |||
| 2671 | static gboolean | 2728 | static gboolean |
| 2672 | scroll_bar_button_cb (widget, event, user_data) | 2729 | scroll_bar_button_cb (widget, event, user_data) |
| 2673 | GtkWidget *widget; | 2730 | GtkWidget *widget; |
| @@ -2692,6 +2749,7 @@ scroll_bar_button_cb (widget, event, user_data) | |||
| 2692 | bar changes. | 2749 | bar changes. |
| 2693 | SCROLL_BAR_NAME is the name we use for the scroll bar. Can be used | 2750 | SCROLL_BAR_NAME is the name we use for the scroll bar. Can be used |
| 2694 | to set resources for the widget. */ | 2751 | to set resources for the widget. */ |
| 2752 | |||
| 2695 | void | 2753 | void |
| 2696 | xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name) | 2754 | xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name) |
| 2697 | FRAME_PTR f; | 2755 | FRAME_PTR f; |
| @@ -2753,6 +2811,7 @@ xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name) | |||
| 2753 | } | 2811 | } |
| 2754 | 2812 | ||
| 2755 | /* Make the scroll bar represented by SCROLLBAR_ID visible. */ | 2813 | /* Make the scroll bar represented by SCROLLBAR_ID visible. */ |
| 2814 | |||
| 2756 | void | 2815 | void |
| 2757 | xg_show_scroll_bar (scrollbar_id) | 2816 | xg_show_scroll_bar (scrollbar_id) |
| 2758 | int scrollbar_id; | 2817 | int scrollbar_id; |
| @@ -2763,6 +2822,7 @@ xg_show_scroll_bar (scrollbar_id) | |||
| 2763 | } | 2822 | } |
| 2764 | 2823 | ||
| 2765 | /* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */ | 2824 | /* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */ |
| 2825 | |||
| 2766 | void | 2826 | void |
| 2767 | xg_remove_scroll_bar (f, scrollbar_id) | 2827 | xg_remove_scroll_bar (f, scrollbar_id) |
| 2768 | FRAME_PTR f; | 2828 | FRAME_PTR f; |
| @@ -2782,6 +2842,7 @@ xg_remove_scroll_bar (f, scrollbar_id) | |||
| 2782 | in frame F. | 2842 | in frame F. |
| 2783 | TOP/LEFT are the new pixel positions where the bar shall appear. | 2843 | TOP/LEFT are the new pixel positions where the bar shall appear. |
| 2784 | WIDTH, HEIGHT is the size in pixels the bar shall have. */ | 2844 | WIDTH, HEIGHT is the size in pixels the bar shall have. */ |
| 2845 | |||
| 2785 | void | 2846 | void |
| 2786 | xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height) | 2847 | xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height) |
| 2787 | FRAME_PTR f; | 2848 | FRAME_PTR f; |
| @@ -2810,6 +2871,7 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height) | |||
| 2810 | 2871 | ||
| 2811 | /* Set the thumb size and position of scroll bar BAR. We are currently | 2872 | /* Set the thumb size and position of scroll bar BAR. We are currently |
| 2812 | displaying PORTION out of a whole WHOLE, and our position POSITION. */ | 2873 | displaying PORTION out of a whole WHOLE, and our position POSITION. */ |
| 2874 | |||
| 2813 | void | 2875 | void |
| 2814 | xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | 2876 | xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) |
| 2815 | struct scroll_bar *bar; | 2877 | struct scroll_bar *bar; |
| @@ -2902,6 +2964,7 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole) | |||
| 2902 | W is the button widget in the tool bar that got pressed, | 2964 | W is the button widget in the tool bar that got pressed, |
| 2903 | CLIENT_DATA is an integer that is the index of the button in the | 2965 | CLIENT_DATA is an integer that is the index of the button in the |
| 2904 | tool bar. 0 is the first button. */ | 2966 | tool bar. 0 is the first button. */ |
| 2967 | |||
| 2905 | static void | 2968 | static void |
| 2906 | xg_tool_bar_callback (w, client_data) | 2969 | xg_tool_bar_callback (w, client_data) |
| 2907 | GtkWidget *w; | 2970 | GtkWidget *w; |
| @@ -2938,6 +3001,7 @@ xg_tool_bar_callback (w, client_data) | |||
| 2938 | WBOX is the handle box widget that enables detach/attach of the tool bar. | 3001 | WBOX is the handle box widget that enables detach/attach of the tool bar. |
| 2939 | W is the tool bar widget. | 3002 | W is the tool bar widget. |
| 2940 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ | 3003 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ |
| 3004 | |||
| 2941 | static void | 3005 | static void |
| 2942 | xg_tool_bar_detach_callback (wbox, w, client_data) | 3006 | xg_tool_bar_detach_callback (wbox, w, client_data) |
| 2943 | GtkHandleBox *wbox; | 3007 | GtkHandleBox *wbox; |
| @@ -2966,6 +3030,7 @@ xg_tool_bar_detach_callback (wbox, w, client_data) | |||
| 2966 | WBOX is the handle box widget that enables detach/attach of the tool bar. | 3030 | WBOX is the handle box widget that enables detach/attach of the tool bar. |
| 2967 | W is the tool bar widget. | 3031 | W is the tool bar widget. |
| 2968 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ | 3032 | CLIENT_DATA is a pointer to the frame the tool bar belongs to. */ |
| 3033 | |||
| 2969 | static void | 3034 | static void |
| 2970 | xg_tool_bar_attach_callback (wbox, w, client_data) | 3035 | xg_tool_bar_attach_callback (wbox, w, client_data) |
| 2971 | GtkHandleBox *wbox; | 3036 | GtkHandleBox *wbox; |
| @@ -2995,6 +3060,7 @@ xg_tool_bar_attach_callback (wbox, w, client_data) | |||
| 2995 | tool bar. 0 is the first button. | 3060 | tool bar. 0 is the first button. |
| 2996 | 3061 | ||
| 2997 | Returns FALSE to tell GTK to keep processing this event. */ | 3062 | Returns FALSE to tell GTK to keep processing this event. */ |
| 3063 | |||
| 2998 | static gboolean | 3064 | static gboolean |
| 2999 | xg_tool_bar_help_callback (w, event, client_data) | 3065 | xg_tool_bar_help_callback (w, event, client_data) |
| 3000 | GtkWidget *w; | 3066 | GtkWidget *w; |
| @@ -3040,6 +3106,7 @@ xg_tool_bar_help_callback (w, event, client_data) | |||
| 3040 | CLIENT_DATA is unused. | 3106 | CLIENT_DATA is unused. |
| 3041 | 3107 | ||
| 3042 | Returns FALSE to tell GTK to keep processing this event. */ | 3108 | Returns FALSE to tell GTK to keep processing this event. */ |
| 3109 | |||
| 3043 | static gboolean | 3110 | static gboolean |
| 3044 | xg_tool_bar_item_expose_callback (w, event, client_data) | 3111 | xg_tool_bar_item_expose_callback (w, event, client_data) |
| 3045 | GtkWidget *w; | 3112 | GtkWidget *w; |
| @@ -3070,6 +3137,7 @@ xg_tool_bar_item_expose_callback (w, event, client_data) | |||
| 3070 | CLIENT_DATA is pointing to the frame for this tool bar. | 3137 | CLIENT_DATA is pointing to the frame for this tool bar. |
| 3071 | 3138 | ||
| 3072 | Returns FALSE to tell GTK to keep processing this event. */ | 3139 | Returns FALSE to tell GTK to keep processing this event. */ |
| 3140 | |||
| 3073 | static gboolean | 3141 | static gboolean |
| 3074 | xg_tool_bar_expose_callback (w, event, client_data) | 3142 | xg_tool_bar_expose_callback (w, event, client_data) |
| 3075 | GtkWidget *w; | 3143 | GtkWidget *w; |
| @@ -3080,6 +3148,8 @@ xg_tool_bar_expose_callback (w, event, client_data) | |||
| 3080 | return FALSE; | 3148 | return FALSE; |
| 3081 | } | 3149 | } |
| 3082 | 3150 | ||
| 3151 | /* Create a tool bar for frame F. */ | ||
| 3152 | |||
| 3083 | static void | 3153 | static void |
| 3084 | xg_create_tool_bar (f) | 3154 | xg_create_tool_bar (f) |
| 3085 | FRAME_PTR f; | 3155 | FRAME_PTR f; |
| @@ -3133,6 +3203,8 @@ xg_create_tool_bar (f) | |||
| 3133 | SET_FRAME_GARBAGED (f); | 3203 | SET_FRAME_GARBAGED (f); |
| 3134 | } | 3204 | } |
| 3135 | 3205 | ||
| 3206 | /* Update the tool bar for frame F. Add new buttons and remove old. */ | ||
| 3207 | |||
| 3136 | void | 3208 | void |
| 3137 | update_frame_tool_bar (f) | 3209 | update_frame_tool_bar (f) |
| 3138 | FRAME_PTR f; | 3210 | FRAME_PTR f; |
| @@ -3300,6 +3372,9 @@ update_frame_tool_bar (f) | |||
| 3300 | UNBLOCK_INPUT; | 3372 | UNBLOCK_INPUT; |
| 3301 | } | 3373 | } |
| 3302 | 3374 | ||
| 3375 | /* Deallocate all resources for the tool bar on frame F. | ||
| 3376 | Remove the tool bar. */ | ||
| 3377 | |||
| 3303 | void | 3378 | void |
| 3304 | free_frame_tool_bar (f) | 3379 | free_frame_tool_bar (f) |
| 3305 | FRAME_PTR f; | 3380 | FRAME_PTR f; |
diff --git a/src/indent.c b/src/indent.c index ffde428c12f..99fca1c2ff7 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -1885,7 +1885,7 @@ vmotion (from, vtarget, w) | |||
| 1885 | struct position pos; | 1885 | struct position pos; |
| 1886 | /* vpos is cumulative vertical position, changed as from is changed */ | 1886 | /* vpos is cumulative vertical position, changed as from is changed */ |
| 1887 | register int vpos = 0; | 1887 | register int vpos = 0; |
| 1888 | Lisp_Object prevline; | 1888 | int prevline; |
| 1889 | register int first; | 1889 | register int first; |
| 1890 | int from_byte; | 1890 | int from_byte; |
| 1891 | int lmargin = hscroll > 0 ? 1 - hscroll : 0; | 1891 | int lmargin = hscroll > 0 ? 1 - hscroll : 0; |
| @@ -1919,23 +1919,21 @@ vmotion (from, vtarget, w) | |||
| 1919 | { | 1919 | { |
| 1920 | Lisp_Object propval; | 1920 | Lisp_Object propval; |
| 1921 | 1921 | ||
| 1922 | XSETFASTINT (prevline, find_next_newline_no_quit (from - 1, -1)); | 1922 | prevline = find_next_newline_no_quit (from - 1, -1); |
| 1923 | while (XFASTINT (prevline) > BEGV | 1923 | while (prevline > BEGV |
| 1924 | && ((selective > 0 | 1924 | && ((selective > 0 |
| 1925 | && indented_beyond_p (XFASTINT (prevline), | 1925 | && indented_beyond_p (prevline, |
| 1926 | CHAR_TO_BYTE (XFASTINT (prevline)), | 1926 | CHAR_TO_BYTE (prevline), |
| 1927 | (double) selective)) /* iftc */ | 1927 | (double) selective)) /* iftc */ |
| 1928 | /* watch out for newlines with `invisible' property */ | 1928 | /* Watch out for newlines with `invisible' property. |
| 1929 | || (propval = Fget_char_property (prevline, | 1929 | When moving upward, check the newline before. */ |
| 1930 | || (propval = Fget_char_property (make_number (prevline - 1), | ||
| 1930 | Qinvisible, | 1931 | Qinvisible, |
| 1931 | text_prop_object), | 1932 | text_prop_object), |
| 1932 | TEXT_PROP_MEANS_INVISIBLE (propval)))) | 1933 | TEXT_PROP_MEANS_INVISIBLE (propval)))) |
| 1933 | XSETFASTINT (prevline, | 1934 | prevline = find_next_newline_no_quit (prevline - 1, -1); |
| 1934 | find_next_newline_no_quit (XFASTINT (prevline) - 1, | 1935 | pos = *compute_motion (prevline, 0, |
| 1935 | -1)); | 1936 | lmargin + (prevline == BEG ? start_hpos : 0), |
| 1936 | pos = *compute_motion (XFASTINT (prevline), 0, | ||
| 1937 | lmargin + (XFASTINT (prevline) == BEG | ||
| 1938 | ? start_hpos : 0), | ||
| 1939 | 0, | 1937 | 0, |
| 1940 | from, | 1938 | from, |
| 1941 | /* Don't care for VPOS... */ | 1939 | /* Don't care for VPOS... */ |
| @@ -1946,12 +1944,11 @@ vmotion (from, vtarget, w) | |||
| 1946 | /* This compensates for start_hpos | 1944 | /* This compensates for start_hpos |
| 1947 | so that a tab as first character | 1945 | so that a tab as first character |
| 1948 | still occupies 8 columns. */ | 1946 | still occupies 8 columns. */ |
| 1949 | (XFASTINT (prevline) == BEG | 1947 | (prevline == BEG ? -start_hpos : 0), |
| 1950 | ? -start_hpos : 0), | ||
| 1951 | w); | 1948 | w); |
| 1952 | vpos -= pos.vpos; | 1949 | vpos -= pos.vpos; |
| 1953 | first = 0; | 1950 | first = 0; |
| 1954 | from = XFASTINT (prevline); | 1951 | from = prevline; |
| 1955 | } | 1952 | } |
| 1956 | 1953 | ||
| 1957 | /* If we made exactly the desired vertical distance, | 1954 | /* If we made exactly the desired vertical distance, |
| @@ -1979,21 +1976,21 @@ vmotion (from, vtarget, w) | |||
| 1979 | { | 1976 | { |
| 1980 | Lisp_Object propval; | 1977 | Lisp_Object propval; |
| 1981 | 1978 | ||
| 1982 | XSETFASTINT (prevline, find_next_newline_no_quit (from, -1)); | 1979 | prevline = find_next_newline_no_quit (from, -1); |
| 1983 | while (XFASTINT (prevline) > BEGV | 1980 | while (prevline > BEGV |
| 1984 | && ((selective > 0 | 1981 | && ((selective > 0 |
| 1985 | && indented_beyond_p (XFASTINT (prevline), | 1982 | && indented_beyond_p (prevline, |
| 1986 | CHAR_TO_BYTE (XFASTINT (prevline)), | 1983 | CHAR_TO_BYTE (prevline), |
| 1987 | (double) selective)) /* iftc */ | 1984 | (double) selective)) /* iftc */ |
| 1988 | /* watch out for newlines with `invisible' property */ | 1985 | /* Watch out for newlines with `invisible' property. |
| 1989 | || (propval = Fget_char_property (prevline, Qinvisible, | 1986 | When moving downward, check the newline after. */ |
| 1987 | || (propval = Fget_char_property (make_number (prevline), | ||
| 1988 | Qinvisible, | ||
| 1990 | text_prop_object), | 1989 | text_prop_object), |
| 1991 | TEXT_PROP_MEANS_INVISIBLE (propval)))) | 1990 | TEXT_PROP_MEANS_INVISIBLE (propval)))) |
| 1992 | XSETFASTINT (prevline, | 1991 | prevline = find_next_newline_no_quit (prevline - 1, -1); |
| 1993 | find_next_newline_no_quit (XFASTINT (prevline) - 1, | 1992 | pos = *compute_motion (prevline, 0, |
| 1994 | -1)); | 1993 | lmargin + (prevline == BEG |
| 1995 | pos = *compute_motion (XFASTINT (prevline), 0, | ||
| 1996 | lmargin + (XFASTINT (prevline) == BEG | ||
| 1997 | ? start_hpos : 0), | 1994 | ? start_hpos : 0), |
| 1998 | 0, | 1995 | 0, |
| 1999 | from, | 1996 | from, |
| @@ -2002,7 +1999,7 @@ vmotion (from, vtarget, w) | |||
| 2002 | /* ... nor HPOS. */ | 1999 | /* ... nor HPOS. */ |
| 2003 | 1 << (BITS_PER_SHORT - 1), | 2000 | 1 << (BITS_PER_SHORT - 1), |
| 2004 | -1, hscroll, | 2001 | -1, hscroll, |
| 2005 | (XFASTINT (prevline) == BEG ? -start_hpos : 0), | 2002 | (prevline == BEG ? -start_hpos : 0), |
| 2006 | w); | 2003 | w); |
| 2007 | did_motion = 1; | 2004 | did_motion = 1; |
| 2008 | } | 2005 | } |
diff --git a/src/lisp.h b/src/lisp.h index ce0fdf96e43..55664cb8ca3 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3265,7 +3265,7 @@ extern Lisp_Object Vdirectory_sep_char; | |||
| 3265 | extern Lisp_Object safe_alloca_unwind (Lisp_Object); | 3265 | extern Lisp_Object safe_alloca_unwind (Lisp_Object); |
| 3266 | 3266 | ||
| 3267 | #define USE_SAFE_ALLOCA \ | 3267 | #define USE_SAFE_ALLOCA \ |
| 3268 | int sa_count = SPECPDL_INDEX () | 3268 | int sa_count = SPECPDL_INDEX (), sa_must_free = 0 |
| 3269 | 3269 | ||
| 3270 | /* SAFE_ALLOCA allocates a simple buffer. */ | 3270 | /* SAFE_ALLOCA allocates a simple buffer. */ |
| 3271 | 3271 | ||
| @@ -3276,6 +3276,7 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object); | |||
| 3276 | else \ | 3276 | else \ |
| 3277 | { \ | 3277 | { \ |
| 3278 | buf = (type) xmalloc (size); \ | 3278 | buf = (type) xmalloc (size); \ |
| 3279 | sa_must_free++; \ | ||
| 3279 | record_unwind_protect (safe_alloca_unwind, \ | 3280 | record_unwind_protect (safe_alloca_unwind, \ |
| 3280 | make_save_value (buf, 0)); \ | 3281 | make_save_value (buf, 0)); \ |
| 3281 | } \ | 3282 | } \ |
| @@ -3283,10 +3284,12 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object); | |||
| 3283 | 3284 | ||
| 3284 | /* SAFE_FREE frees xmalloced memory and enables GC as needed. */ | 3285 | /* SAFE_FREE frees xmalloced memory and enables GC as needed. */ |
| 3285 | 3286 | ||
| 3286 | #define SAFE_FREE(size) \ | 3287 | #define SAFE_FREE() \ |
| 3287 | do { \ | 3288 | do { \ |
| 3288 | if ((size) >= MAX_ALLOCA) \ | 3289 | if (sa_must_free) { \ |
| 3290 | sa_must_free = 0; \ | ||
| 3289 | unbind_to (sa_count, Qnil); \ | 3291 | unbind_to (sa_count, Qnil); \ |
| 3292 | } \ | ||
| 3290 | } while (0) | 3293 | } while (0) |
| 3291 | 3294 | ||
| 3292 | 3295 | ||
| @@ -3303,17 +3306,11 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object); | |||
| 3303 | buf = (Lisp_Object *) xmalloc (size_); \ | 3306 | buf = (Lisp_Object *) xmalloc (size_); \ |
| 3304 | arg_ = make_save_value (buf, nelt); \ | 3307 | arg_ = make_save_value (buf, nelt); \ |
| 3305 | XSAVE_VALUE (arg_)->dogc = 1; \ | 3308 | XSAVE_VALUE (arg_)->dogc = 1; \ |
| 3309 | sa_must_free++; \ | ||
| 3306 | record_unwind_protect (safe_alloca_unwind, arg_); \ | 3310 | record_unwind_protect (safe_alloca_unwind, arg_); \ |
| 3307 | } \ | 3311 | } \ |
| 3308 | } while (0) | 3312 | } while (0) |
| 3309 | 3313 | ||
| 3310 | #define SAFE_FREE_LISP(nelt) \ | ||
| 3311 | do { \ | ||
| 3312 | if (((nelt) * sizeof (Lisp_Object)) >= MAX_ALLOCA) \ | ||
| 3313 | unbind_to (sa_count, Qnil); \ | ||
| 3314 | } while (0) | ||
| 3315 | |||
| 3316 | |||
| 3317 | 3314 | ||
| 3318 | #endif /* EMACS_LISP_H */ | 3315 | #endif /* EMACS_LISP_H */ |
| 3319 | 3316 | ||
diff --git a/src/macterm.c b/src/macterm.c index f62bbbc0d84..cdc1ccf41e3 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -228,6 +228,10 @@ extern int errno; | |||
| 228 | 228 | ||
| 229 | extern int extra_keyboard_modifiers; | 229 | extern int extra_keyboard_modifiers; |
| 230 | 230 | ||
| 231 | /* The keysyms to use for the various modifiers. */ | ||
| 232 | |||
| 233 | static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value; | ||
| 234 | |||
| 231 | static Lisp_Object Qvendor_specific_keysyms; | 235 | static Lisp_Object Qvendor_specific_keysyms; |
| 232 | 236 | ||
| 233 | #if 0 | 237 | #if 0 |
| @@ -6988,6 +6992,9 @@ Lisp_Object Qreverse; | |||
| 6988 | /* True if using command key as meta key. */ | 6992 | /* True if using command key as meta key. */ |
| 6989 | Lisp_Object Vmac_command_key_is_meta; | 6993 | Lisp_Object Vmac_command_key_is_meta; |
| 6990 | 6994 | ||
| 6995 | /* Modifier associated with the option key, or nil for normal behavior. */ | ||
| 6996 | Lisp_Object Vmac_option_modifier; | ||
| 6997 | |||
| 6991 | /* True if the ctrl and meta keys should be reversed. */ | 6998 | /* True if the ctrl and meta keys should be reversed. */ |
| 6992 | Lisp_Object Vmac_reverse_ctrl_meta; | 6999 | Lisp_Object Vmac_reverse_ctrl_meta; |
| 6993 | 7000 | ||
| @@ -7069,6 +7076,12 @@ mac_to_emacs_modifiers (EventModifiers mods) | |||
| 7069 | result |= meta_modifier; | 7076 | result |= meta_modifier; |
| 7070 | if (NILP (Vmac_command_key_is_meta) && (mods & macAltKey)) | 7077 | if (NILP (Vmac_command_key_is_meta) && (mods & macAltKey)) |
| 7071 | result |= alt_modifier; | 7078 | result |= alt_modifier; |
| 7079 | if (!NILP (Vmac_option_modifier) && (mods & optionKey)) { | ||
| 7080 | Lisp_Object val = Fget(Vmac_option_modifier, Qmodifier_value); | ||
| 7081 | if (!NILP(val)) | ||
| 7082 | result |= XUINT(val); | ||
| 7083 | } | ||
| 7084 | |||
| 7072 | return result; | 7085 | return result; |
| 7073 | } | 7086 | } |
| 7074 | 7087 | ||
| @@ -8549,7 +8562,18 @@ XTread_socket (sd, expected, hold_quit) | |||
| 8549 | unsigned long some_state = 0; | 8562 | unsigned long some_state = 0; |
| 8550 | inev.code = KeyTranslate (kchr_ptr, new_keycode, | 8563 | inev.code = KeyTranslate (kchr_ptr, new_keycode, |
| 8551 | &some_state) & 0xff; | 8564 | &some_state) & 0xff; |
| 8552 | } | 8565 | } else if (!NILP(Vmac_option_modifier) && (er.modifiers & optionKey)) |
| 8566 | { | ||
| 8567 | /* When using the option key as an emacs modifier, convert | ||
| 8568 | the pressed key code back to one without the Mac option | ||
| 8569 | modifier applied. */ | ||
| 8570 | int new_modifiers = er.modifiers & ~optionKey; | ||
| 8571 | int new_keycode = keycode | new_modifiers; | ||
| 8572 | Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache); | ||
| 8573 | unsigned long some_state = 0; | ||
| 8574 | inev.code = KeyTranslate (kchr_ptr, new_keycode, | ||
| 8575 | &some_state) & 0xff; | ||
| 8576 | } | ||
| 8553 | else | 8577 | else |
| 8554 | inev.code = er.message & charCodeMask; | 8578 | inev.code = er.message & charCodeMask; |
| 8555 | inev.kind = ASCII_KEYSTROKE_EVENT; | 8579 | inev.kind = ASCII_KEYSTROKE_EVENT; |
| @@ -9249,6 +9273,14 @@ syms_of_macterm () | |||
| 9249 | x_error_message_string = Qnil; | 9273 | x_error_message_string = Qnil; |
| 9250 | #endif | 9274 | #endif |
| 9251 | 9275 | ||
| 9276 | Qmodifier_value = intern ("modifier-value"); | ||
| 9277 | Qalt = intern ("alt"); | ||
| 9278 | Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); | ||
| 9279 | Qhyper = intern ("hyper"); | ||
| 9280 | Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier)); | ||
| 9281 | Qsuper = intern ("super"); | ||
| 9282 | Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); | ||
| 9283 | |||
| 9252 | Fprovide (intern ("mac-carbon"), Qnil); | 9284 | Fprovide (intern ("mac-carbon"), Qnil); |
| 9253 | 9285 | ||
| 9254 | staticpro (&Qreverse); | 9286 | staticpro (&Qreverse); |
| @@ -9305,6 +9337,12 @@ to 4.1, set this to nil. */); | |||
| 9305 | Otherwise the option key is used. */); | 9337 | Otherwise the option key is used. */); |
| 9306 | Vmac_command_key_is_meta = Qt; | 9338 | Vmac_command_key_is_meta = Qt; |
| 9307 | 9339 | ||
| 9340 | DEFVAR_LISP ("mac-option-modifier", &Vmac_option_modifier, | ||
| 9341 | doc: /* Modifier to use for the Mac alt/option key. The value can | ||
| 9342 | be alt, hyper, or super for the respective modifier. If the value is | ||
| 9343 | nil then the key will act as the normal Mac option modifier. */); | ||
| 9344 | Vmac_option_modifier = Qnil; | ||
| 9345 | |||
| 9308 | DEFVAR_LISP ("mac-reverse-ctrl-meta", &Vmac_reverse_ctrl_meta, | 9346 | DEFVAR_LISP ("mac-reverse-ctrl-meta", &Vmac_reverse_ctrl_meta, |
| 9309 | doc: /* Non-nil means that the control and meta keys are reversed. This is | 9347 | doc: /* Non-nil means that the control and meta keys are reversed. This is |
| 9310 | useful for non-standard keyboard layouts. */); | 9348 | useful for non-standard keyboard layouts. */); |
diff --git a/src/search.c b/src/search.c index f7bee1b8683..1742cfb08c2 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -554,7 +554,7 @@ newline_cache_on_off (buf) | |||
| 554 | direction indicated by COUNT. | 554 | direction indicated by COUNT. |
| 555 | 555 | ||
| 556 | If we find COUNT instances, set *SHORTAGE to zero, and return the | 556 | If we find COUNT instances, set *SHORTAGE to zero, and return the |
| 557 | position after the COUNTth match. Note that for reverse motion | 557 | position past the COUNTth match. Note that for reverse motion |
| 558 | this is not the same as the usual convention for Emacs motion commands. | 558 | this is not the same as the usual convention for Emacs motion commands. |
| 559 | 559 | ||
| 560 | If we don't find COUNT instances before reaching END, set *SHORTAGE | 560 | If we don't find COUNT instances before reaching END, set *SHORTAGE |
diff --git a/src/syntax.c b/src/syntax.c index 272e9cf1b12..8bfa62b49fc 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -2799,12 +2799,23 @@ do { prev_from = from; \ | |||
| 2799 | INC_FROM; | 2799 | INC_FROM; |
| 2800 | code = prev_from_syntax & 0xff; | 2800 | code = prev_from_syntax & 0xff; |
| 2801 | 2801 | ||
| 2802 | if (code == Scomment) | 2802 | if (from < end |
| 2803 | && SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax) | ||
| 2804 | && (c1 = FETCH_CHAR (from_byte), | ||
| 2805 | SYNTAX_COMSTART_SECOND (c1))) | ||
| 2806 | /* Duplicate code to avoid a complex if-expression | ||
| 2807 | which causes trouble for the SGI compiler. */ | ||
| 2803 | { | 2808 | { |
| 2804 | state.comstyle = SYNTAX_FLAGS_COMMENT_STYLE (prev_from_syntax); | 2809 | /* Record the comment style we have entered so that only |
| 2805 | state.incomment = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) ? | 2810 | the comment-end sequence of the same style actually |
| 2806 | 1 : -1); | 2811 | terminates the comment section. */ |
| 2812 | state.comstyle = SYNTAX_COMMENT_STYLE (c1); | ||
| 2813 | comnested = SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax); | ||
| 2814 | comnested = comnested || SYNTAX_COMMENT_NESTED (c1); | ||
| 2815 | state.incomment = comnested ? 1 : -1; | ||
| 2807 | state.comstr_start = prev_from; | 2816 | state.comstr_start = prev_from; |
| 2817 | INC_FROM; | ||
| 2818 | code = Scomment; | ||
| 2808 | } | 2819 | } |
| 2809 | else if (code == Scomment_fence) | 2820 | else if (code == Scomment_fence) |
| 2810 | { | 2821 | { |
| @@ -2816,24 +2827,13 @@ do { prev_from = from; \ | |||
| 2816 | state.comstr_start = prev_from; | 2827 | state.comstr_start = prev_from; |
| 2817 | code = Scomment; | 2828 | code = Scomment; |
| 2818 | } | 2829 | } |
| 2819 | else if (from < end) | 2830 | else if (code == Scomment) |
| 2820 | if (SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax)) | 2831 | { |
| 2821 | if (c1 = FETCH_CHAR (from_byte), | 2832 | state.comstyle = SYNTAX_FLAGS_COMMENT_STYLE (prev_from_syntax); |
| 2822 | SYNTAX_COMSTART_SECOND (c1)) | 2833 | state.incomment = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) ? |
| 2823 | /* Duplicate code to avoid a complex if-expression | 2834 | 1 : -1); |
| 2824 | which causes trouble for the SGI compiler. */ | 2835 | state.comstr_start = prev_from; |
| 2825 | { | 2836 | } |
| 2826 | /* Record the comment style we have entered so that only | ||
| 2827 | the comment-end sequence of the same style actually | ||
| 2828 | terminates the comment section. */ | ||
| 2829 | state.comstyle = SYNTAX_COMMENT_STYLE (c1); | ||
| 2830 | comnested = SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax); | ||
| 2831 | comnested = comnested || SYNTAX_COMMENT_NESTED (c1); | ||
| 2832 | state.incomment = comnested ? 1 : -1; | ||
| 2833 | state.comstr_start = prev_from; | ||
| 2834 | INC_FROM; | ||
| 2835 | code = Scomment; | ||
| 2836 | } | ||
| 2837 | 2837 | ||
| 2838 | if (SYNTAX_FLAGS_PREFIX (prev_from_syntax)) | 2838 | if (SYNTAX_FLAGS_PREFIX (prev_from_syntax)) |
| 2839 | continue; | 2839 | continue; |
diff --git a/src/w32fns.c b/src/w32fns.c index 1e52155ab3b..38faa7c3199 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -6398,7 +6398,7 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 6398 | } | 6398 | } |
| 6399 | 6399 | ||
| 6400 | DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, | 6400 | DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, |
| 6401 | doc: /* Returns the vendor ID string of the W32 system (Microsoft). | 6401 | doc: /* Returns the "vendor ID" string of the W32 system (Microsoft). |
| 6402 | The optional argument DISPLAY specifies which display to ask about. | 6402 | The optional argument DISPLAY specifies which display to ask about. |
| 6403 | DISPLAY should be either a frame or a display name (a string). | 6403 | DISPLAY should be either a frame or a display name (a string). |
| 6404 | If omitted or nil, that stands for the selected frame's display. */) | 6404 | If omitted or nil, that stands for the selected frame's display. */) |
| @@ -6411,7 +6411,7 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 6411 | DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, | 6411 | DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, |
| 6412 | doc: /* Returns the version numbers of the server of DISPLAY. | 6412 | doc: /* Returns the version numbers of the server of DISPLAY. |
| 6413 | The value is a list of three integers: the major and minor | 6413 | The value is a list of three integers: the major and minor |
| 6414 | version numbers, and the vendor-specific release | 6414 | version numbers of the X Protocol in use, and the distributor-specific release |
| 6415 | number. See also the function `x-server-vendor'. | 6415 | number. See also the function `x-server-vendor'. |
| 6416 | 6416 | ||
| 6417 | The optional argument DISPLAY specifies which display to ask about. | 6417 | The optional argument DISPLAY specifies which display to ask about. |
diff --git a/src/xdisp.c b/src/xdisp.c index 47b4bc1f06d..a5449c4db7c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -4890,6 +4890,8 @@ get_next_display_element (it) | |||
| 4890 | translated to octal form. */ | 4890 | translated to octal form. */ |
| 4891 | else if ((it->c < ' ' | 4891 | else if ((it->c < ' ' |
| 4892 | && (it->area != TEXT_AREA | 4892 | && (it->area != TEXT_AREA |
| 4893 | /* In mode line, treat \n, \t like other crl chars. */ | ||
| 4894 | || (it->glyph_row && it->glyph_row->mode_line_p) | ||
| 4893 | || (it->c != '\n' && it->c != '\t'))) | 4895 | || (it->c != '\n' && it->c != '\t'))) |
| 4894 | || (it->multibyte_p | 4896 | || (it->multibyte_p |
| 4895 | ? ((it->c >= 127 | 4897 | ? ((it->c >= 127 |
| @@ -6364,7 +6366,7 @@ add_to_log (format, arg1, arg2) | |||
| 6364 | bcopy (SDATA (msg), buffer, len); | 6366 | bcopy (SDATA (msg), buffer, len); |
| 6365 | 6367 | ||
| 6366 | message_dolog (buffer, len - 1, 1, 0); | 6368 | message_dolog (buffer, len - 1, 1, 0); |
| 6367 | SAFE_FREE (len); | 6369 | SAFE_FREE (); |
| 6368 | 6370 | ||
| 6369 | UNGCPRO; | 6371 | UNGCPRO; |
| 6370 | } | 6372 | } |
diff --git a/src/xfns.c b/src/xfns.c index 97a55869a05..b11779da185 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1970,6 +1970,7 @@ xic_create_xfontset (f, base_fontname) | |||
| 1970 | struct frame *cf = XFRAME (frame); | 1970 | struct frame *cf = XFRAME (frame); |
| 1971 | if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf) | 1971 | if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf) |
| 1972 | && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f) | 1972 | && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f) |
| 1973 | && FRAME_XIC_BASE_FONTNAME (cf) | ||
| 1973 | && !strcmp (FRAME_XIC_BASE_FONTNAME (cf), base_fontname)) | 1974 | && !strcmp (FRAME_XIC_BASE_FONTNAME (cf), base_fontname)) |
| 1974 | { | 1975 | { |
| 1975 | xfs = FRAME_XIC_FONTSET (cf); | 1976 | xfs = FRAME_XIC_FONTSET (cf); |
| @@ -3513,7 +3514,9 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 3513 | } | 3514 | } |
| 3514 | 3515 | ||
| 3515 | DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, | 3516 | DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, |
| 3516 | doc: /* Returns the vendor ID string of the X server of display DISPLAY. | 3517 | doc: /* Returns the "vendor ID" string of the X server of display DISPLAY. |
| 3518 | \(Labelling every distributor as a "vendor" embodies the false assumption | ||
| 3519 | that operating systems cannot be developed and distributed noncommercially.) | ||
| 3517 | The optional argument DISPLAY specifies which display to ask about. | 3520 | The optional argument DISPLAY specifies which display to ask about. |
| 3518 | DISPLAY should be either a frame or a display name (a string). | 3521 | DISPLAY should be either a frame or a display name (a string). |
| 3519 | If omitted or nil, that stands for the selected frame's display. */) | 3522 | If omitted or nil, that stands for the selected frame's display. */) |
| @@ -3530,7 +3533,7 @@ If omitted or nil, that stands for the selected frame's display. */) | |||
| 3530 | DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, | 3533 | DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, |
| 3531 | doc: /* Returns the version numbers of the X server of display DISPLAY. | 3534 | doc: /* Returns the version numbers of the X server of display DISPLAY. |
| 3532 | The value is a list of three integers: the major and minor | 3535 | The value is a list of three integers: the major and minor |
| 3533 | version numbers of the X Protocol in use, and the vendor-specific release | 3536 | version numbers of the X Protocol in use, and the distributor-specific release |
| 3534 | number. See also the function `x-server-vendor'. | 3537 | number. See also the function `x-server-vendor'. |
| 3535 | 3538 | ||
| 3536 | The optional argument DISPLAY specifies which display to ask about. | 3539 | The optional argument DISPLAY specifies which display to ask about. |
diff --git a/src/xselect.c b/src/xselect.c index 530bf060af4..65cb584410e 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -108,8 +108,8 @@ Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3, | |||
| 108 | QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7; | 108 | QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7; |
| 109 | #endif | 109 | #endif |
| 110 | 110 | ||
| 111 | static Lisp_Object Vx_lost_selection_hooks; | 111 | static Lisp_Object Vx_lost_selection_functions; |
| 112 | static Lisp_Object Vx_sent_selection_hooks; | 112 | static Lisp_Object Vx_sent_selection_functions; |
| 113 | /* Coding system for communicating with other X clients via cutbuffer, | 113 | /* Coding system for communicating with other X clients via cutbuffer, |
| 114 | selection, and clipboard. */ | 114 | selection, and clipboard. */ |
| 115 | static Lisp_Object Vselection_coding_system; | 115 | static Lisp_Object Vselection_coding_system; |
| @@ -864,7 +864,7 @@ x_handle_selection_request (event) | |||
| 864 | /* Let random lisp code notice that the selection has been asked for. */ | 864 | /* Let random lisp code notice that the selection has been asked for. */ |
| 865 | { | 865 | { |
| 866 | Lisp_Object rest; | 866 | Lisp_Object rest; |
| 867 | rest = Vx_sent_selection_hooks; | 867 | rest = Vx_sent_selection_functions; |
| 868 | if (!EQ (rest, Qunbound)) | 868 | if (!EQ (rest, Qunbound)) |
| 869 | for (; CONSP (rest); rest = Fcdr (rest)) | 869 | for (; CONSP (rest); rest = Fcdr (rest)) |
| 870 | call3 (Fcar (rest), selection_symbol, target_symbol, successful_p); | 870 | call3 (Fcar (rest), selection_symbol, target_symbol, successful_p); |
| @@ -947,7 +947,7 @@ x_handle_selection_clear (event) | |||
| 947 | 947 | ||
| 948 | { | 948 | { |
| 949 | Lisp_Object rest; | 949 | Lisp_Object rest; |
| 950 | rest = Vx_lost_selection_hooks; | 950 | rest = Vx_lost_selection_functions; |
| 951 | if (!EQ (rest, Qunbound)) | 951 | if (!EQ (rest, Qunbound)) |
| 952 | { | 952 | { |
| 953 | for (; CONSP (rest); rest = Fcdr (rest)) | 953 | for (; CONSP (rest); rest = Fcdr (rest)) |
| @@ -980,7 +980,7 @@ x_clear_frame_selections (f) | |||
| 980 | /* Let random Lisp code notice that the selection has been stolen. */ | 980 | /* Let random Lisp code notice that the selection has been stolen. */ |
| 981 | Lisp_Object hooks, selection_symbol; | 981 | Lisp_Object hooks, selection_symbol; |
| 982 | 982 | ||
| 983 | hooks = Vx_lost_selection_hooks; | 983 | hooks = Vx_lost_selection_functions; |
| 984 | selection_symbol = Fcar (Fcar (Vselection_alist)); | 984 | selection_symbol = Fcar (Fcar (Vselection_alist)); |
| 985 | 985 | ||
| 986 | if (!EQ (hooks, Qunbound)) | 986 | if (!EQ (hooks, Qunbound)) |
| @@ -1004,7 +1004,7 @@ x_clear_frame_selections (f) | |||
| 1004 | /* Let random Lisp code notice that the selection has been stolen. */ | 1004 | /* Let random Lisp code notice that the selection has been stolen. */ |
| 1005 | Lisp_Object hooks, selection_symbol; | 1005 | Lisp_Object hooks, selection_symbol; |
| 1006 | 1006 | ||
| 1007 | hooks = Vx_lost_selection_hooks; | 1007 | hooks = Vx_lost_selection_functions; |
| 1008 | selection_symbol = Fcar (Fcar (XCDR (rest))); | 1008 | selection_symbol = Fcar (Fcar (XCDR (rest))); |
| 1009 | 1009 | ||
| 1010 | if (!EQ (hooks, Qunbound)) | 1010 | if (!EQ (hooks, Qunbound)) |
| @@ -2731,15 +2731,15 @@ means that a side-effect was executed, | |||
| 2731 | and there is no meaningful selection value. */); | 2731 | and there is no meaningful selection value. */); |
| 2732 | Vselection_converter_alist = Qnil; | 2732 | Vselection_converter_alist = Qnil; |
| 2733 | 2733 | ||
| 2734 | DEFVAR_LISP ("x-lost-selection-hooks", &Vx_lost_selection_hooks, | 2734 | DEFVAR_LISP ("x-lost-selection-functions", &Vx_lost_selection_functions, |
| 2735 | doc: /* A list of functions to be called when Emacs loses an X selection. | 2735 | doc: /* A list of functions to be called when Emacs loses an X selection. |
| 2736 | \(This happens when some other X client makes its own selection | 2736 | \(This happens when some other X client makes its own selection |
| 2737 | or when a Lisp program explicitly clears the selection.) | 2737 | or when a Lisp program explicitly clears the selection.) |
| 2738 | The functions are called with one argument, the selection type | 2738 | The functions are called with one argument, the selection type |
| 2739 | \(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'). */); | 2739 | \(a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'). */); |
| 2740 | Vx_lost_selection_hooks = Qnil; | 2740 | Vx_lost_selection_functions = Qnil; |
| 2741 | 2741 | ||
| 2742 | DEFVAR_LISP ("x-sent-selection-hooks", &Vx_sent_selection_hooks, | 2742 | DEFVAR_LISP ("x-sent-selection-functions", &Vx_sent_selection_functions, |
| 2743 | doc: /* A list of functions to be called when Emacs answers a selection request. | 2743 | doc: /* A list of functions to be called when Emacs answers a selection request. |
| 2744 | The functions are called with four arguments: | 2744 | The functions are called with four arguments: |
| 2745 | - the selection name (typically `PRIMARY', `SECONDARY', or `CLIPBOARD'); | 2745 | - the selection name (typically `PRIMARY', `SECONDARY', or `CLIPBOARD'); |
| @@ -2751,7 +2751,7 @@ including being asked for a selection that we no longer own, or being asked | |||
| 2751 | to convert into a type that we don't know about or that is inappropriate. | 2751 | to convert into a type that we don't know about or that is inappropriate. |
| 2752 | This hook doesn't let you change the behavior of Emacs's selection replies, | 2752 | This hook doesn't let you change the behavior of Emacs's selection replies, |
| 2753 | it merely informs you that they have happened. */); | 2753 | it merely informs you that they have happened. */); |
| 2754 | Vx_sent_selection_hooks = Qnil; | 2754 | Vx_sent_selection_functions = Qnil; |
| 2755 | 2755 | ||
| 2756 | DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system, | 2756 | DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system, |
| 2757 | doc: /* Coding system for communicating with other X clients. | 2757 | doc: /* Coding system for communicating with other X clients. |
diff --git a/src/xsmfns.c b/src/xsmfns.c index 080f998e779..27ab90c5432 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c | |||
| @@ -74,33 +74,35 @@ static int ice_fd = -1; | |||
| 74 | 74 | ||
| 75 | static int doing_interact = False; | 75 | static int doing_interact = False; |
| 76 | 76 | ||
| 77 | /* The session manager object for the session manager connection */ | 77 | /* The session manager object for the session manager connection. */ |
| 78 | 78 | ||
| 79 | static SmcConn smc_conn; | 79 | static SmcConn smc_conn; |
| 80 | 80 | ||
| 81 | /* The client session id for this session */ | 81 | /* The client session id for this session. */ |
| 82 | |||
| 82 | static char *client_id; | 83 | static char *client_id; |
| 83 | 84 | ||
| 84 | /* The full path name to the Emacs program */ | 85 | /* The full path name to the Emacs program. */ |
| 86 | |||
| 85 | static char *emacs_program; | 87 | static char *emacs_program; |
| 86 | 88 | ||
| 87 | /* The client session id for this session as a lisp object. */ | 89 | /* The client session id for this session as a lisp object. */ |
| 88 | 90 | ||
| 89 | Lisp_Object Vx_session_id; | 91 | Lisp_Object Vx_session_id; |
| 90 | 92 | ||
| 91 | /* The id we had the previous session. This is only available if we | 93 | /* The id we had the previous session. This is only available if we |
| 92 | have been started by the session manager with SMID_OPT. */ | 94 | have been started by the session manager with SMID_OPT. */ |
| 93 | 95 | ||
| 94 | Lisp_Object Vx_session_previous_id; | 96 | Lisp_Object Vx_session_previous_id; |
| 95 | 97 | ||
| 96 | /* The option we tell the session manager to start Emacs with when | 98 | /* The option we tell the session manager to start Emacs with when |
| 97 | restarting Emacs. The client_id is appended. */ | 99 | restarting Emacs. The client_id is appended. */ |
| 98 | 100 | ||
| 99 | #define SMID_OPT "--smid=" | 101 | #define SMID_OPT "--smid=" |
| 100 | 102 | ||
| 101 | 103 | ||
| 102 | /* The option to start Emacs without the splash screen when | 104 | /* The option to start Emacs without the splash screen when |
| 103 | restarting Emacs. */ | 105 | restarting Emacs. */ |
| 104 | 106 | ||
| 105 | #define NOSPLASH_OPT "--no-splash" | 107 | #define NOSPLASH_OPT "--no-splash" |
| 106 | 108 | ||
| @@ -108,6 +110,7 @@ Lisp_Object Vx_session_previous_id; | |||
| 108 | /* Handle any messages from the session manager. If no connection is | 110 | /* Handle any messages from the session manager. If no connection is |
| 109 | open to a session manager, just return 0. | 111 | open to a session manager, just return 0. |
| 110 | Otherwise returns 1 if SAVE_SESSION_EVENT is stored in buffer BUFP. */ | 112 | Otherwise returns 1 if SAVE_SESSION_EVENT is stored in buffer BUFP. */ |
| 113 | |||
| 111 | int | 114 | int |
| 112 | x_session_check_input (bufp) | 115 | x_session_check_input (bufp) |
| 113 | struct input_event *bufp; | 116 | struct input_event *bufp; |
| @@ -126,7 +129,7 @@ x_session_check_input (bufp) | |||
| 126 | /* Reset this so wo can check kind after callbacks have been called by | 129 | /* Reset this so wo can check kind after callbacks have been called by |
| 127 | IceProcessMessages. The smc_interact_CB sets the kind to | 130 | IceProcessMessages. The smc_interact_CB sets the kind to |
| 128 | SAVE_SESSION_EVENT, but we don't know beforehand if that callback | 131 | SAVE_SESSION_EVENT, but we don't know beforehand if that callback |
| 129 | will be called. */ | 132 | will be called. */ |
| 130 | emacs_event.kind = NO_EVENT; | 133 | emacs_event.kind = NO_EVENT; |
| 131 | 134 | ||
| 132 | if (select (ice_fd+1, &read_fds, | 135 | if (select (ice_fd+1, &read_fds, |
| @@ -143,7 +146,7 @@ x_session_check_input (bufp) | |||
| 143 | 146 | ||
| 144 | 147 | ||
| 145 | /* Check if smc_interact_CB was called and we shall generate a | 148 | /* Check if smc_interact_CB was called and we shall generate a |
| 146 | SAVE_SESSION_EVENT. */ | 149 | SAVE_SESSION_EVENT. */ |
| 147 | if (emacs_event.kind == NO_EVENT) | 150 | if (emacs_event.kind == NO_EVENT) |
| 148 | return 0; | 151 | return 0; |
| 149 | 152 | ||
| @@ -151,7 +154,8 @@ x_session_check_input (bufp) | |||
| 151 | return 1; | 154 | return 1; |
| 152 | } | 155 | } |
| 153 | 156 | ||
| 154 | /* Return non-zero if we have a connection to a session manager.*/ | 157 | /* Return non-zero if we have a connection to a session manager. */ |
| 158 | |||
| 155 | int | 159 | int |
| 156 | x_session_have_connection () | 160 | x_session_have_connection () |
| 157 | { | 161 | { |
| @@ -160,7 +164,8 @@ x_session_have_connection () | |||
| 160 | 164 | ||
| 161 | /* This is called when the session manager says it is OK to interact with the | 165 | /* This is called when the session manager says it is OK to interact with the |
| 162 | user. Here we set the kind to SAVE_SESSION_EVENT so an event is generated. | 166 | user. Here we set the kind to SAVE_SESSION_EVENT so an event is generated. |
| 163 | Then lisp code can interact with the user. */ | 167 | Then lisp code can interact with the user. */ |
| 168 | |||
| 164 | static void | 169 | static void |
| 165 | smc_interact_CB (smcConn, clientData) | 170 | smc_interact_CB (smcConn, clientData) |
| 166 | SmcConn smcConn; | 171 | SmcConn smcConn; |
| @@ -176,7 +181,8 @@ smc_interact_CB (smcConn, clientData) | |||
| 176 | are started in the correct directory. | 181 | are started in the correct directory. |
| 177 | 182 | ||
| 178 | If this is a shutdown and we can request to interact with the user, | 183 | If this is a shutdown and we can request to interact with the user, |
| 179 | we do so, because we don't know what the lisp code might do. */ | 184 | we do so, because we don't know what the lisp code might do. */ |
| 185 | |||
| 180 | static void | 186 | static void |
| 181 | smc_save_yourself_CB (smcConn, | 187 | smc_save_yourself_CB (smcConn, |
| 182 | clientData, | 188 | clientData, |
| @@ -203,7 +209,7 @@ smc_save_yourself_CB (smcConn, | |||
| 203 | char cwd[MAXPATHLEN+1]; | 209 | char cwd[MAXPATHLEN+1]; |
| 204 | char *smid_opt; | 210 | char *smid_opt; |
| 205 | 211 | ||
| 206 | /* How to start a new instance of Emacs */ | 212 | /* How to start a new instance of Emacs. */ |
| 207 | props[props_idx] = &prop_ptr[props_idx]; | 213 | props[props_idx] = &prop_ptr[props_idx]; |
| 208 | props[props_idx]->name = SmCloneCommand; | 214 | props[props_idx]->name = SmCloneCommand; |
| 209 | props[props_idx]->type = SmLISTofARRAY8; | 215 | props[props_idx]->type = SmLISTofARRAY8; |
| @@ -213,7 +219,7 @@ smc_save_yourself_CB (smcConn, | |||
| 213 | props[props_idx]->vals[0].value = emacs_program; | 219 | props[props_idx]->vals[0].value = emacs_program; |
| 214 | ++props_idx; | 220 | ++props_idx; |
| 215 | 221 | ||
| 216 | /* The name of the program */ | 222 | /* The name of the program. */ |
| 217 | props[props_idx] = &prop_ptr[props_idx]; | 223 | props[props_idx] = &prop_ptr[props_idx]; |
| 218 | props[props_idx]->name = SmProgram; | 224 | props[props_idx]->name = SmProgram; |
| 219 | props[props_idx]->type = SmARRAY8; | 225 | props[props_idx]->type = SmARRAY8; |
| @@ -223,11 +229,11 @@ smc_save_yourself_CB (smcConn, | |||
| 223 | props[props_idx]->vals[0].value = SDATA (Vinvocation_name); | 229 | props[props_idx]->vals[0].value = SDATA (Vinvocation_name); |
| 224 | ++props_idx; | 230 | ++props_idx; |
| 225 | 231 | ||
| 226 | /* How to restart Emacs (i.e.: /path/to/emacs --smid=xxxx --no-splash). */ | 232 | /* How to restart Emacs (i.e.: /path/to/emacs --smid=xxxx --no-splash). */ |
| 227 | props[props_idx] = &prop_ptr[props_idx]; | 233 | props[props_idx] = &prop_ptr[props_idx]; |
| 228 | props[props_idx]->name = SmRestartCommand; | 234 | props[props_idx]->name = SmRestartCommand; |
| 229 | props[props_idx]->type = SmLISTofARRAY8; | 235 | props[props_idx]->type = SmLISTofARRAY8; |
| 230 | props[props_idx]->num_vals = 3; /* /path/to/emacs, --smid=xxx --no-splash */ | 236 | props[props_idx]->num_vals = 3; /* /path/to/emacs, --smid=xxx --no-splash */ |
| 231 | props[props_idx]->vals = &values[val_idx]; | 237 | props[props_idx]->vals = &values[val_idx]; |
| 232 | props[props_idx]->vals[0].length = strlen (emacs_program); | 238 | props[props_idx]->vals[0].length = strlen (emacs_program); |
| 233 | props[props_idx]->vals[0].value = emacs_program; | 239 | props[props_idx]->vals[0].value = emacs_program; |
| @@ -244,7 +250,7 @@ smc_save_yourself_CB (smcConn, | |||
| 244 | val_idx += 3; | 250 | val_idx += 3; |
| 245 | ++props_idx; | 251 | ++props_idx; |
| 246 | 252 | ||
| 247 | /* User id */ | 253 | /* User id. */ |
| 248 | props[props_idx] = &prop_ptr[props_idx]; | 254 | props[props_idx] = &prop_ptr[props_idx]; |
| 249 | props[props_idx]->name = SmUserID; | 255 | props[props_idx]->name = SmUserID; |
| 250 | props[props_idx]->type = SmARRAY8; | 256 | props[props_idx]->type = SmARRAY8; |
| @@ -254,7 +260,7 @@ smc_save_yourself_CB (smcConn, | |||
| 254 | props[props_idx]->vals[0].value = SDATA (Vuser_login_name); | 260 | props[props_idx]->vals[0].value = SDATA (Vuser_login_name); |
| 255 | ++props_idx; | 261 | ++props_idx; |
| 256 | 262 | ||
| 257 | /* The current directory property, not mandatory */ | 263 | /* The current directory property, not mandatory. */ |
| 258 | #ifdef HAVE_GETCWD | 264 | #ifdef HAVE_GETCWD |
| 259 | if (getcwd (cwd, MAXPATHLEN+1) != 0) | 265 | if (getcwd (cwd, MAXPATHLEN+1) != 0) |
| 260 | #else | 266 | #else |
| @@ -276,18 +282,19 @@ smc_save_yourself_CB (smcConn, | |||
| 276 | 282 | ||
| 277 | xfree (smid_opt); | 283 | xfree (smid_opt); |
| 278 | 284 | ||
| 279 | /* See if we maybe shall interact with the user. */ | 285 | /* See if we maybe shall interact with the user. */ |
| 280 | if (interactStyle != SmInteractStyleAny | 286 | if (interactStyle != SmInteractStyleAny |
| 281 | || ! shutdown | 287 | || ! shutdown |
| 282 | || saveType == SmSaveLocal | 288 | || saveType == SmSaveLocal |
| 283 | || ! SmcInteractRequest (smcConn, SmDialogNormal, smc_interact_CB, 0)) | 289 | || ! SmcInteractRequest (smcConn, SmDialogNormal, smc_interact_CB, 0)) |
| 284 | { | 290 | { |
| 285 | /* No interaction, we are done saving ourself. */ | 291 | /* No interaction, we are done saving ourself. */ |
| 286 | SmcSaveYourselfDone (smcConn, True); | 292 | SmcSaveYourselfDone (smcConn, True); |
| 287 | } | 293 | } |
| 288 | } | 294 | } |
| 289 | 295 | ||
| 290 | /* According to the SM specification, this shall close the connection */ | 296 | /* According to the SM specification, this shall close the connection. */ |
| 297 | |||
| 291 | static void | 298 | static void |
| 292 | smc_die_CB (smcConn, clientData) | 299 | smc_die_CB (smcConn, clientData) |
| 293 | SmcConn smcConn; | 300 | SmcConn smcConn; |
| @@ -301,7 +308,8 @@ smc_die_CB (smcConn, clientData) | |||
| 301 | According to the SM specification, we should not interact with the | 308 | According to the SM specification, we should not interact with the |
| 302 | user between smc_save_yourself_CB is called and until smc_save_complete_CB | 309 | user between smc_save_yourself_CB is called and until smc_save_complete_CB |
| 303 | is called. It seems like a lot of job to implement this and it doesn't | 310 | is called. It seems like a lot of job to implement this and it doesn't |
| 304 | even seem necessary. */ | 311 | even seem necessary. */ |
| 312 | |||
| 305 | static void | 313 | static void |
| 306 | smc_save_complete_CB (smcConn, clientData) | 314 | smc_save_complete_CB (smcConn, clientData) |
| 307 | SmcConn smcConn; | 315 | SmcConn smcConn; |
| @@ -319,7 +327,8 @@ smc_shutdown_cancelled_CB (smcConn, clientData) | |||
| 319 | } | 327 | } |
| 320 | 328 | ||
| 321 | /* Error handlers for SM and ICE. We don't want to exit Emacs just | 329 | /* Error handlers for SM and ICE. We don't want to exit Emacs just |
| 322 | because there is some error in the session management. */ | 330 | because there is some error in the session management. */ |
| 331 | |||
| 323 | static void | 332 | static void |
| 324 | smc_error_handler (smcConn, | 333 | smc_error_handler (smcConn, |
| 325 | swap, | 334 | swap, |
| @@ -336,7 +345,7 @@ smc_error_handler (smcConn, | |||
| 336 | int severity; | 345 | int severity; |
| 337 | SmPointer values; | 346 | SmPointer values; |
| 338 | { | 347 | { |
| 339 | /* Empty */ | 348 | /* Empty */ |
| 340 | } | 349 | } |
| 341 | 350 | ||
| 342 | static void | 351 | static void |
| @@ -355,7 +364,7 @@ ice_error_handler (iceConn, | |||
| 355 | int severity; | 364 | int severity; |
| 356 | IcePointer values; | 365 | IcePointer values; |
| 357 | { | 366 | { |
| 358 | /* Empty */ | 367 | /* Empty */ |
| 359 | } | 368 | } |
| 360 | 369 | ||
| 361 | 370 | ||
| @@ -363,12 +372,13 @@ static void | |||
| 363 | ice_io_error_handler (iceConn) | 372 | ice_io_error_handler (iceConn) |
| 364 | IceConn iceConn; | 373 | IceConn iceConn; |
| 365 | { | 374 | { |
| 366 | /* Connection probably gone. */ | 375 | /* Connection probably gone. */ |
| 367 | ice_fd = -1; | 376 | ice_fd = -1; |
| 368 | } | 377 | } |
| 369 | 378 | ||
| 370 | /* This is called when the ICE connection is created or closed. The SM library | 379 | /* This is called when the ICE connection is created or closed. The SM library |
| 371 | uses ICE as it transport protocol. */ | 380 | uses ICE as it transport protocol. */ |
| 381 | |||
| 372 | static void | 382 | static void |
| 373 | ice_conn_watch_CB (iceConn, clientData, opening, watchData) | 383 | ice_conn_watch_CB (iceConn, clientData, opening, watchData) |
| 374 | IceConn iceConn; | 384 | IceConn iceConn; |
| @@ -401,6 +411,7 @@ ice_conn_watch_CB (iceConn, clientData, opening, watchData) | |||
| 401 | } | 411 | } |
| 402 | 412 | ||
| 403 | /* Create the client leader window. */ | 413 | /* Create the client leader window. */ |
| 414 | |||
| 404 | static void | 415 | static void |
| 405 | create_client_leader_window (dpyinfo, client_id) | 416 | create_client_leader_window (dpyinfo, client_id) |
| 406 | struct x_display_info *dpyinfo; | 417 | struct x_display_info *dpyinfo; |
| @@ -427,7 +438,8 @@ create_client_leader_window (dpyinfo, client_id) | |||
| 427 | dpyinfo->client_leader_window = w; | 438 | dpyinfo->client_leader_window = w; |
| 428 | } | 439 | } |
| 429 | 440 | ||
| 430 | /* Try to open a connection to the session manager. */ | 441 | /* Try to open a connection to the session manager. */ |
| 442 | |||
| 431 | void | 443 | void |
| 432 | x_session_initialize (dpyinfo) | 444 | x_session_initialize (dpyinfo) |
| 433 | struct x_display_info *dpyinfo; | 445 | struct x_display_info *dpyinfo; |
| @@ -439,17 +451,17 @@ x_session_initialize (dpyinfo) | |||
| 439 | int name_len = 0; | 451 | int name_len = 0; |
| 440 | 452 | ||
| 441 | /* Check if we where started by the session manager. If so, we will | 453 | /* Check if we where started by the session manager. If so, we will |
| 442 | have a previous id. */ | 454 | have a previous id. */ |
| 443 | if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) | 455 | if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) |
| 444 | previous_id = SDATA (Vx_session_previous_id); | 456 | previous_id = SDATA (Vx_session_previous_id); |
| 445 | 457 | ||
| 446 | /* Construct the path to the Emacs program. */ | 458 | /* Construct the path to the Emacs program. */ |
| 447 | if (! EQ (Vinvocation_directory, Qnil)) | 459 | if (! EQ (Vinvocation_directory, Qnil)) |
| 448 | name_len += strlen (SDATA (Vinvocation_directory)); | 460 | name_len += strlen (SDATA (Vinvocation_directory)); |
| 449 | name_len += strlen (SDATA (Vinvocation_name)); | 461 | name_len += strlen (SDATA (Vinvocation_name)); |
| 450 | 462 | ||
| 451 | /* This malloc will not be freed, but it is only done once, and hopefully | 463 | /* This malloc will not be freed, but it is only done once, and hopefully |
| 452 | not very large */ | 464 | not very large */ |
| 453 | emacs_program = xmalloc (name_len + 1); | 465 | emacs_program = xmalloc (name_len + 1); |
| 454 | emacs_program[0] = '\0'; | 466 | emacs_program[0] = '\0'; |
| 455 | 467 | ||
| @@ -458,7 +470,7 @@ x_session_initialize (dpyinfo) | |||
| 458 | strcat (emacs_program, SDATA (Vinvocation_name)); | 470 | strcat (emacs_program, SDATA (Vinvocation_name)); |
| 459 | 471 | ||
| 460 | /* The SM protocol says all callbacks are mandatory, so set up all | 472 | /* The SM protocol says all callbacks are mandatory, so set up all |
| 461 | here and in the mask passed to SmcOpenConnection */ | 473 | here and in the mask passed to SmcOpenConnection. */ |
| 462 | callbacks.save_yourself.callback = smc_save_yourself_CB; | 474 | callbacks.save_yourself.callback = smc_save_yourself_CB; |
| 463 | callbacks.save_yourself.client_data = 0; | 475 | callbacks.save_yourself.client_data = 0; |
| 464 | callbacks.die.callback = smc_die_CB; | 476 | callbacks.die.callback = smc_die_CB; |
| @@ -468,17 +480,17 @@ x_session_initialize (dpyinfo) | |||
| 468 | callbacks.shutdown_cancelled.callback = smc_shutdown_cancelled_CB; | 480 | callbacks.shutdown_cancelled.callback = smc_shutdown_cancelled_CB; |
| 469 | callbacks.shutdown_cancelled.client_data = 0; | 481 | callbacks.shutdown_cancelled.client_data = 0; |
| 470 | 482 | ||
| 471 | /* Set error handlers. */ | 483 | /* Set error handlers. */ |
| 472 | SmcSetErrorHandler (smc_error_handler); | 484 | SmcSetErrorHandler (smc_error_handler); |
| 473 | IceSetErrorHandler (ice_error_handler); | 485 | IceSetErrorHandler (ice_error_handler); |
| 474 | IceSetIOErrorHandler (ice_io_error_handler); | 486 | IceSetIOErrorHandler (ice_io_error_handler); |
| 475 | 487 | ||
| 476 | /* Install callback for when connection status changes. */ | 488 | /* Install callback for when connection status changes. */ |
| 477 | IceAddConnectionWatch (ice_conn_watch_CB, 0); | 489 | IceAddConnectionWatch (ice_conn_watch_CB, 0); |
| 478 | 490 | ||
| 479 | /* Open the connection to the session manager. A failure is not | 491 | /* Open the connection to the session manager. A failure is not |
| 480 | critical, it usually means that no session manager is running. | 492 | critical, it usually means that no session manager is running. |
| 481 | The errorstring is here for debugging. */ | 493 | The errorstring is here for debugging. */ |
| 482 | smc_conn = SmcOpenConnection (NULL, NULL, 1, 0, | 494 | smc_conn = SmcOpenConnection (NULL, NULL, 1, 0, |
| 483 | (SmcSaveYourselfProcMask| | 495 | (SmcSaveYourselfProcMask| |
| 484 | SmcDieProcMask| | 496 | SmcDieProcMask| |