diff options
| author | Miles Bader | 2007-08-13 13:48:35 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-08-13 13:48:35 +0000 |
| commit | b2e6b10fe2d40020a75ab0025af98a4abf339cd2 (patch) | |
| tree | db265e5ea93cdc13f8e3b54ed5c7ad2869d50ec9 /lisp | |
| parent | 905350bef3ebc514a418658dd155c1d062664b56 (diff) | |
| parent | 37cc095b6a175fb5a2fb18fa029eaf3aa3b3fa53 (diff) | |
| download | emacs-b2e6b10fe2d40020a75ab0025af98a4abf339cd2.tar.gz emacs-b2e6b10fe2d40020a75ab0025af98a4abf339cd2.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 846-851)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 88-92)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 242-244)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-246
Diffstat (limited to 'lisp')
141 files changed, 2357 insertions, 727 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8c3af441f34..8daf2daf71f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,194 @@ | |||
| 1 | 2007-08-13 Nick Roberts <nickrob@snap.net.nz> | ||
| 2 | |||
| 3 | * progmodes/gdb-ui.el (gdb-send): Handle CTRL-D more carefully. | ||
| 4 | |||
| 5 | 2007-08-12 Richard Stallman <rms@gnu.org> | ||
| 6 | |||
| 7 | * pcvs.el (cvs-reread-cvsrc, cvs-checkout, cvs-mode-checkout) | ||
| 8 | (cvs-execute-single-file): Use new name split-string-and-unquote. | ||
| 9 | (cvs-header-msg): Use new name combine-and-quote-strings. | ||
| 10 | |||
| 11 | * emulation/vi.el (vi-next-line): Ignore return value of line-move. | ||
| 12 | |||
| 13 | * progmodes/gud.el (gud-common-init): Use new name | ||
| 14 | split-string-and-unquote. | ||
| 15 | |||
| 16 | * progmodes/flymake.el (flymake-err-line-patterns): Fix infloop | ||
| 17 | in javac regexp. | ||
| 18 | |||
| 19 | * pcvs-util.el (cvs-qtypedesc-strings): Use new names | ||
| 20 | combine-and-quote-strings and split-string-and-unquote. | ||
| 21 | |||
| 22 | * subr.el (combine-and-quote-strings): Renamed from strings->string. | ||
| 23 | (split-string-and-unquote): Renamed from string->strings. | ||
| 24 | |||
| 25 | 2007-08-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 26 | |||
| 27 | * log-view.el (log-view-font-lock-keywords): Use `eval' so as to adapt | ||
| 28 | to buffer-local settings. | ||
| 29 | |||
| 30 | * emacs-lisp/backquote.el (backquote-delay-process): New function. | ||
| 31 | (backquote-process): Add internal arg `level'. Use the two to | ||
| 32 | correctly handle nested backquotes. | ||
| 33 | |||
| 34 | 2007-08-09 Riccardo Murri <riccardo.murri@gmail.com> | ||
| 35 | |||
| 36 | * vc-bzr.el (vc-bzr-registered): Use \0 instead of literal NULs. | ||
| 37 | (vc-bzr-state-words): Add "kind changed" state word. | ||
| 38 | (vc-bzr-status): New function. Return Bzr idea of file status, | ||
| 39 | which is different from VC's. | ||
| 40 | (vc-bzr-state): Use vc-bzr-status. | ||
| 41 | (vc-workfile-unchanged-p): Use vc-bzr-status. | ||
| 42 | (vc-bzr-revert): Use synchronous process; expect exitcode 0. | ||
| 43 | (vc-dired-state): Process "kind changed" state word. | ||
| 44 | |||
| 45 | 2007-08-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 46 | |||
| 47 | * vc-hooks.el (vc-default-find-file-not-found-hook): Do nothing. | ||
| 48 | |||
| 49 | * vc-rcs.el (vc-rcs-find-file-not-found-hook): | ||
| 50 | Move from vc-default-find-file-not-found-hook. | ||
| 51 | |||
| 52 | 2007-08-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 53 | |||
| 54 | * man.el: Remove spurious * in docstrings. | ||
| 55 | Merge defvars and toplevel setq-defaults. | ||
| 56 | (Man-highlight-references0): Limit=nil rather than point-max. | ||
| 57 | (Man-mode-map): Move initialization into the declaration. | ||
| 58 | (Man-strip-page-headers, Man-unindent): Use dolist & inhibit-read-only. | ||
| 59 | (Man-view-header-file): Use expand-file-name rather than concat. | ||
| 60 | (Man-notify-when-ready, Man-bgproc-sentinel): Use with-current-buffer. | ||
| 61 | |||
| 62 | * man.el (Man-next-section): Make sure we do not move backward. | ||
| 63 | |||
| 64 | 2007-08-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 65 | |||
| 66 | * files.el (auto-mode-alist): Use the purecopied text (duh!). | ||
| 67 | |||
| 68 | 2007-08-08 Glenn Morris <rgm@gnu.org> | ||
| 69 | |||
| 70 | * Replace `iff' in doc-strings and comments. | ||
| 71 | |||
| 72 | 2007-08-08 Martin Rudalics <rudalics@gmx.at> | ||
| 73 | |||
| 74 | * dired.el (dired-pop-to-buffer): | ||
| 75 | * mouse-drag.el (mouse-drag-should-do-col-scrolling): | ||
| 76 | * calendar/calendar.el (generate-calendar-window): | ||
| 77 | * progmodes/compile.el (compilation-set-window-height): | ||
| 78 | * textmodes/two-column.el (2C-two-columns, 2C-merge): | ||
| 79 | Use window-full-width-p instead of comparing frame-width and | ||
| 80 | window-width. | ||
| 81 | |||
| 82 | * progmodes/compile.el (compilation-find-buffer): Remove extra | ||
| 83 | argument in call to compilation-buffer-internal-p. | ||
| 84 | |||
| 85 | 2007-08-07 Tom Tromey <tromey@redhat.com> | ||
| 86 | |||
| 87 | * progmodes/tcl.el (tcl-indent-level, tcl-continued-indent-level): | ||
| 88 | Add safe-local-variable property. | ||
| 89 | |||
| 90 | 2007-08-07 Chong Yidong <cyd@stupidchicken.com> | ||
| 91 | |||
| 92 | * image-mode.el (image-toggle-display): Use image-refresh. | ||
| 93 | |||
| 94 | 2007-08-07 Riccardo Murri <riccardo.murri@gmail.com> | ||
| 95 | |||
| 96 | * vc-bzr.el: Remove comments about vc-bzr.el being a modified | ||
| 97 | unofficial version. | ||
| 98 | (vc-bzr-command): Remove redundant setting of process-connection-type. | ||
| 99 | (vc-bzr-admin-checkout-format-file): Add autoload. | ||
| 100 | (vc-bzr-root-dir): Remove in favor of vc-bzr-root. | ||
| 101 | (vc-bzr-root): Switch to implementation of vc-bzr-root-dir. | ||
| 102 | (vc-bzr-registered): Compare dirstate format tag with known good | ||
| 103 | value, abort parsing if match fails. Warn user in docstring. | ||
| 104 | (vc-bzr-workfile-version): Case for different Bzr branch formats. | ||
| 105 | See bzrlib/branch.py in Bzr sources. | ||
| 106 | (vc-bzr-diff): First argument FILES may be a string rather than a list. | ||
| 107 | (vc-bzr-shell-command): Remove in favor of | ||
| 108 | vc-bzr-command-discarding-stderr. | ||
| 109 | (vc-bzr-command-discarding-stderr): New function. | ||
| 110 | |||
| 111 | 2007-08-06 Riccardo Murri <riccardo.murri@gmail.com> | ||
| 112 | |||
| 113 | * vc-bzr.el (vc-bzr-registered): Gracefully handle missing "bzr" | ||
| 114 | program, and return nil | ||
| 115 | (vc-bzr-state): Gracefully handle missing "bzr" program, and return nil. | ||
| 116 | (vc-bzr-state): Look for path names relative to the repository | ||
| 117 | root after status keyword. | ||
| 118 | (vc-bzr-file-name-relative): New function. | ||
| 119 | (vc-bzr-admin-dirname): Reinstate, as other vc-bzr-admin-... paths | ||
| 120 | depend on it. | ||
| 121 | (vc-bzr-admin-dirname, ...-checkout-format-file) | ||
| 122 | (...-branch-format-file, ...-revhistory): Paths to some Bzr internal | ||
| 123 | files that we now parse directly for speed. | ||
| 124 | (vc-bzr-root-dir): Use `vc-bzr-admin-checkout-format-file' as witness. | ||
| 125 | (vc-bzr-registered): Only parse vc-bzr-admin-dirstate file if it exists. | ||
| 126 | (vc-bzr-state): "bzr status" successful only if exitcode is 0 | ||
| 127 | (vc-bzr-root): Use `vc-bzr-shell-command'. Stderr may contain | ||
| 128 | Bzr warnings, so we must discard it. | ||
| 129 | (vc-bzr-workfile-version): Speedup counting lines from | ||
| 130 | `vc-bzr-admin-revhistory' file, but fallback to spawning "bzr revno" | ||
| 131 | if that file doesn't exist. | ||
| 132 | (vc-bzr-responsible-p): Use `vc-bzr-root' instead of | ||
| 133 | `vc-bzr-root-dir' for speed. Add `vc-bzr-admin-dirname' | ||
| 134 | (not ".bzr"!) to `vc-directory-exclusion-list' | ||
| 135 | (vc-bzr-shell-command): New function. | ||
| 136 | |||
| 137 | 2007-08-06 Tom Tromey <tromey@redhat.com> | ||
| 138 | |||
| 139 | * diff-mode.el (diff-unified->context, diff-reverse-direction) | ||
| 140 | (diff-fixup-modifs): Typo in docstring. | ||
| 141 | |||
| 142 | 2007-08-06 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 143 | |||
| 144 | * emulation/tpu-edt.el (tpu-current-line): Use posn-at-point and | ||
| 145 | count-screen-lines. | ||
| 146 | (tpu-edt-off): Disable relevant pieces of advice. | ||
| 147 | |||
| 148 | * emulation/tpu-extras.el (tpu-before-save-hook): Rename from | ||
| 149 | tpu-write-file-hook. Activate it with add-hook on buffer-save-hook. | ||
| 150 | (newline, newline-and-indent, do-auto-fill): Use advice instead of | ||
| 151 | redefining the function. | ||
| 152 | (tpu-set-scroll-margins): Activate the pieces of advice. | ||
| 153 | |||
| 154 | 2007-08-06 Martin Rudalics <rudalics@gmx.at> | ||
| 155 | |||
| 156 | * help.el (resize-temp-buffer-window): Use window-full-width-p | ||
| 157 | instead of comparing frame-width and window-width. | ||
| 158 | |||
| 159 | 2007-08-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 160 | |||
| 161 | * emacs-lisp/autoload.el (autoload-print-form): Use print-quoted. | ||
| 162 | |||
| 163 | 2007-08-12 Richard Stallman <rms@gnu.org> | ||
| 164 | |||
| 165 | * progmodes/sh-script.el (sh): Delete group `unix'. | ||
| 166 | |||
| 167 | * progmodes/gud.el (gud): Change to group `processes'. | ||
| 168 | |||
| 169 | 2007-08-11 Glenn Morris <rgm@gnu.org> | ||
| 170 | |||
| 171 | * progmodes/compile.el (compilation-buffer-name): Don't check | ||
| 172 | compilation-arguments. It is superfluous, and the variable isn't | ||
| 173 | even set when this function is called. | ||
| 174 | |||
| 175 | 2007-08-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 176 | |||
| 177 | * term/mac-win.el (mac-ae-reopen-application): New function. | ||
| 178 | (mac-apple-event-map): Bind "reopen application" Apple event to it. | ||
| 179 | |||
| 180 | 2007-08-10 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 181 | |||
| 182 | * textmodes/tex-mode.el (tex-font-lock-unfontify-region): Fix to | ||
| 183 | take tex-font-script-display into account. | ||
| 184 | (tex-font-script-display, tex-font-lock-suscript): Change from a cons | ||
| 185 | cell to a list of 2 elements to simplify the unfontify code. | ||
| 186 | |||
| 187 | 2007-08-09 Edward O'Connor <hober0@gmail.com> (tiny change) | ||
| 188 | |||
| 189 | * url/url-auth.el (url-basic-auth): When prompting for username | ||
| 190 | and password, default to the username and password in the URL. | ||
| 191 | |||
| 1 | 2007-08-08 Vinicius Jose Latorre <viniciusjl@ig.com.br> | 192 | 2007-08-08 Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 2 | 193 | ||
| 3 | * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix. | 194 | * ps-print.el (ps-default-fg, ps-default-bg): Docstring fix. |
| @@ -5,11 +196,177 @@ | |||
| 5 | ps-print-color-p is neither nil nor black-white. Reported by Christian | 196 | ps-print-color-p is neither nil nor black-white. Reported by Christian |
| 6 | Schlauer <cs-muelleimer-rubbish.bin@arcor.de>. | 197 | Schlauer <cs-muelleimer-rubbish.bin@arcor.de>. |
| 7 | 198 | ||
| 199 | 2007-08-08 Andreas Schwab <schwab@suse.de> | ||
| 200 | |||
| 201 | * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook): Check for | ||
| 202 | self-insert-command, not self-insert. | ||
| 203 | |||
| 204 | 2007-08-08 Glenn Morris <rgm@gnu.org> | ||
| 205 | |||
| 206 | * emacs-lisp/eldoc.el (eldoc-get-fnsym-args-string): Make second | ||
| 207 | argument optional, for backwards compatibility, and only highlight | ||
| 208 | args when present. Fix symbol name typo (doc/args). | ||
| 209 | |||
| 210 | * help-mode.el (help-make-xrefs): Search for symbol constituents, | ||
| 211 | rather than just `-'. | ||
| 212 | |||
| 213 | 2007-08-07 Jay Belanger <jay.p.belanger@gmail.com> | ||
| 214 | |||
| 215 | * calc/calc-units.el (calc-convert-temperature): | ||
| 216 | Use `/' to create fractions. | ||
| 217 | |||
| 218 | 2007-08-07 Michael Albinus <michael.albinus@gmx.de> | ||
| 219 | |||
| 220 | * net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more | ||
| 221 | global matching. | ||
| 222 | (tramp-handle-shell-command): Handle OUTPUT-BUFFER and | ||
| 223 | ERROR-BUFFER more robust. Display output. | ||
| 224 | (tramp-file-name-handler): Add a connection property when we found | ||
| 225 | a foreign file name handler. This allows backends like ftp to | ||
| 226 | profit also from usr/host name completion based on connection | ||
| 227 | cache. | ||
| 228 | (tramp-send-command-and-read): Search for trash after the regexp | ||
| 229 | until eol only. In XEmacs, there is a problem with \n. | ||
| 230 | |||
| 231 | * net/tramp-cache.el (top): Read persistent connection history | ||
| 232 | when cache is empty. | ||
| 233 | |||
| 234 | 2007-08-07 Nic Ferrier <nferrier@tapsellferrier.co.uk> (tiny change) | ||
| 235 | |||
| 236 | * net/tramp.el (tramp-handle-process-file): Fix bug inserting | ||
| 237 | resulting output. | ||
| 238 | |||
| 239 | 2007-08-07 Sam Steingold <sds@gnu.org> | ||
| 240 | |||
| 241 | * progmodes/compile.el (compilation-start): Pass nil as startfile | ||
| 242 | to comint-exec. | ||
| 243 | |||
| 244 | 2007-08-07 Chong Yidong <cyd@stupidchicken.com> | ||
| 245 | |||
| 246 | * longlines.el (longlines-decoded): New variable. | ||
| 247 | (longlines-mode): Avoid encoding or decoding the buffer twice. | ||
| 248 | |||
| 249 | 2007-08-07 Martin Rudalics <rudalics@gmx.at> | ||
| 250 | |||
| 251 | * format.el (format-insert-file): Make sure that at most one undo | ||
| 252 | entry is recorded for the insertion. Inhibit point-motion and | ||
| 253 | modification hooks around call to insert-file-contents. | ||
| 254 | |||
| 255 | 2007-08-07 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 256 | |||
| 257 | * vc.el (vc-annotate): Select temp-buffer before running vc-exec-after. | ||
| 258 | Select the buffer's window before moving point. | ||
| 259 | |||
| 260 | 2007-08-07 Richard Stallman <rms@gnu.org> | ||
| 261 | |||
| 262 | * term.el (term): Remove parent group `unix'. | ||
| 263 | |||
| 264 | * simple.el (default-indent-new-line): New function. | ||
| 265 | It calls comment-line-break-function if there are comments. | ||
| 266 | (do-auto-fill): Use that. | ||
| 267 | |||
| 268 | 2007-08-07 Ivan Kanis <apple@kanis.eu> | ||
| 269 | |||
| 270 | * time.el (display-time-world-mode, display-time-world-display) | ||
| 271 | (display-time-world, display-time-world-list) | ||
| 272 | (display-time-world-time-format, display-time-world-buffer-name) | ||
| 273 | (display-time-world-timer-enable) | ||
| 274 | (display-time-world-timer-second, display-time-world-mode-map): | ||
| 275 | New. | ||
| 276 | |||
| 277 | 2007-08-07 Sean O'Rourke <sorourke@cs.ucsd.edu> | ||
| 278 | |||
| 279 | * complete.el (PC-lisp-complete-symbol): Complete symbol around point. | ||
| 280 | (PC-do-completion): Add "acronym completion" for symbols and | ||
| 281 | filenames, so e.g. "mvbl" expands to "make-variable-buffer-local". | ||
| 282 | |||
| 283 | 2007-08-06 Sam Steingold <sds@gnu.org> | ||
| 284 | |||
| 285 | * mouse.el (mouse-buffer-menu): Pass mode-name through | ||
| 286 | format-mode-line because it may be a list, | ||
| 287 | e.g., (sgml-xml-mode "XML" "SGML"), and not a string. | ||
| 288 | |||
| 8 | 2007-08-06 Vinicius Jose Latorre <viniciusig@ig.com.br> | 289 | 2007-08-06 Vinicius Jose Latorre <viniciusig@ig.com.br> |
| 9 | 290 | ||
| 291 | * printing.el (pr-update-menus): Docstring fix. | ||
| 292 | |||
| 293 | 2007-08-06 Jason Rumney <jasonr@gnu.org> | ||
| 294 | |||
| 295 | * menu-bar.el (menu-bar-vc-filter): Use vc-call-backend. | ||
| 296 | |||
| 297 | * vc-hooks.el (vc-call): Add doc string. | ||
| 298 | |||
| 299 | 2007-08-06 Michael Albinus <michael.albinus@gmx.de> | ||
| 300 | |||
| 301 | * net/ange-ftp.el (ange-ftp-hook-function): Catch also errors in | ||
| 302 | process-filter. | ||
| 303 | |||
| 304 | 2007-08-06 Kenichi Handa <handa@m17n.org> | ||
| 305 | |||
| 306 | * international/quail.el: Wrap (require 'help-mode) by | ||
| 307 | eval-when-compile. | ||
| 308 | (quail-help-init): New function. | ||
| 309 | (quail-help): Call quail-help-init. | ||
| 310 | (quail-store-decode-map-key): Change it to a function. | ||
| 311 | |||
| 312 | 2007-08-05 Jason Rumney <jasonr@gnu.org> | ||
| 313 | |||
| 314 | * vc.el (vc-rollback): Add norevert argument back. | ||
| 315 | (vc-revert-buffer): Add back as obsolete alias. | ||
| 316 | |||
| 317 | 2007-08-05 Peter Povinec <ppovinec@yahoo.com> (tiny change) | ||
| 318 | |||
| 319 | * term.el: Honor term-default-fg-color and term-default-bg-color | ||
| 320 | settings when modifying term-current-face. | ||
| 321 | (term-default-fg-color, term-default-bg-color): Initialize from | ||
| 322 | default term-current-face. | ||
| 323 | (term-mode, term-reset-terminal): Set term-current-face with | ||
| 324 | term-default-fg-color and term-default-bg-color. | ||
| 325 | (term-handle-colors-array): term-current-face has term-default-fg-color | ||
| 326 | and term-default-bg-color after reset escape sequence. | ||
| 327 | (term-handle-colors-array): Set term-current-color with | ||
| 328 | term-default-fg/bg-color instead of ansi-term-color-vector when the | ||
| 329 | index (term-ansi-current-color or term-ansi-current-bg-color) is zero. | ||
| 330 | |||
| 331 | 2007-08-05 Jay Belanger <belanger@localhost.localdomain> | ||
| 332 | |||
| 333 | * calc/calc-nlfit.el (math-nlfit-curve): | ||
| 334 | Remove unnecessary variables. | ||
| 335 | (math-nlfit-givens): Let bind free variables. | ||
| 336 | |||
| 337 | 2007-08-05 Vinicius Jose Latorre <viniciusig@ig.com.br> | ||
| 338 | |||
| 10 | * printing.el: Require lpr and ps-print when loading printing package. | 339 | * printing.el: Require lpr and ps-print when loading printing package. |
| 11 | Reported by Glenn Morris <rgm@gnu.org>. | 340 | Reported by Glenn Morris <rgm@gnu.org>. |
| 12 | (pr-update-menus): Docstring fix. | 341 | |
| 342 | 2007-08-05 Michael Albinus <michael.albinus@gmx.de> | ||
| 343 | |||
| 344 | * files.el (set-auto-mode): Handle also remote files wrt | ||
| 345 | `auto-mode-alist'. | ||
| 346 | |||
| 347 | 2007-08-04 Jay Belanger <belanger@localhost.localdomain> | ||
| 348 | |||
| 349 | * calc/calcalg3.el (calc-curve-fit): Add support for nonlinear | ||
| 350 | curves and plotting. | ||
| 351 | |||
| 352 | * calc/calc-nlfit.el: New file. | ||
| 353 | |||
| 354 | 2007-08-04 Glenn Morris <rgm@gnu.org> | ||
| 355 | |||
| 356 | * autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is | ||
| 357 | zero, not nil, when the library is first loaded. Check for a file | ||
| 358 | that has been modified on disk. | ||
| 359 | |||
| 360 | * progmodes/cperl-mode.el (cperl-compilation-error-regexp-alist): | ||
| 361 | Remove duplicate defvar preventing initialization. | ||
| 362 | (cperl-mode): Fix compilation-error-regexp-alist-alist setting. | ||
| 363 | |||
| 364 | 2007-08-03 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 365 | |||
| 366 | * diff-mode.el (diff-font-lock-keywords): Fix up false positives. | ||
| 367 | (diff-beginning-of-file): Adjust to the fact that diff-file-header-re | ||
| 368 | may match up to 4 lines. | ||
| 369 | (diff-beginning-of-file-and-junk): Rewrite. | ||
| 13 | 370 | ||
| 14 | 2007-08-03 Vinicius Jose Latorre <viniciusjl@ig.com.br> | 371 | 2007-08-03 Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 15 | 372 | ||
| @@ -18,6 +375,11 @@ | |||
| 18 | (deactivate-mark): Replace (defvar VAR nil) by (defvar VAR). | 375 | (deactivate-mark): Replace (defvar VAR nil) by (defvar VAR). |
| 19 | (pr-global-menubar): Fix code. | 376 | (pr-global-menubar): Fix code. |
| 20 | 377 | ||
| 378 | 2007-08-03 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 379 | |||
| 380 | * term.el (term-erase-in-display): Fix case when point is not at | ||
| 381 | the beginning of the line. | ||
| 382 | |||
| 21 | 2007-08-03 Jay Belanger <jay.p.belanger@gmail.com> | 383 | 2007-08-03 Jay Belanger <jay.p.belanger@gmail.com> |
| 22 | 384 | ||
| 23 | * calc/calc-ext.el (math-get-value,math-get-sdev) | 385 | * calc/calc-ext.el (math-get-value,math-get-sdev) |
| @@ -38,7 +400,7 @@ | |||
| 38 | * vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info) | 400 | * vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info) |
| 39 | (vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'. | 401 | (vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'. |
| 40 | 402 | ||
| 41 | 2007-08-02 Richard Stallman <rms@gnu.org> | 403 | 2007-08-03 Richard Stallman <rms@gnu.org> |
| 42 | 404 | ||
| 43 | * mail/rmailsum.el (rmail-make-summary-line): Find end of msg number | 405 | * mail/rmailsum.el (rmail-make-summary-line): Find end of msg number |
| 44 | to update deleted flag. | 406 | to update deleted flag. |
| @@ -58,13 +420,13 @@ | |||
| 58 | buffer immediately if suitable. | 420 | buffer immediately if suitable. |
| 59 | (compile, compilation-buffer-name, compilation-start): Doc fixes. | 421 | (compile, compilation-buffer-name, compilation-start): Doc fixes. |
| 60 | 422 | ||
| 61 | 2007-07-31 Daiki Ueno <ueno@unixuser.org> | 423 | 2007-08-03 Daiki Ueno <ueno@unixuser.org> |
| 62 | 424 | ||
| 63 | * faces.el (face-normalize-spec): New function. | 425 | * faces.el (face-normalize-spec): New function. |
| 64 | (frame-set-background-mode): Normalize face-spec before calling | 426 | (frame-set-background-mode): Normalize face-spec before calling |
| 65 | face-spec-match-p. | 427 | face-spec-match-p. |
| 66 | 428 | ||
| 67 | 2007-07-31 Stefan Monnier <monnier@iro.umontreal.ca> | 429 | 2007-08-03 Stefan Monnier <monnier@iro.umontreal.ca> |
| 68 | 430 | ||
| 69 | * server.el (server-window): Add switch-to-buffer-other-frame option. | 431 | * server.el (server-window): Add switch-to-buffer-other-frame option. |
| 70 | 432 | ||
| @@ -118,16 +480,15 @@ | |||
| 118 | (fortran-mode): Use fortran-line-length, and | 480 | (fortran-mode): Use fortran-line-length, and |
| 119 | fortran-font-lock-syntactic-keywords as a function. Add a | 481 | fortran-font-lock-syntactic-keywords as a function. Add a |
| 120 | hack-local-variables-hook function. | 482 | hack-local-variables-hook function. |
| 121 | (fortran-line-length, fortran-hack-local-variables): New | 483 | (fortran-line-length, fortran-hack-local-variables): New functions. |
| 122 | functions. | 484 | (fortran-window-create, fortran-strip-sequence-nos): Doc fix. |
| 123 | (fortran-window-create, fortran-strip-sequence-nos): Doc fix. Use | 485 | Use fortran-line-length rather than 72. |
| 124 | fortran-line-length rather than 72. | ||
| 125 | (fortran-window-create-momentarily): Doc fix. | 486 | (fortran-window-create-momentarily): Doc fix. |
| 126 | 487 | ||
| 127 | 2007-07-31 Drew Adams <drew.adams@oracle.com> (tiny change) | 488 | 2007-07-31 Drew Adams <drew.adams@oracle.com> (tiny change) |
| 128 | 489 | ||
| 129 | * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix | 490 | * cus-edit.el (custom-group-value-create, custom-goto-parent): |
| 130 | parent groups link. | 491 | Fix parent groups link. |
| 131 | 492 | ||
| 132 | 2007-07-31 Paul Pogonyshev <pogonyshev@gmx.net> | 493 | 2007-07-31 Paul Pogonyshev <pogonyshev@gmx.net> |
| 133 | 494 | ||
| @@ -180,21 +541,21 @@ | |||
| 180 | 541 | ||
| 181 | 2007-07-29 Michael Albinus <michael.albinus@gmx.de> | 542 | 2007-07-29 Michael Albinus <michael.albinus@gmx.de> |
| 182 | 543 | ||
| 183 | * tramp.el: | 544 | * net/tramp.el: |
| 184 | * tramp-uu.el: | 545 | * net/tramp-uu.el: |
| 185 | * trampver.el: Use utf-8 encoding with coding cookie. | 546 | * net/trampver.el: Use utf-8 encoding with coding cookie. |
| 186 | 547 | ||
| 187 | * tramp-cache.el: | 548 | * net/tramp-cache.el: |
| 188 | * tramp-fish.el: | 549 | * net/tramp-fish.el: |
| 189 | * tramp-ftp.el: | 550 | * net/tramp-ftp.el: |
| 190 | * tramp-gw.el: | 551 | * net/tramp-gw.el: |
| 191 | * tramp-smb.el: Remove coding cookie. | 552 | * net/tramp-smb.el: Remove coding cookie. |
| 192 | 553 | ||
| 193 | * tramp.el (tramp-handle-verify-visited-file-modtime): | 554 | * net/tramp.el (tramp-handle-verify-visited-file-modtime): |
| 194 | Flush buffer file-name's file property. | 555 | Flush buffer file-name's file property. |
| 195 | (tramp-handle-file-remote-p): The first parameter is FILENAME. | 556 | (tramp-handle-file-remote-p): The first parameter is FILENAME. |
| 196 | 557 | ||
| 197 | * trampver.el: Update release number. | 558 | * net/trampver.el: Update release number. |
| 198 | 559 | ||
| 199 | 2007-07-29 Juri Linkov <juri@jurta.org> | 560 | 2007-07-29 Juri Linkov <juri@jurta.org> |
| 200 | 561 | ||
| @@ -748,9 +1109,9 @@ | |||
| 748 | 1109 | ||
| 749 | Sync with Tramp 2.1.10. | 1110 | Sync with Tramp 2.1.10. |
| 750 | 1111 | ||
| 751 | * tramp.el (tramp-get-ls-command): Fyx typo. | 1112 | * net/tramp.el (tramp-get-ls-command): Fyx typo. |
| 752 | 1113 | ||
| 753 | * trampver.el: Update release number. | 1114 | * net/trampver.el: Update release number. |
| 754 | 1115 | ||
| 755 | 2007-07-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 1116 | 2007-07-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 756 | 1117 | ||
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 1471ca7bebd..b2b03fe63bb 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -39,9 +39,9 @@ define global abbrevs instead." | |||
| 39 | 39 | ||
| 40 | (defun abbrev-mode (&optional arg) | 40 | (defun abbrev-mode (&optional arg) |
| 41 | "Toggle Abbrev mode in the current buffer. | 41 | "Toggle Abbrev mode in the current buffer. |
| 42 | With argument ARG, turn abbrev mode on iff ARG is positive. | 42 | With optional argument ARG, turn abbrev mode on if ARG is |
| 43 | In Abbrev mode, inserting an abbreviation causes it to expand | 43 | positive, otherwise turn it off. In Abbrev mode, inserting an |
| 44 | and be replaced by its expansion." | 44 | abbreviation causes it to expand and be replaced by its expansion." |
| 45 | (interactive "P") | 45 | (interactive "P") |
| 46 | (setq abbrev-mode | 46 | (setq abbrev-mode |
| 47 | (if (null arg) (not abbrev-mode) | 47 | (if (null arg) (not abbrev-mode) |
diff --git a/lisp/allout.el b/lisp/allout.el index f6598063e97..d243a188812 100644 --- a/lisp/allout.el +++ b/lisp/allout.el | |||
| @@ -1658,8 +1658,9 @@ the following two lines in your Emacs init file: | |||
| 1658 | "Toggle minor mode for controlling exposure and editing of text outlines. | 1658 | "Toggle minor mode for controlling exposure and editing of text outlines. |
| 1659 | \\<allout-mode-map> | 1659 | \\<allout-mode-map> |
| 1660 | 1660 | ||
| 1661 | Optional arg forces mode to re-initialize iff arg is positive num or | 1661 | Optional prefix argument TOGGLE forces the mode to re-initialize |
| 1662 | symbol. Allout outline mode always runs as a minor mode. | 1662 | if it is positive, otherwise it turns the mode off. Allout |
| 1663 | outline mode always runs as a minor mode. | ||
| 1663 | 1664 | ||
| 1664 | Allout outline mode provides extensive outline oriented formatting and | 1665 | Allout outline mode provides extensive outline oriented formatting and |
| 1665 | manipulation. It enables structural editing of outlines, as well as | 1666 | manipulation. It enables structural editing of outlines, as well as |
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 473e8e1976b..f1e5b146058 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -276,9 +276,9 @@ the list of old buffers.") | |||
| 276 | "Position of last known end of file.") | 276 | "Position of last known end of file.") |
| 277 | 277 | ||
| 278 | (add-hook 'find-file-hook | 278 | (add-hook 'find-file-hook |
| 279 | (lambda () | 279 | (lambda () |
| 280 | (set (make-local-variable 'auto-revert-tail-pos) | 280 | (set (make-local-variable 'auto-revert-tail-pos) |
| 281 | (nth 7 (file-attributes buffer-file-name))))) | 281 | (nth 7 (file-attributes buffer-file-name))))) |
| 282 | 282 | ||
| 283 | ;; Functions: | 283 | ;; Functions: |
| 284 | 284 | ||
| @@ -315,7 +315,7 @@ This function is designed to be added to hooks, for example: | |||
| 315 | ;;;###autoload | 315 | ;;;###autoload |
| 316 | (define-minor-mode auto-revert-tail-mode | 316 | (define-minor-mode auto-revert-tail-mode |
| 317 | "Toggle reverting tail of buffer when file on disk grows. | 317 | "Toggle reverting tail of buffer when file on disk grows. |
| 318 | With arg, turn Tail mode on iff arg is positive. | 318 | With arg, turn Tail mode on if arg is positive, otherwise turn it off. |
| 319 | 319 | ||
| 320 | When Tail mode is enabled, the tail of the file is constantly | 320 | When Tail mode is enabled, the tail of the file is constantly |
| 321 | followed, as with the shell command `tail -f'. This means that | 321 | followed, as with the shell command `tail -f'. This means that |
| @@ -334,9 +334,25 @@ Use `auto-revert-mode' for changes other than appends!" | |||
| 334 | (auto-revert-tail-mode 0) | 334 | (auto-revert-tail-mode 0) |
| 335 | (error "This buffer is not visiting a file")) | 335 | (error "This buffer is not visiting a file")) |
| 336 | (if (and (buffer-modified-p) | 336 | (if (and (buffer-modified-p) |
| 337 | (not auto-revert-tail-pos) ; library was loaded only after finding file | 337 | (zerop auto-revert-tail-pos) ; library was loaded only after finding file |
| 338 | (not (y-or-n-p "Buffer is modified, so tail offset may be wrong. Proceed? "))) | 338 | (not (y-or-n-p "Buffer is modified, so tail offset may be wrong. Proceed? "))) |
| 339 | (auto-revert-tail-mode 0) | 339 | (auto-revert-tail-mode 0) |
| 340 | ;; a-r-tail-pos stores the size of the file at the time of the | ||
| 341 | ;; last revert. After this package loads, it adds a | ||
| 342 | ;; find-file-hook to set this variable every time a file is | ||
| 343 | ;; loaded. If the package is loaded only _after_ visiting the | ||
| 344 | ;; file to be reverted, then we have no idea what the value of | ||
| 345 | ;; a-r-tail-pos should have been when the file was visited. If | ||
| 346 | ;; the file has changed on disk in the meantime, all we can do | ||
| 347 | ;; is offer to revert the whole thing. If you choose not to | ||
| 348 | ;; revert, then you might miss some output then happened | ||
| 349 | ;; between visiting the file and activating a-r-t-mode. | ||
| 350 | (and (zerop auto-revert-tail-pos) | ||
| 351 | (not (verify-visited-file-modtime (current-buffer))) | ||
| 352 | (y-or-n-p "File changed on disk, content may be missing. \ | ||
| 353 | Perform a full revert? ") | ||
| 354 | ;; Use this (not just revert-buffer) for point-preservation. | ||
| 355 | (auto-revert-handler)) | ||
| 340 | ;; else we might reappend our own end when we save | 356 | ;; else we might reappend our own end when we save |
| 341 | (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) | 357 | (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) |
| 342 | (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position | 358 | (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position |
diff --git a/lisp/bindings.el b/lisp/bindings.el index 8a492d665a1..9fd4b3b9569 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el | |||
| @@ -493,7 +493,7 @@ Menu of mode operations in the mode line.") | |||
| 493 | (defvar minor-mode-alist nil "\ | 493 | (defvar minor-mode-alist nil "\ |
| 494 | Alist saying how to show minor modes in the mode line. | 494 | Alist saying how to show minor modes in the mode line. |
| 495 | Each element looks like (VARIABLE STRING); | 495 | Each element looks like (VARIABLE STRING); |
| 496 | STRING is included in the mode line iff VARIABLE's value is non-nil. | 496 | STRING is included in the mode line if VARIABLE's value is non-nil. |
| 497 | 497 | ||
| 498 | Actually, STRING need not be a string; any possible mode-line element | 498 | Actually, STRING need not be a string; any possible mode-line element |
| 499 | is okay. See `mode-line-format'.") | 499 | is okay. See `mode-line-format'.") |
diff --git a/lisp/calc/calc-nlfit.el b/lisp/calc/calc-nlfit.el new file mode 100644 index 00000000000..489599781f6 --- /dev/null +++ b/lisp/calc/calc-nlfit.el | |||
| @@ -0,0 +1,817 @@ | |||
| 1 | ;;; calc-nlfit.el --- nonlinear curve fitting for Calc | ||
| 2 | |||
| 3 | ;; Copyright (C) 2007 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com> | ||
| 6 | |||
| 7 | ;; This file is part of GNU Emacs. | ||
| 8 | |||
| 9 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 10 | ;; it under the terms of the GNU General Public License as published by | ||
| 11 | ;; the Free Software Foundation; either version 3, or (at your option) | ||
| 12 | ;; any later version. | ||
| 13 | |||
| 14 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | ;; GNU General Public License for more details. | ||
| 18 | |||
| 19 | ;; You should have received a copy of the GNU General Public License | ||
| 20 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | ||
| 21 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 22 | ;; Boston, MA 02110-1301, USA. | ||
| 23 | |||
| 24 | ;;; Commentary: | ||
| 25 | |||
| 26 | ;; This code uses the Levenberg-Marquardt method, as described in | ||
| 27 | ;; _Numerical Analysis_ by H. R. Schwarz, to fit data to | ||
| 28 | ;; nonlinear curves. Currently, the only the following curves are | ||
| 29 | ;; supported: | ||
| 30 | ;; The logistic S curve, y=a/(1+exp(b*(t-c))) | ||
| 31 | ;; Here, y is usually interpreted as the population of some | ||
| 32 | ;; quantity at time t. So we will think of the data as consisting | ||
| 33 | ;; of quantities q0, q1, ..., qn and their respective times | ||
| 34 | ;; t0, t1, ..., tn. | ||
| 35 | |||
| 36 | ;; The logistic bell curve, y=A*exp(B*(t-C))/(1+exp(B*(t-C)))^2 | ||
| 37 | ;; Note that this is the derivative of the formula for the S curve. | ||
| 38 | ;; We get A=-a*b, B=b and C=c. Here, y is interpreted as the rate | ||
| 39 | ;; of growth of a population at time t. So we will think of the | ||
| 40 | ;; data as consisting of rates p0, p1, ..., pn and their | ||
| 41 | ;; respective times t0, t1, ..., tn. | ||
| 42 | |||
| 43 | ;; The Hubbert Linearization, y/x=A*(1-x/B) | ||
| 44 | ;; Here, y is thought of as the rate of growth of a population | ||
| 45 | ;; and x represents the actual population. This is essentially | ||
| 46 | ;; the differential equation describing the actual population. | ||
| 47 | |||
| 48 | ;; The Levenberg-Marquardt method is an iterative process: it takes | ||
| 49 | ;; an initial guess for the parameters and refines them. To get an | ||
| 50 | ;; initial guess for the parameters, we'll use a method described by | ||
| 51 | ;; Luis de Sousa in "Hubbert's Peak Mathematics". The idea is that | ||
| 52 | ;; given quantities Q and the corresponding rates P, they should | ||
| 53 | ;; satisfy P/Q= mQ+a. We can use the parameter a for an | ||
| 54 | ;; approximation for the parameter a in the S curve, and | ||
| 55 | ;; approximations for b and c are found using least squares on the | ||
| 56 | ;; linearization log((a/y)-1) = log(bb) + cc*t of | ||
| 57 | ;; y=a/(1+bb*exp(cc*t)), which is equivalent to the above s curve | ||
| 58 | ;; formula, and then tranlating it to b and c. From this, we can | ||
| 59 | ;; also get approximations for the bell curve parameters. | ||
| 60 | |||
| 61 | ;;; Code: | ||
| 62 | |||
| 63 | (require 'calc-arith) | ||
| 64 | |||
| 65 | (defun math-nlfit-least-squares (xdata ydata &optional sdata sigmas) | ||
| 66 | "Return the parameters A and B for the best least squares fit y=a+bx." | ||
| 67 | (let* ((n (length xdata)) | ||
| 68 | (s2data (if sdata | ||
| 69 | (mapcar 'calcFunc-sqr sdata) | ||
| 70 | (make-list n 1))) | ||
| 71 | (S (if sdata 0 n)) | ||
| 72 | (Sx 0) | ||
| 73 | (Sy 0) | ||
| 74 | (Sxx 0) | ||
| 75 | (Sxy 0) | ||
| 76 | D) | ||
| 77 | (while xdata | ||
| 78 | (let ((x (car xdata)) | ||
| 79 | (y (car ydata)) | ||
| 80 | (s (car s2data))) | ||
| 81 | (setq Sx (math-add Sx (if s (math-div x s) x))) | ||
| 82 | (setq Sy (math-add Sy (if s (math-div y s) y))) | ||
| 83 | (setq Sxx (math-add Sxx (if s (math-div (math-mul x x) s) | ||
| 84 | (math-mul x x)))) | ||
| 85 | (setq Sxy (math-add Sxy (if s (math-div (math-mul x y) s) | ||
| 86 | (math-mul x y)))) | ||
| 87 | (if sdata | ||
| 88 | (setq S (math-add S (math-div 1 s))))) | ||
| 89 | (setq xdata (cdr xdata)) | ||
| 90 | (setq ydata (cdr ydata)) | ||
| 91 | (setq s2data (cdr s2data))) | ||
| 92 | (setq D (math-sub (math-mul S Sxx) (math-mul Sx Sx))) | ||
| 93 | (let ((A (math-div (math-sub (math-mul Sxx Sy) (math-mul Sx Sxy)) D)) | ||
| 94 | (B (math-div (math-sub (math-mul S Sxy) (math-mul Sx Sy)) D))) | ||
| 95 | (if sigmas | ||
| 96 | (let ((C11 (math-div Sxx D)) | ||
| 97 | (C12 (math-neg (math-div Sx D))) | ||
| 98 | (C22 (math-div S D))) | ||
| 99 | (list (list 'sdev A (calcFunc-sqrt C11)) | ||
| 100 | (list 'sdev B (calcFunc-sqrt C22)) | ||
| 101 | (list 'vec | ||
| 102 | (list 'vec C11 C12) | ||
| 103 | (list 'vec C12 C22)))) | ||
| 104 | (list A B))))) | ||
| 105 | |||
| 106 | ;;; The methods described by de Sousa require the cumulative data qdata | ||
| 107 | ;;; and the rates pdata. We will assume that we are given either | ||
| 108 | ;;; qdata and the corresponding times tdata, or pdata and the corresponding | ||
| 109 | ;;; tdata. The following two functions will find pdata or qdata, | ||
| 110 | ;;; given the other.. | ||
| 111 | |||
| 112 | ;;; First, given two lists; one of values q0, q1, ..., qn and one of | ||
| 113 | ;;; corresponding times t0, t1, ..., tn; return a list | ||
| 114 | ;;; p0, p1, ..., pn of the rates of change of the qi with respect to t. | ||
| 115 | ;;; p0 is the right hand derivative (q1 - q0)/(t1 - t0). | ||
| 116 | ;;; pn is the left hand derivative (qn - q(n-1))/(tn - t(n-1)). | ||
| 117 | ;;; The other pis are the averages of the two: | ||
| 118 | ;;; (1/2)((qi - q(i-1))/(ti - t(i-1)) + (q(i+1) - qi)/(t(i+1) - ti)). | ||
| 119 | |||
| 120 | (defun math-nlfit-get-rates-from-cumul (tdata qdata) | ||
| 121 | (let ((pdata (list | ||
| 122 | (math-div | ||
| 123 | (math-sub (nth 1 qdata) | ||
| 124 | (nth 0 qdata)) | ||
| 125 | (math-sub (nth 1 tdata) | ||
| 126 | (nth 0 tdata)))))) | ||
| 127 | (while (> (length qdata) 2) | ||
| 128 | (setq pdata | ||
| 129 | (cons | ||
| 130 | (math-mul | ||
| 131 | '(float 5 -1) | ||
| 132 | (math-add | ||
| 133 | (math-div | ||
| 134 | (math-sub (nth 2 qdata) | ||
| 135 | (nth 1 qdata)) | ||
| 136 | (math-sub (nth 2 tdata) | ||
| 137 | (nth 1 tdata))) | ||
| 138 | (math-div | ||
| 139 | (math-sub (nth 1 qdata) | ||
| 140 | (nth 0 qdata)) | ||
| 141 | (math-sub (nth 1 tdata) | ||
| 142 | (nth 0 tdata))))) | ||
| 143 | pdata)) | ||
| 144 | (setq qdata (cdr qdata))) | ||
| 145 | (setq pdata | ||
| 146 | (cons | ||
| 147 | (math-div | ||
| 148 | (math-sub (nth 1 qdata) | ||
| 149 | (nth 0 qdata)) | ||
| 150 | (math-sub (nth 1 tdata) | ||
| 151 | (nth 0 tdata))) | ||
| 152 | pdata)) | ||
| 153 | (reverse pdata))) | ||
| 154 | |||
| 155 | ;;; Next, given two lists -- one of rates p0, p1, ..., pn and one of | ||
| 156 | ;;; corresponding times t0, t1, ..., tn -- and an initial values q0, | ||
| 157 | ;;; return a list q0, q1, ..., qn of the cumulative values. | ||
| 158 | ;;; q0 is the initial value given. | ||
| 159 | ;;; For i>0, qi is computed using the trapezoid rule: | ||
| 160 | ;;; qi = q(i-1) + (1/2)(pi + p(i-1))(ti - t(i-1)) | ||
| 161 | |||
| 162 | (defun math-nlfit-get-cumul-from-rates (tdata pdata q0) | ||
| 163 | (let* ((qdata (list q0))) | ||
| 164 | (while (cdr pdata) | ||
| 165 | (setq qdata | ||
| 166 | (cons | ||
| 167 | (math-add (car qdata) | ||
| 168 | (math-mul | ||
| 169 | (math-mul | ||
| 170 | '(float 5 -1) | ||
| 171 | (math-add (nth 1 pdata) (nth 0 pdata))) | ||
| 172 | (math-sub (nth 1 tdata) | ||
| 173 | (nth 0 tdata)))) | ||
| 174 | qdata)) | ||
| 175 | (setq pdata (cdr pdata)) | ||
| 176 | (setq tdata (cdr tdata))) | ||
| 177 | (reverse qdata))) | ||
| 178 | |||
| 179 | ;;; Given the qdata, pdata and tdata, find the parameters | ||
| 180 | ;;; a, b and c that fit q = a/(1+b*exp(c*t)). | ||
| 181 | ;;; a is found using the method described by de Sousa. | ||
| 182 | ;;; b and c are found using least squares on the linearization | ||
| 183 | ;;; log((a/q)-1) = log(b) + c*t | ||
| 184 | ;;; In some cases (where the logistic curve may well be the wrong | ||
| 185 | ;;; model), the computed a will be less than or equal to the maximum | ||
| 186 | ;;; value of q in qdata; in which case the above linearization won't work. | ||
| 187 | ;;; In this case, a will be replaced by a number slightly above | ||
| 188 | ;;; the maximum value of q. | ||
| 189 | |||
| 190 | (defun math-nlfit-find-qmax (qdata pdata tdata) | ||
| 191 | (let* ((ratios (mapcar* 'math-div pdata qdata)) | ||
| 192 | (lsdata (math-nlfit-least-squares ratios tdata)) | ||
| 193 | (qmax (math-max-list (car qdata) (cdr qdata))) | ||
| 194 | (a (math-neg (math-div (nth 1 lsdata) (nth 0 lsdata))))) | ||
| 195 | (if (math-lessp a qmax) | ||
| 196 | (math-add '(float 5 -1) qmax) | ||
| 197 | a))) | ||
| 198 | |||
| 199 | (defun math-nlfit-find-logistic-parameters (qdata pdata tdata) | ||
| 200 | (let* ((a (math-nlfit-find-qmax qdata pdata tdata)) | ||
| 201 | (newqdata | ||
| 202 | (mapcar (lambda (q) (calcFunc-ln (math-sub (math-div a q) 1))) | ||
| 203 | qdata)) | ||
| 204 | (bandc (math-nlfit-least-squares tdata newqdata))) | ||
| 205 | (list | ||
| 206 | a | ||
| 207 | (calcFunc-exp (nth 0 bandc)) | ||
| 208 | (nth 1 bandc)))) | ||
| 209 | |||
| 210 | ;;; Next, given the pdata and tdata, we can find the qdata if we know q0. | ||
| 211 | ;;; We first try to find q0, using the fact that when p takes on its largest | ||
| 212 | ;;; value, q is half of its maximum value. So we'll find the maximum value | ||
| 213 | ;;; of q given various q0, and use bisection to approximate the correct q0. | ||
| 214 | |||
| 215 | ;;; First, given pdata and tdata, find what half of qmax would be if q0=0. | ||
| 216 | |||
| 217 | (defun math-nlfit-find-qmaxhalf (pdata tdata) | ||
| 218 | (let ((pmax (math-max-list (car pdata) (cdr pdata))) | ||
| 219 | (qmh 0)) | ||
| 220 | (while (math-lessp (car pdata) pmax) | ||
| 221 | (setq qmh | ||
| 222 | (math-add qmh | ||
| 223 | (math-mul | ||
| 224 | (math-mul | ||
| 225 | '(float 5 -1) | ||
| 226 | (math-add (nth 1 pdata) (nth 0 pdata))) | ||
| 227 | (math-sub (nth 1 tdata) | ||
| 228 | (nth 0 tdata))))) | ||
| 229 | (setq pdata (cdr pdata)) | ||
| 230 | (setq tdata (cdr tdata))) | ||
| 231 | qmh)) | ||
| 232 | |||
| 233 | ;;; Next, given pdata and tdata, approximate q0. | ||
| 234 | |||
| 235 | (defun math-nlfit-find-q0 (pdata tdata) | ||
| 236 | (let* ((qhalf (math-nlfit-find-qmaxhalf pdata tdata)) | ||
| 237 | (q0 (math-mul 2 qhalf)) | ||
| 238 | (qdata (math-nlfit-get-cumul-from-rates tdata pdata q0))) | ||
| 239 | (while (math-lessp (math-nlfit-find-qmax | ||
| 240 | (mapcar | ||
| 241 | (lambda (q) (math-add q0 q)) | ||
| 242 | qdata) | ||
| 243 | pdata tdata) | ||
| 244 | (math-mul | ||
| 245 | '(float 5 -1) | ||
| 246 | (math-add | ||
| 247 | q0 | ||
| 248 | qhalf))) | ||
| 249 | (setq q0 (math-add q0 qhalf))) | ||
| 250 | (let* ((qmin (math-sub q0 qhalf)) | ||
| 251 | (qmax q0) | ||
| 252 | (qt (math-nlfit-find-qmax | ||
| 253 | (mapcar | ||
| 254 | (lambda (q) (math-add q0 q)) | ||
| 255 | qdata) | ||
| 256 | pdata tdata)) | ||
| 257 | (i 0)) | ||
| 258 | (while (< i 10) | ||
| 259 | (setq q0 (math-mul '(float 5 -1) (math-add qmin qmax))) | ||
| 260 | (if (math-lessp | ||
| 261 | (math-nlfit-find-qmax | ||
| 262 | (mapcar | ||
| 263 | (lambda (q) (math-add q0 q)) | ||
| 264 | qdata) | ||
| 265 | pdata tdata) | ||
| 266 | (math-mul '(float 5 -1) (math-add qhalf q0))) | ||
| 267 | (setq qmin q0) | ||
| 268 | (setq qmax q0)) | ||
| 269 | (setq i (1+ i))) | ||
| 270 | (math-mul '(float 5 -1) (math-add qmin qmax))))) | ||
| 271 | |||
| 272 | ;;; To improve the approximations to the parameters, we can use | ||
| 273 | ;;; Marquardt method as described in Schwarz's book. | ||
| 274 | |||
| 275 | ;;; Small numbers used in the Givens algorithm | ||
| 276 | (defvar math-nlfit-delta '(float 1 -8)) | ||
| 277 | |||
| 278 | (defvar math-nlfit-epsilon '(float 1 -5)) | ||
| 279 | |||
| 280 | ;;; Maximum number of iterations | ||
| 281 | (defvar math-nlfit-max-its 100) | ||
| 282 | |||
| 283 | ;;; Next, we need some functions for dealing with vectors and | ||
| 284 | ;;; matrices. For convenience, we'll work with Emacs lists | ||
| 285 | ;;; as vectors, rather than Calc's vectors. | ||
| 286 | |||
| 287 | (defun math-nlfit-set-elt (vec i x) | ||
| 288 | (setcar (nthcdr (1- i) vec) x)) | ||
| 289 | |||
| 290 | (defun math-nlfit-get-elt (vec i) | ||
| 291 | (nth (1- i) vec)) | ||
| 292 | |||
| 293 | (defun math-nlfit-make-matrix (i j) | ||
| 294 | (let ((row (make-list j 0)) | ||
| 295 | (mat nil) | ||
| 296 | (k 0)) | ||
| 297 | (while (< k i) | ||
| 298 | (setq mat (cons (copy-list row) mat)) | ||
| 299 | (setq k (1+ k))) | ||
| 300 | mat)) | ||
| 301 | |||
| 302 | (defun math-nlfit-set-matx-elt (mat i j x) | ||
| 303 | (setcar (nthcdr (1- j) (nth (1- i) mat)) x)) | ||
| 304 | |||
| 305 | (defun math-nlfit-get-matx-elt (mat i j) | ||
| 306 | (nth (1- j) (nth (1- i) mat))) | ||
| 307 | |||
| 308 | ;;; For solving the linearized system. | ||
| 309 | ;;; (The Givens method, from Schwarz.) | ||
| 310 | |||
| 311 | (defun math-nlfit-givens (C d) | ||
| 312 | (let* ((C (copy-tree C)) | ||
| 313 | (d (copy-tree d)) | ||
| 314 | (n (length (car C))) | ||
| 315 | (N (length C)) | ||
| 316 | (j 1) | ||
| 317 | (r (make-list N 0)) | ||
| 318 | (x (make-list N 0)) | ||
| 319 | w | ||
| 320 | gamma | ||
| 321 | sigma | ||
| 322 | rho) | ||
| 323 | (while (<= j n) | ||
| 324 | (let ((i (1+ j))) | ||
| 325 | (while (<= i N) | ||
| 326 | (let ((cij (math-nlfit-get-matx-elt C i j)) | ||
| 327 | (cjj (math-nlfit-get-matx-elt C j j))) | ||
| 328 | (when (not (math-equal 0 cij)) | ||
| 329 | (if (math-lessp (calcFunc-abs cjj) | ||
| 330 | (math-mul math-nlfit-delta (calcFunc-abs cij))) | ||
| 331 | (setq w (math-neg cij) | ||
| 332 | gamma 0 | ||
| 333 | sigma 1 | ||
| 334 | rho 1) | ||
| 335 | (setq w (math-mul | ||
| 336 | (calcFunc-sign cjj) | ||
| 337 | (calcFunc-sqrt | ||
| 338 | (math-add | ||
| 339 | (math-mul cjj cjj) | ||
| 340 | (math-mul cij cij)))) | ||
| 341 | gamma (math-div cjj w) | ||
| 342 | sigma (math-neg (math-div cij w))) | ||
| 343 | (if (math-lessp (calcFunc-abs sigma) gamma) | ||
| 344 | (setq rho sigma) | ||
| 345 | (setq rho (math-div (calcFunc-sign sigma) gamma)))) | ||
| 346 | (setq cjj w | ||
| 347 | cij rho) | ||
| 348 | (math-nlfit-set-matx-elt C j j w) | ||
| 349 | (math-nlfit-set-matx-elt C i j rho) | ||
| 350 | (let ((k (1+ j))) | ||
| 351 | (while (<= k n) | ||
| 352 | (let* ((cjk (math-nlfit-get-matx-elt C j k)) | ||
| 353 | (cik (math-nlfit-get-matx-elt C i k)) | ||
| 354 | (h (math-sub | ||
| 355 | (math-mul gamma cjk) (math-mul sigma cik)))) | ||
| 356 | (setq cik (math-add | ||
| 357 | (math-mul sigma cjk) | ||
| 358 | (math-mul gamma cik))) | ||
| 359 | (setq cjk h) | ||
| 360 | (math-nlfit-set-matx-elt C i k cik) | ||
| 361 | (math-nlfit-set-matx-elt C j k cjk) | ||
| 362 | (setq k (1+ k))))) | ||
| 363 | (let* ((di (math-nlfit-get-elt d i)) | ||
| 364 | (dj (math-nlfit-get-elt d j)) | ||
| 365 | (h (math-sub | ||
| 366 | (math-mul gamma dj) | ||
| 367 | (math-mul sigma di)))) | ||
| 368 | (setq di (math-add | ||
| 369 | (math-mul sigma dj) | ||
| 370 | (math-mul gamma di))) | ||
| 371 | (setq dj h) | ||
| 372 | (math-nlfit-set-elt d i di) | ||
| 373 | (math-nlfit-set-elt d j dj)))) | ||
| 374 | (setq i (1+ i)))) | ||
| 375 | (setq j (1+ j))) | ||
| 376 | (let ((i n) | ||
| 377 | s) | ||
| 378 | (while (>= i 1) | ||
| 379 | (math-nlfit-set-elt r i 0) | ||
| 380 | (setq s (math-nlfit-get-elt d i)) | ||
| 381 | (let ((k (1+ i))) | ||
| 382 | (while (<= k n) | ||
| 383 | (setq s (math-add s (math-mul (math-nlfit-get-matx-elt C i k) | ||
| 384 | (math-nlfit-get-elt x k)))) | ||
| 385 | (setq k (1+ k)))) | ||
| 386 | (math-nlfit-set-elt x i | ||
| 387 | (math-neg | ||
| 388 | (math-div s | ||
| 389 | (math-nlfit-get-matx-elt C i i)))) | ||
| 390 | (setq i (1- i)))) | ||
| 391 | (let ((i (1+ n))) | ||
| 392 | (while (<= i N) | ||
| 393 | (math-nlfit-set-elt r i (math-nlfit-get-elt d i)) | ||
| 394 | (setq i (1+ i)))) | ||
| 395 | (let ((j n)) | ||
| 396 | (while (>= j 1) | ||
| 397 | (let ((i N)) | ||
| 398 | (while (>= i (1+ j)) | ||
| 399 | (setq rho (math-nlfit-get-matx-elt C i j)) | ||
| 400 | (if (math-equal rho 1) | ||
| 401 | (setq gamma 0 | ||
| 402 | sigma 1) | ||
| 403 | (if (math-lessp (calcFunc-abs rho) 1) | ||
| 404 | (setq sigma rho | ||
| 405 | gamma (calcFunc-sqrt | ||
| 406 | (math-sub 1 (math-mul sigma sigma)))) | ||
| 407 | (setq gamma (math-div 1 (calcFunc-abs rho)) | ||
| 408 | sigma (math-mul (calcFunc-sign rho) | ||
| 409 | (calcFunc-sqrt | ||
| 410 | (math-sub 1 (math-mul gamma gamma))))))) | ||
| 411 | (let ((ri (math-nlfit-get-elt r i)) | ||
| 412 | (rj (math-nlfit-get-elt r j)) | ||
| 413 | h) | ||
| 414 | (setq h (math-add (math-mul gamma rj) | ||
| 415 | (math-mul sigma ri))) | ||
| 416 | (setq ri (math-sub | ||
| 417 | (math-mul gamma ri) | ||
| 418 | (math-mul sigma rj))) | ||
| 419 | (setq rj h) | ||
| 420 | (math-nlfit-set-elt r i ri) | ||
| 421 | (math-nlfit-set-elt r j rj)) | ||
| 422 | (setq i (1- i)))) | ||
| 423 | (setq j (1- j)))) | ||
| 424 | |||
| 425 | x)) | ||
| 426 | |||
| 427 | (defun math-nlfit-jacobian (grad xlist parms &optional slist) | ||
| 428 | (let ((j nil)) | ||
| 429 | (while xlist | ||
| 430 | (let ((row (apply grad (car xlist) parms))) | ||
| 431 | (setq j | ||
| 432 | (cons | ||
| 433 | (if slist | ||
| 434 | (mapcar (lambda (x) (math-div x (car slist))) row) | ||
| 435 | row) | ||
| 436 | j))) | ||
| 437 | (setq slist (cdr slist)) | ||
| 438 | (setq xlist (cdr xlist))) | ||
| 439 | (reverse j))) | ||
| 440 | |||
| 441 | (defun math-nlfit-make-ident (l n) | ||
| 442 | (let ((m (math-nlfit-make-matrix n n)) | ||
| 443 | (i 1)) | ||
| 444 | (while (<= i n) | ||
| 445 | (math-nlfit-set-matx-elt m i i l) | ||
| 446 | (setq i (1+ i))) | ||
| 447 | m)) | ||
| 448 | |||
| 449 | (defun math-nlfit-chi-sq (xlist ylist parms fn &optional slist) | ||
| 450 | (let ((cs 0)) | ||
| 451 | (while xlist | ||
| 452 | (let ((c | ||
| 453 | (math-sub | ||
| 454 | (apply fn (car xlist) parms) | ||
| 455 | (car ylist)))) | ||
| 456 | (if slist | ||
| 457 | (setq c (math-div c (car slist)))) | ||
| 458 | (setq cs | ||
| 459 | (math-add cs | ||
| 460 | (math-mul c c)))) | ||
| 461 | (setq xlist (cdr xlist)) | ||
| 462 | (setq ylist (cdr ylist)) | ||
| 463 | (setq slist (cdr slist))) | ||
| 464 | cs)) | ||
| 465 | |||
| 466 | (defun math-nlfit-init-lambda (C) | ||
| 467 | (let ((l 0) | ||
| 468 | (n (length (car C))) | ||
| 469 | (N (length C))) | ||
| 470 | (while C | ||
| 471 | (let ((row (car C))) | ||
| 472 | (while row | ||
| 473 | (setq l (math-add l (math-mul (car row) (car row)))) | ||
| 474 | (setq row (cdr row)))) | ||
| 475 | (setq C (cdr C))) | ||
| 476 | (calcFunc-sqrt (math-div l (math-mul n N))))) | ||
| 477 | |||
| 478 | (defun math-nlfit-make-Ctilda (C l) | ||
| 479 | (let* ((n (length (car C))) | ||
| 480 | (bot (math-nlfit-make-ident l n))) | ||
| 481 | (append C bot))) | ||
| 482 | |||
| 483 | (defun math-nlfit-make-d (fn xdata ydata parms &optional sdata) | ||
| 484 | (let ((d nil)) | ||
| 485 | (while xdata | ||
| 486 | (setq d (cons | ||
| 487 | (let ((dd (math-sub (apply fn (car xdata) parms) | ||
| 488 | (car ydata)))) | ||
| 489 | (if sdata (math-div dd (car sdata)) dd)) | ||
| 490 | d)) | ||
| 491 | (setq xdata (cdr xdata)) | ||
| 492 | (setq ydata (cdr ydata)) | ||
| 493 | (setq sdata (cdr sdata))) | ||
| 494 | (reverse d))) | ||
| 495 | |||
| 496 | (defun math-nlfit-make-dtilda (d n) | ||
| 497 | (append d (make-list n 0))) | ||
| 498 | |||
| 499 | (defun math-nlfit-fit (xlist ylist parms fn grad &optional slist) | ||
| 500 | (let* | ||
| 501 | ((C (math-nlfit-jacobian grad xlist parms slist)) | ||
| 502 | (d (math-nlfit-make-d fn xlist ylist parms slist)) | ||
| 503 | (chisq (math-nlfit-chi-sq xlist ylist parms fn slist)) | ||
| 504 | (lambda (math-nlfit-init-lambda C)) | ||
| 505 | (really-done nil) | ||
| 506 | (iters 0)) | ||
| 507 | (while (and | ||
| 508 | (not really-done) | ||
| 509 | (< iters math-nlfit-max-its)) | ||
| 510 | (setq iters (1+ iters)) | ||
| 511 | (let ((done nil)) | ||
| 512 | (while (not done) | ||
| 513 | (let* ((Ctilda (math-nlfit-make-Ctilda C lambda)) | ||
| 514 | (dtilda (math-nlfit-make-dtilda d (length (car C)))) | ||
| 515 | (zeta (math-nlfit-givens Ctilda dtilda)) | ||
| 516 | (newparms (mapcar* 'math-add (copy-tree parms) zeta)) | ||
| 517 | (newchisq (math-nlfit-chi-sq xlist ylist newparms fn slist))) | ||
| 518 | (if (math-lessp newchisq chisq) | ||
| 519 | (progn | ||
| 520 | (if (math-lessp | ||
| 521 | (math-div | ||
| 522 | (math-sub chisq newchisq) newchisq) math-nlfit-epsilon) | ||
| 523 | (setq really-done t)) | ||
| 524 | (setq lambda (math-div lambda 10)) | ||
| 525 | (setq chisq newchisq) | ||
| 526 | (setq parms newparms) | ||
| 527 | (setq done t)) | ||
| 528 | (setq lambda (math-mul lambda 10))))) | ||
| 529 | (setq C (math-nlfit-jacobian grad xlist parms slist)) | ||
| 530 | (setq d (math-nlfit-make-d fn xlist ylist parms slist)))) | ||
| 531 | (list chisq parms))) | ||
| 532 | |||
| 533 | ;;; The functions that describe our models, and their gradients. | ||
| 534 | |||
| 535 | (defun math-nlfit-s-logistic-fn (x a b c) | ||
| 536 | (math-div a (math-add 1 (math-mul b (calcFunc-exp (math-mul c x)))))) | ||
| 537 | |||
| 538 | (defun math-nlfit-s-logistic-grad (x a b c) | ||
| 539 | (let* ((ep (calcFunc-exp (math-mul c x))) | ||
| 540 | (d (math-add 1 (math-mul b ep))) | ||
| 541 | (d2 (math-mul d d))) | ||
| 542 | (list | ||
| 543 | (math-div 1 d) | ||
| 544 | (math-neg (math-div (math-mul a ep) d2)) | ||
| 545 | (math-neg (math-div (math-mul a (math-mul b (math-mul x ep))) d2))))) | ||
| 546 | |||
| 547 | (defun math-nlfit-b-logistic-fn (x a c d) | ||
| 548 | (let ((ex (calcFunc-exp (math-mul c (math-sub x d))))) | ||
| 549 | (math-div | ||
| 550 | (math-mul a ex) | ||
| 551 | (math-sqr | ||
| 552 | (math-add | ||
| 553 | 1 ex))))) | ||
| 554 | |||
| 555 | (defun math-nlfit-b-logistic-grad (x a c d) | ||
| 556 | (let* ((ex (calcFunc-exp (math-mul c (math-sub x d)))) | ||
| 557 | (ex1 (math-add 1 ex)) | ||
| 558 | (xd (math-sub x d))) | ||
| 559 | (list | ||
| 560 | (math-div | ||
| 561 | ex | ||
| 562 | (math-sqr ex1)) | ||
| 563 | (math-sub | ||
| 564 | (math-div | ||
| 565 | (math-mul a (math-mul xd ex)) | ||
| 566 | (math-sqr ex1)) | ||
| 567 | (math-div | ||
| 568 | (math-mul 2 (math-mul a (math-mul xd (math-sqr ex)))) | ||
| 569 | (math-pow ex1 3))) | ||
| 570 | (math-sub | ||
| 571 | (math-div | ||
| 572 | (math-mul 2 (math-mul a (math-mul c (math-sqr ex)))) | ||
| 573 | (math-pow ex1 3)) | ||
| 574 | (math-div | ||
| 575 | (math-mul a (math-mul c ex)) | ||
| 576 | (math-sqr ex1)))))) | ||
| 577 | |||
| 578 | ;;; Functions to get the final covariance matrix and the sdevs | ||
| 579 | |||
| 580 | (defun math-nlfit-find-covar (grad xlist pparms) | ||
| 581 | (let ((j nil)) | ||
| 582 | (while xlist | ||
| 583 | (setq j (cons (cons 'vec (apply grad (car xlist) pparms)) j)) | ||
| 584 | (setq xlist (cdr xlist))) | ||
| 585 | (setq j (cons 'vec (reverse j))) | ||
| 586 | (setq j | ||
| 587 | (math-mul | ||
| 588 | (calcFunc-trn j) j)) | ||
| 589 | (calcFunc-inv j))) | ||
| 590 | |||
| 591 | (defun math-nlfit-get-sigmas (grad xlist pparms chisq) | ||
| 592 | (let* ((sgs nil) | ||
| 593 | (covar (math-nlfit-find-covar grad xlist pparms)) | ||
| 594 | (n (1- (length covar))) | ||
| 595 | (N (length xlist)) | ||
| 596 | (i 1)) | ||
| 597 | (when (> N n) | ||
| 598 | (while (<= i n) | ||
| 599 | (setq sgs (cons (calcFunc-sqrt (nth i (nth i covar))) sgs)) | ||
| 600 | (setq i (1+ i))) | ||
| 601 | (setq sgs (reverse sgs))) | ||
| 602 | (list sgs covar))) | ||
| 603 | |||
| 604 | ;;; Now the Calc functions | ||
| 605 | |||
| 606 | (defun math-nlfit-s-logistic-params (xdata ydata) | ||
| 607 | (let ((pdata (math-nlfit-get-rates-from-cumul xdata ydata))) | ||
| 608 | (math-nlfit-find-logistic-parameters ydata pdata xdata))) | ||
| 609 | |||
| 610 | (defun math-nlfit-b-logistic-params (xdata ydata) | ||
| 611 | (let* ((q0 (math-nlfit-find-q0 ydata xdata)) | ||
| 612 | (qdata (math-nlfit-get-cumul-from-rates xdata ydata q0)) | ||
| 613 | (abc (math-nlfit-find-logistic-parameters qdata ydata xdata)) | ||
| 614 | (B (nth 1 abc)) | ||
| 615 | (C (nth 2 abc)) | ||
| 616 | (A (math-neg | ||
| 617 | (math-mul | ||
| 618 | (nth 0 abc) | ||
| 619 | (math-mul B C)))) | ||
| 620 | (D (math-neg (math-div (calcFunc-ln B) C))) | ||
| 621 | (A (math-div A B))) | ||
| 622 | (list A C D))) | ||
| 623 | |||
| 624 | ;;; Some functions to turn the parameter lists and variables | ||
| 625 | ;;; into the appropriate functions. | ||
| 626 | |||
| 627 | (defun math-nlfit-s-logistic-solnexpr (pms var) | ||
| 628 | (let ((a (nth 0 pms)) | ||
| 629 | (b (nth 1 pms)) | ||
| 630 | (c (nth 2 pms))) | ||
| 631 | (list '/ a | ||
| 632 | (list '+ | ||
| 633 | 1 | ||
| 634 | (list '* | ||
| 635 | b | ||
| 636 | (calcFunc-exp | ||
| 637 | (list '* | ||
| 638 | c | ||
| 639 | var))))))) | ||
| 640 | |||
| 641 | (defun math-nlfit-b-logistic-solnexpr (pms var) | ||
| 642 | (let ((a (nth 0 pms)) | ||
| 643 | (c (nth 1 pms)) | ||
| 644 | (d (nth 2 pms))) | ||
| 645 | (list '/ | ||
| 646 | (list '* | ||
| 647 | a | ||
| 648 | (calcFunc-exp | ||
| 649 | (list '* | ||
| 650 | c | ||
| 651 | (list '- var d)))) | ||
| 652 | (list '^ | ||
| 653 | (list '+ | ||
| 654 | 1 | ||
| 655 | (calcFunc-exp | ||
| 656 | (list '* | ||
| 657 | c | ||
| 658 | (list '- var d)))) | ||
| 659 | 2)))) | ||
| 660 | |||
| 661 | (defun math-nlfit-enter-result (n prefix vals) | ||
| 662 | (setq calc-aborted-prefix prefix) | ||
| 663 | (calc-pop-push-record-list n prefix vals) | ||
| 664 | (calc-handle-whys)) | ||
| 665 | |||
| 666 | (defun math-nlfit-fit-curve (fn grad solnexpr initparms &optional sdv) | ||
| 667 | (calc-slow-wrapper | ||
| 668 | (let* ((sdevv (or (eq sdv 'calcFunc-efit) (eq sdv 'calcFunc-xfit))) | ||
| 669 | (calc-display-working-message nil) | ||
| 670 | (data (calc-top 1)) | ||
| 671 | (xdata (cdr (car (cdr data)))) | ||
| 672 | (ydata (cdr (car (cdr (cdr data))))) | ||
| 673 | (sdata (if (math-contains-sdev-p ydata) | ||
| 674 | (mapcar (lambda (x) (math-get-sdev x t)) ydata) | ||
| 675 | nil)) | ||
| 676 | (ydata (mapcar (lambda (x) (math-get-value x)) ydata)) | ||
| 677 | (calc-curve-varnames nil) | ||
| 678 | (calc-curve-coefnames nil) | ||
| 679 | (calc-curve-nvars 1) | ||
| 680 | (fitvars (calc-get-fit-variables 1 3)) | ||
| 681 | (var (nth 1 calc-curve-varnames)) | ||
| 682 | (parms (cdr calc-curve-coefnames)) | ||
| 683 | (parmguess | ||
| 684 | (funcall initparms xdata ydata)) | ||
| 685 | (fit (math-nlfit-fit xdata ydata parmguess fn grad sdata)) | ||
| 686 | (finalparms (nth 1 fit)) | ||
| 687 | (sigmacovar | ||
| 688 | (if sdevv | ||
| 689 | (math-nlfit-get-sigmas grad xdata finalparms (nth 0 fit)))) | ||
| 690 | (sigmas | ||
| 691 | (if sdevv | ||
| 692 | (nth 0 sigmacovar))) | ||
| 693 | (finalparms | ||
| 694 | (if sigmas | ||
| 695 | (mapcar* (lambda (x y) (list 'sdev x y)) finalparms sigmas) | ||
| 696 | finalparms)) | ||
| 697 | (soln (funcall solnexpr finalparms var))) | ||
| 698 | (let ((calc-fit-to-trail t) | ||
| 699 | (traillist nil)) | ||
| 700 | (while parms | ||
| 701 | (setq traillist (cons (list 'calcFunc-eq (car parms) (car finalparms)) | ||
| 702 | traillist)) | ||
| 703 | (setq finalparms (cdr finalparms)) | ||
| 704 | (setq parms (cdr parms))) | ||
| 705 | (setq traillist (calc-normalize (cons 'vec (nreverse traillist)))) | ||
| 706 | (cond ((eq sdv 'calcFunc-efit) | ||
| 707 | (math-nlfit-enter-result 1 "efit" soln)) | ||
| 708 | ((eq sdv 'calcFunc-xfit) | ||
| 709 | (let (sln) | ||
| 710 | (setq sln | ||
| 711 | (list 'vec | ||
| 712 | soln | ||
| 713 | traillist | ||
| 714 | (nth 1 sigmacovar) | ||
| 715 | '(vec) | ||
| 716 | (nth 0 fit) | ||
| 717 | (let ((n (length xdata)) | ||
| 718 | (m (length finalparms))) | ||
| 719 | (if (and sdata (> n m)) | ||
| 720 | (calcFunc-utpc (nth 0 fit) | ||
| 721 | (- n m)) | ||
| 722 | '(var nan var-nan))))) | ||
| 723 | (math-nlfit-enter-result 1 "xfit" sln))) | ||
| 724 | (t | ||
| 725 | (math-nlfit-enter-result 1 "fit" soln))) | ||
| 726 | (calc-record traillist "parm"))))) | ||
| 727 | |||
| 728 | (defun calc-fit-s-shaped-logistic-curve (arg) | ||
| 729 | (interactive "P") | ||
| 730 | (math-nlfit-fit-curve 'math-nlfit-s-logistic-fn | ||
| 731 | 'math-nlfit-s-logistic-grad | ||
| 732 | 'math-nlfit-s-logistic-solnexpr | ||
| 733 | 'math-nlfit-s-logistic-params | ||
| 734 | arg)) | ||
| 735 | |||
| 736 | (defun calc-fit-bell-shaped-logistic-curve (arg) | ||
| 737 | (interactive "P") | ||
| 738 | (math-nlfit-fit-curve 'math-nlfit-b-logistic-fn | ||
| 739 | 'math-nlfit-b-logistic-grad | ||
| 740 | 'math-nlfit-b-logistic-solnexpr | ||
| 741 | 'math-nlfit-b-logistic-params | ||
| 742 | arg)) | ||
| 743 | |||
| 744 | (defun calc-fit-hubbert-linear-curve (&optional sdv) | ||
| 745 | (calc-slow-wrapper | ||
| 746 | (let* ((sdevv (or (eq sdv 'calcFunc-efit) (eq sdv 'calcFunc-xfit))) | ||
| 747 | (calc-display-working-message nil) | ||
| 748 | (data (calc-top 1)) | ||
| 749 | (qdata (cdr (car (cdr data)))) | ||
| 750 | (pdata (cdr (car (cdr (cdr data))))) | ||
| 751 | (sdata (if (math-contains-sdev-p pdata) | ||
| 752 | (mapcar (lambda (x) (math-get-sdev x t)) pdata) | ||
| 753 | nil)) | ||
| 754 | (pdata (mapcar (lambda (x) (math-get-value x)) pdata)) | ||
| 755 | (poverqdata (mapcar* 'math-div pdata qdata)) | ||
| 756 | (parmvals (math-nlfit-least-squares qdata poverqdata sdata sdevv)) | ||
| 757 | (finalparms (list (nth 0 parmvals) | ||
| 758 | (math-neg | ||
| 759 | (math-div (nth 0 parmvals) | ||
| 760 | (nth 1 parmvals))))) | ||
| 761 | (calc-curve-varnames nil) | ||
| 762 | (calc-curve-coefnames nil) | ||
| 763 | (calc-curve-nvars 1) | ||
| 764 | (fitvars (calc-get-fit-variables 1 2)) | ||
| 765 | (var (nth 1 calc-curve-varnames)) | ||
| 766 | (parms (cdr calc-curve-coefnames)) | ||
| 767 | (soln (list '* (nth 0 finalparms) | ||
| 768 | (list '- 1 | ||
| 769 | (list '/ var (nth 1 finalparms)))))) | ||
| 770 | (let ((calc-fit-to-trail t) | ||
| 771 | (traillist nil)) | ||
| 772 | (setq traillist | ||
| 773 | (list 'vec | ||
| 774 | (list 'calcFunc-eq (nth 0 parms) (nth 0 finalparms)) | ||
| 775 | (list 'calcFunc-eq (nth 1 parms) (nth 1 finalparms)))) | ||
| 776 | (cond ((eq sdv 'calcFunc-efit) | ||
| 777 | (math-nlfit-enter-result 1 "efit" soln)) | ||
| 778 | ((eq sdv 'calcFunc-xfit) | ||
| 779 | (let (sln | ||
| 780 | (chisq | ||
| 781 | (math-nlfit-chi-sq | ||
| 782 | qdata poverqdata | ||
| 783 | (list (nth 1 (nth 0 finalparms)) | ||
| 784 | (nth 1 (nth 1 finalparms))) | ||
| 785 | (lambda (x a b) | ||
| 786 | (math-mul a | ||
| 787 | (math-sub | ||
| 788 | 1 | ||
| 789 | (math-div x b)))) | ||
| 790 | sdata))) | ||
| 791 | (setq sln | ||
| 792 | (list 'vec | ||
| 793 | soln | ||
| 794 | traillist | ||
| 795 | (nth 2 parmvals) | ||
| 796 | (list | ||
| 797 | 'vec | ||
| 798 | '(calcFunc-fitdummy 1) | ||
| 799 | (list 'calcFunc-neg | ||
| 800 | (list '/ | ||
| 801 | '(calcFunc-fitdummy 1) | ||
| 802 | '(calcFunc-fitdummy 2)))) | ||
| 803 | chisq | ||
| 804 | (let ((n (length qdata))) | ||
| 805 | (if (and sdata (> n 2)) | ||
| 806 | (calcFunc-utpc | ||
| 807 | chisq | ||
| 808 | (- n 2)) | ||
| 809 | '(var nan var-nan))))) | ||
| 810 | (math-nlfit-enter-result 1 "xfit" sln))) | ||
| 811 | (t | ||
| 812 | (math-nlfit-enter-result 1 "fit" soln))) | ||
| 813 | (calc-record traillist "parm"))))) | ||
| 814 | |||
| 815 | (provide 'calc-nlfit) | ||
| 816 | |||
| 817 | ;; arch-tag: 6eba3cd6-f48b-4a84-8174-10c15a024928 | ||
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 82769a66b13..e823a57aef0 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el | |||
| @@ -49,7 +49,7 @@ | |||
| 49 | (defvar math-standard-units | 49 | (defvar math-standard-units |
| 50 | '( ;; Length | 50 | '( ;; Length |
| 51 | ( m nil "*Meter" ) | 51 | ( m nil "*Meter" ) |
| 52 | ( in "2.54 cm" "Inch" ) | 52 | ( in "2.54 cm" "Inch" ) |
| 53 | ( ft "12 in" "Foot" ) | 53 | ( ft "12 in" "Foot" ) |
| 54 | ( yd "3 ft" "Yard" ) | 54 | ( yd "3 ft" "Yard" ) |
| 55 | ( mi "5280 ft" "Mile" ) | 55 | ( mi "5280 ft" "Mile" ) |
| @@ -971,17 +971,17 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") | |||
| 971 | (symbol-name v))))))) | 971 | (symbol-name v))))))) |
| 972 | (or (eq (nth 3 uold) (nth 3 unew)) | 972 | (or (eq (nth 3 uold) (nth 3 unew)) |
| 973 | (cond ((eq (nth 3 uold) 'K) | 973 | (cond ((eq (nth 3 uold) 'K) |
| 974 | (setq expr (list '- expr '(float 27315 -2))) | 974 | (setq expr (list '- expr '(/ 27315 100))) |
| 975 | (if (eq (nth 3 unew) 'F) | 975 | (if (eq (nth 3 unew) 'F) |
| 976 | (setq expr (list '+ (list '* expr '(frac 9 5)) 32)))) | 976 | (setq expr (list '+ (list '* expr '(/ 9 5)) 32)))) |
| 977 | ((eq (nth 3 uold) 'C) | 977 | ((eq (nth 3 uold) 'C) |
| 978 | (if (eq (nth 3 unew) 'F) | 978 | (if (eq (nth 3 unew) 'F) |
| 979 | (setq expr (list '+ (list '* expr '(frac 9 5)) 32)) | 979 | (setq expr (list '+ (list '* expr '(/ 9 5)) 32)) |
| 980 | (setq expr (list '+ expr '(float 27315 -2))))) | 980 | (setq expr (list '+ expr '(/ 27315 100))))) |
| 981 | (t | 981 | (t |
| 982 | (setq expr (list '* (list '- expr 32) '(frac 5 9))) | 982 | (setq expr (list '* (list '- expr 32) '(/ 5 9))) |
| 983 | (if (eq (nth 3 unew) 'K) | 983 | (if (eq (nth 3 unew) 'K) |
| 984 | (setq expr (list '+ expr '(float 27315 -2))))))) | 984 | (setq expr (list '+ expr '(/ 27315 100))))))) |
| 985 | (if pure | 985 | (if pure |
| 986 | expr | 986 | expr |
| 987 | (list '* expr new)))) | 987 | (list '* expr new)))) |
diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index 9f263a2281a..5aa410be19e 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el | |||
| @@ -115,6 +115,8 @@ | |||
| 115 | (if (calc-is-hyperbolic) 'calcFunc-efit | 115 | (if (calc-is-hyperbolic) 'calcFunc-efit |
| 116 | 'calcFunc-fit))) | 116 | 'calcFunc-fit))) |
| 117 | key (which 0) | 117 | key (which 0) |
| 118 | (nonlinear nil) | ||
| 119 | (plot nil) | ||
| 118 | n calc-curve-nvars temp data | 120 | n calc-curve-nvars temp data |
| 119 | (homog nil) | 121 | (homog nil) |
| 120 | (msgs '( "(Press ? for help)" | 122 | (msgs '( "(Press ? for help)" |
| @@ -125,12 +127,18 @@ | |||
| 125 | "E = a 10^(b x), X = 10^(a + b x), L = a + b log10(x)" | 127 | "E = a 10^(b x), X = 10^(a + b x), L = a + b log10(x)" |
| 126 | "q = a + b (x-c)^2" | 128 | "q = a + b (x-c)^2" |
| 127 | "g = (a/b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)" | 129 | "g = (a/b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)" |
| 130 | "s = a/(1 + exp(b (x - c)))" | ||
| 131 | "b = a exp(b (x - c))/(1 + exp(b (x - c)))^2" | ||
| 132 | "o = (y/x) = a (1 - x/b)" | ||
| 128 | "h prefix = homogeneous model (no constant term)" | 133 | "h prefix = homogeneous model (no constant term)" |
| 134 | "P prefix = plot result" | ||
| 129 | "' = alg entry, $ = stack, u = Model1, U = Model2"))) | 135 | "' = alg entry, $ = stack, u = Model1, U = Model2"))) |
| 130 | (while (not calc-curve-model) | 136 | (while (not calc-curve-model) |
| 131 | (message "Fit to model: %s:%s" | 137 | (message |
| 132 | (nth which msgs) | 138 | "Fit to model: %s:%s%s" |
| 133 | (if homog " h" "")) | 139 | (nth which msgs) |
| 140 | (if plot "P" " ") | ||
| 141 | (if homog "h" "")) | ||
| 134 | (setq key (read-char)) | 142 | (setq key (read-char)) |
| 135 | (cond ((= key ?\C-g) | 143 | (cond ((= key ?\C-g) |
| 136 | (keyboard-quit)) | 144 | (keyboard-quit)) |
| @@ -138,6 +146,16 @@ | |||
| 138 | (setq which (% (1+ which) (length msgs)))) | 146 | (setq which (% (1+ which) (length msgs)))) |
| 139 | ((memq key '(?h ?H)) | 147 | ((memq key '(?h ?H)) |
| 140 | (setq homog (not homog))) | 148 | (setq homog (not homog))) |
| 149 | ((= key ?P) | ||
| 150 | (if plot | ||
| 151 | (setq plot nil) | ||
| 152 | (let ((data (calc-top 1))) | ||
| 153 | (if (or | ||
| 154 | (calc-is-hyperbolic) | ||
| 155 | (calc-is-inverse) | ||
| 156 | (not (= (length data) 3))) | ||
| 157 | (setq plot "Can't plot") | ||
| 158 | (setq plot data))))) | ||
| 141 | ((progn | 159 | ((progn |
| 142 | (if (eq key ?\$) | 160 | (if (eq key ?\$) |
| 143 | (setq n 1) | 161 | (setq n 1) |
| @@ -164,8 +182,9 @@ | |||
| 164 | ((= key ?1) ; linear or multilinear | 182 | ((= key ?1) ; linear or multilinear |
| 165 | (calc-get-fit-variables calc-curve-nvars | 183 | (calc-get-fit-variables calc-curve-nvars |
| 166 | (1+ calc-curve-nvars) (and homog 0)) | 184 | (1+ calc-curve-nvars) (and homog 0)) |
| 167 | (setq calc-curve-model (math-mul calc-curve-coefnames | 185 | (setq calc-curve-model |
| 168 | (cons 'vec (cons 1 (cdr calc-curve-varnames)))))) | 186 | (math-mul calc-curve-coefnames |
| 187 | (cons 'vec (cons 1 (cdr calc-curve-varnames)))))) | ||
| 169 | ((and (>= key ?2) (<= key ?9)) ; polynomial | 188 | ((and (>= key ?2) (<= key ?9)) ; polynomial |
| 170 | (calc-get-fit-variables 1 (- key ?0 -1) (and homog 0)) | 189 | (calc-get-fit-variables 1 (- key ?0 -1) (and homog 0)) |
| 171 | (setq calc-curve-model | 190 | (setq calc-curve-model |
| @@ -180,58 +199,88 @@ | |||
| 180 | ((= key ?p) ; power law | 199 | ((= key ?p) ; power law |
| 181 | (calc-get-fit-variables calc-curve-nvars | 200 | (calc-get-fit-variables calc-curve-nvars |
| 182 | (1+ calc-curve-nvars) (and homog 1)) | 201 | (1+ calc-curve-nvars) (and homog 1)) |
| 183 | (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames) | 202 | (setq calc-curve-model |
| 184 | (calcFunc-reduce | 203 | (math-mul |
| 185 | '(var mul var-mul) | 204 | (nth 1 calc-curve-coefnames) |
| 186 | (calcFunc-map | 205 | (calcFunc-reduce |
| 187 | '(var pow var-pow) | 206 | '(var mul var-mul) |
| 188 | calc-curve-varnames | 207 | (calcFunc-map |
| 189 | (cons 'vec (cdr (cdr calc-curve-coefnames)))))))) | 208 | '(var pow var-pow) |
| 209 | calc-curve-varnames | ||
| 210 | (cons 'vec (cdr (cdr calc-curve-coefnames)))))))) | ||
| 190 | ((= key ?^) ; exponential law | 211 | ((= key ?^) ; exponential law |
| 191 | (calc-get-fit-variables calc-curve-nvars | 212 | (calc-get-fit-variables calc-curve-nvars |
| 192 | (1+ calc-curve-nvars) (and homog 1)) | 213 | (1+ calc-curve-nvars) (and homog 1)) |
| 193 | (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames) | 214 | (setq calc-curve-model |
| 194 | (calcFunc-reduce | 215 | (math-mul (nth 1 calc-curve-coefnames) |
| 195 | '(var mul var-mul) | 216 | (calcFunc-reduce |
| 196 | (calcFunc-map | 217 | '(var mul var-mul) |
| 197 | '(var pow var-pow) | 218 | (calcFunc-map |
| 198 | (cons 'vec (cdr (cdr calc-curve-coefnames))) | 219 | '(var pow var-pow) |
| 199 | calc-curve-varnames))))) | 220 | (cons 'vec (cdr (cdr calc-curve-coefnames))) |
| 221 | calc-curve-varnames))))) | ||
| 222 | ((= key ?s) | ||
| 223 | (setq nonlinear t) | ||
| 224 | (setq calc-curve-model t) | ||
| 225 | (require 'calc-nlfit) | ||
| 226 | (calc-fit-s-shaped-logistic-curve func)) | ||
| 227 | ((= key ?b) | ||
| 228 | (setq nonlinear t) | ||
| 229 | (setq calc-curve-model t) | ||
| 230 | (require 'calc-nlfit) | ||
| 231 | (calc-fit-bell-shaped-logistic-curve func)) | ||
| 232 | ((= key ?o) | ||
| 233 | (setq nonlinear t) | ||
| 234 | (setq calc-curve-model t) | ||
| 235 | (require 'calc-nlfit) | ||
| 236 | (if (and plot (not (stringp plot))) | ||
| 237 | (setq plot | ||
| 238 | (list 'vec | ||
| 239 | (nth 1 plot) | ||
| 240 | (cons | ||
| 241 | 'vec | ||
| 242 | (mapcar* 'calcFunc-div | ||
| 243 | (cdr (nth 2 plot)) | ||
| 244 | (cdr (nth 1 plot))))))) | ||
| 245 | (calc-fit-hubbert-linear-curve func)) | ||
| 200 | ((memq key '(?e ?E)) | 246 | ((memq key '(?e ?E)) |
| 201 | (calc-get-fit-variables calc-curve-nvars | 247 | (calc-get-fit-variables calc-curve-nvars |
| 202 | (1+ calc-curve-nvars) (and homog 1)) | 248 | (1+ calc-curve-nvars) (and homog 1)) |
| 203 | (setq calc-curve-model (math-mul (nth 1 calc-curve-coefnames) | 249 | (setq calc-curve-model |
| 204 | (calcFunc-reduce | 250 | (math-mul (nth 1 calc-curve-coefnames) |
| 205 | '(var mul var-mul) | 251 | (calcFunc-reduce |
| 206 | (calcFunc-map | 252 | '(var mul var-mul) |
| 207 | (if (eq key ?e) | 253 | (calcFunc-map |
| 208 | '(var exp var-exp) | 254 | (if (eq key ?e) |
| 209 | '(calcFunc-lambda | 255 | '(var exp var-exp) |
| 210 | (var a var-a) | 256 | '(calcFunc-lambda |
| 211 | (^ 10 (var a var-a)))) | 257 | (var a var-a) |
| 212 | (calcFunc-map | 258 | (^ 10 (var a var-a)))) |
| 213 | '(var mul var-mul) | 259 | (calcFunc-map |
| 214 | (cons 'vec (cdr (cdr calc-curve-coefnames))) | 260 | '(var mul var-mul) |
| 215 | calc-curve-varnames)))))) | 261 | (cons 'vec (cdr (cdr calc-curve-coefnames))) |
| 262 | calc-curve-varnames)))))) | ||
| 216 | ((memq key '(?x ?X)) | 263 | ((memq key '(?x ?X)) |
| 217 | (calc-get-fit-variables calc-curve-nvars | 264 | (calc-get-fit-variables calc-curve-nvars |
| 218 | (1+ calc-curve-nvars) (and homog 0)) | 265 | (1+ calc-curve-nvars) (and homog 0)) |
| 219 | (setq calc-curve-model (math-mul calc-curve-coefnames | 266 | (setq calc-curve-model |
| 220 | (cons 'vec (cons 1 (cdr calc-curve-varnames))))) | 267 | (math-mul calc-curve-coefnames |
| 268 | (cons 'vec (cons 1 (cdr calc-curve-varnames))))) | ||
| 221 | (setq calc-curve-model (if (eq key ?x) | 269 | (setq calc-curve-model (if (eq key ?x) |
| 222 | (list 'calcFunc-exp calc-curve-model) | 270 | (list 'calcFunc-exp calc-curve-model) |
| 223 | (list '^ 10 calc-curve-model)))) | 271 | (list '^ 10 calc-curve-model)))) |
| 224 | ((memq key '(?l ?L)) | 272 | ((memq key '(?l ?L)) |
| 225 | (calc-get-fit-variables calc-curve-nvars | 273 | (calc-get-fit-variables calc-curve-nvars |
| 226 | (1+ calc-curve-nvars) (and homog 0)) | 274 | (1+ calc-curve-nvars) (and homog 0)) |
| 227 | (setq calc-curve-model (math-mul calc-curve-coefnames | 275 | (setq calc-curve-model |
| 228 | (cons 'vec | 276 | (math-mul calc-curve-coefnames |
| 229 | (cons 1 (cdr (calcFunc-map | 277 | (cons 'vec |
| 230 | (if (eq key ?l) | 278 | (cons 1 (cdr (calcFunc-map |
| 231 | '(var ln var-ln) | 279 | (if (eq key ?l) |
| 232 | '(var log10 | 280 | '(var ln var-ln) |
| 233 | var-log10)) | 281 | '(var log10 |
| 234 | calc-curve-varnames))))))) | 282 | var-log10)) |
| 283 | calc-curve-varnames))))))) | ||
| 235 | ((= key ?q) | 284 | ((= key ?q) |
| 236 | (calc-get-fit-variables calc-curve-nvars | 285 | (calc-get-fit-variables calc-curve-nvars |
| 237 | (1+ (* 2 calc-curve-nvars)) (and homog 0)) | 286 | (1+ (* 2 calc-curve-nvars)) (and homog 0)) |
| @@ -247,12 +296,14 @@ | |||
| 247 | (list '- (car v) (nth 1 c)) | 296 | (list '- (car v) (nth 1 c)) |
| 248 | 2))))))) | 297 | 2))))))) |
| 249 | ((= key ?g) | 298 | ((= key ?g) |
| 250 | (setq calc-curve-model | 299 | (setq |
| 251 | (math-read-expr "(AFit / BFit sqrt(2 pi)) exp(-0.5 * ((XFit - CFit) / BFit)^2)") | 300 | calc-curve-model |
| 252 | calc-curve-varnames '(vec (var XFit var-XFit)) | 301 | (math-read-expr |
| 253 | calc-curve-coefnames '(vec (var AFit var-AFit) | 302 | "(AFit / BFit sqrt(2 pi)) exp(-0.5 * ((XFit - CFit) / BFit)^2)") |
| 254 | (var BFit var-BFit) | 303 | calc-curve-varnames '(vec (var XFit var-XFit)) |
| 255 | (var CFit var-CFit))) | 304 | calc-curve-coefnames '(vec (var AFit var-AFit) |
| 305 | (var BFit var-BFit) | ||
| 306 | (var CFit var-CFit))) | ||
| 256 | (calc-get-fit-variables 1 (1- (length calc-curve-coefnames)) | 307 | (calc-get-fit-variables 1 (1- (length calc-curve-coefnames)) |
| 257 | (and homog 1))) | 308 | (and homog 1))) |
| 258 | ((memq key '(?\$ ?\' ?u ?U)) | 309 | ((memq key '(?\$ ?\' ?u ?U)) |
| @@ -262,8 +313,9 @@ | |||
| 262 | (let* ((calc-dollar-values calc-arg-values) | 313 | (let* ((calc-dollar-values calc-arg-values) |
| 263 | (calc-dollar-used 0) | 314 | (calc-dollar-used 0) |
| 264 | (calc-hashes-used 0)) | 315 | (calc-hashes-used 0)) |
| 265 | (setq calc-curve-model (calc-do-alg-entry "" "Model formula: " | 316 | (setq calc-curve-model |
| 266 | nil 'calc-curve-fit-history)) | 317 | (calc-do-alg-entry "" "Model formula: " |
| 318 | nil 'calc-curve-fit-history)) | ||
| 267 | (if (/= (length calc-curve-model) 1) | 319 | (if (/= (length calc-curve-model) 1) |
| 268 | (error "Bad format")) | 320 | (error "Bad format")) |
| 269 | (setq calc-curve-model (car calc-curve-model) | 321 | (setq calc-curve-model (car calc-curve-model) |
| @@ -296,11 +348,13 @@ | |||
| 296 | (or (nth 3 calc-curve-model) | 348 | (or (nth 3 calc-curve-model) |
| 297 | (cons 'vec | 349 | (cons 'vec |
| 298 | (math-all-vars-but | 350 | (math-all-vars-but |
| 299 | calc-curve-model calc-curve-varnames))) | 351 | calc-curve-model |
| 352 | calc-curve-varnames))) | ||
| 300 | calc-curve-model (nth 1 calc-curve-model)) | 353 | calc-curve-model (nth 1 calc-curve-model)) |
| 301 | (error "Incorrect model specifier"))))) | 354 | (error "Incorrect model specifier"))))) |
| 302 | (or calc-curve-varnames | 355 | (or calc-curve-varnames |
| 303 | (let ((with-y (eq (car-safe calc-curve-model) 'calcFunc-eq))) | 356 | (let ((with-y |
| 357 | (eq (car-safe calc-curve-model) 'calcFunc-eq))) | ||
| 304 | (if calc-curve-coefnames | 358 | (if calc-curve-coefnames |
| 305 | (calc-get-fit-variables | 359 | (calc-get-fit-variables |
| 306 | (if with-y (1+ calc-curve-nvars) calc-curve-nvars) | 360 | (if with-y (1+ calc-curve-nvars) calc-curve-nvars) |
| @@ -310,7 +364,10 @@ | |||
| 310 | nil with-y) | 364 | nil with-y) |
| 311 | (let* ((coefs (math-all-vars-but calc-curve-model nil)) | 365 | (let* ((coefs (math-all-vars-but calc-curve-model nil)) |
| 312 | (vars nil) | 366 | (vars nil) |
| 313 | (n (- (length coefs) calc-curve-nvars (if with-y 2 1))) | 367 | (n (- |
| 368 | (length coefs) | ||
| 369 | calc-curve-nvars | ||
| 370 | (if with-y 2 1))) | ||
| 314 | p) | 371 | p) |
| 315 | (if (< n 0) | 372 | (if (< n 0) |
| 316 | (error "Not enough variables in model")) | 373 | (error "Not enough variables in model")) |
| @@ -326,18 +383,43 @@ | |||
| 326 | calc-curve-varnames calc-curve-coefnames) | 383 | calc-curve-varnames calc-curve-coefnames) |
| 327 | "modl")))) | 384 | "modl")))) |
| 328 | (t (beep)))) | 385 | (t (beep)))) |
| 329 | (let ((calc-fit-to-trail t)) | 386 | (unless nonlinear |
| 330 | (calc-enter-result n (substring (symbol-name func) 9) | 387 | (let ((calc-fit-to-trail t)) |
| 331 | (list func calc-curve-model | 388 | (calc-enter-result n (substring (symbol-name func) 9) |
| 332 | (if (= (length calc-curve-varnames) 2) | 389 | (list func calc-curve-model |
| 333 | (nth 1 calc-curve-varnames) | 390 | (if (= (length calc-curve-varnames) 2) |
| 334 | calc-curve-varnames) | 391 | (nth 1 calc-curve-varnames) |
| 335 | (if (= (length calc-curve-coefnames) 2) | 392 | calc-curve-varnames) |
| 336 | (nth 1 calc-curve-coefnames) | 393 | (if (= (length calc-curve-coefnames) 2) |
| 337 | calc-curve-coefnames) | 394 | (nth 1 calc-curve-coefnames) |
| 338 | data)) | 395 | calc-curve-coefnames) |
| 339 | (if (consp calc-fit-to-trail) | 396 | data)) |
| 340 | (calc-record (calc-normalize calc-fit-to-trail) "parm")))))) | 397 | (if (consp calc-fit-to-trail) |
| 398 | (calc-record (calc-normalize calc-fit-to-trail) "parm")))) | ||
| 399 | (when plot | ||
| 400 | (if (stringp plot) | ||
| 401 | (message plot) | ||
| 402 | (let ((calc-graph-no-auto-view t)) | ||
| 403 | (calc-graph-delete t) | ||
| 404 | (calc-graph-add-curve | ||
| 405 | (calc-graph-lookup (nth 1 plot)) | ||
| 406 | (calc-graph-lookup (nth 2 plot))) | ||
| 407 | (unless (math-contains-sdev-p (nth 2 data)) | ||
| 408 | (calc-graph-set-styles nil nil) | ||
| 409 | (calc-graph-point-style nil)) | ||
| 410 | (setq plot (cdr (nth 1 plot))) | ||
| 411 | (setq plot | ||
| 412 | (list 'intv | ||
| 413 | 3 | ||
| 414 | (math-sub | ||
| 415 | (math-min-list (car plot) (cdr plot)) | ||
| 416 | '(float 5 -1)) | ||
| 417 | (math-add | ||
| 418 | '(float 5 -1) | ||
| 419 | (math-max-list (car plot) (cdr plot))))) | ||
| 420 | (calc-graph-add-curve (calc-graph-lookup plot) | ||
| 421 | (calc-graph-lookup (calc-top-n 1))) | ||
| 422 | (calc-graph-plot nil))))))) | ||
| 341 | 423 | ||
| 342 | (defun calc-invent-independent-variables (n &optional but) | 424 | (defun calc-invent-independent-variables (n &optional but) |
| 343 | (calc-invent-variables n but '(x y z t) "x")) | 425 | (calc-invent-variables n but '(x y z t) "x")) |
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 7611e40f8ef..ea495777f19 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -2080,7 +2080,7 @@ Or, for optional MON, YR." | |||
| 2080 | ;; Don't do any window-related stuff if we weren't called from a | 2080 | ;; Don't do any window-related stuff if we weren't called from a |
| 2081 | ;; window displaying the calendar | 2081 | ;; window displaying the calendar |
| 2082 | (when in-calendar-window | 2082 | (when in-calendar-window |
| 2083 | (if (or (one-window-p t) (/= (frame-width) (window-width))) | 2083 | (if (or (one-window-p t) (not (window-full-width-p))) |
| 2084 | ;; Don't mess with the window size, but ensure that the first | 2084 | ;; Don't mess with the window size, but ensure that the first |
| 2085 | ;; line is fully visible | 2085 | ;; line is fully visible |
| 2086 | (set-window-vscroll nil 0) | 2086 | (set-window-vscroll nil 0) |
diff --git a/lisp/complete.el b/lisp/complete.el index 9be68d833e5..75774b65db0 100644 --- a/lisp/complete.el +++ b/lisp/complete.el | |||
| @@ -450,6 +450,7 @@ GOTO-END is non-nil, however, it instead replaces up to END." | |||
| 450 | env-on | 450 | env-on |
| 451 | regex | 451 | regex |
| 452 | p offset | 452 | p offset |
| 453 | abbreviated | ||
| 453 | (poss nil) | 454 | (poss nil) |
| 454 | helpposs | 455 | helpposs |
| 455 | (case-fold-search completion-ignore-case)) | 456 | (case-fold-search completion-ignore-case)) |
| @@ -586,17 +587,42 @@ GOTO-END is non-nil, however, it instead replaces up to END." | |||
| 586 | pred nil)) | 587 | pred nil)) |
| 587 | 588 | ||
| 588 | ;; Find an initial list of possible completions | 589 | ;; Find an initial list of possible completions |
| 589 | (if (not (setq p (string-match (concat PC-delim-regex | 590 | (unless (setq p (string-match (concat PC-delim-regex |
| 590 | (if filename "\\|\\*" "")) | 591 | (if filename "\\|\\*" "")) |
| 591 | str | 592 | str |
| 592 | (+ (length dirname) offset)))) | 593 | (+ (length dirname) offset))) |
| 593 | 594 | ||
| 594 | ;; Minibuffer contains no hyphens -- simple case! | 595 | ;; Minibuffer contains no hyphens -- simple case! |
| 595 | (setq poss (all-completions (if env-on | 596 | (setq poss (all-completions (if env-on basestr str) |
| 596 | basestr str) | ||
| 597 | table | 597 | table |
| 598 | pred)) | 598 | pred)) |
| 599 | 599 | (unless poss | |
| 600 | ;; Try completion as an abbreviation, e.g. "mvb" -> | ||
| 601 | ;; "m-v-b" -> "multiple-value-bind" | ||
| 602 | (setq origstr str | ||
| 603 | abbreviated t) | ||
| 604 | (if filename | ||
| 605 | (cond | ||
| 606 | ;; "alpha" or "/alpha" -> expand whole path. | ||
| 607 | ((string-match "^/?\\([A-Za-z0-9]+\\)$" str) | ||
| 608 | (setq | ||
| 609 | basestr "" | ||
| 610 | p nil | ||
| 611 | poss (PC-expand-many-files | ||
| 612 | (concat "/" | ||
| 613 | (mapconcat #'list (match-string 1 str) "*/") | ||
| 614 | "*")) | ||
| 615 | beg (1- beg))) | ||
| 616 | ;; Alphanumeric trailer -> expand trailing file | ||
| 617 | ((string-match "^\\(.+/\\)\\([A-Za-z0-9]+\\)$" str) | ||
| 618 | (setq regex (concat "\\`" | ||
| 619 | (mapconcat #'list | ||
| 620 | (match-string 2 str) | ||
| 621 | "[A-Za-z0-9]*[^A-Za-z0-9]")) | ||
| 622 | p (1+ (length (match-string 1 str)))))) | ||
| 623 | (setq regex (concat "\\`" (mapconcat #'list str "[^-]*-")) | ||
| 624 | p 1)))) | ||
| 625 | (when p | ||
| 600 | ;; Use all-completions to do an initial cull. This is a big win, | 626 | ;; Use all-completions to do an initial cull. This is a big win, |
| 601 | ;; since all-completions is written in C! | 627 | ;; since all-completions is written in C! |
| 602 | (let ((compl (all-completions (if env-on | 628 | (let ((compl (all-completions (if env-on |
| @@ -605,12 +631,24 @@ GOTO-END is non-nil, however, it instead replaces up to END." | |||
| 605 | table | 631 | table |
| 606 | pred))) | 632 | pred))) |
| 607 | (setq p compl) | 633 | (setq p compl) |
| 634 | (when (and compl abbreviated) | ||
| 635 | (if filename | ||
| 636 | (progn | ||
| 637 | (setq p nil) | ||
| 638 | (dolist (x compl) | ||
| 639 | (when (string-match regex x) | ||
| 640 | (push x p))) | ||
| 641 | (setq basestr (try-completion "" p))) | ||
| 642 | (setq basestr (mapconcat 'list str "-")) | ||
| 643 | (delete-region beg end) | ||
| 644 | (setq end (+ beg (length basestr))) | ||
| 645 | (insert basestr)))) | ||
| 608 | (while p | 646 | (while p |
| 609 | (and (string-match regex (car p)) | 647 | (and (string-match regex (car p)) |
| 610 | (progn | 648 | (progn |
| 611 | (set-text-properties 0 (length (car p)) '() (car p)) | 649 | (set-text-properties 0 (length (car p)) '() (car p)) |
| 612 | (setq poss (cons (car p) poss)))) | 650 | (setq poss (cons (car p) poss)))) |
| 613 | (setq p (cdr p))))) | 651 | (setq p (cdr p)))) |
| 614 | 652 | ||
| 615 | ;; If table had duplicates, they can be here. | 653 | ;; If table had duplicates, they can be here. |
| 616 | (delete-dups poss) | 654 | (delete-dups poss) |
| @@ -644,6 +682,7 @@ GOTO-END is non-nil, however, it instead replaces up to END." | |||
| 644 | (and p (setq poss p)))) | 682 | (and p (setq poss p)))) |
| 645 | 683 | ||
| 646 | ;; Now we have a list of possible completions | 684 | ;; Now we have a list of possible completions |
| 685 | |||
| 647 | (cond | 686 | (cond |
| 648 | 687 | ||
| 649 | ;; No valid completions found | 688 | ;; No valid completions found |
| @@ -653,6 +692,9 @@ GOTO-END is non-nil, however, it instead replaces up to END." | |||
| 653 | (let ((PC-word-failed-flag t)) | 692 | (let ((PC-word-failed-flag t)) |
| 654 | (delete-backward-char 1) | 693 | (delete-backward-char 1) |
| 655 | (PC-do-completion 'word)) | 694 | (PC-do-completion 'word)) |
| 695 | (when abbreviated | ||
| 696 | (delete-region beg end) | ||
| 697 | (insert origstr)) | ||
| 656 | (beep) | 698 | (beep) |
| 657 | (PC-temp-minibuffer-message (if ambig | 699 | (PC-temp-minibuffer-message (if ambig |
| 658 | " [Ambiguous dir name]" | 700 | " [Ambiguous dir name]" |
| @@ -789,13 +831,18 @@ GOTO-END is non-nil, however, it instead replaces up to END." | |||
| 789 | (setq completion-base-size (if dirname | 831 | (setq completion-base-size (if dirname |
| 790 | dirlength | 832 | dirlength |
| 791 | (- beg prompt-end)))))) | 833 | (- beg prompt-end)))))) |
| 792 | (PC-temp-minibuffer-message " [Next char not unique]")) | 834 | (PC-temp-minibuffer-message " [Next char not unique]")))))) |
| 793 | nil))))) | 835 | ;; Expansion of filenames is not reversible, so just keep |
| 836 | ;; the prefix. | ||
| 837 | (when (and abbreviated filename) | ||
| 838 | (delete-region (point) end)) | ||
| 839 | nil) | ||
| 794 | 840 | ||
| 795 | ;; Only one possible completion | 841 | ;; Only one possible completion |
| 796 | (t | 842 | (t |
| 797 | (if (and (equal basestr (car poss)) | 843 | (if (and (equal basestr (car poss)) |
| 798 | (not (and env-on filename))) | 844 | (not (and env-on filename)) |
| 845 | (not abbreviated)) | ||
| 799 | (if (null mode) | 846 | (if (null mode) |
| 800 | (PC-temp-minibuffer-message " [Sole completion]")) | 847 | (PC-temp-minibuffer-message " [Sole completion]")) |
| 801 | (delete-region beg end) | 848 | (delete-region beg end) |
| @@ -853,13 +900,11 @@ only symbols with function definitions are considered. | |||
| 853 | Otherwise, all symbols with function definitions, values | 900 | Otherwise, all symbols with function definitions, values |
| 854 | or properties are considered." | 901 | or properties are considered." |
| 855 | (interactive) | 902 | (interactive) |
| 856 | (let* ((end (point)) | 903 | (let* ((end |
| 857 | ;; To complete the word under point, rather than just the portion | 904 | (save-excursion |
| 858 | ;; before point, use this: | 905 | (with-syntax-table lisp-mode-syntax-table |
| 859 | ;;; (save-excursion | 906 | (skip-syntax-forward "_w") |
| 860 | ;;; (with-syntax-table lisp-mode-syntax-table | 907 | (point)))) |
| 861 | ;;; (forward-sexp 1) | ||
| 862 | ;;; (point)))) | ||
| 863 | (beg (save-excursion | 908 | (beg (save-excursion |
| 864 | (with-syntax-table lisp-mode-syntax-table | 909 | (with-syntax-table lisp-mode-syntax-table |
| 865 | (backward-sexp 1) | 910 | (backward-sexp 1) |
diff --git a/lisp/custom.el b/lisp/custom.el index a5a455c2f32..5138f800972 100644 --- a/lisp/custom.el +++ b/lisp/custom.el | |||
| @@ -642,7 +642,7 @@ this sets the local binding in that buffer instead." | |||
| 642 | (funcall variable (if value 1 0)))) | 642 | (funcall variable (if value 1 0)))) |
| 643 | 643 | ||
| 644 | (defun custom-quote (sexp) | 644 | (defun custom-quote (sexp) |
| 645 | "Quote SEXP iff it is not self quoting." | 645 | "Quote SEXP if it is not self quoting." |
| 646 | (if (or (memq sexp '(t nil)) | 646 | (if (or (memq sexp '(t nil)) |
| 647 | (keywordp sexp) | 647 | (keywordp sexp) |
| 648 | (and (listp sexp) | 648 | (and (listp sexp) |
| @@ -665,14 +665,14 @@ default value. Otherwise, set it to nil. | |||
| 665 | 665 | ||
| 666 | To actually save the value, call `custom-save-all'. | 666 | To actually save the value, call `custom-save-all'. |
| 667 | 667 | ||
| 668 | Return non-nil iff the `saved-value' property actually changed." | 668 | Return non-nil if the `saved-value' property actually changed." |
| 669 | (custom-load-symbol symbol) | 669 | (custom-load-symbol symbol) |
| 670 | (let* ((get (or (get symbol 'custom-get) 'default-value)) | 670 | (let* ((get (or (get symbol 'custom-get) 'default-value)) |
| 671 | (value (funcall get symbol)) | 671 | (value (funcall get symbol)) |
| 672 | (saved (get symbol 'saved-value)) | 672 | (saved (get symbol 'saved-value)) |
| 673 | (standard (get symbol 'standard-value)) | 673 | (standard (get symbol 'standard-value)) |
| 674 | (comment (get symbol 'customized-variable-comment))) | 674 | (comment (get symbol 'customized-variable-comment))) |
| 675 | ;; Save default value iff different from standard value. | 675 | ;; Save default value if different from standard value. |
| 676 | (if (or (null standard) | 676 | (if (or (null standard) |
| 677 | (not (equal value (condition-case nil | 677 | (not (equal value (condition-case nil |
| 678 | (eval (car standard)) | 678 | (eval (car standard)) |
| @@ -694,13 +694,13 @@ or else if it is different from the standard value, set the | |||
| 694 | `customized-value' property to a list whose car evaluates to the | 694 | `customized-value' property to a list whose car evaluates to the |
| 695 | default value. Otherwise, set it to nil. | 695 | default value. Otherwise, set it to nil. |
| 696 | 696 | ||
| 697 | Return non-nil iff the `customized-value' property actually changed." | 697 | Return non-nil if the `customized-value' property actually changed." |
| 698 | (custom-load-symbol symbol) | 698 | (custom-load-symbol symbol) |
| 699 | (let* ((get (or (get symbol 'custom-get) 'default-value)) | 699 | (let* ((get (or (get symbol 'custom-get) 'default-value)) |
| 700 | (value (funcall get symbol)) | 700 | (value (funcall get symbol)) |
| 701 | (customized (get symbol 'customized-value)) | 701 | (customized (get symbol 'customized-value)) |
| 702 | (old (or (get symbol 'saved-value) (get symbol 'standard-value)))) | 702 | (old (or (get symbol 'saved-value) (get symbol 'standard-value)))) |
| 703 | ;; Mark default value as set iff different from old value. | 703 | ;; Mark default value as set if different from old value. |
| 704 | (if (not (and old | 704 | (if (not (and old |
| 705 | (equal value (condition-case nil | 705 | (equal value (condition-case nil |
| 706 | (eval (car old)) | 706 | (eval (car old)) |
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index cfac6517209..be4c7e7b905 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el | |||
| @@ -349,8 +349,11 @@ when editing big diffs)." | |||
| 349 | ("^--- .+ ----$" . diff-hunk-header-face) ;context | 349 | ("^--- .+ ----$" . diff-hunk-header-face) ;context |
| 350 | ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal | 350 | ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal |
| 351 | ("^---$" . diff-hunk-header-face) ;normal | 351 | ("^---$" . diff-hunk-header-face) ;normal |
| 352 | ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t\n]+\\)\\(.*[^*-]\\)?\n" | 352 | ;; For file headers, accept files with spaces, but be careful to rule |
| 353 | (0 diff-header-face) (2 diff-file-header-face prepend)) | 353 | ;; out false-positives when matching hunk headers. |
| 354 | ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^\t\n]+?\\)\\(?:\t.*\\| \\(\\*\\*\\*\\*\\|----\\)\\)?\n" | ||
| 355 | (0 diff-header-face) | ||
| 356 | (2 (if (not (match-end 3)) diff-file-header-face) prepend)) | ||
| 354 | ("^\\([-<]\\)\\(.*\n\\)" | 357 | ("^\\([-<]\\)\\(.*\n\\)" |
| 355 | (1 diff-indicator-removed-face) (2 diff-removed-face)) | 358 | (1 diff-indicator-removed-face) (2 diff-removed-face)) |
| 356 | ("^\\([+>]\\)\\(.*\n\\)" | 359 | ("^\\([+>]\\)\\(.*\n\\)" |
| @@ -425,10 +428,20 @@ but in the file header instead, in which case move forward to the first hunk." | |||
| 425 | (defun diff-beginning-of-file () | 428 | (defun diff-beginning-of-file () |
| 426 | (beginning-of-line) | 429 | (beginning-of-line) |
| 427 | (unless (looking-at diff-file-header-re) | 430 | (unless (looking-at diff-file-header-re) |
| 428 | (forward-line 2) | 431 | (let ((start (point)) |
| 429 | (condition-case () | 432 | res) |
| 430 | (re-search-backward diff-file-header-re) | 433 | ;; diff-file-header-re may need to match up to 4 lines, so in case |
| 431 | (error (error "Can't find the beginning of the file"))))) | 434 | ;; we're inside the header, we need to move up to 3 lines forward. |
| 435 | (forward-line 3) | ||
| 436 | (if (and (setq res (re-search-backward diff-file-header-re nil t)) | ||
| 437 | ;; Maybe the 3 lines forward were too much and we matched | ||
| 438 | ;; a file header after our starting point :-( | ||
| 439 | (or (<= (point) start) | ||
| 440 | (setq res (re-search-backward diff-file-header-re nil t)))) | ||
| 441 | res | ||
| 442 | (goto-char start) | ||
| 443 | (error "Can't find the beginning of the file"))))) | ||
| 444 | |||
| 432 | 445 | ||
| 433 | (defun diff-end-of-file () | 446 | (defun diff-end-of-file () |
| 434 | (re-search-forward "^[-+#!<>0-9@* \\]" nil t) | 447 | (re-search-forward "^[-+#!<>0-9@* \\]" nil t) |
| @@ -481,26 +494,34 @@ If the prefix ARG is given, restrict the view to the current file instead." | |||
| 481 | "Go to the beginning of file-related diff-info. | 494 | "Go to the beginning of file-related diff-info. |
| 482 | This is like `diff-beginning-of-file' except it tries to skip back over leading | 495 | This is like `diff-beginning-of-file' except it tries to skip back over leading |
| 483 | data such as \"Index: ...\" and such." | 496 | data such as \"Index: ...\" and such." |
| 484 | (let ((start (point)) | 497 | (let* ((start (point)) |
| 485 | (file (condition-case err (progn (diff-beginning-of-file) (point)) | 498 | (prevfile (condition-case err |
| 486 | (error err))) | 499 | (save-excursion (diff-beginning-of-file) (point)) |
| 487 | ;; prevhunk is one of the limits. | 500 | (error err))) |
| 488 | (prevhunk (save-excursion (ignore-errors (diff-hunk-prev) (point)))) | 501 | (err (if (consp prevfile) prevfile)) |
| 489 | err) | 502 | (nextfile (ignore-errors |
| 490 | (when (consp file) | 503 | (save-excursion |
| 491 | ;; Presumably, we started before the file header, in the leading junk. | 504 | (goto-char start) (diff-file-next) (point)))) |
| 492 | (setq err file) | 505 | ;; prevhunk is one of the limits. |
| 493 | (diff-file-next) | 506 | (prevhunk (save-excursion |
| 494 | (setq file (point))) | 507 | (ignore-errors |
| 495 | (let ((index (save-excursion | 508 | (if (numberp prevfile) (goto-char prevfile)) |
| 496 | (re-search-backward "^Index: " prevhunk t)))) | 509 | (diff-hunk-prev) (point)))) |
| 497 | (when index (setq file index)) | 510 | (previndex (save-excursion |
| 498 | (if (<= file start) | 511 | (re-search-backward "^Index: " prevhunk t)))) |
| 499 | (goto-char file) | 512 | ;; If we're in the junk, we should use nextfile instead of prevfile. |
| 500 | ;; File starts *after* the starting point: we really weren't in | 513 | (if (and (numberp nextfile) |
| 501 | ;; a file diff but elsewhere. | 514 | (or (not (numberp prevfile)) |
| 502 | (goto-char start) | 515 | (and previndex (> previndex prevfile)))) |
| 503 | (signal (car err) (cdr err)))))) | 516 | (setq prevfile nextfile)) |
| 517 | (if (and previndex (numberp prevfile) (< previndex prevfile)) | ||
| 518 | (setq prevfile previndex)) | ||
| 519 | (if (and (numberp prevfile) (<= prevfile start)) | ||
| 520 | (goto-char prevfile) | ||
| 521 | ;; File starts *after* the starting point: we really weren't in | ||
| 522 | ;; a file diff but elsewhere. | ||
| 523 | (goto-char start) | ||
| 524 | (signal (car err) (cdr err))))) | ||
| 504 | 525 | ||
| 505 | (defun diff-file-kill () | 526 | (defun diff-file-kill () |
| 506 | "Kill current file's hunks." | 527 | "Kill current file's hunks." |
| @@ -703,7 +724,7 @@ PREFIX is only used internally: don't use it." | |||
| 703 | (defun diff-unified->context (start end) | 724 | (defun diff-unified->context (start end) |
| 704 | "Convert unified diffs to context diffs. | 725 | "Convert unified diffs to context diffs. |
| 705 | START and END are either taken from the region (if a prefix arg is given) or | 726 | START and END are either taken from the region (if a prefix arg is given) or |
| 706 | else cover the whole bufer." | 727 | else cover the whole buffer." |
| 707 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) | 728 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) |
| 708 | (list (region-beginning) (region-end)) | 729 | (list (region-beginning) (region-end)) |
| 709 | (list (point-min) (point-max)))) | 730 | (list (point-min) (point-max)))) |
| @@ -886,7 +907,7 @@ With a prefix argument, convert unified format to context format." | |||
| 886 | (defun diff-reverse-direction (start end) | 907 | (defun diff-reverse-direction (start end) |
| 887 | "Reverse the direction of the diffs. | 908 | "Reverse the direction of the diffs. |
| 888 | START and END are either taken from the region (if a prefix arg is given) or | 909 | START and END are either taken from the region (if a prefix arg is given) or |
| 889 | else cover the whole bufer." | 910 | else cover the whole buffer." |
| 890 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) | 911 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) |
| 891 | (list (region-beginning) (region-end)) | 912 | (list (region-beginning) (region-end)) |
| 892 | (list (point-min) (point-max)))) | 913 | (list (point-min) (point-max)))) |
| @@ -948,7 +969,7 @@ else cover the whole bufer." | |||
| 948 | (defun diff-fixup-modifs (start end) | 969 | (defun diff-fixup-modifs (start end) |
| 949 | "Fixup the hunk headers (in case the buffer was modified). | 970 | "Fixup the hunk headers (in case the buffer was modified). |
| 950 | START and END are either taken from the region (if a prefix arg is given) or | 971 | START and END are either taken from the region (if a prefix arg is given) or |
| 951 | else cover the whole bufer." | 972 | else cover the whole buffer." |
| 952 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) | 973 | (interactive (if (or current-prefix-arg (and transient-mark-mode mark-active)) |
| 953 | (list (region-beginning) (region-end)) | 974 | (list (region-beginning) (region-end)) |
| 954 | (list (point-min) (point-max)))) | 975 | (list (point-min) (point-max)))) |
diff --git a/lisp/diff.el b/lisp/diff.el index 3013f0d769e..b063c07b40f 100644 --- a/lisp/diff.el +++ b/lisp/diff.el | |||
| @@ -62,7 +62,8 @@ | |||
| 62 | 62 | ||
| 63 | (defun diff-sentinel (code) | 63 | (defun diff-sentinel (code) |
| 64 | "Code run when the diff process exits. | 64 | "Code run when the diff process exits. |
| 65 | CODE is the exit code of the process. It should be 0 iff no diffs were found." | 65 | CODE is the exit code of the process. It should be 0 only if no diffs |
| 66 | were found." | ||
| 66 | (if diff-old-temp-file (delete-file diff-old-temp-file)) | 67 | (if diff-old-temp-file (delete-file diff-old-temp-file)) |
| 67 | (if diff-new-temp-file (delete-file diff-new-temp-file)) | 68 | (if diff-new-temp-file (delete-file diff-new-temp-file)) |
| 68 | (save-excursion | 69 | (save-excursion |
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 4d06acdcf6c..124c53b44c5 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -1993,8 +1993,8 @@ of marked files. If KILL-ROOT is non-nil, kill DIRNAME as well." | |||
| 1993 | 1993 | ||
| 1994 | (defun dired-tree-lessp (dir1 dir2) | 1994 | (defun dired-tree-lessp (dir1 dir2) |
| 1995 | ;; Lexicographic order on file name components, like `ls -lR': | 1995 | ;; Lexicographic order on file name components, like `ls -lR': |
| 1996 | ;; DIR1 < DIR2 iff DIR1 comes *before* DIR2 in an `ls -lR' listing, | 1996 | ;; DIR1 < DIR2 if DIR1 comes *before* DIR2 in an `ls -lR' listing, |
| 1997 | ;; i.e., iff DIR1 is a (grand)parent dir of DIR2, | 1997 | ;; i.e., if DIR1 is a (grand)parent dir of DIR2, |
| 1998 | ;; or DIR1 and DIR2 are in the same parentdir and their last | 1998 | ;; or DIR1 and DIR2 are in the same parentdir and their last |
| 1999 | ;; components are string-lessp. | 1999 | ;; components are string-lessp. |
| 2000 | ;; Thus ("/usr/" "/usr/bin") and ("/usr/a/" "/usr/b/") are tree-lessp. | 2000 | ;; Thus ("/usr/" "/usr/bin") and ("/usr/a/" "/usr/b/") are tree-lessp. |
diff --git a/lisp/dired.el b/lisp/dired.el index 1a906093a7a..d263f0b3044 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -2560,12 +2560,12 @@ non-empty directories is allowed." | |||
| 2560 | (cond ;; if split-height-threshold is enabled, use the largest window | 2560 | (cond ;; if split-height-threshold is enabled, use the largest window |
| 2561 | ((and (> (window-height (setq w2 (get-largest-window))) | 2561 | ((and (> (window-height (setq w2 (get-largest-window))) |
| 2562 | split-height-threshold) | 2562 | split-height-threshold) |
| 2563 | (= (frame-width) (window-width w2))) | 2563 | (window-full-width-p w2)) |
| 2564 | (setq window w2)) | 2564 | (setq window w2)) |
| 2565 | ;; if the least-recently-used window is big enough, use it | 2565 | ;; if the least-recently-used window is big enough, use it |
| 2566 | ((and (> (window-height (setq w2 (get-lru-window))) | 2566 | ((and (> (window-height (setq w2 (get-lru-window))) |
| 2567 | (* 2 window-min-height)) | 2567 | (* 2 window-min-height)) |
| 2568 | (= (frame-width) (window-width w2))) | 2568 | (window-full-width-p w2)) |
| 2569 | (setq window w2))) | 2569 | (setq window w2))) |
| 2570 | (save-excursion | 2570 | (save-excursion |
| 2571 | (set-buffer buf) | 2571 | (set-buffer buf) |
diff --git a/lisp/double.el b/lisp/double.el index 4b1d59ff1ec..0b5cf110fbd 100644 --- a/lisp/double.el +++ b/lisp/double.el | |||
| @@ -186,7 +186,8 @@ use either \\[customize] or the function `double-mode'." | |||
| 186 | ;;;###autoload | 186 | ;;;###autoload |
| 187 | (defun double-mode (arg) | 187 | (defun double-mode (arg) |
| 188 | "Toggle Double mode. | 188 | "Toggle Double mode. |
| 189 | With prefix arg, turn Double mode on iff arg is positive. | 189 | With prefix argument ARG, turn Double mode on if ARG is positive, otherwise |
| 190 | turn it off. | ||
| 190 | 191 | ||
| 191 | When Double mode is on, some keys will insert different strings | 192 | When Double mode is on, some keys will insert different strings |
| 192 | when pressed twice. See variable `double-map' for details." | 193 | when pressed twice. See variable `double-map' for details." |
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el index 48cd7c79d4e..ec153fde625 100644 --- a/lisp/ediff-diff.el +++ b/lisp/ediff-diff.el | |||
| @@ -867,7 +867,7 @@ one optional arguments, diff-number to refine.") | |||
| 867 | (ediff-make-fine-diffs n 'noforce) | 867 | (ediff-make-fine-diffs n 'noforce) |
| 868 | (ediff-make-fine-diffs n 'skip))) | 868 | (ediff-make-fine-diffs n 'skip))) |
| 869 | 869 | ||
| 870 | ;; highlight iff fine diffs already exist | 870 | ;; highlight if fine diffs already exist |
| 871 | ((eq ediff-auto-refine 'off) | 871 | ((eq ediff-auto-refine 'off) |
| 872 | (ediff-make-fine-diffs n 'skip)))) | 872 | (ediff-make-fine-diffs n 'skip)))) |
| 873 | 873 | ||
| @@ -1459,7 +1459,7 @@ arguments to `skip-chars-forward'." | |||
| 1459 | 1459 | ||
| 1460 | 1460 | ||
| 1461 | (defun ediff-same-contents (d1 d2 &optional filter-re) | 1461 | (defun ediff-same-contents (d1 d2 &optional filter-re) |
| 1462 | "Returns t iff D1 and D2 have the same content. | 1462 | "Return t if D1 and D2 have the same content. |
| 1463 | D1 and D2 can either be both directories or both regular files. | 1463 | D1 and D2 can either be both directories or both regular files. |
| 1464 | Symlinks and the likes are not handled. | 1464 | Symlinks and the likes are not handled. |
| 1465 | If FILTER-RE is non-nil, recursive checking in directories | 1465 | If FILTER-RE is non-nil, recursive checking in directories |
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index d39b0bd9e4a..669c055de26 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -209,6 +209,7 @@ put the output in." | |||
| 209 | (setcdr p nil) | 209 | (setcdr p nil) |
| 210 | (princ "\n(" outbuf) | 210 | (princ "\n(" outbuf) |
| 211 | (let ((print-escape-newlines t) | 211 | (let ((print-escape-newlines t) |
| 212 | (print-quoted t) | ||
| 212 | (print-escape-nonascii t)) | 213 | (print-escape-nonascii t)) |
| 213 | (dolist (elt form) | 214 | (dolist (elt form) |
| 214 | (prin1 elt outbuf) | 215 | (prin1 elt outbuf) |
| @@ -232,6 +233,7 @@ put the output in." | |||
| 232 | outbuf)) | 233 | outbuf)) |
| 233 | (terpri outbuf))) | 234 | (terpri outbuf))) |
| 234 | (let ((print-escape-newlines t) | 235 | (let ((print-escape-newlines t) |
| 236 | (print-quoted t) | ||
| 235 | (print-escape-nonascii t)) | 237 | (print-escape-nonascii t)) |
| 236 | (print form outbuf))))))) | 238 | (print form outbuf))))))) |
| 237 | 239 | ||
diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el index 54fcfc3df8a..6daaf001433 100644 --- a/lisp/emacs-lisp/backquote.el +++ b/lisp/emacs-lisp/backquote.el | |||
| @@ -118,10 +118,28 @@ Vectors work just like lists. Nested backquotes are permitted." | |||
| 118 | ;; constant, 1 => to be unquoted, 2 => to be spliced in. | 118 | ;; constant, 1 => to be unquoted, 2 => to be spliced in. |
| 119 | ;; The top-level backquote macro just discards the tag. | 119 | ;; The top-level backquote macro just discards the tag. |
| 120 | 120 | ||
| 121 | (defun backquote-process (s) | 121 | (defun backquote-delay-process (s level) |
| 122 | "Process a (un|back|splice)quote inside a backquote. | ||
| 123 | This simply recurses through the body." | ||
| 124 | (let ((exp (backquote-listify (list (backquote-process (nth 1 s) level) | ||
| 125 | (cons 0 (list 'quote (car s)))) | ||
| 126 | '(0)))) | ||
| 127 | (if (eq (car-safe exp) 'quote) | ||
| 128 | (cons 0 (list 'quote s)) | ||
| 129 | (cons 1 exp)))) | ||
| 130 | |||
| 131 | (defun backquote-process (s &optional level) | ||
| 132 | "Process the body of a backquote. | ||
| 133 | S is the body. Returns a cons cell whose cdr is piece of code which | ||
| 134 | is the macro-expansion of S, and whose car is a small integer whose value | ||
| 135 | can either indicate that the code is constant (0), or not (1), or returns | ||
| 136 | a list which should be spliced into its environment (2). | ||
| 137 | LEVEL is only used internally and indicates the nesting level: | ||
| 138 | 0 (the default) is for the toplevel nested inside a single backquote." | ||
| 139 | (unless level (setq level 0)) | ||
| 122 | (cond | 140 | (cond |
| 123 | ((vectorp s) | 141 | ((vectorp s) |
| 124 | (let ((n (backquote-process (append s ())))) | 142 | (let ((n (backquote-process (append s ()) level))) |
| 125 | (if (= (car n) 0) | 143 | (if (= (car n) 0) |
| 126 | (cons 0 s) | 144 | (cons 0 s) |
| 127 | (cons 1 (cond | 145 | (cons 1 (cond |
| @@ -138,11 +156,15 @@ Vectors work just like lists. Nested backquotes are permitted." | |||
| 138 | s | 156 | s |
| 139 | (list 'quote s)))) | 157 | (list 'quote s)))) |
| 140 | ((eq (car s) backquote-unquote-symbol) | 158 | ((eq (car s) backquote-unquote-symbol) |
| 141 | (cons 1 (nth 1 s))) | 159 | (if (<= level 0) |
| 160 | (cons 1 (nth 1 s)) | ||
| 161 | (backquote-delay-process s (1- level)))) | ||
| 142 | ((eq (car s) backquote-splice-symbol) | 162 | ((eq (car s) backquote-splice-symbol) |
| 143 | (cons 2 (nth 1 s))) | 163 | (if (<= level 0) |
| 164 | (cons 2 (nth 1 s)) | ||
| 165 | (backquote-delay-process s (1- level)))) | ||
| 144 | ((eq (car s) backquote-backquote-symbol) | 166 | ((eq (car s) backquote-backquote-symbol) |
| 145 | (backquote-process (cdr (backquote-process (nth 1 s))))) | 167 | (backquote-delay-process s (1+ level))) |
| 146 | (t | 168 | (t |
| 147 | (let ((rest s) | 169 | (let ((rest s) |
| 148 | item firstlist list lists expression) | 170 | item firstlist list lists expression) |
| @@ -154,11 +176,13 @@ Vectors work just like lists. Nested backquotes are permitted." | |||
| 154 | ;; at the beginning, put them in FIRSTLIST, | 176 | ;; at the beginning, put them in FIRSTLIST, |
| 155 | ;; as a list of tagged values (TAG . FORM). | 177 | ;; as a list of tagged values (TAG . FORM). |
| 156 | ;; If there are any at the end, they go in LIST, likewise. | 178 | ;; If there are any at the end, they go in LIST, likewise. |
| 157 | (while (consp rest) | 179 | (while (and (consp rest) |
| 158 | ;; Turn . (, foo) into (,@ foo). | 180 | ;; Stop if the cdr is an expression inside a backquote or |
| 159 | (if (eq (car rest) backquote-unquote-symbol) | 181 | ;; unquote since this needs to go recursively through |
| 160 | (setq rest (list (list backquote-splice-symbol (nth 1 rest))))) | 182 | ;; backquote-process. |
| 161 | (setq item (backquote-process (car rest))) | 183 | (not (or (eq (car rest) backquote-unquote-symbol) |
| 184 | (eq (car rest) backquote-backquote-symbol)))) | ||
| 185 | (setq item (backquote-process (car rest) level)) | ||
| 162 | (cond | 186 | (cond |
| 163 | ((= (car item) 2) | 187 | ((= (car item) 2) |
| 164 | ;; Put the nonspliced items before the first spliced item | 188 | ;; Put the nonspliced items before the first spliced item |
| @@ -168,8 +192,8 @@ Vectors work just like lists. Nested backquotes are permitted." | |||
| 168 | list nil)) | 192 | list nil)) |
| 169 | ;; Otherwise, put any preceding nonspliced items into LISTS. | 193 | ;; Otherwise, put any preceding nonspliced items into LISTS. |
| 170 | (if list | 194 | (if list |
| 171 | (setq lists (cons (backquote-listify list '(0 . nil)) lists))) | 195 | (push (backquote-listify list '(0 . nil)) lists)) |
| 172 | (setq lists (cons (cdr item) lists)) | 196 | (push (cdr item) lists) |
| 173 | (setq list nil)) | 197 | (setq list nil)) |
| 174 | (t | 198 | (t |
| 175 | (setq list (cons item list)))) | 199 | (setq list (cons item list)))) |
| @@ -177,8 +201,8 @@ Vectors work just like lists. Nested backquotes are permitted." | |||
| 177 | ;; Handle nonsplicing final elements, and the tail of the list | 201 | ;; Handle nonsplicing final elements, and the tail of the list |
| 178 | ;; (which remains in REST). | 202 | ;; (which remains in REST). |
| 179 | (if (or rest list) | 203 | (if (or rest list) |
| 180 | (setq lists (cons (backquote-listify list (backquote-process rest)) | 204 | (push (backquote-listify list (backquote-process rest level)) |
| 181 | lists))) | 205 | lists)) |
| 182 | ;; Turn LISTS into a form that produces the combined list. | 206 | ;; Turn LISTS into a form that produces the combined list. |
| 183 | (setq expression | 207 | (setq expression |
| 184 | (if (or (cdr lists) | 208 | (if (or (cdr lists) |
| @@ -221,5 +245,5 @@ Vectors work just like lists. Nested backquotes are permitted." | |||
| 221 | tail)) | 245 | tail)) |
| 222 | (t (cons 'list heads))))) | 246 | (t (cons 'list heads))))) |
| 223 | 247 | ||
| 224 | ;;; arch-tag: 1a26206a-6b5e-4c56-8e24-2eef0f7e0e7a | 248 | ;; arch-tag: 1a26206a-6b5e-4c56-8e24-2eef0f7e0e7a |
| 225 | ;;; backquote.el ends here | 249 | ;;; backquote.el ends here |
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 588501aad97..6db7aaf1183 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el | |||
| @@ -564,7 +564,7 @@ | |||
| 564 | (cons fn args))))))) | 564 | (cons fn args))))))) |
| 565 | 565 | ||
| 566 | (defun byte-optimize-all-constp (list) | 566 | (defun byte-optimize-all-constp (list) |
| 567 | "Non-nil iff all elements of LIST satisfy `byte-compile-constp'." | 567 | "Non-nil if all elements of LIST satisfy `byte-compile-constp'." |
| 568 | (let ((constant t)) | 568 | (let ((constant t)) |
| 569 | (while (and list constant) | 569 | (while (and list constant) |
| 570 | (unless (byte-compile-constp (car list)) | 570 | (unless (byte-compile-constp (car list)) |
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 862a7efe046..e1835d75fcb 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -1243,7 +1243,8 @@ generating a buffered list of errors." | |||
| 1243 | ;;;###autoload | 1243 | ;;;###autoload |
| 1244 | (define-minor-mode checkdoc-minor-mode | 1244 | (define-minor-mode checkdoc-minor-mode |
| 1245 | "Toggle Checkdoc minor mode, a mode for checking Lisp doc strings. | 1245 | "Toggle Checkdoc minor mode, a mode for checking Lisp doc strings. |
| 1246 | With prefix ARG, turn Checkdoc minor mode on iff ARG is positive. | 1246 | With prefix ARG, turn Checkdoc minor mode on if ARG is positive, otherwise |
| 1247 | turn it off. | ||
| 1247 | 1248 | ||
| 1248 | In Checkdoc minor mode, the usual bindings for `eval-defun' which is | 1249 | In Checkdoc minor mode, the usual bindings for `eval-defun' which is |
| 1249 | bound to \\<checkdoc-minor-mode-map>\\[checkdoc-eval-defun] and `checkdoc-eval-current-buffer' are overridden to include | 1250 | bound to \\<checkdoc-minor-mode-map>\\[checkdoc-eval-defun] and `checkdoc-eval-current-buffer' are overridden to include |
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 12514b43534..4a0c17c0a4c 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | ;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p | 10 | ;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p |
| 11 | ;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively | 11 | ;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively |
| 12 | ;;;;;; notevery notany every some mapcon mapcan mapl maplist map | 12 | ;;;;;; notevery notany every some mapcon mapcan mapl maplist map |
| 13 | ;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "47c92504dda976a632c2c10bedd4b6a4") | 13 | ;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "53c2b3ede19dac62cff13a37f58cdf9c") |
| 14 | ;;; Generated autoloads from cl-extra.el | 14 | ;;; Generated autoloads from cl-extra.el |
| 15 | 15 | ||
| 16 | (autoload (quote coerce) "cl-extra" "\ | 16 | (autoload (quote coerce) "cl-extra" "\ |
| @@ -745,7 +745,7 @@ Not documented | |||
| 745 | ;;;;;; find nsubstitute-if-not nsubstitute-if nsubstitute substitute-if-not | 745 | ;;;;;; find nsubstitute-if-not nsubstitute-if nsubstitute substitute-if-not |
| 746 | ;;;;;; substitute-if substitute delete-duplicates remove-duplicates | 746 | ;;;;;; substitute-if substitute delete-duplicates remove-duplicates |
| 747 | ;;;;;; delete-if-not delete-if delete* remove-if-not remove-if remove* | 747 | ;;;;;; delete-if-not delete-if delete* remove-if-not remove-if remove* |
| 748 | ;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" "8805f76626399794931f5db36ddf855f") | 748 | ;;;;;; replace fill reduce) "cl-seq" "cl-seq.el" "c972a97c053d4e001ac1d1012c315b28") |
| 749 | ;;; Generated autoloads from cl-seq.el | 749 | ;;; Generated autoloads from cl-seq.el |
| 750 | 750 | ||
| 751 | (autoload (quote reduce) "cl-seq" "\ | 751 | (autoload (quote reduce) "cl-seq" "\ |
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 5a7dc53e917..b802d8acd43 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el | |||
| @@ -546,7 +546,7 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'." | |||
| 546 | (easy-menu-define-key map (easy-menu-intern (car item)) (cdr item) before))) | 546 | (easy-menu-define-key map (easy-menu-intern (car item)) (cdr item) before))) |
| 547 | 547 | ||
| 548 | (defun easy-menu-item-present-p (map path name) | 548 | (defun easy-menu-item-present-p (map path name) |
| 549 | "In submenu of MAP with path PATH, return non-nil iff item NAME is present. | 549 | "In submenu of MAP with path PATH, return non-nil if item NAME is present. |
| 550 | MAP and PATH are defined as in `easy-menu-add-item'. | 550 | MAP and PATH are defined as in `easy-menu-add-item'. |
| 551 | NAME should be a string, the name of the element to be looked for." | 551 | NAME should be a string, the name of the element to be looked for." |
| 552 | (easy-menu-return-item (easy-menu-get-map map path) name)) | 552 | (easy-menu-return-item (easy-menu-get-map map path) name)) |
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index c1bc6dae515..2ff273ebab3 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el | |||
| @@ -267,13 +267,13 @@ Emacs Lisp mode) that support Eldoc.") | |||
| 267 | ;; Return a string containing the function parameter list, or 1-line | 267 | ;; Return a string containing the function parameter list, or 1-line |
| 268 | ;; docstring if function is a subr and no arglist is obtainable from the | 268 | ;; docstring if function is a subr and no arglist is obtainable from the |
| 269 | ;; docstring or elsewhere. | 269 | ;; docstring or elsewhere. |
| 270 | (defun eldoc-get-fnsym-args-string (sym argument-index) | 270 | (defun eldoc-get-fnsym-args-string (sym &optional argument-index) |
| 271 | (let ((args nil) | 271 | (let ((args nil) |
| 272 | (doc nil)) | 272 | (doc nil)) |
| 273 | (cond ((not (and sym (symbolp sym) (fboundp sym)))) | 273 | (cond ((not (and sym (symbolp sym) (fboundp sym)))) |
| 274 | ((and (eq sym (aref eldoc-last-data 0)) | 274 | ((and (eq sym (aref eldoc-last-data 0)) |
| 275 | (eq 'function (aref eldoc-last-data 2))) | 275 | (eq 'function (aref eldoc-last-data 2))) |
| 276 | (setq args (aref eldoc-last-data 1))) | 276 | (setq doc (aref eldoc-last-data 1))) |
| 277 | ((setq doc (help-split-fundoc (documentation sym t) sym)) | 277 | ((setq doc (help-split-fundoc (documentation sym t) sym)) |
| 278 | (setq args (car doc)) | 278 | (setq args (car doc)) |
| 279 | (string-match "\\`[^ )]* ?" args) | 279 | (string-match "\\`[^ )]* ?" args) |
| @@ -281,8 +281,9 @@ Emacs Lisp mode) that support Eldoc.") | |||
| 281 | (eldoc-last-data-store sym args 'function)) | 281 | (eldoc-last-data-store sym args 'function)) |
| 282 | (t | 282 | (t |
| 283 | (setq args (eldoc-function-argstring sym)))) | 283 | (setq args (eldoc-function-argstring sym)))) |
| 284 | (when args | 284 | (and args |
| 285 | (setq doc (eldoc-highlight-function-argument sym args argument-index))) | 285 | argument-index |
| 286 | (setq doc (eldoc-highlight-function-argument sym args argument-index))) | ||
| 286 | doc)) | 287 | doc)) |
| 287 | 288 | ||
| 288 | ;; Highlight argument INDEX in ARGS list for SYM. | 289 | ;; Highlight argument INDEX in ARGS list for SYM. |
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 957c5b23541..ae150078785 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el | |||
| @@ -554,7 +554,7 @@ appended to R will apply to all of R. For example, \"a\" | |||
| 554 | 554 | ||
| 555 | This function may return false negatives, but it will not | 555 | This function may return false negatives, but it will not |
| 556 | return false positives. It is nevertheless useful in | 556 | return false positives. It is nevertheless useful in |
| 557 | situations where an efficiency shortcut can be taken iff a | 557 | situations where an efficiency shortcut can be taken only if a |
| 558 | regexp is atomic. The function can be improved to detect | 558 | regexp is atomic. The function can be improved to detect |
| 559 | more cases of atomic regexps. Presently, this function | 559 | more cases of atomic regexps. Presently, this function |
| 560 | detects the following categories of atomic regexp; | 560 | detects the following categories of atomic regexp; |
diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index bf52acef382..d7dd1f19300 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el | |||
| @@ -212,7 +212,7 @@ of symbols with local bindings." | |||
| 212 | 212 | ||
| 213 | 213 | ||
| 214 | (defun unsafep-function (fun) | 214 | (defun unsafep-function (fun) |
| 215 | "Return nil iff FUN is a safe function. | 215 | "Return nil if FUN is a safe function. |
| 216 | \(either a safe lambda or a symbol that names a safe function). Otherwise | 216 | \(either a safe lambda or a symbol that names a safe function). Otherwise |
| 217 | result is a reason code." | 217 | result is a reason code." |
| 218 | (cond | 218 | (cond |
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index f3792b92e42..81187112a66 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el | |||
| @@ -792,10 +792,13 @@ Create the key map if necessary." | |||
| 792 | (use-local-map tpu-buffer-local-map))) | 792 | (use-local-map tpu-buffer-local-map))) |
| 793 | (local-set-key key func)) | 793 | (local-set-key key func)) |
| 794 | 794 | ||
| 795 | (defun tpu-current-line nil | 795 | (defun tpu-current-line () |
| 796 | "Return the vertical position of point in the selected window. | 796 | "Return the vertical position of point in the selected window. |
| 797 | Top line is 0. Counts each text line only once, even if it wraps." | 797 | Top line is 0. Counts each text line only once, even if it wraps." |
| 798 | (+ (count-lines (window-start) (point)) (if (= (current-column) 0) 1 0) -1)) | 798 | (or |
| 799 | (cdr (nth 6 (posn-at-point))) | ||
| 800 | (if (eq (window-start) (point)) 0 | ||
| 801 | (1- (count-screen-lines (window-start) (point) 'count-final-newline))))) | ||
| 799 | 802 | ||
| 800 | 803 | ||
| 801 | ;;; | 804 | ;;; |
| @@ -2422,6 +2425,7 @@ If FILE is nil, try to load a default file. The default file names are | |||
| 2422 | (if (eq tpu-global-map parent) | 2425 | (if (eq tpu-global-map parent) |
| 2423 | (set-keymap-parent map (keymap-parent parent)) | 2426 | (set-keymap-parent map (keymap-parent parent)) |
| 2424 | (setq map parent))))) | 2427 | (setq map parent))))) |
| 2428 | (ad-disable-regexp "\\`tpu-") | ||
| 2425 | (setq tpu-edt-mode nil)) | 2429 | (setq tpu-edt-mode nil)) |
| 2426 | 2430 | ||
| 2427 | (provide 'tpu-edt) | 2431 | (provide 'tpu-edt) |
diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el index 019896c0eb2..609ce2e203b 100644 --- a/lisp/emulation/tpu-extras.el +++ b/lisp/emulation/tpu-extras.el | |||
| @@ -141,13 +141,11 @@ the previous line when starting from a line beginning." | |||
| 141 | 141 | ||
| 142 | (add-hook 'picture-mode-hook 'tpu-set-cursor-free) | 142 | (add-hook 'picture-mode-hook 'tpu-set-cursor-free) |
| 143 | 143 | ||
| 144 | (defun tpu-write-file-hook nil | 144 | (defun tpu-before-save-hook () |
| 145 | "Eliminate whitespace at ends of lines, if the cursor is free." | 145 | "Eliminate whitespace at ends of lines, if the cursor is free." |
| 146 | (if (and (buffer-modified-p) tpu-cursor-free) (tpu-trim-line-ends))) | 146 | (if (and (buffer-modified-p) tpu-cursor-free) (tpu-trim-line-ends))) |
| 147 | 147 | ||
| 148 | (or (memq 'tpu-write-file-hook write-file-functions) | 148 | (add-hook 'before-save-hook 'tpu-before-save-hook) |
| 149 | (setq write-file-functions | ||
| 150 | (cons 'tpu-write-file-hook write-file-functions))) | ||
| 151 | 149 | ||
| 152 | 150 | ||
| 153 | ;;; Utility routines for implementing scroll margins | 151 | ;;; Utility routines for implementing scroll margins |
| @@ -246,7 +244,7 @@ Accepts a prefix argument for the number of lines to move." | |||
| 246 | (end-of-line (- 1 num)))) | 244 | (end-of-line (- 1 num)))) |
| 247 | (tpu-top-check beg num))) | 245 | (tpu-top-check beg num))) |
| 248 | 246 | ||
| 249 | (defun tpu-current-end-of-line nil | 247 | (defun tpu-current-end-of-line () |
| 250 | "Move point to end of current line." | 248 | "Move point to end of current line." |
| 251 | (interactive) | 249 | (interactive) |
| 252 | (let ((beg (point))) | 250 | (let ((beg (point))) |
| @@ -392,41 +390,24 @@ A repeat count means scroll that many sections." | |||
| 392 | 390 | ||
| 393 | 391 | ||
| 394 | 392 | ||
| 395 | ;;; Replace the newline, newline-and-indent, and do-auto-fill functions | 393 | ;; Advise the newline, newline-and-indent, and do-auto-fill functions. |
| 396 | 394 | (defadvice newline (around tpu-respect-bottom-scroll-margin activate disable) | |
| 397 | (or (fboundp 'tpu-old-newline) | 395 | "Respect `tpu-bottom-scroll-margin'." |
| 398 | (fset 'tpu-old-newline (symbol-function 'newline))) | 396 | (let ((beg (tpu-current-line)) |
| 399 | (or (fboundp 'tpu-old-do-auto-fill) | 397 | (num (prefix-numeric-value (ad-get-arg 0)))) |
| 400 | (fset 'tpu-old-do-auto-fill (symbol-function 'do-auto-fill))) | 398 | ad-do-it |
| 401 | (or (fboundp 'tpu-old-newline-and-indent) | ||
| 402 | (fset 'tpu-old-newline-and-indent (symbol-function 'newline-and-indent))) | ||
| 403 | |||
| 404 | (defun newline (&optional num) | ||
| 405 | "Insert a newline. With arg, insert that many newlines. | ||
| 406 | In Auto Fill mode, can break the preceding line if no numeric arg. | ||
| 407 | This is the TPU-edt version that respects the bottom scroll margin." | ||
| 408 | (interactive "p") | ||
| 409 | (let ((beg (tpu-current-line))) | ||
| 410 | (or num (setq num 1)) | ||
| 411 | (tpu-old-newline num) | ||
| 412 | (tpu-bottom-check beg num))) | 399 | (tpu-bottom-check beg num))) |
| 413 | 400 | ||
| 414 | (defun newline-and-indent nil | 401 | (defadvice newline-and-indent (around tpu-respect-bottom-scroll-margin) |
| 415 | "Insert a newline, then indent according to major mode. | 402 | "Respect `tpu-bottom-scroll-margin'." |
| 416 | Indentation is done using the current indent-line-function. | ||
| 417 | In programming language modes, this is the same as TAB. | ||
| 418 | In some text modes, where TAB inserts a tab, this indents | ||
| 419 | to the specified left-margin column. This is the TPU-edt | ||
| 420 | version that respects the bottom scroll margin." | ||
| 421 | (interactive) | ||
| 422 | (let ((beg (tpu-current-line))) | 403 | (let ((beg (tpu-current-line))) |
| 423 | (tpu-old-newline-and-indent) | 404 | ad-do-it |
| 424 | (tpu-bottom-check beg 1))) | 405 | (tpu-bottom-check beg 1))) |
| 425 | 406 | ||
| 426 | (defun do-auto-fill nil | 407 | (defadvice do-auto-fill (around tpu-respect-bottom-scroll-margin) |
| 427 | "TPU-edt version that respects the bottom scroll margin." | 408 | "Respect `tpu-bottom-scroll-margin'." |
| 428 | (let ((beg (tpu-current-line))) | 409 | (let ((beg (tpu-current-line))) |
| 429 | (tpu-old-do-auto-fill) | 410 | ad-do-it |
| 430 | (tpu-bottom-check beg 1))) | 411 | (tpu-bottom-check beg 1))) |
| 431 | 412 | ||
| 432 | 413 | ||
| @@ -440,18 +421,21 @@ version that respects the bottom scroll margin." | |||
| 440 | \nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ") | 421 | \nsEnter bottom scroll margin (N lines or N%% or RETURN for current value): ") |
| 441 | ;; set top scroll margin | 422 | ;; set top scroll margin |
| 442 | (or (string= top "") | 423 | (or (string= top "") |
| 443 | (if (string= "%" (substring top -1)) | 424 | (setq tpu-top-scroll-margin |
| 444 | (setq tpu-top-scroll-margin (string-to-number top)) | 425 | (if (string= "%" (substring top -1)) |
| 445 | (setq tpu-top-scroll-margin | 426 | (string-to-number top) |
| 446 | (/ (1- (+ (* (string-to-number top) 100) (window-height))) | 427 | (/ (1- (+ (* (string-to-number top) 100) (window-height))) |
| 447 | (window-height))))) | 428 | (window-height))))) |
| 448 | ;; set bottom scroll margin | 429 | ;; set bottom scroll margin |
| 449 | (or (string= bottom "") | 430 | (or (string= bottom "") |
| 450 | (if (string= "%" (substring bottom -1)) | 431 | (setq tpu-bottom-scroll-margin |
| 451 | (setq tpu-bottom-scroll-margin (string-to-number bottom)) | 432 | (if (string= "%" (substring bottom -1)) |
| 452 | (setq tpu-bottom-scroll-margin | 433 | (string-to-number bottom) |
| 453 | (/ (1- (+ (* (string-to-number bottom) 100) (window-height))) | 434 | (/ (1- (+ (* (string-to-number bottom) 100) (window-height))) |
| 454 | (window-height))))) | 435 | (window-height))))) |
| 436 | (dolist (f '(newline newline-and-indent do-auto-fill)) | ||
| 437 | (ad-enable-advice f 'around 'tpu-respect-bottom-scroll-margin) | ||
| 438 | (ad-activate f)) | ||
| 455 | ;; report scroll margin settings if running interactively | 439 | ;; report scroll margin settings if running interactively |
| 456 | (and (interactive-p) | 440 | (and (interactive-p) |
| 457 | (message "Scroll margins set. Top = %s%%, Bottom = %s%%" | 441 | (message "Scroll margins set. Top = %s%%, Bottom = %s%%" |
| @@ -461,7 +445,7 @@ version that respects the bottom scroll margin." | |||
| 461 | ;;; Functions to set cursor bound or free | 445 | ;;; Functions to set cursor bound or free |
| 462 | 446 | ||
| 463 | ;;;###autoload | 447 | ;;;###autoload |
| 464 | (defun tpu-set-cursor-free nil | 448 | (defun tpu-set-cursor-free () |
| 465 | "Allow the cursor to move freely about the screen." | 449 | "Allow the cursor to move freely about the screen." |
| 466 | (interactive) | 450 | (interactive) |
| 467 | (setq tpu-cursor-free t) | 451 | (setq tpu-cursor-free t) |
| @@ -471,7 +455,7 @@ version that respects the bottom scroll margin." | |||
| 471 | (message "The cursor will now move freely about the screen.")) | 455 | (message "The cursor will now move freely about the screen.")) |
| 472 | 456 | ||
| 473 | ;;;###autoload | 457 | ;;;###autoload |
| 474 | (defun tpu-set-cursor-bound nil | 458 | (defun tpu-set-cursor-bound () |
| 475 | "Constrain the cursor to the flow of the text." | 459 | "Constrain the cursor to the flow of the text." |
| 476 | (interactive) | 460 | (interactive) |
| 477 | (tpu-trim-line-ends) | 461 | (tpu-trim-line-ends) |
| @@ -481,5 +465,5 @@ version that respects the bottom scroll margin." | |||
| 481 | GOLD-map) | 465 | GOLD-map) |
| 482 | (message "The cursor is now bound to the flow of your text.")) | 466 | (message "The cursor is now bound to the flow of your text.")) |
| 483 | 467 | ||
| 484 | ;;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a | 468 | ;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a |
| 485 | ;;; tpu-extras.el ends here | 469 | ;;; tpu-extras.el ends here |
diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el index 54fb2d1e997..977a7980803 100644 --- a/lisp/emulation/vi.el +++ b/lisp/emulation/vi.el | |||
| @@ -788,7 +788,7 @@ The given COUNT is remembered for future scrollings." | |||
| 788 | "Go down count lines, try to keep at the same column." | 788 | "Go down count lines, try to keep at the same column." |
| 789 | (interactive "p") | 789 | (interactive "p") |
| 790 | (setq this-command 'next-line) ; this is a needed trick | 790 | (setq this-command 'next-line) ; this is a needed trick |
| 791 | (if (= (point) (or (line-move count) (point))) | 791 | (if (= (point) (progn (line-move count) (point))) |
| 792 | (ding) ; no moving, already at end of buffer | 792 | (ding) ; no moving, already at end of buffer |
| 793 | (setq last-command 'next-line))) | 793 | (setq last-command 'next-line))) |
| 794 | 794 | ||
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index a5b2a8100a8..43f4c230d14 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2007-08-08 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * erc-log.el, erc.el: Replace `iff' in doc-strings and comments. | ||
| 4 | |||
| 1 | 2007-07-30 Michael Olson <mwolson@gnu.org> | 5 | 2007-07-30 Michael Olson <mwolson@gnu.org> |
| 2 | 6 | ||
| 3 | * erc-nicklist.el: Remove from the Emacs source tree. This file | 7 | * erc-nicklist.el: Remove from the Emacs source tree. This file |
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 194f8ae6bf1..88132afae0c 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el | |||
| @@ -261,7 +261,7 @@ The current buffer is given by BUFFER." | |||
| 261 | 261 | ||
| 262 | (defun erc-log-all-but-server-buffers (buffer) | 262 | (defun erc-log-all-but-server-buffers (buffer) |
| 263 | "Returns t if logging should be enabled in BUFFER. | 263 | "Returns t if logging should be enabled in BUFFER. |
| 264 | Returns nil iff `erc-server-buffer-p' returns t." | 264 | Returns nil if `erc-server-buffer-p' returns t." |
| 265 | (save-excursion | 265 | (save-excursion |
| 266 | (save-window-excursion | 266 | (save-window-excursion |
| 267 | (set-buffer buffer) | 267 | (set-buffer buffer) |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index d5a823ac825..c26bdf2a19f 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -3958,7 +3958,7 @@ and always returns t." | |||
| 3958 | (defun erc-echo-notice-in-target-buffer (s parsed buffer sender) | 3958 | (defun erc-echo-notice-in-target-buffer (s parsed buffer sender) |
| 3959 | "Echos a private notice in BUFFER, if BUFFER is non-nil. This | 3959 | "Echos a private notice in BUFFER, if BUFFER is non-nil. This |
| 3960 | function is designed to be added to either `erc-echo-notice-hook' | 3960 | function is designed to be added to either `erc-echo-notice-hook' |
| 3961 | or `erc-echo-notice-always-hook', and returns non-nil iff BUFFER | 3961 | or `erc-echo-notice-always-hook', and returns non-nil if BUFFER |
| 3962 | is non-nil." | 3962 | is non-nil." |
| 3963 | (if buffer | 3963 | (if buffer |
| 3964 | (progn (erc-display-message parsed nil buffer s) t) | 3964 | (progn (erc-display-message parsed nil buffer s) t) |
| @@ -3982,7 +3982,7 @@ designed to be added to either `erc-echo-notice-hook' or | |||
| 3982 | "Echos a private notice in the active buffer if the active | 3982 | "Echos a private notice in the active buffer if the active |
| 3983 | buffer is not the server buffer. This function is designed to be | 3983 | buffer is not the server buffer. This function is designed to be |
| 3984 | added to either `erc-echo-notice-hook' or | 3984 | added to either `erc-echo-notice-hook' or |
| 3985 | `erc-echo-notice-always-hook', and returns non-nil iff the active | 3985 | `erc-echo-notice-always-hook', and returns non-nil if the active |
| 3986 | buffer is not the server buffer." | 3986 | buffer is not the server buffer." |
| 3987 | (if (not (eq (erc-server-buffer) (erc-active-buffer))) | 3987 | (if (not (eq (erc-server-buffer) (erc-active-buffer))) |
| 3988 | (progn (erc-display-message parsed nil 'active s) t) | 3988 | (progn (erc-display-message parsed nil 'active s) t) |
| @@ -3999,7 +3999,7 @@ designed to be added to either `erc-echo-notice-hook' or | |||
| 3999 | "Echos a private notice in all of the buffers for which SENDER | 3999 | "Echos a private notice in all of the buffers for which SENDER |
| 4000 | is a member. This function is designed to be added to either | 4000 | is a member. This function is designed to be added to either |
| 4001 | `erc-echo-notice-hook' or `erc-echo-notice-always-hook', and | 4001 | `erc-echo-notice-hook' or `erc-echo-notice-always-hook', and |
| 4002 | returns non-nil iff there is at least one buffer for which the | 4002 | returns non-nil if there is at least one buffer for which the |
| 4003 | sender is a member. | 4003 | sender is a member. |
| 4004 | 4004 | ||
| 4005 | See also: `erc-echo-notice-in-first-user-buffer', | 4005 | See also: `erc-echo-notice-in-first-user-buffer', |
| @@ -4013,7 +4013,7 @@ See also: `erc-echo-notice-in-first-user-buffer', | |||
| 4013 | "Echos a private notice in BUFFER and in all of the buffers for | 4013 | "Echos a private notice in BUFFER and in all of the buffers for |
| 4014 | which SENDER is a member. This function is designed to be added | 4014 | which SENDER is a member. This function is designed to be added |
| 4015 | to either `erc-echo-notice-hook' or | 4015 | to either `erc-echo-notice-hook' or |
| 4016 | `erc-echo-notice-always-hook', and returns non-nil iff there is | 4016 | `erc-echo-notice-always-hook', and returns non-nil if there is |
| 4017 | at least one buffer for which the sender is a member or the | 4017 | at least one buffer for which the sender is a member or the |
| 4018 | default target. | 4018 | default target. |
| 4019 | 4019 | ||
| @@ -4029,7 +4029,7 @@ See also: `erc-echo-notice-in-user-buffers', | |||
| 4029 | "Echos a private notice in one of the buffers for which SENDER | 4029 | "Echos a private notice in one of the buffers for which SENDER |
| 4030 | is a member. This function is designed to be added to either | 4030 | is a member. This function is designed to be added to either |
| 4031 | `erc-echo-notice-hook' or `erc-echo-notice-always-hook', and | 4031 | `erc-echo-notice-hook' or `erc-echo-notice-always-hook', and |
| 4032 | returns non-nil iff there is at least one buffer for which the | 4032 | returns non-nil if there is at least one buffer for which the |
| 4033 | sender is a member. | 4033 | sender is a member. |
| 4034 | 4034 | ||
| 4035 | See also: `erc-echo-notice-in-user-buffers', | 4035 | See also: `erc-echo-notice-in-user-buffers', |
| @@ -4938,7 +4938,7 @@ Specifically, return the position of `erc-insert-marker'." | |||
| 4938 | (defun erc-send-input (input) | 4938 | (defun erc-send-input (input) |
| 4939 | "Treat INPUT as typed in by the user. It is assumed that the input | 4939 | "Treat INPUT as typed in by the user. It is assumed that the input |
| 4940 | and the prompt is already deleted. | 4940 | and the prompt is already deleted. |
| 4941 | This returns non-nil only iff we actually send anything." | 4941 | This returns non-nil only if we actually send anything." |
| 4942 | ;; Handle different kinds of inputs | 4942 | ;; Handle different kinds of inputs |
| 4943 | (cond | 4943 | (cond |
| 4944 | ;; Ignore empty input | 4944 | ;; Ignore empty input |
diff --git a/lisp/files.el b/lisp/files.el index 9cc64284d15..94a8c383c5a 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1937,7 +1937,7 @@ since only a single case-insensitive search through the alist is made." | |||
| 1937 | ;; c++-mode, java-mode and more) are added through autoload | 1937 | ;; c++-mode, java-mode and more) are added through autoload |
| 1938 | ;; directives in that file. That way is discouraged since it | 1938 | ;; directives in that file. That way is discouraged since it |
| 1939 | ;; spreads out the definition of the initial value. | 1939 | ;; spreads out the definition of the initial value. |
| 1940 | (mapc | 1940 | (mapcar |
| 1941 | (lambda (elt) | 1941 | (lambda (elt) |
| 1942 | (cons (purecopy (car elt)) (cdr elt))) | 1942 | (cons (purecopy (car elt)) (cdr elt))) |
| 1943 | `(;; do this first, so that .html.pl is Polish html, not Perl | 1943 | `(;; do this first, so that .html.pl is Polish html, not Perl |
| @@ -2310,7 +2310,12 @@ we don't actually set it to the same mode the buffer already has." | |||
| 2310 | ;; Next compare the filename against the entries in auto-mode-alist. | 2310 | ;; Next compare the filename against the entries in auto-mode-alist. |
| 2311 | (unless done | 2311 | (unless done |
| 2312 | (if buffer-file-name | 2312 | (if buffer-file-name |
| 2313 | (let ((name buffer-file-name)) | 2313 | (let ((name buffer-file-name) |
| 2314 | (remote-id (file-remote-p buffer-file-name))) | ||
| 2315 | ;; Remove remote file name identification. | ||
| 2316 | (when (and (stringp remote-id) | ||
| 2317 | (string-match (regexp-quote remote-id) name)) | ||
| 2318 | (setq name (substring name (match-end 0)))) | ||
| 2314 | ;; Remove backup-suffixes from file name. | 2319 | ;; Remove backup-suffixes from file name. |
| 2315 | (setq name (file-name-sans-versions name)) | 2320 | (setq name (file-name-sans-versions name)) |
| 2316 | (while name | 2321 | (while name |
| @@ -3988,8 +3993,9 @@ prints a message in the minibuffer. Instead, use `set-buffer-modified-p'." | |||
| 3988 | 3993 | ||
| 3989 | (defun toggle-read-only (&optional arg) | 3994 | (defun toggle-read-only (&optional arg) |
| 3990 | "Change whether this buffer is visiting its file read-only. | 3995 | "Change whether this buffer is visiting its file read-only. |
| 3991 | With arg, set read-only iff arg is positive. | 3996 | With prefix argument ARG, make the buffer read-only if ARG is |
| 3992 | If visiting file read-only and `view-read-only' is non-nil, enter view mode." | 3997 | positive, otherwise make it writable. If visiting file read-only |
| 3998 | and `view-read-only' is non-nil, enter view mode." | ||
| 3993 | (interactive "P") | 3999 | (interactive "P") |
| 3994 | (if (and arg | 4000 | (if (and arg |
| 3995 | (if (> (prefix-numeric-value arg) 0) buffer-read-only | 4001 | (if (> (prefix-numeric-value arg) 0) buffer-read-only |
| @@ -4632,7 +4638,7 @@ FILENAME should lack slashes. You can redefine this for customization." | |||
| 4632 | 4638 | ||
| 4633 | (defun wildcard-to-regexp (wildcard) | 4639 | (defun wildcard-to-regexp (wildcard) |
| 4634 | "Given a shell file name pattern WILDCARD, return an equivalent regexp. | 4640 | "Given a shell file name pattern WILDCARD, return an equivalent regexp. |
| 4635 | The generated regexp will match a filename iff the filename | 4641 | The generated regexp will match a filename only if the filename |
| 4636 | matches that wildcard according to shell rules. Only wildcards known | 4642 | matches that wildcard according to shell rules. Only wildcards known |
| 4637 | by `sh' are supported." | 4643 | by `sh' are supported." |
| 4638 | (let* ((i (string-match "[[.*+\\^$?]" wildcard)) | 4644 | (let* ((i (string-match "[[.*+\\^$?]" wildcard)) |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 32a63e598d7..e254b040ce7 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -355,7 +355,7 @@ Each element in a user-level keywords list should have one of these forms: | |||
| 355 | 355 | ||
| 356 | where MATCHER can be either the regexp to search for, or the function name to | 356 | where MATCHER can be either the regexp to search for, or the function name to |
| 357 | call to make the search (called with one argument, the limit of the search; | 357 | call to make the search (called with one argument, the limit of the search; |
| 358 | it should return non-nil, move point, and set `match-data' appropriately iff | 358 | it should return non-nil, move point, and set `match-data' appropriately if |
| 359 | it succeeds; like `re-search-forward' would). | 359 | it succeeds; like `re-search-forward' would). |
| 360 | MATCHER regexps can be generated via the function `regexp-opt'. | 360 | MATCHER regexps can be generated via the function `regexp-opt'. |
| 361 | 361 | ||
| @@ -1068,7 +1068,7 @@ that tries to find such elements and move the boundaries such that they do | |||
| 1068 | not fall in the middle of one. | 1068 | not fall in the middle of one. |
| 1069 | Each function is called with no argument; it is expected to adjust the | 1069 | Each function is called with no argument; it is expected to adjust the |
| 1070 | dynamically bound variables `font-lock-beg' and `font-lock-end'; and return | 1070 | dynamically bound variables `font-lock-beg' and `font-lock-end'; and return |
| 1071 | non-nil iff it did make such an adjustment. | 1071 | non-nil if it did make such an adjustment. |
| 1072 | These functions are run in turn repeatedly until they all return nil. | 1072 | These functions are run in turn repeatedly until they all return nil. |
| 1073 | Put first the functions more likely to cause a change and cheaper to compute.") | 1073 | Put first the functions more likely to cause a change and cheaper to compute.") |
| 1074 | ;; Mark it as a special hook which doesn't use any global setting | 1074 | ;; Mark it as a special hook which doesn't use any global setting |
| @@ -1746,7 +1746,7 @@ A LEVEL of nil is equal to a LEVEL of 0, a LEVEL of t is equal to | |||
| 1746 | "Set fontification defaults appropriately for this mode. | 1746 | "Set fontification defaults appropriately for this mode. |
| 1747 | Sets various variables using `font-lock-defaults' (or, if nil, using | 1747 | Sets various variables using `font-lock-defaults' (or, if nil, using |
| 1748 | `font-lock-defaults-alist') and `font-lock-maximum-decoration'." | 1748 | `font-lock-defaults-alist') and `font-lock-maximum-decoration'." |
| 1749 | ;; Set fontification defaults iff not previously set for correct major mode. | 1749 | ;; Set fontification defaults if not previously set for correct major mode. |
| 1750 | (unless (and font-lock-set-defaults | 1750 | (unless (and font-lock-set-defaults |
| 1751 | (eq font-lock-mode-major-mode major-mode)) | 1751 | (eq font-lock-mode-major-mode major-mode)) |
| 1752 | (setq font-lock-mode-major-mode major-mode) | 1752 | (setq font-lock-mode-major-mode major-mode) |
diff --git a/lisp/format.el b/lisp/format.el index af708bd9a0c..d18afd7e8be 100644 --- a/lisp/format.el +++ b/lisp/format.el | |||
| @@ -420,13 +420,34 @@ a list (ABSOLUTE-FILE-NAME SIZE)." | |||
| 420 | (fmt (format-read (format "Read file `%s' in format: " | 420 | (fmt (format-read (format "Read file `%s' in format: " |
| 421 | (file-name-nondirectory file))))) | 421 | (file-name-nondirectory file))))) |
| 422 | (list file fmt))) | 422 | (list file fmt))) |
| 423 | (let (value size) | 423 | (let (value size old-undo) |
| 424 | (let ((format-alist nil)) | 424 | ;; Record only one undo entry for the insertion. Inhibit point-motion and |
| 425 | (setq value (insert-file-contents filename nil beg end)) | 425 | ;; modification hooks as with `insert-file-contents'. |
| 426 | (setq size (nth 1 value))) | 426 | (let ((inhibit-point-motion-hooks t) |
| 427 | (if format | 427 | (inhibit-modification-hooks t)) |
| 428 | (setq size (format-decode format size) | 428 | ;; Don't bind `buffer-undo-list' to t here to assert that |
| 429 | value (list (car value) size))) | 429 | ;; `insert-file-contents' may record whether the buffer was unmodified |
| 430 | ;; before. | ||
| 431 | (let ((format-alist nil)) | ||
| 432 | (setq value (insert-file-contents filename nil beg end)) | ||
| 433 | (setq size (nth 1 value))) | ||
| 434 | (when (consp buffer-undo-list) | ||
| 435 | (let ((head (car buffer-undo-list))) | ||
| 436 | (when (and (consp head) | ||
| 437 | (equal (car head) (point)) | ||
| 438 | (equal (cdr head) (+ (point) size))) | ||
| 439 | ;; Remove first entry from `buffer-undo-list', we shall insert | ||
| 440 | ;; another one below. | ||
| 441 | (setq old-undo (cdr buffer-undo-list))))) | ||
| 442 | (when format | ||
| 443 | (let ((buffer-undo-list t)) | ||
| 444 | (setq size (format-decode format size) | ||
| 445 | value (list (car value) size))) | ||
| 446 | (unless (eq buffer-undo-list t) | ||
| 447 | (setq buffer-undo-list | ||
| 448 | (cons (cons (point) (+ (point) size)) old-undo))))) | ||
| 449 | (unless inhibit-modification-hooks | ||
| 450 | (run-hook-with-args 'after-change-functions (point) (+ (point) size) 0)) | ||
| 430 | value)) | 451 | value)) |
| 431 | 452 | ||
| 432 | (defun format-read (&optional prompt) | 453 | (defun format-read (&optional prompt) |
diff --git a/lisp/frame.el b/lisp/frame.el index 863524d8add..3246efc31a1 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -1332,9 +1332,9 @@ itself as a pre-command hook." | |||
| 1332 | 1332 | ||
| 1333 | (define-minor-mode blink-cursor-mode | 1333 | (define-minor-mode blink-cursor-mode |
| 1334 | "Toggle blinking cursor mode. | 1334 | "Toggle blinking cursor mode. |
| 1335 | With a numeric argument, turn blinking cursor mode on iff ARG is positive. | 1335 | With a numeric argument, turn blinking cursor mode on if ARG is positive, |
| 1336 | When blinking cursor mode is enabled, the cursor of the selected | 1336 | otherwise turn it off. When blinking cursor mode is enabled, the |
| 1337 | window blinks. | 1337 | cursor of the selected window blinks. |
| 1338 | 1338 | ||
| 1339 | Note that this command is effective only when Emacs | 1339 | Note that this command is effective only when Emacs |
| 1340 | displays through a window system, because then Emacs does its own | 1340 | displays through a window system, because then Emacs does its own |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 83ca62ca0de..7fd187a4aeb 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,23 @@ | |||
| 1 | 2007-08-10 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * nntp.el (nntp-xref-number-is-evil): New server variable. | ||
| 4 | (nntp-find-group-and-number): If it is non-nil, don't trust article | ||
| 5 | numbers in the Xref header. | ||
| 6 | |||
| 7 | 2007-08-06 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 8 | |||
| 9 | * gnus-ems.el (gnus-x-splash): Bind inhibit-read-only to t. | ||
| 10 | |||
| 11 | 2007-08-04 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 12 | |||
| 13 | * gnus-art.el (article-hide-headers): Bind inhibit-read-only to t. | ||
| 14 | |||
| 15 | 2007-08-08 Glenn Morris <rgm@gnu.org> | ||
| 16 | |||
| 17 | * gmm-utils.el, gnus-async.el, gnus-msg.el, gnus-score.el | ||
| 18 | * gnus-util.el, imap.el, mailcap.el, nnimap.el: Replace `iff' in | ||
| 19 | doc-strings and comments. | ||
| 20 | |||
| 1 | 2007-07-25 Glenn Morris <rgm@gnu.org> | 21 | 2007-07-25 Glenn Morris <rgm@gnu.org> |
| 2 | 22 | ||
| 3 | * Relicense all FSF files to GPLv3 or later. | 23 | * Relicense all FSF files to GPLv3 or later. |
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index d7e3c344b0e..71a0662f35a 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el | |||
| @@ -79,7 +79,7 @@ ARGS are passed to `message'." | |||
| 79 | 79 | ||
| 80 | ;;;###autoload | 80 | ;;;###autoload |
| 81 | (defun gmm-widget-p (symbol) | 81 | (defun gmm-widget-p (symbol) |
| 82 | "Non-nil iff SYMBOL is a widget." | 82 | "Non-nil if SYMBOL is a widget." |
| 83 | (get symbol 'widget-type)) | 83 | (get symbol 'widget-type)) |
| 84 | 84 | ||
| 85 | ;; Copy of the `nnmail-lazy' code from `nnmail.el': | 85 | ;; Copy of the `nnmail-lazy' code from `nnmail.el': |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 40de10187f3..6ccba3b108f 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -1743,7 +1743,7 @@ Initialized from `text-mode-syntax-table.") | |||
| 1743 | (interactive) | 1743 | (interactive) |
| 1744 | ;; This function might be inhibited. | 1744 | ;; This function might be inhibited. |
| 1745 | (unless gnus-inhibit-hiding | 1745 | (unless gnus-inhibit-hiding |
| 1746 | (let ((inhibit-read-only nil) | 1746 | (let ((inhibit-read-only t) |
| 1747 | (case-fold-search t) | 1747 | (case-fold-search t) |
| 1748 | (max (1+ (length gnus-sorted-header-list))) | 1748 | (max (1+ (length gnus-sorted-header-list))) |
| 1749 | (inhibit-point-motion-hooks t) | 1749 | (inhibit-point-motion-hooks t) |
diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el index 3493d51950d..a06724855c5 100644 --- a/lisp/gnus/gnus-async.el +++ b/lisp/gnus/gnus-async.el | |||
| @@ -320,7 +320,7 @@ It should return non-nil if the article is to be prefetched." | |||
| 320 | (pop alist)))))) | 320 | (pop alist)))))) |
| 321 | 321 | ||
| 322 | (defun gnus-async-prefetched-article-entry (group article) | 322 | (defun gnus-async-prefetched-article-entry (group article) |
| 323 | "Return the entry for ARTICLE in GROUP iff it has been prefetched." | 323 | "Return the entry for ARTICLE in GROUP if it has been prefetched." |
| 324 | (let ((entry (save-excursion | 324 | (let ((entry (save-excursion |
| 325 | (gnus-async-set-buffer) | 325 | (gnus-async-set-buffer) |
| 326 | (assq (intern (format "%s-%d" group article) | 326 | (assq (intern (format "%s-%d" group article) |
diff --git a/lisp/gnus/gnus-ems.el b/lisp/gnus/gnus-ems.el index bacf5581e0d..88190b8085b 100644 --- a/lisp/gnus/gnus-ems.el +++ b/lisp/gnus/gnus-ems.el | |||
| @@ -179,7 +179,7 @@ | |||
| 179 | (interactive-p)) | 179 | (interactive-p)) |
| 180 | "*gnus-x-splash*" | 180 | "*gnus-x-splash*" |
| 181 | gnus-group-buffer))) | 181 | gnus-group-buffer))) |
| 182 | (let ((inhibit-read-only nil) | 182 | (let ((inhibit-read-only t) |
| 183 | (file (nnheader-find-etc-directory "images/gnus/x-splash" t)) | 183 | (file (nnheader-find-etc-directory "images/gnus/x-splash" t)) |
| 184 | pixmap fcw fch width height fringes sbars left yoffset top ls) | 184 | pixmap fcw fch width height fringes sbars left yoffset top ls) |
| 185 | (erase-buffer) | 185 | (erase-buffer) |
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index c9aedab7019..f8e4a7a67d0 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el | |||
| @@ -260,15 +260,15 @@ See also the `mml-default-encrypt-method' variable." | |||
| 260 | This is done because new users often reply by mistake when reading | 260 | This is done because new users often reply by mistake when reading |
| 261 | news. | 261 | news. |
| 262 | This can also be a function receiving the group name as the only | 262 | This can also be a function receiving the group name as the only |
| 263 | parameter which should return non-nil iff a confirmation is needed, or | 263 | parameter, which should return non-nil if a confirmation is needed; or |
| 264 | a regexp, in which case a confirmation is asked for iff the group name | 264 | a regexp, in which case a confirmation is asked for if the group name |
| 265 | matches the regexp." | 265 | matches the regexp." |
| 266 | :version "22.1" | 266 | :version "22.1" |
| 267 | :group 'gnus-message | 267 | :group 'gnus-message |
| 268 | :type '(choice (const :tag "No" nil) | 268 | :type '(choice (const :tag "No" nil) |
| 269 | (const :tag "Yes" t) | 269 | (const :tag "Yes" t) |
| 270 | (regexp :tag "Iff group matches regexp") | 270 | (regexp :tag "If group matches regexp") |
| 271 | (function :tag "Iff function evaluates to non-nil"))) | 271 | (function :tag "If function evaluates to non-nil"))) |
| 272 | 272 | ||
| 273 | (defcustom gnus-confirm-treat-mail-like-news | 273 | (defcustom gnus-confirm-treat-mail-like-news |
| 274 | nil | 274 | nil |
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index e833c8ccc6a..f7ba9222937 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el | |||
| @@ -381,7 +381,7 @@ If nil, the user will be asked for a match type." | |||
| 381 | (const :tag "ask" nil))) | 381 | (const :tag "ask" nil))) |
| 382 | 382 | ||
| 383 | (defcustom gnus-score-default-fold nil | 383 | (defcustom gnus-score-default-fold nil |
| 384 | "Use case folding for new score file entries iff not nil." | 384 | "Non-nil means use case folding for new score file entries." |
| 385 | :group 'gnus-score-default | 385 | :group 'gnus-score-default |
| 386 | :type 'boolean) | 386 | :type 'boolean) |
| 387 | 387 | ||
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index d065acd75ea..74aacdd2860 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el | |||
| @@ -1108,7 +1108,7 @@ Return the modified alist." | |||
| 1108 | `(setq ,alist (delq (,fun ,key ,alist) ,alist)))) | 1108 | `(setq ,alist (delq (,fun ,key ,alist) ,alist)))) |
| 1109 | 1109 | ||
| 1110 | (defun gnus-globalify-regexp (re) | 1110 | (defun gnus-globalify-regexp (re) |
| 1111 | "Return a regexp that matches a whole line, iff RE matches a part of it." | 1111 | "Return a regexp that matches a whole line, if RE matches a part of it." |
| 1112 | (concat (unless (string-match "^\\^" re) "^.*") | 1112 | (concat (unless (string-match "^\\^" re) "^.*") |
| 1113 | re | 1113 | re |
| 1114 | (unless (string-match "\\$$" re) ".*$"))) | 1114 | (unless (string-match "\\$$" re) ".*$"))) |
diff --git a/lisp/gnus/imap.el b/lisp/gnus/imap.el index abe1c7e1c9e..f60801e9ba8 100644 --- a/lisp/gnus/imap.el +++ b/lisp/gnus/imap.el | |||
| @@ -1581,7 +1581,7 @@ is non-nil return these properties." | |||
| 1581 | (imap-mailbox-get-1 'search imap-current-mailbox))))) | 1581 | (imap-mailbox-get-1 'search imap-current-mailbox))))) |
| 1582 | 1582 | ||
| 1583 | (defun imap-message-flag-permanent-p (flag &optional mailbox buffer) | 1583 | (defun imap-message-flag-permanent-p (flag &optional mailbox buffer) |
| 1584 | "Return t iff FLAG can be permanently (between IMAP sessions) saved on articles, in MAILBOX on server in BUFFER." | 1584 | "Return t if FLAG can be permanently (between IMAP sessions) saved on articles, in MAILBOX on server in BUFFER." |
| 1585 | (with-current-buffer (or buffer (current-buffer)) | 1585 | (with-current-buffer (or buffer (current-buffer)) |
| 1586 | (or (member "\\*" (imap-mailbox-get 'permanentflags mailbox)) | 1586 | (or (member "\\*" (imap-mailbox-get 'permanentflags mailbox)) |
| 1587 | (member flag (imap-mailbox-get 'permanentflags mailbox))))) | 1587 | (member flag (imap-mailbox-get 'permanentflags mailbox))))) |
diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el index 422b99d0e0f..e8b624aa546 100644 --- a/lisp/gnus/mailcap.el +++ b/lisp/gnus/mailcap.el | |||
| @@ -538,7 +538,7 @@ MAILCAPS if set; otherwise (on Unix) use the path from RFC 1524, plus | |||
| 538 | results))) | 538 | results))) |
| 539 | 539 | ||
| 540 | (defun mailcap-mailcap-entry-passes-test (info) | 540 | (defun mailcap-mailcap-entry-passes-test (info) |
| 541 | "Return non-nil iff mailcap entry INFO passes its test clause. | 541 | "Return non-nil if mailcap entry INFO passes its test clause. |
| 542 | Also return non-nil if no test clause is present." | 542 | Also return non-nil if no test clause is present." |
| 543 | (let ((test (assq 'test info)) ; The test clause | 543 | (let ((test (assq 'test info)) ; The test clause |
| 544 | status) | 544 | status) |
| @@ -631,7 +631,7 @@ Also return non-nil if no test clause is present." | |||
| 631 | (defvar mailcap-viewer-test-cache nil) | 631 | (defvar mailcap-viewer-test-cache nil) |
| 632 | 632 | ||
| 633 | (defun mailcap-viewer-passes-test (viewer-info type-info) | 633 | (defun mailcap-viewer-passes-test (viewer-info type-info) |
| 634 | "Return non-nil iff viewer specified by VIEWER-INFO passes its test clause. | 634 | "Return non-nil if viewer specified by VIEWER-INFO passes its test clause. |
| 635 | Also return non-nil if it has no test clause. TYPE-INFO is an argument | 635 | Also return non-nil if it has no test clause. TYPE-INFO is an argument |
| 636 | to supply to the test." | 636 | to supply to the test." |
| 637 | (let* ((test-info (assq 'test viewer-info)) | 637 | (let* ((test-info (assq 'test viewer-info)) |
| @@ -704,7 +704,7 @@ If TEST is not given, it defaults to t." | |||
| 704 | ;;; | 704 | ;;; |
| 705 | 705 | ||
| 706 | (defun mailcap-viewer-lessp (x y) | 706 | (defun mailcap-viewer-lessp (x y) |
| 707 | "Return t iff viewer X is more desirable than viewer Y." | 707 | "Return t if viewer X is more desirable than viewer Y." |
| 708 | (let ((x-wild (string-match "[*?]" (or (cdr-safe (assq 'type x)) ""))) | 708 | (let ((x-wild (string-match "[*?]" (or (cdr-safe (assq 'type x)) ""))) |
| 709 | (y-wild (string-match "[*?]" (or (cdr-safe (assq 'type y)) ""))) | 709 | (y-wild (string-match "[*?]" (or (cdr-safe (assq 'type y)) ""))) |
| 710 | (x-lisp (not (stringp (or (cdr-safe (assq 'viewer x)) "")))) | 710 | (x-lisp (not (stringp (or (cdr-safe (assq 'viewer x)) "")))) |
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 235039c3ee9..ba23280658a 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -1645,7 +1645,7 @@ be used in a STORE FLAGS command." | |||
| 1645 | result))) | 1645 | result))) |
| 1646 | 1646 | ||
| 1647 | (defun nnimap-mark-permanent-p (mark &optional group) | 1647 | (defun nnimap-mark-permanent-p (mark &optional group) |
| 1648 | "Return t iff MARK can be permanently (between IMAP sessions) saved on articles, in GROUP." | 1648 | "Return t if MARK can be permanently (between IMAP sessions) saved on articles, in GROUP." |
| 1649 | (imap-message-flag-permanent-p (nnimap-mark-to-flag mark))) | 1649 | (imap-message-flag-permanent-p (nnimap-mark-to-flag mark))) |
| 1650 | 1650 | ||
| 1651 | (when nnimap-debug | 1651 | (when nnimap-debug |
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index 869213c9ae5..2623df58e4d 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el | |||
| @@ -183,6 +183,14 @@ by one.") | |||
| 183 | If the gap between two consecutive articles is bigger than this | 183 | If the gap between two consecutive articles is bigger than this |
| 184 | variable, split the XOVER request into two requests.") | 184 | variable, split the XOVER request into two requests.") |
| 185 | 185 | ||
| 186 | (defvoo nntp-xref-number-is-evil nil | ||
| 187 | "*If non-nil, Gnus never trusts article numbers in the Xref header. | ||
| 188 | Some news servers, e.g., ones running Diablo, run multiple engines | ||
| 189 | having the same articles but article numbers are not kept synchronized | ||
| 190 | between them. If you connect to such a server, set this to a non-nil | ||
| 191 | value, and Gnus never uses article numbers (that appear in the Xref | ||
| 192 | header and vary by which engine is chosen) to refer to articles.") | ||
| 193 | |||
| 186 | (defvoo nntp-prepare-server-hook nil | 194 | (defvoo nntp-prepare-server-hook nil |
| 187 | "*Hook run before a server is opened. | 195 | "*Hook run before a server is opened. |
| 188 | If can be used to set up a server remotely, for instance. Say you | 196 | If can be used to set up a server remotely, for instance. Say you |
| @@ -1632,7 +1640,8 @@ password contained in '~/.nntp-authinfo'." | |||
| 1632 | (match-string 1 xref)) | 1640 | (match-string 1 xref)) |
| 1633 | (t ""))) | 1641 | (t ""))) |
| 1634 | (cond | 1642 | (cond |
| 1635 | ((and (setq xref (mail-fetch-field "xref")) | 1643 | ((and (not nntp-xref-number-is-evil) |
| 1644 | (setq xref (mail-fetch-field "xref")) | ||
| 1636 | (string-match | 1645 | (string-match |
| 1637 | (if group | 1646 | (if group |
| 1638 | (concat "\\(" (regexp-quote group) "\\):\\([0-9]+\\)") | 1647 | (concat "\\(" (regexp-quote group) "\\):\\([0-9]+\\)") |
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 28ac693f870..1435eb019ec 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -461,9 +461,11 @@ that." | |||
| 461 | ;; An obvious case of a key substitution: | 461 | ;; An obvious case of a key substitution: |
| 462 | (save-excursion | 462 | (save-excursion |
| 463 | (while (re-search-forward | 463 | (while (re-search-forward |
| 464 | ;; Assume command name is only word characters | 464 | ;; Assume command name is only word and symbol |
| 465 | ;; and dashes to get things like `use M-x foo.'. | 465 | ;; characters to get things like `use M-x foo->bar'. |
| 466 | "\\<M-x\\s-+\\(\\sw\\(\\sw\\|-\\)+\\)" nil t) | 466 | ;; Command required to end with word constituent |
| 467 | ;; to avoid `.' at end of a sentence. | ||
| 468 | "\\<M-x\\s-+\\(\\sw\\(\\sw\\|\\s_\\)*\\sw\\)" nil t) | ||
| 467 | (let ((sym (intern-soft (match-string 1)))) | 469 | (let ((sym (intern-soft (match-string 1)))) |
| 468 | (if (fboundp sym) | 470 | (if (fboundp sym) |
| 469 | (help-xref-button 1 'help-function sym))))) | 471 | (help-xref-button 1 'help-function sym))))) |
| @@ -489,7 +491,7 @@ that." | |||
| 489 | (end-of-line) | 491 | (end-of-line) |
| 490 | (skip-chars-backward "^ \t\n") | 492 | (skip-chars-backward "^ \t\n") |
| 491 | (if (and (>= (current-column) col) | 493 | (if (and (>= (current-column) col) |
| 492 | (looking-at "\\(\\sw\\|-\\)+$")) | 494 | (looking-at "\\(\\sw\\|\\s_\\)+$")) |
| 493 | (let ((sym (intern-soft (match-string 0)))) | 495 | (let ((sym (intern-soft (match-string 0)))) |
| 494 | (if (fboundp sym) | 496 | (if (fboundp sym) |
| 495 | (help-xref-button 0 'help-function sym)))) | 497 | (help-xref-button 0 'help-function sym)))) |
diff --git a/lisp/help.el b/lisp/help.el index f75e26f93e6..4a94fd35bc7 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -958,14 +958,14 @@ This applies to `help', `apropos' and `completion' buffers, and some others." | |||
| 958 | (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window))) | 958 | (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window))) |
| 959 | 959 | ||
| 960 | (defun resize-temp-buffer-window () | 960 | (defun resize-temp-buffer-window () |
| 961 | "Resize the current window to fit its contents. | 961 | "Resize the selected window to fit its contents. |
| 962 | Will not make it higher than `temp-buffer-max-height' nor smaller than | 962 | Will not make it higher than `temp-buffer-max-height' nor smaller than |
| 963 | `window-min-height'. Do nothing if it is the only window on its frame, if it | 963 | `window-min-height'. Do nothing if it is the only window on its frame, if it |
| 964 | is not as wide as the frame or if some of the window's contents are scrolled | 964 | is not as wide as the frame or if some of the window's contents are scrolled |
| 965 | out of view." | 965 | out of view." |
| 966 | (unless (or (one-window-p 'nomini) | 966 | (unless (or (one-window-p 'nomini) |
| 967 | (not (pos-visible-in-window-p (point-min))) | 967 | (not (pos-visible-in-window-p (point-min))) |
| 968 | (/= (frame-width) (window-width))) | 968 | (not (window-full-width-p))) |
| 969 | (fit-window-to-buffer | 969 | (fit-window-to-buffer |
| 970 | (selected-window) | 970 | (selected-window) |
| 971 | (if (functionp temp-buffer-max-height) | 971 | (if (functionp temp-buffer-max-height) |
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el index b1238b66419..a167b2bc1e7 100644 --- a/lisp/hilit-chg.el +++ b/lisp/hilit-chg.el | |||
| @@ -131,7 +131,7 @@ | |||
| 131 | ;; an example, if the value is `buffer-file-name' then all buffers | 131 | ;; an example, if the value is `buffer-file-name' then all buffers |
| 132 | ;; who are visiting files are suitable, but others (like dired | 132 | ;; who are visiting files are suitable, but others (like dired |
| 133 | ;; buffers) are not; | 133 | ;; buffers) are not; |
| 134 | ;; * a list -- then the buffer is suitable iff its mode is in the | 134 | ;; * a list -- then the buffer is suitable if its mode is in the |
| 135 | ;; list, except if the first element is `not', in which case the test | 135 | ;; list, except if the first element is `not', in which case the test |
| 136 | ;; is reversed (i.e. it is a list of unsuitable modes). | 136 | ;; is reversed (i.e. it is a list of unsuitable modes). |
| 137 | ;; * Otherwise, the buffer is suitable if its name does not begin with | 137 | ;; * Otherwise, the buffer is suitable if its name does not begin with |
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index b077342e5f5..7847bed6f2d 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el | |||
| @@ -1331,7 +1331,7 @@ If a buffer has no filename, it is ignored. | |||
| 1331 | With no prefix arg, use the filename sans its directory of each marked file. | 1331 | With no prefix arg, use the filename sans its directory of each marked file. |
| 1332 | With a zero prefix arg, use the complete filename of each marked file. | 1332 | With a zero prefix arg, use the complete filename of each marked file. |
| 1333 | With \\[universal-argument], use the filename of each marked file relative | 1333 | With \\[universal-argument], use the filename of each marked file relative |
| 1334 | to `ibuffer-default-directory' iff non-nil, otherwise `default-directory'. | 1334 | to `ibuffer-default-directory' if non-nil, otherwise `default-directory'. |
| 1335 | 1335 | ||
| 1336 | You can then feed the file name(s) to other commands with \\[yank]." | 1336 | You can then feed the file name(s) to other commands with \\[yank]." |
| 1337 | (interactive "p") | 1337 | (interactive "p") |
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index c4842b9d982..80133d227ab 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -1835,7 +1835,7 @@ If point is on a group name, this function operates on that group." | |||
| 1835 | 1835 | ||
| 1836 | (defun ibuffer-map-lines (function &optional nomodify group) | 1836 | (defun ibuffer-map-lines (function &optional nomodify group) |
| 1837 | "Call FUNCTION for each buffer. | 1837 | "Call FUNCTION for each buffer. |
| 1838 | Don't set the ibuffer modification flag iff NOMODIFY is non-nil. | 1838 | Set the ibuffer modification flag unless NOMODIFY is non-nil. |
| 1839 | 1839 | ||
| 1840 | If optional argument GROUP is non-nil, then only call FUNCTION on | 1840 | If optional argument GROUP is non-nil, then only call FUNCTION on |
| 1841 | buffers in filtering group GROUP. | 1841 | buffers in filtering group GROUP. |
| @@ -2267,7 +2267,7 @@ If optional arg SILENT is non-nil, do not display progress messages." | |||
| 2267 | 2267 | ||
| 2268 | (defun ibuffer-quit () | 2268 | (defun ibuffer-quit () |
| 2269 | "Quit this `ibuffer' session. | 2269 | "Quit this `ibuffer' session. |
| 2270 | Try to restore the previous window configuration iff | 2270 | Try to restore the previous window configuration if |
| 2271 | `ibuffer-restore-window-config-on-quit' is non-nil." | 2271 | `ibuffer-restore-window-config-on-quit' is non-nil." |
| 2272 | (interactive) | 2272 | (interactive) |
| 2273 | (if ibuffer-restore-window-config-on-quit | 2273 | (if ibuffer-restore-window-config-on-quit |
diff --git a/lisp/icomplete.el b/lisp/icomplete.el index d1e8f9cc3f8..44c854f2f46 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el | |||
| @@ -99,7 +99,7 @@ completions - see `icomplete-delay-completions-threshold'." | |||
| 99 | (defcustom icomplete-minibuffer-setup-hook nil | 99 | (defcustom icomplete-minibuffer-setup-hook nil |
| 100 | "*Icomplete-specific customization of minibuffer setup. | 100 | "*Icomplete-specific customization of minibuffer setup. |
| 101 | 101 | ||
| 102 | This hook is run during minibuffer setup iff icomplete will be active. | 102 | This hook is run during minibuffer setup if icomplete is active. |
| 103 | It is intended for use in customizing icomplete for interoperation | 103 | It is intended for use in customizing icomplete for interoperation |
| 104 | with other features and packages. For instance: | 104 | with other features and packages. For instance: |
| 105 | 105 | ||
| @@ -168,7 +168,8 @@ except those on this list.") | |||
| 168 | ;;;###autoload | 168 | ;;;###autoload |
| 169 | (define-minor-mode icomplete-mode | 169 | (define-minor-mode icomplete-mode |
| 170 | "Toggle incremental minibuffer completion for this Emacs session. | 170 | "Toggle incremental minibuffer completion for this Emacs session. |
| 171 | With a numeric argument, turn Icomplete mode on iff ARG is positive." | 171 | With a numeric argument, turn Icomplete mode on if ARG is positive, |
| 172 | otherwise turn it off." | ||
| 172 | :global t :group 'icomplete | 173 | :global t :group 'icomplete |
| 173 | (if icomplete-mode | 174 | (if icomplete-mode |
| 174 | ;; The following is not really necessary after first time - | 175 | ;; The following is not really necessary after first time - |
diff --git a/lisp/ido.el b/lisp/ido.el index e5c4b644f95..ca44e99b594 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -898,7 +898,7 @@ See documentation of `walk-windows' for useful values.") | |||
| 898 | (defcustom ido-minibuffer-setup-hook nil | 898 | (defcustom ido-minibuffer-setup-hook nil |
| 899 | "*Ido-specific customization of minibuffer setup. | 899 | "*Ido-specific customization of minibuffer setup. |
| 900 | 900 | ||
| 901 | This hook is run during minibuffer setup iff `ido' will be active. | 901 | This hook is run during minibuffer setup if `ido' is active. |
| 902 | It is intended for use in customizing ido for interoperation | 902 | It is intended for use in customizing ido for interoperation |
| 903 | with other packages. For instance: | 903 | with other packages. For instance: |
| 904 | 904 | ||
diff --git a/lisp/image.el b/lisp/image.el index 3b0dd87d1ef..6763cf151fe 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -327,7 +327,7 @@ Image types are symbols like `xbm' or `jpeg'." | |||
| 327 | 327 | ||
| 328 | ;;;###autoload | 328 | ;;;###autoload |
| 329 | (defun image-type-auto-detected-p () | 329 | (defun image-type-auto-detected-p () |
| 330 | "Return t iff the current buffer contains an auto-detectable image. | 330 | "Return t if the current buffer contains an auto-detectable image. |
| 331 | This function is intended to be used from `magic-fallback-mode-alist'. | 331 | This function is intended to be used from `magic-fallback-mode-alist'. |
| 332 | 332 | ||
| 333 | The buffer is considered to contain an auto-detectable image if | 333 | The buffer is considered to contain an auto-detectable image if |
diff --git a/lisp/imenu.el b/lisp/imenu.el index 9aa1f5ea088..6c1de967e66 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -727,7 +727,7 @@ definitions, etc. It contains a substring which is the name to | |||
| 727 | appear in the menu. See the info section on Regexps for more | 727 | appear in the menu. See the info section on Regexps for more |
| 728 | information. REGEXP may also be a function, called without | 728 | information. REGEXP may also be a function, called without |
| 729 | arguments. It is expected to search backwards. It shall return | 729 | arguments. It is expected to search backwards. It shall return |
| 730 | true and set `match-data' iff it finds another element. | 730 | true and set `match-data' if it finds another element. |
| 731 | 731 | ||
| 732 | INDEX points to the substring in REGEXP that contains the | 732 | INDEX points to the substring in REGEXP that contains the |
| 733 | name (of the function, variable or type) that is to appear in the | 733 | name (of the function, variable or type) that is to appear in the |
diff --git a/lisp/info-look.el b/lisp/info-look.el index 8ace7730a12..4ed13ba08e0 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el | |||
| @@ -144,7 +144,7 @@ to `symbol', and the help mode defaults to the current major mode." | |||
| 144 | (apply 'info-lookup-add-help* nil arg)) | 144 | (apply 'info-lookup-add-help* nil arg)) |
| 145 | 145 | ||
| 146 | (defun info-lookup-maybe-add-help (&rest arg) | 146 | (defun info-lookup-maybe-add-help (&rest arg) |
| 147 | "Add a help specification iff none is defined. | 147 | "Add a help specification if none is defined. |
| 148 | See the documentation of the function `info-lookup-add-help' | 148 | See the documentation of the function `info-lookup-add-help' |
| 149 | for more details." | 149 | for more details." |
| 150 | (apply 'info-lookup-add-help* t arg)) | 150 | (apply 'info-lookup-add-help* t arg)) |
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el index 357cf8f7d1e..9daa00410c3 100644 --- a/lisp/international/ja-dic-cnv.el +++ b/lisp/international/ja-dic-cnv.el | |||
| @@ -216,8 +216,8 @@ | |||
| 216 | ;; Return t if substring of STR (between FROM and TO) can be broken up | 216 | ;; Return t if substring of STR (between FROM and TO) can be broken up |
| 217 | ;; to chunks all of which can be derived from another entry in SKK | 217 | ;; to chunks all of which can be derived from another entry in SKK |
| 218 | ;; dictionary. SKKBUF is the buffer where the original SKK dictionary | 218 | ;; dictionary. SKKBUF is the buffer where the original SKK dictionary |
| 219 | ;; is visited, KANA is the current entry for STR. FIRST is t iff this | 219 | ;; is visited, KANA is the current entry for STR. FIRST is t only if |
| 220 | ;; is called at top level. | 220 | ;; this is called at top level. |
| 221 | 221 | ||
| 222 | (defun skkdic-breakup-string (skkbuf kana str from to &optional first) | 222 | (defun skkdic-breakup-string (skkbuf kana str from to &optional first) |
| 223 | (let ((len (- to from))) | 223 | (let ((len (- to from))) |
diff --git a/lisp/international/latin1-disp.el b/lisp/international/latin1-disp.el index 515695bf503..ebeef71b0b7 100644 --- a/lisp/international/latin1-disp.el +++ b/lisp/international/latin1-disp.el | |||
| @@ -777,9 +777,9 @@ use either \\[customize] or the function `latin1-display'." | |||
| 777 | "Set up Latin-1/ASCII display for Unicode characters. | 777 | "Set up Latin-1/ASCII display for Unicode characters. |
| 778 | This uses the transliterations of the Lynx browser. | 778 | This uses the transliterations of the Lynx browser. |
| 779 | 779 | ||
| 780 | With argument ARG, turn such display on iff ARG is positive, otherwise | 780 | With argument ARG, turn such display on if ARG is positive, otherwise |
| 781 | turn it off and display Unicode characters literally. The display | 781 | turn it off and display Unicode characters literally. The display |
| 782 | is't changed if the display can render Unicode characters." | 782 | isn't changed if the display can render Unicode characters." |
| 783 | (interactive "p") | 783 | (interactive "p") |
| 784 | (if (> arg 0) | 784 | (if (> arg 0) |
| 785 | (unless (char-displayable-p | 785 | (unless (char-displayable-p |
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index d80b6ead81a..acff5057f72 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -436,11 +436,11 @@ non-nil, it is used to sort CODINGS instead." | |||
| 436 | (let ((base (coding-system-base x))) | 436 | (let ((base (coding-system-base x))) |
| 437 | ;; We calculate the priority number 0..255 by | 437 | ;; We calculate the priority number 0..255 by |
| 438 | ;; using the 8 bits PMMLCEII as this: | 438 | ;; using the 8 bits PMMLCEII as this: |
| 439 | ;; P: 1 iff most preferred. | 439 | ;; P: 1 if most preferred. |
| 440 | ;; MM: greater than 0 iff mime-charset. | 440 | ;; MM: greater than 0 if mime-charset. |
| 441 | ;; L: 1 iff one of the current lang. env.'s codings. | 441 | ;; L: 1 if one of the current lang. env.'s codings. |
| 442 | ;; C: 1 iff one of codings listed in the category list. | 442 | ;; C: 1 if one of codings listed in the category list. |
| 443 | ;; E: 1 iff not XXX-with-esc | 443 | ;; E: 1 if not XXX-with-esc |
| 444 | ;; II: if iso-2022 based, 0..3, else 1. | 444 | ;; II: if iso-2022 based, 0..3, else 1. |
| 445 | (logior | 445 | (logior |
| 446 | (lsh (if (eq base most-preferred) 1 0) 7) | 446 | (lsh (if (eq base most-preferred) 1 0) 7) |
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index b91a6297f21..1975397359a 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el | |||
| @@ -55,7 +55,7 @@ | |||
| 55 | 55 | ||
| 56 | ;;; Code: | 56 | ;;; Code: |
| 57 | 57 | ||
| 58 | (require 'help-mode) | 58 | (eval-when-compile (require 'help-mode)) |
| 59 | 59 | ||
| 60 | (defgroup quail nil | 60 | (defgroup quail nil |
| 61 | "Quail: multilingual input method." | 61 | "Quail: multilingual input method." |
| @@ -1935,7 +1935,7 @@ Remaining args are for FUNC." | |||
| 1935 | (overlay-put quail-overlay 'face 'highlight)))) | 1935 | (overlay-put quail-overlay 'face 'highlight)))) |
| 1936 | 1936 | ||
| 1937 | (defun quail-require-guidance-buf () | 1937 | (defun quail-require-guidance-buf () |
| 1938 | "Return t iff the current Quail package requires showing guidance buffer." | 1938 | "Return t if the current Quail package requires showing guidance buffer." |
| 1939 | (and input-method-verbose-flag | 1939 | (and input-method-verbose-flag |
| 1940 | (if (eq input-method-verbose-flag 'default) | 1940 | (if (eq input-method-verbose-flag 'default) |
| 1941 | (not (and (eq (selected-window) (minibuffer-window)) | 1941 | (not (and (eq (selected-window) (minibuffer-window)) |
| @@ -2426,22 +2426,27 @@ should be made by `quail-build-decode-map' (which see)." | |||
| 2426 | (insert ?\n)) | 2426 | (insert ?\n)) |
| 2427 | (insert ?\n)))) | 2427 | (insert ?\n)))) |
| 2428 | 2428 | ||
| 2429 | (define-button-type 'quail-keyboard-layout-button | 2429 | (defun quail-help-init () |
| 2430 | :supertype 'help-xref | 2430 | (unless (featurep 'help-mode) |
| 2431 | 'help-function '(lambda (layout) | 2431 | (require 'help-mode) |
| 2432 | (help-setup-xref `(quail-keyboard-layout-button ,layout) nil) | 2432 | (define-button-type 'quail-keyboard-layout-button |
| 2433 | (quail-show-keyboard-layout layout)) | 2433 | :supertype 'help-xref |
| 2434 | 'help-echo (purecopy "mouse-2, RET: show keyboard layout")) | 2434 | 'help-function '(lambda (layout) |
| 2435 | 2435 | (help-setup-xref `(quail-keyboard-layout-button ,layout) | |
| 2436 | (define-button-type 'quail-keyboard-customize-button | 2436 | nil) |
| 2437 | :supertype 'help-customize-variable | 2437 | (quail-show-keyboard-layout layout)) |
| 2438 | 'help-echo (purecopy "mouse-2, RET: customize keyboard layout")) | 2438 | 'help-echo (purecopy "mouse-2, RET: show keyboard layout")) |
| 2439 | |||
| 2440 | (define-button-type 'quail-keyboard-customize-button | ||
| 2441 | :supertype 'help-customize-variable | ||
| 2442 | 'help-echo (purecopy "mouse-2, RET: customize keyboard layout")))) | ||
| 2439 | 2443 | ||
| 2440 | (defun quail-help (&optional package) | 2444 | (defun quail-help (&optional package) |
| 2441 | "Show brief description of the current Quail package. | 2445 | "Show brief description of the current Quail package. |
| 2442 | Optional arg PACKAGE specifies the name of alternative Quail | 2446 | Optional arg PACKAGE specifies the name of alternative Quail |
| 2443 | package to describe." | 2447 | package to describe." |
| 2444 | (interactive) | 2448 | (interactive) |
| 2449 | (quail-help-init) | ||
| 2445 | (let ((help-xref-mule-regexp help-xref-mule-regexp-template) | 2450 | (let ((help-xref-mule-regexp help-xref-mule-regexp-template) |
| 2446 | (default-enable-multibyte-characters enable-multibyte-characters) | 2451 | (default-enable-multibyte-characters enable-multibyte-characters) |
| 2447 | (package-def | 2452 | (package-def |
| @@ -2624,7 +2629,7 @@ KEY BINDINGS FOR CONVERSION | |||
| 2624 | ;; it is not yet stored. As a result, the element is a string or a | 2629 | ;; it is not yet stored. As a result, the element is a string or a |
| 2625 | ;; list of strings. | 2630 | ;; list of strings. |
| 2626 | 2631 | ||
| 2627 | (defsubst quail-store-decode-map-key (table char key) | 2632 | (defun quail-store-decode-map-key (table char key) |
| 2628 | (let ((elt (aref table char))) | 2633 | (let ((elt (aref table char))) |
| 2629 | (if elt | 2634 | (if elt |
| 2630 | (if (consp elt) | 2635 | (if (consp elt) |
diff --git a/lisp/isearch.el b/lisp/isearch.el index fa094caf099..3b9218077f3 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -821,7 +821,7 @@ NOPUSH is t and EDIT is t." | |||
| 821 | (run-hooks 'isearch-mode-end-hook)) | 821 | (run-hooks 'isearch-mode-end-hook)) |
| 822 | 822 | ||
| 823 | ;; If there was movement, mark the starting position. | 823 | ;; If there was movement, mark the starting position. |
| 824 | ;; Maybe should test difference between and set mark iff > threshold. | 824 | ;; Maybe should test difference between and set mark only if > threshold. |
| 825 | (if (/= (point) isearch-opoint) | 825 | (if (/= (point) isearch-opoint) |
| 826 | (or (and transient-mark-mode mark-active) | 826 | (or (and transient-mark-mode mark-active) |
| 827 | (progn | 827 | (progn |
| @@ -2325,7 +2325,7 @@ since they have special meaning in a regexp." | |||
| 2325 | ;; - the direction of the current search is expected to be given by | 2325 | ;; - the direction of the current search is expected to be given by |
| 2326 | ;; `isearch-forward'; | 2326 | ;; `isearch-forward'; |
| 2327 | ;; - the variable `isearch-error' is expected to be true | 2327 | ;; - the variable `isearch-error' is expected to be true |
| 2328 | ;; iff `isearch-string' is an invalid regexp. | 2328 | ;; only if `isearch-string' is an invalid regexp. |
| 2329 | 2329 | ||
| 2330 | (defvar isearch-lazy-highlight-overlays nil) | 2330 | (defvar isearch-lazy-highlight-overlays nil) |
| 2331 | (defvar isearch-lazy-highlight-wrapped nil) | 2331 | (defvar isearch-lazy-highlight-wrapped nil) |
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index 068f5fff2cd..233997285c9 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el | |||
| @@ -396,7 +396,7 @@ See documentation of `walk-windows' for useful values.") | |||
| 396 | (defcustom iswitchb-minibuffer-setup-hook nil | 396 | (defcustom iswitchb-minibuffer-setup-hook nil |
| 397 | "Iswitchb-specific customization of minibuffer setup. | 397 | "Iswitchb-specific customization of minibuffer setup. |
| 398 | 398 | ||
| 399 | This hook is run during minibuffer setup iff `iswitchb' will be active. | 399 | This hook is run during minibuffer setup if `iswitchb' is active. |
| 400 | For instance: | 400 | For instance: |
| 401 | \(add-hook 'iswitchb-minibuffer-setup-hook | 401 | \(add-hook 'iswitchb-minibuffer-setup-hook |
| 402 | '\(lambda () (set (make-local-variable 'max-mini-window-height) 3))) | 402 | '\(lambda () (set (make-local-variable 'max-mini-window-height) 3))) |
| @@ -1440,7 +1440,7 @@ This is an example function which can be hooked on to | |||
| 1440 | (iswitchb-to-end summaries))) | 1440 | (iswitchb-to-end summaries))) |
| 1441 | 1441 | ||
| 1442 | (defun iswitchb-case () | 1442 | (defun iswitchb-case () |
| 1443 | "Return non-nil iff we should ignore case when matching. | 1443 | "Return non-nil if we should ignore case when matching. |
| 1444 | See the variable `iswitchb-case' for details." | 1444 | See the variable `iswitchb-case' for details." |
| 1445 | (if iswitchb-case | 1445 | (if iswitchb-case |
| 1446 | (if (featurep 'xemacs) | 1446 | (if (featurep 'xemacs) |
| @@ -1450,7 +1450,7 @@ See the variable `iswitchb-case' for details." | |||
| 1450 | ;;;###autoload | 1450 | ;;;###autoload |
| 1451 | (define-minor-mode iswitchb-mode | 1451 | (define-minor-mode iswitchb-mode |
| 1452 | "Toggle Iswitchb global minor mode. | 1452 | "Toggle Iswitchb global minor mode. |
| 1453 | With arg, turn Iswitchb mode on if and only iff ARG is positive. | 1453 | With arg, turn Iswitchb mode on if ARG is positive, otherwise turn it off. |
| 1454 | This mode enables switching between buffers using substrings. See | 1454 | This mode enables switching between buffers using substrings. See |
| 1455 | `iswitchb' for details." | 1455 | `iswitchb' for details." |
| 1456 | nil nil iswitchb-global-map :global t :group 'iswitchb | 1456 | nil nil iswitchb-global-map :global t :group 'iswitchb |
diff --git a/lisp/log-edit.el b/lisp/log-edit.el index 7b07b590a4f..5c2cf989f62 100644 --- a/lisp/log-edit.el +++ b/lisp/log-edit.el | |||
| @@ -568,7 +568,7 @@ for more details." | |||
| 568 | (defvar user-mail-address) | 568 | (defvar user-mail-address) |
| 569 | (defun log-edit-changelog-ours-p () | 569 | (defun log-edit-changelog-ours-p () |
| 570 | "See if ChangeLog entry at point is for the current user, today. | 570 | "See if ChangeLog entry at point is for the current user, today. |
| 571 | Return non-nil iff it is." | 571 | Return non-nil if it is." |
| 572 | ;; Code adapted from add-change-log-entry. | 572 | ;; Code adapted from add-change-log-entry. |
| 573 | (let ((name (or (and (boundp 'add-log-full-name) add-log-full-name) | 573 | (let ((name (or (and (boundp 'add-log-full-name) add-log-full-name) |
| 574 | (and (fboundp 'user-full-name) (user-full-name)) | 574 | (and (fboundp 'user-full-name) (user-full-name)) |
diff --git a/lisp/log-view.el b/lisp/log-view.el index 7520e13a1f6..51861da2ae6 100644 --- a/lisp/log-view.el +++ b/lisp/log-view.el | |||
| @@ -174,6 +174,7 @@ The match group number 1 should match the revision number itself.") | |||
| 174 | (1 (if (boundp 'cvs-filename-face) cvs-filename-face)) | 174 | (1 (if (boundp 'cvs-filename-face) cvs-filename-face)) |
| 175 | (0 log-view-file-face append))) | 175 | (0 log-view-file-face append))) |
| 176 | (eval . `(,log-view-message-re . log-view-message-face)))) | 176 | (eval . `(,log-view-message-re . log-view-message-face)))) |
| 177 | |||
| 177 | (defconst log-view-font-lock-defaults | 178 | (defconst log-view-font-lock-defaults |
| 178 | '(log-view-font-lock-keywords t nil nil nil)) | 179 | '(log-view-font-lock-keywords t nil nil nil)) |
| 179 | 180 | ||
diff --git a/lisp/longlines.el b/lisp/longlines.el index fa73ef7057d..07977910a22 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el | |||
| @@ -79,11 +79,13 @@ This is used when `longlines-show-hard-newlines' is on." | |||
| 79 | (defvar longlines-wrap-end nil) | 79 | (defvar longlines-wrap-end nil) |
| 80 | (defvar longlines-wrap-point nil) | 80 | (defvar longlines-wrap-point nil) |
| 81 | (defvar longlines-showing nil) | 81 | (defvar longlines-showing nil) |
| 82 | (defvar longlines-decoded nil) | ||
| 82 | 83 | ||
| 83 | (make-variable-buffer-local 'longlines-wrap-beg) | 84 | (make-variable-buffer-local 'longlines-wrap-beg) |
| 84 | (make-variable-buffer-local 'longlines-wrap-end) | 85 | (make-variable-buffer-local 'longlines-wrap-end) |
| 85 | (make-variable-buffer-local 'longlines-wrap-point) | 86 | (make-variable-buffer-local 'longlines-wrap-point) |
| 86 | (make-variable-buffer-local 'longlines-showing) | 87 | (make-variable-buffer-local 'longlines-showing) |
| 88 | (make-variable-buffer-local 'longlines-decoded) | ||
| 87 | 89 | ||
| 88 | ;; Mode | 90 | ;; Mode |
| 89 | 91 | ||
| @@ -128,7 +130,9 @@ are indicated with a symbol." | |||
| 128 | ;; longlines-wrap-lines that we'll never encounter from here | 130 | ;; longlines-wrap-lines that we'll never encounter from here |
| 129 | (save-restriction | 131 | (save-restriction |
| 130 | (widen) | 132 | (widen) |
| 131 | (longlines-decode-buffer) | 133 | (unless longlines-decoded |
| 134 | (longlines-decode-buffer) | ||
| 135 | (setq longlines-decoded t)) | ||
| 132 | (longlines-wrap-region (point-min) (point-max))) | 136 | (longlines-wrap-region (point-min) (point-max))) |
| 133 | (set-buffer-modified-p mod)) | 137 | (set-buffer-modified-p mod)) |
| 134 | (when (and longlines-show-hard-newlines | 138 | (when (and longlines-show-hard-newlines |
| @@ -161,9 +165,11 @@ are indicated with a symbol." | |||
| 161 | (let ((buffer-undo-list t) | 165 | (let ((buffer-undo-list t) |
| 162 | (after-change-functions nil) | 166 | (after-change-functions nil) |
| 163 | (inhibit-read-only t)) | 167 | (inhibit-read-only t)) |
| 164 | (save-restriction | 168 | (if longlines-decoded |
| 165 | (widen) | 169 | (save-restriction |
| 166 | (longlines-encode-region (point-min) (point-max)))) | 170 | (widen) |
| 171 | (longlines-encode-region (point-min) (point-max)) | ||
| 172 | (setq longlines-decoded nil)))) | ||
| 167 | (remove-hook 'change-major-mode-hook 'longlines-mode-off t) | 173 | (remove-hook 'change-major-mode-hook 'longlines-mode-off t) |
| 168 | (remove-hook 'after-change-functions 'longlines-after-change-function t) | 174 | (remove-hook 'after-change-functions 'longlines-after-change-function t) |
| 169 | (remove-hook 'post-command-hook 'longlines-post-command-function t) | 175 | (remove-hook 'post-command-hook 'longlines-post-command-function t) |
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index b3e2c051e7d..8862e6ca2d2 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el | |||
| @@ -495,7 +495,7 @@ of a mail alias. The value is set up, buffer-local, when first needed.") | |||
| 495 | 495 | ||
| 496 | (or (and (integerp last-command-char) | 496 | (or (and (integerp last-command-char) |
| 497 | ;; Some commands such as M-> may want to expand first. | 497 | ;; Some commands such as M-> may want to expand first. |
| 498 | (equal this-command 'self-insert) | 498 | (equal this-command 'self-insert-command) |
| 499 | (or (eq (char-syntax last-command-char) ?_) | 499 | (or (eq (char-syntax last-command-char) ?_) |
| 500 | ;; Don't expand on @. | 500 | ;; Don't expand on @. |
| 501 | (memq last-command-char '(?@ ?. ?% ?! ?_ ?-)))) | 501 | (memq last-command-char '(?@ ?. ?% ?! ?_ ?-)))) |
diff --git a/lisp/mail/mspools.el b/lisp/mail/mspools.el index d14be55735f..988ce2f8e02 100644 --- a/lisp/mail/mspools.el +++ b/lisp/mail/mspools.el | |||
| @@ -398,7 +398,7 @@ nil." | |||
| 398 | )) | 398 | )) |
| 399 | 399 | ||
| 400 | (defun mspools-size-folder (spool) | 400 | (defun mspools-size-folder (spool) |
| 401 | "Return (SPOOL . SIZE ) iff SIZE of spool file is non-zero." | 401 | "Return (SPOOL . SIZE ), if SIZE of spool file is non-zero." |
| 402 | ;; 7th file attribute is the size of the file in bytes. | 402 | ;; 7th file attribute is the size of the file in bytes. |
| 403 | (let ((file (concat mspools-folder-directory spool)) | 403 | (let ((file (concat mspools-folder-directory spool)) |
| 404 | size) | 404 | size) |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index e4475f5be62..2dd381fdafb 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -3992,13 +3992,13 @@ specifying headers which should not be copied into the new message." | |||
| 3992 | (mail-position-on-field (if resending "Resent-To" "To") t)))))) | 3992 | (mail-position-on-field (if resending "Resent-To" "To") t)))))) |
| 3993 | 3993 | ||
| 3994 | (defun rmail-summary-exists () | 3994 | (defun rmail-summary-exists () |
| 3995 | "Non-nil iff in an RMAIL buffer and an associated summary buffer exists. | 3995 | "Non-nil if in an RMAIL buffer and an associated summary buffer exists. |
| 3996 | In fact, the non-nil value returned is the summary buffer itself." | 3996 | In fact, the non-nil value returned is the summary buffer itself." |
| 3997 | (and rmail-summary-buffer (buffer-name rmail-summary-buffer) | 3997 | (and rmail-summary-buffer (buffer-name rmail-summary-buffer) |
| 3998 | rmail-summary-buffer)) | 3998 | rmail-summary-buffer)) |
| 3999 | 3999 | ||
| 4000 | (defun rmail-summary-displayed () | 4000 | (defun rmail-summary-displayed () |
| 4001 | "t iff in RMAIL buffer and an associated summary buffer is displayed." | 4001 | "t if in RMAIL buffer and an associated summary buffer is displayed." |
| 4002 | (and rmail-summary-buffer (get-buffer-window rmail-summary-buffer))) | 4002 | (and rmail-summary-buffer (get-buffer-window rmail-summary-buffer))) |
| 4003 | 4003 | ||
| 4004 | (defcustom rmail-redisplay-summary nil | 4004 | (defcustom rmail-redisplay-summary nil |
diff --git a/lisp/man.el b/lisp/man.el index 56539072439..c7593e88dda 100644 --- a/lisp/man.el +++ b/lisp/man.el | |||
| @@ -37,7 +37,7 @@ | |||
| 37 | 37 | ||
| 38 | ;; ========== Credits and History ========== | 38 | ;; ========== Credits and History ========== |
| 39 | ;; In mid 1991, several people posted some interesting improvements to | 39 | ;; In mid 1991, several people posted some interesting improvements to |
| 40 | ;; man.el from the standard emacs 18.57 distribution. I liked many of | 40 | ;; man.el from the standard Emacs 18.57 distribution. I liked many of |
| 41 | ;; these, but wanted everything in one single package, so I decided | 41 | ;; these, but wanted everything in one single package, so I decided |
| 42 | ;; to incorporate them into a single manual browsing mode. While | 42 | ;; to incorporate them into a single manual browsing mode. While |
| 43 | ;; much of the code here has been rewritten, and some features added, | 43 | ;; much of the code here has been rewritten, and some features added, |
| @@ -64,7 +64,7 @@ | |||
| 64 | ;; ========== Features ========== | 64 | ;; ========== Features ========== |
| 65 | ;; + Runs "man" in the background and pipes the results through a | 65 | ;; + Runs "man" in the background and pipes the results through a |
| 66 | ;; series of sed and awk scripts so that all retrieving and cleaning | 66 | ;; series of sed and awk scripts so that all retrieving and cleaning |
| 67 | ;; is done in the background. The cleaning commands are configurable. | 67 | ;; is done in the background. The cleaning commands are configurable. |
| 68 | ;; + Syntax is the same as Un*x man | 68 | ;; + Syntax is the same as Un*x man |
| 69 | ;; + Functionality is the same as Un*x man, including "man -k" and | 69 | ;; + Functionality is the same as Un*x man, including "man -k" and |
| 70 | ;; "man <section>", etc. | 70 | ;; "man <section>", etc. |
| @@ -109,8 +109,6 @@ | |||
| 109 | 109 | ||
| 110 | 110 | ||
| 111 | (defvar Man-notify) | 111 | (defvar Man-notify) |
| 112 | (defvar Man-current-page) | ||
| 113 | (defvar Man-page-list) | ||
| 114 | (defcustom Man-filter-list nil | 112 | (defcustom Man-filter-list nil |
| 115 | "*Manpage cleaning filter command phrases. | 113 | "*Manpage cleaning filter command phrases. |
| 116 | This variable contains a list of the following form: | 114 | This variable contains a list of the following form: |
| @@ -127,13 +125,8 @@ the manpage buffer." | |||
| 127 | (string :tag "Phrase String")))) | 125 | (string :tag "Phrase String")))) |
| 128 | :group 'man) | 126 | :group 'man) |
| 129 | 127 | ||
| 130 | (defvar Man-original-frame) | ||
| 131 | (defvar Man-arguments) | ||
| 132 | (defvar Man-sections-alist) | ||
| 133 | (defvar Man-refpages-alist) | ||
| 134 | (defvar Man-uses-untabify-flag t | 128 | (defvar Man-uses-untabify-flag t |
| 135 | "Non-nil means use `untabify' instead of `Man-untabify-command'.") | 129 | "Non-nil means use `untabify' instead of `Man-untabify-command'.") |
| 136 | (defvar Man-page-mode-string) | ||
| 137 | (defvar Man-sed-script nil | 130 | (defvar Man-sed-script nil |
| 138 | "Script for sed to nuke backspaces and ANSI codes from manpages.") | 131 | "Script for sed to nuke backspaces and ANSI codes from manpages.") |
| 139 | 132 | ||
| @@ -141,28 +134,28 @@ the manpage buffer." | |||
| 141 | ;; user variables | 134 | ;; user variables |
| 142 | 135 | ||
| 143 | (defcustom Man-fontify-manpage-flag t | 136 | (defcustom Man-fontify-manpage-flag t |
| 144 | "*Non-nil means make up the manpage with fonts." | 137 | "Non-nil means make up the manpage with fonts." |
| 145 | :type 'boolean | 138 | :type 'boolean |
| 146 | :group 'man) | 139 | :group 'man) |
| 147 | 140 | ||
| 148 | (defcustom Man-overstrike-face 'bold | 141 | (defcustom Man-overstrike-face 'bold |
| 149 | "*Face to use when fontifying overstrike." | 142 | "Face to use when fontifying overstrike." |
| 150 | :type 'face | 143 | :type 'face |
| 151 | :group 'man) | 144 | :group 'man) |
| 152 | 145 | ||
| 153 | (defcustom Man-underline-face 'underline | 146 | (defcustom Man-underline-face 'underline |
| 154 | "*Face to use when fontifying underlining." | 147 | "Face to use when fontifying underlining." |
| 155 | :type 'face | 148 | :type 'face |
| 156 | :group 'man) | 149 | :group 'man) |
| 157 | 150 | ||
| 158 | (defcustom Man-reverse-face 'highlight | 151 | (defcustom Man-reverse-face 'highlight |
| 159 | "*Face to use when fontifying reverse video." | 152 | "Face to use when fontifying reverse video." |
| 160 | :type 'face | 153 | :type 'face |
| 161 | :group 'man) | 154 | :group 'man) |
| 162 | 155 | ||
| 163 | ;; Use the value of the obsolete user option Man-notify, if set. | 156 | ;; Use the value of the obsolete user option Man-notify, if set. |
| 164 | (defcustom Man-notify-method (if (boundp 'Man-notify) Man-notify 'friendly) | 157 | (defcustom Man-notify-method (if (boundp 'Man-notify) Man-notify 'friendly) |
| 165 | "*Selects the behavior when manpage is ready. | 158 | "Selects the behavior when manpage is ready. |
| 166 | This variable may have one of the following values, where (sf) means | 159 | This variable may have one of the following values, where (sf) means |
| 167 | that the frames are switched, so the manpage is displayed in the frame | 160 | that the frames are switched, so the manpage is displayed in the frame |
| 168 | where the man command was called from: | 161 | where the man command was called from: |
| @@ -183,7 +176,7 @@ Any other value of `Man-notify-method' is equivalent to `meek'." | |||
| 183 | :group 'man) | 176 | :group 'man) |
| 184 | 177 | ||
| 185 | (defcustom Man-width nil | 178 | (defcustom Man-width nil |
| 186 | "*Number of columns for which manual pages should be formatted. | 179 | "Number of columns for which manual pages should be formatted. |
| 187 | If nil, the width of the window selected at the moment of man | 180 | If nil, the width of the window selected at the moment of man |
| 188 | invocation is used. If non-nil, the width of the frame selected | 181 | invocation is used. If non-nil, the width of the frame selected |
| 189 | at the moment of man invocation is used. The value also can be a | 182 | at the moment of man invocation is used. The value also can be a |
| @@ -194,12 +187,12 @@ positive integer." | |||
| 194 | :group 'man) | 187 | :group 'man) |
| 195 | 188 | ||
| 196 | (defcustom Man-frame-parameters nil | 189 | (defcustom Man-frame-parameters nil |
| 197 | "*Frame parameter list for creating a new frame for a manual page." | 190 | "Frame parameter list for creating a new frame for a manual page." |
| 198 | :type 'sexp | 191 | :type 'sexp |
| 199 | :group 'man) | 192 | :group 'man) |
| 200 | 193 | ||
| 201 | (defcustom Man-downcase-section-letters-flag t | 194 | (defcustom Man-downcase-section-letters-flag t |
| 202 | "*Non-nil means letters in sections are converted to lower case. | 195 | "Non-nil means letters in sections are converted to lower case. |
| 203 | Some Un*x man commands can't handle uppercase letters in sections, for | 196 | Some Un*x man commands can't handle uppercase letters in sections, for |
| 204 | example \"man 2V chmod\", but they are often displayed in the manpage | 197 | example \"man 2V chmod\", but they are often displayed in the manpage |
| 205 | with the upper case letter. When this variable is t, the section | 198 | with the upper case letter. When this variable is t, the section |
| @@ -209,7 +202,7 @@ being sent to the man background process." | |||
| 209 | :group 'man) | 202 | :group 'man) |
| 210 | 203 | ||
| 211 | (defcustom Man-circular-pages-flag t | 204 | (defcustom Man-circular-pages-flag t |
| 212 | "*Non-nil means the manpage list is treated as circular for traversal." | 205 | "Non-nil means the manpage list is treated as circular for traversal." |
| 213 | :type 'boolean | 206 | :type 'boolean |
| 214 | :group 'man) | 207 | :group 'man) |
| 215 | 208 | ||
| @@ -220,7 +213,7 @@ being sent to the man background process." | |||
| 220 | ;; '("3X" . "3") ; Xlib man pages | 213 | ;; '("3X" . "3") ; Xlib man pages |
| 221 | '("3X11" . "3") | 214 | '("3X11" . "3") |
| 222 | '("1-UCB" . "")) | 215 | '("1-UCB" . "")) |
| 223 | "*Association list of bogus sections to real section numbers. | 216 | "Association list of bogus sections to real section numbers. |
| 224 | Some manpages (e.g. the Sun C++ 2.1 manpages) have section numbers in | 217 | Some manpages (e.g. the Sun C++ 2.1 manpages) have section numbers in |
| 225 | their references which Un*x `man' does not recognize. This | 218 | their references which Un*x `man' does not recognize. This |
| 226 | association list is used to translate those sections, when found, to | 219 | association list is used to translate those sections, when found, to |
| @@ -250,9 +243,6 @@ the associated section number." | |||
| 250 | (defvar Man-awk-command "awk" | 243 | (defvar Man-awk-command "awk" |
| 251 | "Command used for processing awk scripts.") | 244 | "Command used for processing awk scripts.") |
| 252 | 245 | ||
| 253 | (defvar Man-mode-map nil | ||
| 254 | "Keymap for Man mode.") | ||
| 255 | |||
| 256 | (defvar Man-mode-hook nil | 246 | (defvar Man-mode-hook nil |
| 257 | "Hook run when Man mode is enabled.") | 247 | "Hook run when Man mode is enabled.") |
| 258 | 248 | ||
| @@ -349,20 +339,22 @@ Otherwise, the value is whatever the function | |||
| 349 | ;; end user variables | 339 | ;; end user variables |
| 350 | 340 | ||
| 351 | ;; other variables and keymap initializations | 341 | ;; other variables and keymap initializations |
| 342 | (defvar Man-original-frame) | ||
| 343 | (make-variable-buffer-local 'Man-original-frame) | ||
| 344 | (defvar Man-arguments) | ||
| 345 | (make-variable-buffer-local 'Man-arguments) | ||
| 346 | (put 'Man-arguments 'permanent-local t) | ||
| 347 | |||
| 348 | (defvar Man-sections-alist nil) | ||
| 352 | (make-variable-buffer-local 'Man-sections-alist) | 349 | (make-variable-buffer-local 'Man-sections-alist) |
| 350 | (defvar Man-refpages-alist nil) | ||
| 353 | (make-variable-buffer-local 'Man-refpages-alist) | 351 | (make-variable-buffer-local 'Man-refpages-alist) |
| 352 | (defvar Man-page-list nil) | ||
| 354 | (make-variable-buffer-local 'Man-page-list) | 353 | (make-variable-buffer-local 'Man-page-list) |
| 354 | (defvar Man-current-page 0) | ||
| 355 | (make-variable-buffer-local 'Man-current-page) | 355 | (make-variable-buffer-local 'Man-current-page) |
| 356 | (defvar Man-page-mode-string "1 of 1") | ||
| 356 | (make-variable-buffer-local 'Man-page-mode-string) | 357 | (make-variable-buffer-local 'Man-page-mode-string) |
| 357 | (make-variable-buffer-local 'Man-original-frame) | ||
| 358 | (make-variable-buffer-local 'Man-arguments) | ||
| 359 | (put 'Man-arguments 'permanent-local t) | ||
| 360 | |||
| 361 | (setq-default Man-sections-alist nil) | ||
| 362 | (setq-default Man-refpages-alist nil) | ||
| 363 | (setq-default Man-page-list nil) | ||
| 364 | (setq-default Man-current-page 0) | ||
| 365 | (setq-default Man-page-mode-string "1 of 1") | ||
| 366 | 358 | ||
| 367 | (defconst Man-sysv-sed-script "\ | 359 | (defconst Man-sysv-sed-script "\ |
| 368 | /\b/ { s/_\b//g | 360 | /\b/ { s/_\b//g |
| @@ -398,30 +390,32 @@ Otherwise, the value is whatever the function | |||
| 398 | table) | 390 | table) |
| 399 | "Syntax table used in Man mode buffers.") | 391 | "Syntax table used in Man mode buffers.") |
| 400 | 392 | ||
| 401 | (unless Man-mode-map | 393 | (defvar Man-mode-map |
| 402 | (setq Man-mode-map (make-sparse-keymap)) | 394 | (let ((map (make-sparse-keymap))) |
| 403 | (suppress-keymap Man-mode-map) | 395 | (suppress-keymap map) |
| 404 | (set-keymap-parent Man-mode-map button-buffer-map) | 396 | (set-keymap-parent map button-buffer-map) |
| 405 | 397 | ||
| 406 | (define-key Man-mode-map " " 'scroll-up) | 398 | (define-key map " " 'scroll-up) |
| 407 | (define-key Man-mode-map "\177" 'scroll-down) | 399 | (define-key map "\177" 'scroll-down) |
| 408 | (define-key Man-mode-map "n" 'Man-next-section) | 400 | (define-key map "n" 'Man-next-section) |
| 409 | (define-key Man-mode-map "p" 'Man-previous-section) | 401 | (define-key map "p" 'Man-previous-section) |
| 410 | (define-key Man-mode-map "\en" 'Man-next-manpage) | 402 | (define-key map "\en" 'Man-next-manpage) |
| 411 | (define-key Man-mode-map "\ep" 'Man-previous-manpage) | 403 | (define-key map "\ep" 'Man-previous-manpage) |
| 412 | (define-key Man-mode-map ">" 'end-of-buffer) | 404 | (define-key map ">" 'end-of-buffer) |
| 413 | (define-key Man-mode-map "<" 'beginning-of-buffer) | 405 | (define-key map "<" 'beginning-of-buffer) |
| 414 | (define-key Man-mode-map "." 'beginning-of-buffer) | 406 | (define-key map "." 'beginning-of-buffer) |
| 415 | (define-key Man-mode-map "r" 'Man-follow-manual-reference) | 407 | (define-key map "r" 'Man-follow-manual-reference) |
| 416 | (define-key Man-mode-map "g" 'Man-goto-section) | 408 | (define-key map "g" 'Man-goto-section) |
| 417 | (define-key Man-mode-map "s" 'Man-goto-see-also-section) | 409 | (define-key map "s" 'Man-goto-see-also-section) |
| 418 | (define-key Man-mode-map "k" 'Man-kill) | 410 | (define-key map "k" 'Man-kill) |
| 419 | (define-key Man-mode-map "q" 'Man-quit) | 411 | (define-key map "q" 'Man-quit) |
| 420 | (define-key Man-mode-map "m" 'man) | 412 | (define-key map "m" 'man) |
| 421 | ;; Not all the man references get buttons currently. The text in the | 413 | ;; Not all the man references get buttons currently. The text in the |
| 422 | ;; manual page can contain references to other man pages | 414 | ;; manual page can contain references to other man pages |
| 423 | (define-key Man-mode-map "\r" 'man-follow) | 415 | (define-key map "\r" 'man-follow) |
| 424 | (define-key Man-mode-map "?" 'describe-mode)) | 416 | (define-key map "?" 'describe-mode) |
| 417 | map) | ||
| 418 | "Keymap for Man mode.") | ||
| 425 | 419 | ||
| 426 | ;; buttons | 420 | ;; buttons |
| 427 | (define-button-type 'Man-abstract-xref-man-page | 421 | (define-button-type 'Man-abstract-xref-man-page |
| @@ -730,8 +724,7 @@ all sections related to a subject, put something appropriate into the | |||
| 730 | (require 'env) | 724 | (require 'env) |
| 731 | (message "Invoking %s %s in the background" manual-program man-args) | 725 | (message "Invoking %s %s in the background" manual-program man-args) |
| 732 | (setq buffer (generate-new-buffer bufname)) | 726 | (setq buffer (generate-new-buffer bufname)) |
| 733 | (save-excursion | 727 | (with-current-buffer buffer |
| 734 | (set-buffer buffer) | ||
| 735 | (setq buffer-undo-list t) | 728 | (setq buffer-undo-list t) |
| 736 | (setq Man-original-frame (selected-frame)) | 729 | (setq Man-original-frame (selected-frame)) |
| 737 | (setq Man-arguments man-args)) | 730 | (setq Man-arguments man-args)) |
| @@ -802,8 +795,7 @@ all sections related to a subject, put something appropriate into the | |||
| 802 | (defun Man-notify-when-ready (man-buffer) | 795 | (defun Man-notify-when-ready (man-buffer) |
| 803 | "Notify the user when MAN-BUFFER is ready. | 796 | "Notify the user when MAN-BUFFER is ready. |
| 804 | See the variable `Man-notify-method' for the different notification behaviors." | 797 | See the variable `Man-notify-method' for the different notification behaviors." |
| 805 | (let ((saved-frame (save-excursion | 798 | (let ((saved-frame (with-current-buffer man-buffer |
| 806 | (set-buffer man-buffer) | ||
| 807 | Man-original-frame))) | 799 | Man-original-frame))) |
| 808 | (cond | 800 | (cond |
| 809 | ((eq Man-notify-method 'newframe) | 801 | ((eq Man-notify-method 'newframe) |
| @@ -975,7 +967,7 @@ default type, `Man-xref-man-page' is used for the buttons." | |||
| 975 | (Man-next-section 1) | 967 | (Man-next-section 1) |
| 976 | (point))) | 968 | (point))) |
| 977 | (goto-char (point-min)) | 969 | (goto-char (point-min)) |
| 978 | (point-max)))) | 970 | nil))) |
| 979 | (while (re-search-forward regexp end t) | 971 | (while (re-search-forward regexp end t) |
| 980 | (make-text-button | 972 | (make-text-button |
| 981 | (match-beginning button-pos) | 973 | (match-beginning button-pos) |
| @@ -1031,8 +1023,7 @@ manpage command." | |||
| 1031 | (or (stringp process) | 1023 | (or (stringp process) |
| 1032 | (set-process-buffer process nil)) | 1024 | (set-process-buffer process nil)) |
| 1033 | 1025 | ||
| 1034 | (save-excursion | 1026 | (with-current-buffer Man-buffer |
| 1035 | (set-buffer Man-buffer) | ||
| 1036 | (let ((case-fold-search nil)) | 1027 | (let ((case-fold-search nil)) |
| 1037 | (goto-char (point-min)) | 1028 | (goto-char (point-min)) |
| 1038 | (cond ((or (looking-at "No \\(manual \\)*entry for") | 1029 | (cond ((or (looking-at "No \\(manual \\)*entry for") |
| @@ -1223,13 +1214,10 @@ The following key bindings are currently in effect in the buffer: | |||
| 1223 | 1214 | ||
| 1224 | (defun Man-strip-page-headers () | 1215 | (defun Man-strip-page-headers () |
| 1225 | "Strip all the page headers but the first from the manpage." | 1216 | "Strip all the page headers but the first from the manpage." |
| 1226 | (let ((buffer-read-only nil) | 1217 | (let ((inhibit-read-only t) |
| 1227 | (case-fold-search nil) | 1218 | (case-fold-search nil) |
| 1228 | (page-list Man-page-list) | ||
| 1229 | (page ()) | ||
| 1230 | (header "")) | 1219 | (header "")) |
| 1231 | (while page-list | 1220 | (dolist (page Man-page-list) |
| 1232 | (setq page (car page-list)) | ||
| 1233 | (and (nth 2 page) | 1221 | (and (nth 2 page) |
| 1234 | (goto-char (car page)) | 1222 | (goto-char (car page)) |
| 1235 | (re-search-forward Man-first-heading-regexp nil t) | 1223 | (re-search-forward Man-first-heading-regexp nil t) |
| @@ -1243,17 +1231,14 @@ The following key bindings are currently in effect in the buffer: | |||
| 1243 | ;; line. | 1231 | ;; line. |
| 1244 | ;; (setq header (concat "\n" header))) | 1232 | ;; (setq header (concat "\n" header))) |
| 1245 | (while (search-forward header (nth 1 page) t) | 1233 | (while (search-forward header (nth 1 page) t) |
| 1246 | (replace-match ""))) | 1234 | (replace-match "")))))) |
| 1247 | (setq page-list (cdr page-list))))) | ||
| 1248 | 1235 | ||
| 1249 | (defun Man-unindent () | 1236 | (defun Man-unindent () |
| 1250 | "Delete the leading spaces that indent the manpage." | 1237 | "Delete the leading spaces that indent the manpage." |
| 1251 | (let ((buffer-read-only nil) | 1238 | (let ((inhibit-read-only t) |
| 1252 | (case-fold-search nil) | 1239 | (case-fold-search nil)) |
| 1253 | (page-list Man-page-list)) | 1240 | (dolist (page Man-page-list) |
| 1254 | (while page-list | 1241 | (let ((indent "") |
| 1255 | (let ((page (car page-list)) | ||
| 1256 | (indent "") | ||
| 1257 | (nindent 0)) | 1242 | (nindent 0)) |
| 1258 | (narrow-to-region (car page) (car (cdr page))) | 1243 | (narrow-to-region (car page) (car (cdr page))) |
| 1259 | (if Man-uses-untabify-flag | 1244 | (if Man-uses-untabify-flag |
| @@ -1281,7 +1266,6 @@ The following key bindings are currently in effect in the buffer: | |||
| 1281 | (or (eolp) | 1266 | (or (eolp) |
| 1282 | (delete-char nindent)) | 1267 | (delete-char nindent)) |
| 1283 | (forward-line 1))) | 1268 | (forward-line 1))) |
| 1284 | (setq page-list (cdr page-list)) | ||
| 1285 | )))) | 1269 | )))) |
| 1286 | 1270 | ||
| 1287 | 1271 | ||
| @@ -1291,14 +1275,18 @@ The following key bindings are currently in effect in the buffer: | |||
| 1291 | (defun Man-next-section (n) | 1275 | (defun Man-next-section (n) |
| 1292 | "Move point to Nth next section (default 1)." | 1276 | "Move point to Nth next section (default 1)." |
| 1293 | (interactive "p") | 1277 | (interactive "p") |
| 1294 | (let ((case-fold-search nil)) | 1278 | (let ((case-fold-search nil) |
| 1279 | (start (point))) | ||
| 1295 | (if (looking-at Man-heading-regexp) | 1280 | (if (looking-at Man-heading-regexp) |
| 1296 | (forward-line 1)) | 1281 | (forward-line 1)) |
| 1297 | (if (re-search-forward Man-heading-regexp (point-max) t n) | 1282 | (if (re-search-forward Man-heading-regexp (point-max) t n) |
| 1298 | (beginning-of-line) | 1283 | (beginning-of-line) |
| 1299 | (goto-char (point-max)) | 1284 | (goto-char (point-max)) |
| 1300 | ;; The last line doesn't belong to any section. | 1285 | ;; The last line doesn't belong to any section. |
| 1301 | (forward-line -1)))) | 1286 | (forward-line -1)) |
| 1287 | ;; But don't move back from the starting point (can happen if `start' | ||
| 1288 | ;; is somewhere on the last line). | ||
| 1289 | (if (< (point) start) (goto-char start)))) | ||
| 1302 | 1290 | ||
| 1303 | (defun Man-previous-section (n) | 1291 | (defun Man-previous-section (n) |
| 1304 | "Move point to Nth previous section (default 1)." | 1292 | "Move point to Nth previous section (default 1)." |
| @@ -1462,7 +1450,7 @@ Specify which REFERENCE to use; default is based on word at point." | |||
| 1462 | (let ((path Man-header-file-path) | 1450 | (let ((path Man-header-file-path) |
| 1463 | complete-path) | 1451 | complete-path) |
| 1464 | (while path | 1452 | (while path |
| 1465 | (setq complete-path (concat (car path) "/" file) | 1453 | (setq complete-path (expand-file-name file (car path)) |
| 1466 | path (cdr path)) | 1454 | path (cdr path)) |
| 1467 | (if (file-readable-p complete-path) | 1455 | (if (file-readable-p complete-path) |
| 1468 | (progn (view-file complete-path) | 1456 | (progn (view-file complete-path) |
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 48f4613287b..8bc0bd86a41 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -1170,7 +1170,7 @@ mail status in mode line")) | |||
| 1170 | 1170 | ||
| 1171 | (defun menu-bar-vc-filter (orig-binding) | 1171 | (defun menu-bar-vc-filter (orig-binding) |
| 1172 | (let ((ext-binding | 1172 | (let ((ext-binding |
| 1173 | (if vc-mode (vc-call 'extra-menu buffer-file-name)))) | 1173 | (if vc-mode (vc-call-backend (vc-backend buffer-file-name) 'extra-menu)))) |
| 1174 | ;; Give the VC backend a chance to add menu entries | 1174 | ;; Give the VC backend a chance to add menu entries |
| 1175 | ;; specific for that backend. | 1175 | ;; specific for that backend. |
| 1176 | (if (null ext-binding) | 1176 | (if (null ext-binding) |
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 254b44f9a03..b7fe48ccd7c 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-08-08 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * mh-folder.el, mh-letter.el, mh-show.el: Replace `iff' in | ||
| 4 | doc-strings and comments. | ||
| 5 | |||
| 1 | 2007-07-25 Glenn Morris <rgm@gnu.org> | 6 | 2007-07-25 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * Relicense all FSF files to GPLv3 or later. | 8 | * Relicense all FSF files to GPLv3 or later. |
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index 63d55459cf4..42abad4536a 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el | |||
| @@ -1495,7 +1495,7 @@ function doesn't recenter the folder buffer." | |||
| 1495 | 1495 | ||
| 1496 | (defun mh-update-unseen () | 1496 | (defun mh-update-unseen () |
| 1497 | "Synchronize the unseen sequence with MH. | 1497 | "Synchronize the unseen sequence with MH. |
| 1498 | Return non-nil iff the MH folder was set. | 1498 | Return non-nil if the MH folder was set. |
| 1499 | The hook `mh-unseen-updated-hook' is called after the unseen sequence | 1499 | The hook `mh-unseen-updated-hook' is called after the unseen sequence |
| 1500 | is updated." | 1500 | is updated." |
| 1501 | (if mh-seen-list | 1501 | (if mh-seen-list |
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index c70c9d8c7e4..7b2cab77d04 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el | |||
| @@ -844,7 +844,7 @@ body." | |||
| 844 | (defun mh-position-on-field (field &optional ignored) | 844 | (defun mh-position-on-field (field &optional ignored) |
| 845 | "Move to the end of the FIELD in the header. | 845 | "Move to the end of the FIELD in the header. |
| 846 | Move to end of entire header if FIELD not found. | 846 | Move to end of entire header if FIELD not found. |
| 847 | Returns non-nil iff FIELD was found. | 847 | Returns non-nil if FIELD was found. |
| 848 | The optional second arg is for pre-version 4 compatibility and is | 848 | The optional second arg is for pre-version 4 compatibility and is |
| 849 | IGNORED." | 849 | IGNORED." |
| 850 | (cond ((mh-goto-header-field field) | 850 | (cond ((mh-goto-header-field field) |
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el index d3b93ca65ab..4e1a19c3a06 100644 --- a/lisp/mh-e/mh-show.el +++ b/lisp/mh-e/mh-show.el | |||
| @@ -161,7 +161,7 @@ displayed." | |||
| 161 | (defun mh-showing-mode (&optional arg) | 161 | (defun mh-showing-mode (&optional arg) |
| 162 | "Change whether messages should be displayed. | 162 | "Change whether messages should be displayed. |
| 163 | 163 | ||
| 164 | With ARG, display messages iff ARG is positive." | 164 | With ARG, display messages if ARG is positive, otherwise don't display them." |
| 165 | (setq mh-showing-mode | 165 | (setq mh-showing-mode |
| 166 | (if (null arg) | 166 | (if (null arg) |
| 167 | (not mh-showing-mode) | 167 | (not mh-showing-mode) |
diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el index f1d56eccc66..bfb199ab897 100644 --- a/lisp/mouse-drag.el +++ b/lisp/mouse-drag.el | |||
| @@ -158,7 +158,7 @@ Keep the cursor on the screen as needed." | |||
| 158 | Basically, we check for existing horizontal scrolling." | 158 | Basically, we check for existing horizontal scrolling." |
| 159 | (or truncate-lines | 159 | (or truncate-lines |
| 160 | (> (window-hscroll (selected-window)) 0) | 160 | (> (window-hscroll (selected-window)) 0) |
| 161 | (< (window-width) (frame-width)) | 161 | (not (window-full-width-p)) |
| 162 | (and | 162 | (and |
| 163 | mouse-drag-electric-col-scrolling | 163 | mouse-drag-electric-col-scrolling |
| 164 | (save-excursion ;; on a long line? | 164 | (save-excursion ;; on a long line? |
diff --git a/lisp/mouse.el b/lisp/mouse.el index cbbaf73fcbb..27c5dd901f7 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -1814,27 +1814,23 @@ and selects that window." | |||
| 1814 | (mouse-minibuffer-check event) | 1814 | (mouse-minibuffer-check event) |
| 1815 | (let ((buffers (buffer-list)) alist menu split-by-major-mode sum-of-squares) | 1815 | (let ((buffers (buffer-list)) alist menu split-by-major-mode sum-of-squares) |
| 1816 | ;; Make an alist of elements that look like (MENU-ITEM . BUFFER). | 1816 | ;; Make an alist of elements that look like (MENU-ITEM . BUFFER). |
| 1817 | (let ((tail buffers)) | 1817 | (dolist (buf buffers) |
| 1818 | (while tail | 1818 | ;; Divide all buffers into buckets for various major modes. |
| 1819 | ;; Divide all buffers into buckets for various major modes. | 1819 | ;; Each bucket looks like (MODE NAMESTRING BUFFERS...). |
| 1820 | ;; Each bucket looks like (MODE NAMESTRING BUFFERS...). | 1820 | (with-current-buffer buf |
| 1821 | (with-current-buffer (car tail) | 1821 | (let* ((adjusted-major-mode major-mode) elt) |
| 1822 | (let* ((adjusted-major-mode major-mode) elt) | 1822 | (dolist (group mouse-buffer-menu-mode-groups) |
| 1823 | (let ((tail mouse-buffer-menu-mode-groups)) | 1823 | (when (string-match (car group) (format-mode-line mode-name)) |
| 1824 | (while tail | 1824 | (setq adjusted-major-mode (cdr group)))) |
| 1825 | (if (string-match (car (car tail)) mode-name) | 1825 | (setq elt (assoc adjusted-major-mode split-by-major-mode)) |
| 1826 | (setq adjusted-major-mode (cdr (car tail)))) | 1826 | (unless elt |
| 1827 | (setq tail (cdr tail)))) | 1827 | (setq elt (list adjusted-major-mode |
| 1828 | (setq elt (assoc adjusted-major-mode split-by-major-mode)) | 1828 | (if (stringp adjusted-major-mode) |
| 1829 | (if (null elt) | 1829 | adjusted-major-mode |
| 1830 | (setq elt (list adjusted-major-mode | 1830 | mode-name)) |
| 1831 | (if (stringp adjusted-major-mode) | 1831 | split-by-major-mode (cons elt split-by-major-mode))) |
| 1832 | adjusted-major-mode | 1832 | (or (memq buf (cdr (cdr elt))) |
| 1833 | mode-name)) | 1833 | (setcdr (cdr elt) (cons buf (cdr (cdr elt)))))))) |
| 1834 | split-by-major-mode (cons elt split-by-major-mode))) | ||
| 1835 | (or (memq (car tail) (cdr (cdr elt))) | ||
| 1836 | (setcdr (cdr elt) (cons (car tail) (cdr (cdr elt))))))) | ||
| 1837 | (setq tail (cdr tail)))) | ||
| 1838 | ;; Compute the sum of squares of sizes of the major-mode buckets. | 1834 | ;; Compute the sum of squares of sizes of the major-mode buckets. |
| 1839 | (let ((tail split-by-major-mode)) | 1835 | (let ((tail split-by-major-mode)) |
| 1840 | (setq sum-of-squares 0) | 1836 | (setq sum-of-squares 0) |
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index fd7f0682622..2f06344ccda 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el | |||
| @@ -4285,7 +4285,12 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") | |||
| 4285 | ;;;###autoload | 4285 | ;;;###autoload |
| 4286 | (defun ange-ftp-hook-function (operation &rest args) | 4286 | (defun ange-ftp-hook-function (operation &rest args) |
| 4287 | (let ((fn (get operation 'ange-ftp))) | 4287 | (let ((fn (get operation 'ange-ftp))) |
| 4288 | (if fn (save-match-data (apply fn args)) | 4288 | (if fn |
| 4289 | ;; Catch also errors in process-filter. | ||
| 4290 | (condition-case err | ||
| 4291 | (let ((debug-on-error t)) | ||
| 4292 | (save-match-data (apply fn args))) | ||
| 4293 | (error (signal (car err) (cdr err)))) | ||
| 4289 | (ange-ftp-run-real-handler operation args)))) | 4294 | (ange-ftp-run-real-handler operation args)))) |
| 4290 | 4295 | ||
| 4291 | ;; The following code is commented out because Tramp now deals with | 4296 | ;; The following code is commented out because Tramp now deals with |
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el index 28f7d1ddb46..ef01c96ec8e 100644 --- a/lisp/net/telnet.el +++ b/lisp/net/telnet.el | |||
| @@ -248,7 +248,7 @@ There is a variable ``telnet-interrupt-string'' which is the character | |||
| 248 | sent to try to stop execution of a job on the remote host. | 248 | sent to try to stop execution of a job on the remote host. |
| 249 | Data is sent to the remote host when RET is typed." | 249 | Data is sent to the remote host when RET is typed." |
| 250 | (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern) | 250 | (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern) |
| 251 | (setq comint-use-prompt-regexp t)) | 251 | (set (make-local-variable 'comint-use-prompt-regexp) t)) |
| 252 | 252 | ||
| 253 | ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)") | 253 | ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)") |
| 254 | 254 | ||
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 79b0b537837..db08fe3b6df 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el | |||
| @@ -290,9 +290,8 @@ history." | |||
| 290 | tramp-cache-data) | 290 | tramp-cache-data) |
| 291 | res)) | 291 | res)) |
| 292 | 292 | ||
| 293 | ;; Read persistent connection history. Applied with | 293 | ;; Read persistent connection history. |
| 294 | ;; `load-in-progress', because it shall be evaluated only once. | 294 | (when (zerop (hash-table-count tramp-cache-data)) |
| 295 | (when load-in-progress | ||
| 296 | (condition-case err | 295 | (condition-case err |
| 297 | (with-temp-buffer | 296 | (with-temp-buffer |
| 298 | (insert-file-contents tramp-persistency-file-name) | 297 | (insert-file-contents tramp-persistency-file-name) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5285b87313a..1070d61cba6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1027,7 +1027,7 @@ The `sudo' program appears to insert a `^@' character into the prompt." | |||
| 1027 | "Login incorrect" | 1027 | "Login incorrect" |
| 1028 | "Login Incorrect" | 1028 | "Login Incorrect" |
| 1029 | "Connection refused" | 1029 | "Connection refused" |
| 1030 | "Connection closed by foreign host." | 1030 | "Connection closed" |
| 1031 | "Sorry, try again." | 1031 | "Sorry, try again." |
| 1032 | "Name or service not known" | 1032 | "Name or service not known" |
| 1033 | "Host key verification failed." | 1033 | "Host key verification failed." |
| @@ -3581,8 +3581,11 @@ beginning of local filename are not substituted." | |||
| 3581 | (tramp-send-command v command) | 3581 | (tramp-send-command v command) |
| 3582 | ;; We should show the output anyway. | 3582 | ;; We should show the output anyway. |
| 3583 | (when outbuf | 3583 | (when outbuf |
| 3584 | (with-current-buffer outbuf | 3584 | (let ((output-string |
| 3585 | (insert-buffer-substring (tramp-get-connection-buffer v))) | 3585 | (with-current-buffer (tramp-get-connection-buffer v) |
| 3586 | (buffer-substring (point-min) (point-max))))) | ||
| 3587 | (with-current-buffer outbuf | ||
| 3588 | (insert output-string))) | ||
| 3586 | (when display (display-buffer outbuf)))) | 3589 | (when display (display-buffer outbuf)))) |
| 3587 | ;; When the user did interrupt, we should do it also. | 3590 | ;; When the user did interrupt, we should do it also. |
| 3588 | (error | 3591 | (error |
| @@ -3614,12 +3617,20 @@ beginning of local filename are not substituted." | |||
| 3614 | (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command)) | 3617 | (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command)) |
| 3615 | (args (split-string (substring command 0 asynchronous) " ")) | 3618 | (args (split-string (substring command 0 asynchronous) " ")) |
| 3616 | (output-buffer | 3619 | (output-buffer |
| 3617 | (or output-buffer | 3620 | (cond |
| 3618 | (if asynchronous | 3621 | ((bufferp output-buffer) output-buffer) |
| 3619 | "*Async Shell Command*" | 3622 | ((stringp output-buffer) (get-buffer-create output-buffer)) |
| 3620 | "*Shell Command Output*"))) | 3623 | (output-buffer (current-buffer)) |
| 3624 | (t (generate-new-buffer | ||
| 3625 | (if asynchronous | ||
| 3626 | "*Async Shell Command*" | ||
| 3627 | "*Shell Command Output*"))))) | ||
| 3628 | (error-buffer | ||
| 3629 | (cond | ||
| 3630 | ((bufferp error-buffer) error-buffer) | ||
| 3631 | ((stringp error-buffer) (get-buffer-create error-buffer)))) | ||
| 3621 | (buffer | 3632 | (buffer |
| 3622 | (if (and (not asynchronous) (bufferp error-buffer)) | 3633 | (if (and (not asynchronous) error-buffer) |
| 3623 | (with-parsed-tramp-file-name default-directory nil | 3634 | (with-parsed-tramp-file-name default-directory nil |
| 3624 | (list output-buffer (tramp-make-tramp-temp-file v))) | 3635 | (list output-buffer (tramp-make-tramp-temp-file v))) |
| 3625 | output-buffer))) | 3636 | output-buffer))) |
| @@ -3637,7 +3648,10 @@ beginning of local filename are not substituted." | |||
| 3637 | (when (listp buffer) | 3648 | (when (listp buffer) |
| 3638 | (with-current-buffer error-buffer | 3649 | (with-current-buffer error-buffer |
| 3639 | (insert-file-contents (cadr buffer))) | 3650 | (insert-file-contents (cadr buffer))) |
| 3640 | (delete-file (cadr buffer)))))) | 3651 | (delete-file (buffer-file-name (cadr buffer)))) |
| 3652 | ;; There's some output, display it. | ||
| 3653 | (when (with-current-buffer output-buffer (> (point-max) (point-min))) | ||
| 3654 | (display-message-or-buffer output-buffer))))) | ||
| 3641 | 3655 | ||
| 3642 | ;; File Editing. | 3656 | ;; File Editing. |
| 3643 | 3657 | ||
| @@ -4177,8 +4191,12 @@ Falls back to normal file name handler if no tramp file name handler exists." | |||
| 4177 | ((and completion (zerop (length localname)) | 4191 | ((and completion (zerop (length localname)) |
| 4178 | (memq operation '(file-name-as-directory))) | 4192 | (memq operation '(file-name-as-directory))) |
| 4179 | filename) | 4193 | filename) |
| 4180 | ;; Call the backend function. | 4194 | ;; Call the backend function. Set a connection property |
| 4181 | (foreign (apply foreign operation args)) | 4195 | ;; first, it will be reused for user/host name completion. |
| 4196 | (foreign | ||
| 4197 | (unless (zerop (length localname)) | ||
| 4198 | (tramp-set-connection-property v "started" nil)) | ||
| 4199 | (apply foreign operation args)) | ||
| 4182 | ;; Nothing to do for us. | 4200 | ;; Nothing to do for us. |
| 4183 | (t (tramp-run-real-handler operation args))))))) | 4201 | (t (tramp-run-real-handler operation args))))))) |
| 4184 | 4202 | ||
| @@ -6116,7 +6134,8 @@ In case there is no valid Lisp expression, it raises an error" | |||
| 6116 | (condition-case nil | 6134 | (condition-case nil |
| 6117 | (prog1 (read (current-buffer)) | 6135 | (prog1 (read (current-buffer)) |
| 6118 | ;; Error handling. | 6136 | ;; Error handling. |
| 6119 | (when (re-search-forward "\\S-" nil t) (error))) | 6137 | (when (re-search-forward "\\S-" (tramp-line-end-position) t) |
| 6138 | (error))) | ||
| 6120 | (error (tramp-error | 6139 | (error (tramp-error |
| 6121 | vec 'file-error | 6140 | vec 'file-error |
| 6122 | "`%s' does not return a valid Lisp expression: `%s'" | 6141 | "`%s' does not return a valid Lisp expression: `%s'" |
| @@ -6125,7 +6144,7 @@ In case there is no valid Lisp expression, it raises an error" | |||
| 6125 | ;; It seems that Tru64 Unix does not like it if long strings are sent | 6144 | ;; It seems that Tru64 Unix does not like it if long strings are sent |
| 6126 | ;; to it in one go. (This happens when sending the Perl | 6145 | ;; to it in one go. (This happens when sending the Perl |
| 6127 | ;; `file-attributes' implementation, for instance.) Therefore, we | 6146 | ;; `file-attributes' implementation, for instance.) Therefore, we |
| 6128 | ;; have this function which waits a bit at each line. | 6147 | ;; have this function which sends the string in chunks. |
| 6129 | (defun tramp-send-string (vec string) | 6148 | (defun tramp-send-string (vec string) |
| 6130 | "Send the STRING via connection VEC. | 6149 | "Send the STRING via connection VEC. |
| 6131 | 6150 | ||
| @@ -6143,7 +6162,7 @@ the remote host use line-endings as defined in the variable | |||
| 6143 | ;; Clean up the buffer. We cannot call `erase-buffer' because | 6162 | ;; Clean up the buffer. We cannot call `erase-buffer' because |
| 6144 | ;; narrowing might be in effect. | 6163 | ;; narrowing might be in effect. |
| 6145 | (let (buffer-read-only) (delete-region (point-min) (point-max))) | 6164 | (let (buffer-read-only) (delete-region (point-min) (point-max))) |
| 6146 | ;; replace "\n" by `tramp-rsh-end-of-line' | 6165 | ;; Replace "\n" by `tramp-rsh-end-of-line'. |
| 6147 | (setq string | 6166 | (setq string |
| 6148 | (mapconcat 'identity | 6167 | (mapconcat 'identity |
| 6149 | (split-string string "\n") | 6168 | (split-string string "\n") |
| @@ -6151,7 +6170,7 @@ the remote host use line-endings as defined in the variable | |||
| 6151 | (unless (or (string= string "") | 6170 | (unless (or (string= string "") |
| 6152 | (string-equal (substring string -1) tramp-rsh-end-of-line)) | 6171 | (string-equal (substring string -1) tramp-rsh-end-of-line)) |
| 6153 | (setq string (concat string tramp-rsh-end-of-line))) | 6172 | (setq string (concat string tramp-rsh-end-of-line))) |
| 6154 | ;; send the string | 6173 | ;; Send the string. |
| 6155 | (if (and chunksize (not (zerop chunksize))) | 6174 | (if (and chunksize (not (zerop chunksize))) |
| 6156 | (let ((pos 0) | 6175 | (let ((pos 0) |
| 6157 | (end (length string))) | 6176 | (end (length string))) |
diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el index a2405b0edb2..569771143e3 100644 --- a/lisp/obsolete/fast-lock.el +++ b/lisp/obsolete/fast-lock.el | |||
| @@ -523,7 +523,7 @@ See `fast-lock-cache-directories'." | |||
| 523 | ;; Just a directory. | 523 | ;; Just a directory. |
| 524 | directory) | 524 | directory) |
| 525 | (t | 525 | (t |
| 526 | ;; A directory iff the file name matches the regexp. | 526 | ;; A directory if the file name matches the regexp. |
| 527 | (let ((bufile (expand-file-name buffer-file-truename)) | 527 | (let ((bufile (expand-file-name buffer-file-truename)) |
| 528 | (case-fold-search nil)) | 528 | (case-fold-search nil)) |
| 529 | (when (save-match-data (string-match (car directory) bufile)) | 529 | (when (save-match-data (string-match (car directory) bufile)) |
diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el index 6991f796526..e5ab1638c60 100644 --- a/lisp/pcvs-util.el +++ b/lisp/pcvs-util.el | |||
| @@ -211,7 +211,8 @@ arguments. If ARGS is not a list, no argument will be passed." | |||
| 211 | (defconst cvs-qtypedesc-string1 (cvs-qtypedesc-create 'identity 'identity t)) | 211 | (defconst cvs-qtypedesc-string1 (cvs-qtypedesc-create 'identity 'identity t)) |
| 212 | (defconst cvs-qtypedesc-string (cvs-qtypedesc-create 'identity 'identity)) | 212 | (defconst cvs-qtypedesc-string (cvs-qtypedesc-create 'identity 'identity)) |
| 213 | (defconst cvs-qtypedesc-strings | 213 | (defconst cvs-qtypedesc-strings |
| 214 | (cvs-qtypedesc-create 'string->strings 'strings->string nil)) | 214 | (cvs-qtypedesc-create 'split-string-and-unquote |
| 215 | 'combine-and-quote-strings nil)) | ||
| 215 | 216 | ||
| 216 | (defun cvs-query-read (default prompt qtypedesc &optional hist-sym) | 217 | (defun cvs-query-read (default prompt qtypedesc &optional hist-sym) |
| 217 | (let* ((qtypedesc (or qtypedesc cvs-qtypedesc-strings)) | 218 | (let* ((qtypedesc (or qtypedesc cvs-qtypedesc-strings)) |
diff --git a/lisp/pcvs.el b/lisp/pcvs.el index 5c79f7a5fb9..21cfd5b042d 100644 --- a/lisp/pcvs.el +++ b/lisp/pcvs.el | |||
| @@ -182,7 +182,7 @@ | |||
| 182 | (when (re-search-forward | 182 | (when (re-search-forward |
| 183 | (concat "^" cmd "\\(\\s-+\\(.*\\)\\)?$") nil t) | 183 | (concat "^" cmd "\\(\\s-+\\(.*\\)\\)?$") nil t) |
| 184 | (let* ((sym (intern (concat "cvs-" cmd "-flags"))) | 184 | (let* ((sym (intern (concat "cvs-" cmd "-flags"))) |
| 185 | (val (string->strings (or (match-string 2) "")))) | 185 | (val (split-string-and-unquote (or (match-string 2) "")))) |
| 186 | (cvs-flags-set sym 0 val)))) | 186 | (cvs-flags-set sym 0 val)))) |
| 187 | ;; ensure that cvs doesn't have -q or -Q | 187 | ;; ensure that cvs doesn't have -q or -Q |
| 188 | (cvs-flags-set 'cvs-cvs-flags 0 | 188 | (cvs-flags-set 'cvs-cvs-flags 0 |
| @@ -612,7 +612,7 @@ If non-nil, NEW means to create a new buffer no matter what." | |||
| 612 | (t arg))) | 612 | (t arg))) |
| 613 | args))) | 613 | args))) |
| 614 | (concat cvs-program " " | 614 | (concat cvs-program " " |
| 615 | (strings->string | 615 | (combine-and-quote-strings |
| 616 | (append (cvs-flags-query 'cvs-cvs-flags nil 'noquery) | 616 | (append (cvs-flags-query 'cvs-cvs-flags nil 'noquery) |
| 617 | (if cvs-cvsroot (list "-d" cvs-cvsroot)) | 617 | (if cvs-cvsroot (list "-d" cvs-cvsroot)) |
| 618 | args | 618 | args |
| @@ -941,7 +941,8 @@ With a prefix argument, prompt for cvs FLAGS to use." | |||
| 941 | (let ((root (cvs-get-cvsroot))) | 941 | (let ((root (cvs-get-cvsroot))) |
| 942 | (if (or (null root) current-prefix-arg) | 942 | (if (or (null root) current-prefix-arg) |
| 943 | (setq root (read-string "CVS Root: "))) | 943 | (setq root (read-string "CVS Root: "))) |
| 944 | (list (string->strings (read-string "Module(s): " (cvs-get-module))) | 944 | (list (split-string-and-unquote |
| 945 | (read-string "Module(s): " (cvs-get-module))) | ||
| 945 | (read-directory-name "CVS Checkout Directory: " | 946 | (read-directory-name "CVS Checkout Directory: " |
| 946 | nil default-directory nil) | 947 | nil default-directory nil) |
| 947 | (cvs-add-branch-prefix | 948 | (cvs-add-branch-prefix |
| @@ -964,7 +965,7 @@ The files are stored to DIR." | |||
| 964 | (if branch (format " (branch: %s)" branch) | 965 | (if branch (format " (branch: %s)" branch) |
| 965 | "")))) | 966 | "")))) |
| 966 | (list (read-directory-name prompt nil default-directory nil)))) | 967 | (list (read-directory-name prompt nil default-directory nil)))) |
| 967 | (let ((modules (string->strings (cvs-get-module))) | 968 | (let ((modules (split-string-and-unquote (cvs-get-module))) |
| 968 | (flags (cvs-add-branch-prefix | 969 | (flags (cvs-add-branch-prefix |
| 969 | (cvs-flags-query 'cvs-checkout-flags "cvs checkout flags"))) | 970 | (cvs-flags-query 'cvs-checkout-flags "cvs checkout flags"))) |
| 970 | (cvs-cvsroot (cvs-get-cvsroot))) | 971 | (cvs-cvsroot (cvs-get-cvsroot))) |
| @@ -2253,7 +2254,7 @@ With prefix argument, prompt for cvs flags." | |||
| 2253 | (let* ((args (append constant-args arg-list))) | 2254 | (let* ((args (append constant-args arg-list))) |
| 2254 | 2255 | ||
| 2255 | (insert (format "=== %s %s\n\n" | 2256 | (insert (format "=== %s %s\n\n" |
| 2256 | program (strings->string args))) | 2257 | program (split-string-and-unquote args))) |
| 2257 | 2258 | ||
| 2258 | ;; FIXME: return the exit status? | 2259 | ;; FIXME: return the exit status? |
| 2259 | (apply 'call-process program nil t t args) | 2260 | (apply 'call-process program nil t t args) |
diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 7fbeeab6eea..594b628ad44 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el | |||
| @@ -568,7 +568,7 @@ The standard value contains the following functions as READ-FN: | |||
| 568 | general value, or `antlr-read-boolean' with ARGs = \(PROMPT TABLE) which | 568 | general value, or `antlr-read-boolean' with ARGs = \(PROMPT TABLE) which |
| 569 | reads a boolean value or a member of TABLE. PROMPT is the prompt when | 569 | reads a boolean value or a member of TABLE. PROMPT is the prompt when |
| 570 | asking for a new value. If non-nil, TABLE is a table for completion or | 570 | asking for a new value. If non-nil, TABLE is a table for completion or |
| 571 | a function evaluating to such a table. The return value is quoted iff | 571 | a function evaluating to such a table. The return value is quoted if |
| 572 | AS-STRING is non-nil and is either t or a symbol which is a member of | 572 | AS-STRING is non-nil and is either t or a symbol which is a member of |
| 573 | `antlr-options-style'.") | 573 | `antlr-options-style'.") |
| 574 | 574 | ||
| @@ -2203,8 +2203,8 @@ part SUPER in the result of `antlr-file-dependencies'. CLASSES is the | |||
| 2203 | part \(CLASS-SPEC ...) in the result of `antlr-directory-dependencies'. | 2203 | part \(CLASS-SPEC ...) in the result of `antlr-directory-dependencies'. |
| 2204 | 2204 | ||
| 2205 | The result looks like \(OPTION WITH-UNKNOWN GLIB ...). OPTION is the | 2205 | The result looks like \(OPTION WITH-UNKNOWN GLIB ...). OPTION is the |
| 2206 | complete \"-glib\" option. WITH-UNKNOWN has value t iff there is none | 2206 | complete \"-glib\" option. WITH-UNKNOWN is t if there is none or more |
| 2207 | or more than one grammar file for at least one super grammar. | 2207 | than one grammar file for at least one super grammar. |
| 2208 | 2208 | ||
| 2209 | Each GLIB looks like \(GRAMMAR-FILE \. EVOCAB). GRAMMAR-FILE is a file | 2209 | Each GLIB looks like \(GRAMMAR-FILE \. EVOCAB). GRAMMAR-FILE is a file |
| 2210 | in which a super-grammar is defined. EVOCAB is the value of the export | 2210 | in which a super-grammar is defined. EVOCAB is the value of the export |
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index 997e6c44f1a..33467671170 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el | |||
| @@ -478,7 +478,7 @@ | |||
| 478 | 478 | ||
| 479 | (defun c-awk-get-NL-prop-prev-line (&optional do-lim) | 479 | (defun c-awk-get-NL-prop-prev-line (&optional do-lim) |
| 480 | ;; Get the c-awk-NL-prop text-property from the previous line, calculating | 480 | ;; Get the c-awk-NL-prop text-property from the previous line, calculating |
| 481 | ;; it if necessary. Return nil iff we're already at BOB. | 481 | ;; it if necessary. Return nil if we're at BOB. |
| 482 | ;; See c-awk-after-if-for-while-condition-p for a description of DO-LIM. | 482 | ;; See c-awk-after-if-for-while-condition-p for a description of DO-LIM. |
| 483 | ;; | 483 | ;; |
| 484 | ;; This function might do hidden buffer changes. | 484 | ;; This function might do hidden buffer changes. |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 44463a07f15..97dcc61460f 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -5116,7 +5116,7 @@ comment at the start of cc-engine.el for more info." | |||
| 5116 | ;; Foo::Foo (int b) : Base (b) {} | 5116 | ;; Foo::Foo (int b) : Base (b) {} |
| 5117 | ;; car ^ ^ point | 5117 | ;; car ^ ^ point |
| 5118 | ;; | 5118 | ;; |
| 5119 | ;; The cdr of the return value is non-nil iff a | 5119 | ;; The cdr of the return value is non-nil if a |
| 5120 | ;; `c-typedef-decl-kwds' specifier is found in the declaration, | 5120 | ;; `c-typedef-decl-kwds' specifier is found in the declaration, |
| 5121 | ;; i.e. the declared identifier(s) are types. | 5121 | ;; i.e. the declared identifier(s) are types. |
| 5122 | ;; | 5122 | ;; |
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index a80833c0043..76b0e5a898c 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el | |||
| @@ -186,7 +186,7 @@ the value set here overrides the style system (there is a variable | |||
| 186 | (bq-process type))))))))) | 186 | (bq-process type))))))))) |
| 187 | 187 | ||
| 188 | (defun c-valid-offset (offset) | 188 | (defun c-valid-offset (offset) |
| 189 | "Return non-nil iff OFFSET is a valid offset for a syntactic symbol. | 189 | "Return non-nil if OFFSET is a valid offset for a syntactic symbol. |
| 190 | See `c-offsets-alist'." | 190 | See `c-offsets-alist'." |
| 191 | (or (eq offset '+) | 191 | (or (eq offset '+) |
| 192 | (eq offset '-) | 192 | (eq offset '-) |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index caf0e94b927..805ed3c4040 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -170,7 +170,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) | |||
| 170 | (maven | 170 | (maven |
| 171 | ;; Maven is a popular build tool for Java. Maven is Free Software. | 171 | ;; Maven is a popular build tool for Java. Maven is Free Software. |
| 172 | "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3) | 172 | "\\(.*?\\):\\[\\([0-9]+\\),\\([0-9]+\\)\\]" 1 2 3) |
| 173 | 173 | ||
| 174 | (bash | 174 | (bash |
| 175 | "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2) | 175 | "^\\([^: \n\t]+\\): line \\([0-9]+\\):" 1 2) |
| 176 | 176 | ||
| @@ -979,8 +979,7 @@ Otherwise, construct a buffer name from MODE-NAME." | |||
| 979 | (funcall name-function mode-name)) | 979 | (funcall name-function mode-name)) |
| 980 | (compilation-buffer-name-function | 980 | (compilation-buffer-name-function |
| 981 | (funcall compilation-buffer-name-function mode-name)) | 981 | (funcall compilation-buffer-name-function mode-name)) |
| 982 | ((and (eq mode-command major-mode) | 982 | ((eq mode-command major-mode) |
| 983 | (eq major-mode (nth 1 compilation-arguments))) | ||
| 984 | (buffer-name)) | 983 | (buffer-name)) |
| 985 | (t | 984 | (t |
| 986 | (concat "*" (downcase mode-name) "*")))) | 985 | (concat "*" (downcase mode-name) "*")))) |
| @@ -1032,7 +1031,7 @@ Returns the compilation buffer created." | |||
| 1032 | (with-current-buffer | 1031 | (with-current-buffer |
| 1033 | (setq outbuf | 1032 | (setq outbuf |
| 1034 | (get-buffer-create | 1033 | (get-buffer-create |
| 1035 | (compilation-buffer-name name-of-mode mode name-function))) | 1034 | (compilation-buffer-name name-of-mode mode name-function))) |
| 1036 | (let ((comp-proc (get-buffer-process (current-buffer)))) | 1035 | (let ((comp-proc (get-buffer-process (current-buffer)))) |
| 1037 | (if comp-proc | 1036 | (if comp-proc |
| 1038 | (if (or (not (eq (process-status comp-proc) 'run)) | 1037 | (if (or (not (eq (process-status comp-proc) 'run)) |
| @@ -1136,7 +1135,7 @@ Returns the compilation buffer created." | |||
| 1136 | (if (file-remote-p default-directory) | 1135 | (if (file-remote-p default-directory) |
| 1137 | "/bin/sh" | 1136 | "/bin/sh" |
| 1138 | shell-file-name) | 1137 | shell-file-name) |
| 1139 | `("-c" ,command)))) | 1138 | nil `("-c" ,command)))) |
| 1140 | (start-file-process-shell-command (downcase mode-name) | 1139 | (start-file-process-shell-command (downcase mode-name) |
| 1141 | outbuf command)))) | 1140 | outbuf command)))) |
| 1142 | ;; Make the buffer's mode line show process state. | 1141 | ;; Make the buffer's mode line show process state. |
| @@ -1164,7 +1163,7 @@ Returns the compilation buffer created." | |||
| 1164 | "Set the height of WINDOW according to `compilation-window-height'." | 1163 | "Set the height of WINDOW according to `compilation-window-height'." |
| 1165 | (let ((height (buffer-local-value 'compilation-window-height (window-buffer window)))) | 1164 | (let ((height (buffer-local-value 'compilation-window-height (window-buffer window)))) |
| 1166 | (and height | 1165 | (and height |
| 1167 | (= (window-width window) (frame-width (window-frame window))) | 1166 | (window-full-width-p window) |
| 1168 | ;; If window is alone in its frame, aside from a minibuffer, | 1167 | ;; If window is alone in its frame, aside from a minibuffer, |
| 1169 | ;; don't change its height. | 1168 | ;; don't change its height. |
| 1170 | (not (eq window (frame-root-window (window-frame window)))) | 1169 | (not (eq window (frame-root-window (window-frame window)))) |
| @@ -1624,12 +1623,10 @@ Use this command in a compilation log buffer. Sets the mark at point there." | |||
| 1624 | 1623 | ||
| 1625 | (defun compilation-find-buffer (&optional avoid-current) | 1624 | (defun compilation-find-buffer (&optional avoid-current) |
| 1626 | "Return a compilation buffer. | 1625 | "Return a compilation buffer. |
| 1627 | If AVOID-CURRENT is nil, and | 1626 | If AVOID-CURRENT is nil, and the current buffer is a compilation buffer, |
| 1628 | the current buffer is a compilation buffer, return it. | 1627 | return it. If AVOID-CURRENT is non-nil, return the current buffer only |
| 1629 | If AVOID-CURRENT is non-nil, return the current buffer | 1628 | as a last resort." |
| 1630 | only as a last resort." | 1629 | (if (and (compilation-buffer-internal-p) (not avoid-current)) |
| 1631 | (if (and (compilation-buffer-internal-p (current-buffer)) | ||
| 1632 | (not avoid-current)) | ||
| 1633 | (current-buffer) | 1630 | (current-buffer) |
| 1634 | (next-error-find-buffer avoid-current 'compilation-buffer-internal-p))) | 1631 | (next-error-find-buffer avoid-current 'compilation-buffer-internal-p))) |
| 1635 | 1632 | ||
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index d1dc0e875c4..cd7dabb8825 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el | |||
| @@ -1497,9 +1497,16 @@ the last)." | |||
| 1497 | (defvar cperl-use-major-mode 'cperl-mode) | 1497 | (defvar cperl-use-major-mode 'cperl-mode) |
| 1498 | (defvar cperl-font-lock-multiline-start nil) | 1498 | (defvar cperl-font-lock-multiline-start nil) |
| 1499 | (defvar cperl-font-lock-multiline nil) | 1499 | (defvar cperl-font-lock-multiline nil) |
| 1500 | (defvar cperl-compilation-error-regexp-alist nil) | ||
| 1501 | (defvar cperl-font-locking nil) | 1500 | (defvar cperl-font-locking nil) |
| 1502 | 1501 | ||
| 1502 | ;; NB as it stands the code in cperl-mode assumes this only has one | ||
| 1503 | ;; element. If Xemacs 19 support were dropped, this could all be simplified. | ||
| 1504 | (defvar cperl-compilation-error-regexp-alist | ||
| 1505 | ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS). | ||
| 1506 | '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]" | ||
| 1507 | 2 3)) | ||
| 1508 | "Alist that specifies how to match errors in perl output.") | ||
| 1509 | |||
| 1503 | ;;;###autoload | 1510 | ;;;###autoload |
| 1504 | (defun cperl-mode () | 1511 | (defun cperl-mode () |
| 1505 | "Major mode for editing Perl code. | 1512 | "Major mode for editing Perl code. |
| @@ -1786,7 +1793,7 @@ or as help on variables `cperl-tips', `cperl-problems', | |||
| 1786 | (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x | 1793 | (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x |
| 1787 | (make-local-variable 'compilation-error-regexp-alist-alist) | 1794 | (make-local-variable 'compilation-error-regexp-alist-alist) |
| 1788 | (set 'compilation-error-regexp-alist-alist | 1795 | (set 'compilation-error-regexp-alist-alist |
| 1789 | (cons (cons 'cperl cperl-compilation-error-regexp-alist) | 1796 | (cons (cons 'cperl (car cperl-compilation-error-regexp-alist)) |
| 1790 | (symbol-value 'compilation-error-regexp-alist-alist))) | 1797 | (symbol-value 'compilation-error-regexp-alist-alist))) |
| 1791 | (if (fboundp 'compilation-build-compilation-error-regexp-alist) | 1798 | (if (fboundp 'compilation-build-compilation-error-regexp-alist) |
| 1792 | (let ((f 'compilation-build-compilation-error-regexp-alist)) | 1799 | (let ((f 'compilation-build-compilation-error-regexp-alist)) |
| @@ -3551,7 +3558,7 @@ modify syntax-type text property if the situation is too hard." | |||
| 3551 | (modify-syntax-entry starter (if (eq starter ?\\) "\\" ".") st) | 3558 | (modify-syntax-entry starter (if (eq starter ?\\) "\\" ".") st) |
| 3552 | (if ender (modify-syntax-entry ender "." st)))) | 3559 | (if ender (modify-syntax-entry ender "." st)))) |
| 3553 | ;; i: have 2 args, after end of the first arg | 3560 | ;; i: have 2 args, after end of the first arg |
| 3554 | ;; i2: start of the second arg, if any (before delim iff `ender'). | 3561 | ;; i2: start of the second arg, if any (before delim if `ender'). |
| 3555 | ;; ender: the last arg bounded by parens-like chars, the second one of them | 3562 | ;; ender: the last arg bounded by parens-like chars, the second one of them |
| 3556 | ;; starter: the starting delimiter of the first arg | 3563 | ;; starter: the starting delimiter of the first arg |
| 3557 | ;; go-forward: has 2 args, and the second part is empty | 3564 | ;; go-forward: has 2 args, and the second part is empty |
| @@ -5702,13 +5709,6 @@ indentation and initial hashes. Behaves usually outside of comment." | |||
| 5702 | (t 5))) ; should not happen | 5709 | (t 5))) ; should not happen |
| 5703 | 5710 | ||
| 5704 | 5711 | ||
| 5705 | (defvar cperl-compilation-error-regexp-alist | ||
| 5706 | ;; This look like a paranoiac regexp: could anybody find a better one? (which WORKS). | ||
| 5707 | '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]" | ||
| 5708 | 2 3)) | ||
| 5709 | "Alist that specifies how to match errors in perl output.") | ||
| 5710 | |||
| 5711 | |||
| 5712 | (defun cperl-windowed-init () | 5712 | (defun cperl-windowed-init () |
| 5713 | "Initialization under windowed version." | 5713 | "Initialization under windowed version." |
| 5714 | (cond ((featurep 'ps-print) | 5714 | (cond ((featurep 'ps-print) |
| @@ -8090,7 +8090,7 @@ prototype \\&SUB Returns prototype of the function given a reference. | |||
| 8090 | (defun cperl-beautify-regexp-piece (b e embed level) | 8090 | (defun cperl-beautify-regexp-piece (b e embed level) |
| 8091 | ;; b is before the starting delimiter, e before the ending | 8091 | ;; b is before the starting delimiter, e before the ending |
| 8092 | ;; e should be a marker, may be changed, but remains "correct". | 8092 | ;; e should be a marker, may be changed, but remains "correct". |
| 8093 | ;; EMBED is nil iff we process the whole REx. | 8093 | ;; EMBED is nil if we process the whole REx. |
| 8094 | ;; The REx is guaranteed to have //x | 8094 | ;; The REx is guaranteed to have //x |
| 8095 | ;; LEVEL shows how many levels deep to go | 8095 | ;; LEVEL shows how many levels deep to go |
| 8096 | ;; position at enter and at leave is not defined | 8096 | ;; position at enter and at leave is not defined |
diff --git a/lisp/progmodes/cpp.el b/lisp/progmodes/cpp.el index e85c4752412..05b8b59c00f 100644 --- a/lisp/progmodes/cpp.el +++ b/lisp/progmodes/cpp.el | |||
| @@ -623,7 +623,8 @@ You can also use the keyboard accelerators indicated like this: [K]ey." | |||
| 623 | 623 | ||
| 624 | (defun cpp-edit-toggle-known (arg) | 624 | (defun cpp-edit-toggle-known (arg) |
| 625 | "Toggle writable status for known conditionals. | 625 | "Toggle writable status for known conditionals. |
| 626 | With optional argument ARG, make them writable iff ARG is positive." | 626 | With optional argument ARG, make them writable if ARG is positive, |
| 627 | otherwise make them unwritable." | ||
| 627 | (interactive "@P") | 628 | (interactive "@P") |
| 628 | (if (or (and (null arg) cpp-known-writable) | 629 | (if (or (and (null arg) cpp-known-writable) |
| 629 | (<= (prefix-numeric-value arg) 0)) | 630 | (<= (prefix-numeric-value arg) 0)) |
| @@ -633,7 +634,8 @@ With optional argument ARG, make them writable iff ARG is positive." | |||
| 633 | 634 | ||
| 634 | (defun cpp-edit-toggle-unknown (arg) | 635 | (defun cpp-edit-toggle-unknown (arg) |
| 635 | "Toggle writable status for unknown conditionals. | 636 | "Toggle writable status for unknown conditionals. |
| 636 | With optional argument ARG, make them writable iff ARG is positive." | 637 | With optional argument ARG, make them writable if ARG is positive, |
| 638 | otherwise make them unwritable." | ||
| 637 | (interactive "@P") | 639 | (interactive "@P") |
| 638 | (if (or (and (null arg) cpp-unknown-writable) | 640 | (if (or (and (null arg) cpp-unknown-writable) |
| 639 | (<= (prefix-numeric-value arg) 0)) | 641 | (<= (prefix-numeric-value arg) 0)) |
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 196c22b4a08..96af63849a4 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -256,10 +256,10 @@ One argument, the tag info returned by `snarf-tag-function'.") | |||
| 256 | (defvar tags-included-tables-function nil | 256 | (defvar tags-included-tables-function nil |
| 257 | "Function to do the work of `tags-included-tables' (which see).") | 257 | "Function to do the work of `tags-included-tables' (which see).") |
| 258 | (defvar verify-tags-table-function nil | 258 | (defvar verify-tags-table-function nil |
| 259 | "Function to return t iff current buffer contains valid tags file.") | 259 | "Function to return t if current buffer contains valid tags file.") |
| 260 | 260 | ||
| 261 | ;; Initialize the tags table in the current buffer. | 261 | ;; Initialize the tags table in the current buffer. |
| 262 | ;; Returns non-nil iff it is a valid tags table. On | 262 | ;; Returns non-nil if it is a valid tags table. On |
| 263 | ;; non-nil return, the tags table state variable are | 263 | ;; non-nil return, the tags table state variable are |
| 264 | ;; made buffer-local and initialized to nil. | 264 | ;; made buffer-local and initialized to nil. |
| 265 | (defun initialize-new-tags-table () | 265 | (defun initialize-new-tags-table () |
| @@ -417,7 +417,7 @@ file the tag was in." | |||
| 417 | (defun tags-verify-table (file) | 417 | (defun tags-verify-table (file) |
| 418 | "Read FILE into a buffer and verify that it is a valid tags table. | 418 | "Read FILE into a buffer and verify that it is a valid tags table. |
| 419 | Sets the current buffer to one visiting FILE (if it exists). | 419 | Sets the current buffer to one visiting FILE (if it exists). |
| 420 | Returns non-nil iff it is a valid table." | 420 | Returns non-nil if it is a valid table." |
| 421 | (if (get-file-buffer file) | 421 | (if (get-file-buffer file) |
| 422 | ;; The file is already in a buffer. Check for the visited file | 422 | ;; The file is already in a buffer. Check for the visited file |
| 423 | ;; having changed since we last used it. | 423 | ;; having changed since we last used it. |
| @@ -1219,8 +1219,8 @@ where they were found." | |||
| 1219 | (verify-tags-table-function . etags-verify-tags-table) | 1219 | (verify-tags-table-function . etags-verify-tags-table) |
| 1220 | )))) | 1220 | )))) |
| 1221 | 1221 | ||
| 1222 | ;; Return non-nil iff the current buffer is a valid etags TAGS file. | ||
| 1223 | (defun etags-verify-tags-table () | 1222 | (defun etags-verify-tags-table () |
| 1223 | "Return non-nil if the current buffer is a valid etags TAGS file." | ||
| 1224 | ;; Use eq instead of = in case char-after returns nil. | 1224 | ;; Use eq instead of = in case char-after returns nil. |
| 1225 | (eq (char-after (point-min)) ?\f)) | 1225 | (eq (char-after (point-min)) ?\f)) |
| 1226 | 1226 | ||
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index a6407a3ffa6..5538bd8984a 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el | |||
| @@ -918,7 +918,7 @@ Convert it to flymake internal format." | |||
| 918 | ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1) | 918 | ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1) |
| 919 | ;; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1) | 919 | ;; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1) |
| 920 | ;; ant/javac | 920 | ;; ant/javac |
| 921 | (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" | 921 | (" *\\(\\[javac\\] *\\)?\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" |
| 922 | 2 4 nil 5)) | 922 | 2 4 nil 5)) |
| 923 | ;; compilation-error-regexp-alist) | 923 | ;; compilation-error-regexp-alist) |
| 924 | (flymake-reformat-err-line-patterns-from-compile-el compilation-error-regexp-alist-alist)) | 924 | (flymake-reformat-err-line-patterns-from-compile-el compilation-error-regexp-alist-alist)) |
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 97f4c1c2616..bcb571f8c87 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el | |||
| @@ -1831,7 +1831,7 @@ If ALL is nil, only match comments that start in column > 0." | |||
| 1831 | ;; From: ralf@up3aud1.gwdg.de (Ralf Fassel) | 1831 | ;; From: ralf@up3aud1.gwdg.de (Ralf Fassel) |
| 1832 | ;; Test if TAB format continuation lines work. | 1832 | ;; Test if TAB format continuation lines work. |
| 1833 | (defun fortran-is-in-string-p (where) | 1833 | (defun fortran-is-in-string-p (where) |
| 1834 | "Return non-nil iff WHERE (a buffer position) is inside a Fortran string." | 1834 | "Return non-nil if WHERE (a buffer position) is inside a Fortran string." |
| 1835 | (save-excursion | 1835 | (save-excursion |
| 1836 | (goto-char where) | 1836 | (goto-char where) |
| 1837 | (cond | 1837 | (cond |
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 8f6be334465..c4d14462245 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -347,7 +347,8 @@ for `gdba'." | |||
| 347 | 347 | ||
| 348 | (defun gdb-many-windows (arg) | 348 | (defun gdb-many-windows (arg) |
| 349 | "Toggle the number of windows in the basic arrangement. | 349 | "Toggle the number of windows in the basic arrangement. |
| 350 | With arg, display additional buffers iff arg is positive." | 350 | With prefix argument ARG, display additional buffers if ARG is positive, |
| 351 | otherwise use a single window." | ||
| 351 | (interactive "P") | 352 | (interactive "P") |
| 352 | (setq gdb-many-windows | 353 | (setq gdb-many-windows |
| 353 | (if (null arg) | 354 | (if (null arg) |
| @@ -363,7 +364,8 @@ With arg, display additional buffers iff arg is positive." | |||
| 363 | 364 | ||
| 364 | (defun gdb-use-separate-io-buffer (arg) | 365 | (defun gdb-use-separate-io-buffer (arg) |
| 365 | "Toggle separate IO for debugged program. | 366 | "Toggle separate IO for debugged program. |
| 366 | With arg, use separate IO iff arg is positive." | 367 | With prefix argument ARG, use separate IO if ARG is positive, |
| 368 | otherwise do not." | ||
| 367 | (interactive "P") | 369 | (interactive "P") |
| 368 | (setq gdb-use-separate-io-buffer | 370 | (setq gdb-use-separate-io-buffer |
| 369 | (if (null arg) | 371 | (if (null arg) |
| @@ -664,7 +666,8 @@ line, and no execution takes place." | |||
| 664 | 666 | ||
| 665 | (defun gdb-speedbar-auto-raise (arg) | 667 | (defun gdb-speedbar-auto-raise (arg) |
| 666 | "Toggle automatic raising of the speedbar for watch expressions. | 668 | "Toggle automatic raising of the speedbar for watch expressions. |
| 667 | With arg, automatically raise speedbar iff arg is positive." | 669 | With prefix argument ARG, automatically raise speedbar if ARG is |
| 670 | positive, otherwise don't automatically raise it." | ||
| 668 | (interactive "P") | 671 | (interactive "P") |
| 669 | (setq gdb-speedbar-auto-raise | 672 | (setq gdb-speedbar-auto-raise |
| 670 | (if (null arg) | 673 | (if (null arg) |
| @@ -1381,7 +1384,8 @@ directives." | |||
| 1381 | 1384 | ||
| 1382 | (defun gdb-find-source-frame (arg) | 1385 | (defun gdb-find-source-frame (arg) |
| 1383 | "Toggle trying to find a source frame further up stack. | 1386 | "Toggle trying to find a source frame further up stack. |
| 1384 | With arg, look for a source frame further up stack iff arg is positive." | 1387 | With prefix argument ARG, look for a source frame further up |
| 1388 | stack if ARG is positive, otherwise don't look further up." | ||
| 1385 | (interactive "P") | 1389 | (interactive "P") |
| 1386 | (setq gdb-find-source-frame | 1390 | (setq gdb-find-source-frame |
| 1387 | (if (null arg) | 1391 | (if (null arg) |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 2131aebe2a8..4b0dec7002e 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -59,7 +59,7 @@ | |||
| 59 | (defgroup gud nil | 59 | (defgroup gud nil |
| 60 | "Grand Unified Debugger mode for gdb and other debuggers under Emacs. | 60 | "Grand Unified Debugger mode for gdb and other debuggers under Emacs. |
| 61 | Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb." | 61 | Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb." |
| 62 | :group 'unix | 62 | :group 'processes |
| 63 | :group 'tools) | 63 | :group 'tools) |
| 64 | 64 | ||
| 65 | 65 | ||
| @@ -2467,7 +2467,7 @@ comint mode, which see." | |||
| 2467 | ;; for local variables in the debugger buffer. | 2467 | ;; for local variables in the debugger buffer. |
| 2468 | (defun gud-common-init (command-line massage-args marker-filter | 2468 | (defun gud-common-init (command-line massage-args marker-filter |
| 2469 | &optional find-file) | 2469 | &optional find-file) |
| 2470 | (let* ((words (string->strings command-line)) | 2470 | (let* ((words (split-string-and-unquote command-line)) |
| 2471 | (program (car words)) | 2471 | (program (car words)) |
| 2472 | (dir default-directory) | 2472 | (dir default-directory) |
| 2473 | ;; Extract the file name from WORDS | 2473 | ;; Extract the file name from WORDS |
| @@ -3361,7 +3361,7 @@ This event can be examined by forms in GUD-TOOLTIP-DISPLAY.") | |||
| 3361 | 3361 | ||
| 3362 | (defun gud-tooltip-dereference (&optional arg) | 3362 | (defun gud-tooltip-dereference (&optional arg) |
| 3363 | "Toggle whether tooltips should show `* expr' or `expr'. | 3363 | "Toggle whether tooltips should show `* expr' or `expr'. |
| 3364 | With arg, dereference expr iff arg is positive." | 3364 | With arg, dereference expr if ARG is positive, otherwise do not derereference." |
| 3365 | (interactive "P") | 3365 | (interactive "P") |
| 3366 | (setq gud-tooltip-dereference | 3366 | (setq gud-tooltip-dereference |
| 3367 | (if (null arg) | 3367 | (if (null arg) |
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index bb0a3c634dd..83167ba5a40 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el | |||
| @@ -262,7 +262,7 @@ One of the following symbols: | |||
| 262 | t -- open both code and comment blocks | 262 | t -- open both code and comment blocks |
| 263 | nil -- open neither code nor comment blocks | 263 | nil -- open neither code nor comment blocks |
| 264 | 264 | ||
| 265 | This has effect iff `search-invisible' is set to `open'." | 265 | This has effect only if `search-invisible' is set to `open'." |
| 266 | :type '(choice (const :tag "open only code blocks" code) | 266 | :type '(choice (const :tag "open only code blocks" code) |
| 267 | (const :tag "open only comment blocks" comment) | 267 | (const :tag "open only comment blocks" comment) |
| 268 | (const :tag "open both code and comment blocks" t) | 268 | (const :tag "open both code and comment blocks" t) |
| @@ -515,7 +515,7 @@ Optional arg REPOS-END means reposition at end." | |||
| 515 | (goto-char (if repos-end end beg))) | 515 | (goto-char (if repos-end end beg))) |
| 516 | 516 | ||
| 517 | (defun hs-hide-block-at-point (&optional end comment-reg) | 517 | (defun hs-hide-block-at-point (&optional end comment-reg) |
| 518 | "Hide block iff on block beginning. | 518 | "Hide block if on block beginning. |
| 519 | Optional arg END means reposition at end. | 519 | Optional arg END means reposition at end. |
| 520 | Optional arg COMMENT-REG is a list of the form (BEGIN END) and | 520 | Optional arg COMMENT-REG is a list of the form (BEGIN END) and |
| 521 | specifies the limits of the comment, or nil if the block is not | 521 | specifies the limits of the comment, or nil if the block is not |
| @@ -678,7 +678,7 @@ Return point, or nil if original point was not in a block." | |||
| 678 | (goto-char maxp)) | 678 | (goto-char maxp)) |
| 679 | 679 | ||
| 680 | (defmacro hs-life-goes-on (&rest body) | 680 | (defmacro hs-life-goes-on (&rest body) |
| 681 | "Evaluate BODY forms iff variable `hs-minor-mode' is non-nil. | 681 | "Evaluate BODY forms if variable `hs-minor-mode' is non-nil. |
| 682 | In the dynamic context of this macro, `inhibit-point-motion-hooks' | 682 | In the dynamic context of this macro, `inhibit-point-motion-hooks' |
| 683 | and `case-fold-search' are both t." | 683 | and `case-fold-search' are both t." |
| 684 | `(when hs-minor-mode | 684 | `(when hs-minor-mode |
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index adc1b44edaa..3da3434cda2 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el | |||
| @@ -567,24 +567,24 @@ including a reproducible test case and send the message." | |||
| 567 | (describe-function major-mode)) | 567 | (describe-function major-mode)) |
| 568 | 568 | ||
| 569 | (defsubst octave-in-comment-p () | 569 | (defsubst octave-in-comment-p () |
| 570 | "Returns t if point is inside an Octave comment, nil otherwise." | 570 | "Return t if point is inside an Octave comment." |
| 571 | (interactive) | 571 | (interactive) |
| 572 | (save-excursion | 572 | (save-excursion |
| 573 | (nth 4 (parse-partial-sexp (line-beginning-position) (point))))) | 573 | (nth 4 (parse-partial-sexp (line-beginning-position) (point))))) |
| 574 | 574 | ||
| 575 | (defsubst octave-in-string-p () | 575 | (defsubst octave-in-string-p () |
| 576 | "Returns t if point is inside an Octave string, nil otherwise." | 576 | "Return t if point is inside an Octave string." |
| 577 | (interactive) | 577 | (interactive) |
| 578 | (save-excursion | 578 | (save-excursion |
| 579 | (nth 3 (parse-partial-sexp (line-beginning-position) (point))))) | 579 | (nth 3 (parse-partial-sexp (line-beginning-position) (point))))) |
| 580 | 580 | ||
| 581 | (defsubst octave-not-in-string-or-comment-p () | 581 | (defsubst octave-not-in-string-or-comment-p () |
| 582 | "Returns t iff point is not inside an Octave string or comment." | 582 | "Return t if point is not inside an Octave string or comment." |
| 583 | (let ((pps (parse-partial-sexp (line-beginning-position) (point)))) | 583 | (let ((pps (parse-partial-sexp (line-beginning-position) (point)))) |
| 584 | (not (or (nth 3 pps) (nth 4 pps))))) | 584 | (not (or (nth 3 pps) (nth 4 pps))))) |
| 585 | 585 | ||
| 586 | (defun octave-in-block-p () | 586 | (defun octave-in-block-p () |
| 587 | "Returns t if point is inside an Octave block, nil otherwise. | 587 | "Return t if point is inside an Octave block. |
| 588 | The block is taken to start at the first letter of the begin keyword and | 588 | The block is taken to start at the first letter of the begin keyword and |
| 589 | to end after the end keyword." | 589 | to end after the end keyword." |
| 590 | (let ((pos (point))) | 590 | (let ((pos (point))) |
| @@ -599,7 +599,7 @@ to end after the end keyword." | |||
| 599 | (< pos (point))))) | 599 | (< pos (point))))) |
| 600 | 600 | ||
| 601 | (defun octave-in-defun-p () | 601 | (defun octave-in-defun-p () |
| 602 | "Returns t iff point is inside an Octave function declaration. | 602 | "Return t if point is inside an Octave function declaration. |
| 603 | The function is taken to start at the `f' of `function' and to end after | 603 | The function is taken to start at the `f' of `function' and to end after |
| 604 | the end keyword." | 604 | the end keyword." |
| 605 | (let ((pos (point))) | 605 | (let ((pos (point))) |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9bef41a0878..462445f3d71 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -348,7 +348,7 @@ comments and strings, or that point is within brackets/parens." | |||
| 348 | (error nil)))))))) | 348 | (error nil)))))))) |
| 349 | 349 | ||
| 350 | (defun python-comment-line-p () | 350 | (defun python-comment-line-p () |
| 351 | "Return non-nil iff current line has only a comment." | 351 | "Return non-nil if current line has only a comment." |
| 352 | (save-excursion | 352 | (save-excursion |
| 353 | (end-of-line) | 353 | (end-of-line) |
| 354 | (when (eq 'comment (syntax-ppss-context (syntax-ppss))) | 354 | (when (eq 'comment (syntax-ppss-context (syntax-ppss))) |
| @@ -356,7 +356,7 @@ comments and strings, or that point is within brackets/parens." | |||
| 356 | (looking-at (rx (or (syntax comment-start) line-end)))))) | 356 | (looking-at (rx (or (syntax comment-start) line-end)))))) |
| 357 | 357 | ||
| 358 | (defun python-blank-line-p () | 358 | (defun python-blank-line-p () |
| 359 | "Return non-nil iff current line is blank." | 359 | "Return non-nil if current line is blank." |
| 360 | (save-excursion | 360 | (save-excursion |
| 361 | (beginning-of-line) | 361 | (beginning-of-line) |
| 362 | (looking-at "\\s-*$"))) | 362 | (looking-at "\\s-*$"))) |
| @@ -850,7 +850,7 @@ multi-line bracketed expressions." | |||
| 850 | "Skip out of any nested brackets. | 850 | "Skip out of any nested brackets. |
| 851 | Skip forward if FORWARD is non-nil, else backward. | 851 | Skip forward if FORWARD is non-nil, else backward. |
| 852 | If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. | 852 | If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. |
| 853 | Return non-nil iff skipping was done." | 853 | Return non-nil if skipping was done." |
| 854 | (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss)))) | 854 | (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss)))) |
| 855 | (forward (if forward -1 1))) | 855 | (forward (if forward -1 1))) |
| 856 | (unless (zerop depth) | 856 | (unless (zerop depth) |
| @@ -1199,7 +1199,7 @@ local value.") | |||
| 1199 | (define-key map "\C-c\C-l" 'python-load-file) | 1199 | (define-key map "\C-c\C-l" 'python-load-file) |
| 1200 | (define-key map "\C-c\C-v" 'python-check) | 1200 | (define-key map "\C-c\C-v" 'python-check) |
| 1201 | ;; Note that we _can_ still use these commands which send to the | 1201 | ;; Note that we _can_ still use these commands which send to the |
| 1202 | ;; Python process even at the prompt iff we have a normal prompt, | 1202 | ;; Python process even at the prompt provided we have a normal prompt, |
| 1203 | ;; i.e. '>>> ' and not '... '. See the comment before | 1203 | ;; i.e. '>>> ' and not '... '. See the comment before |
| 1204 | ;; python-send-region. Fixme: uncomment these if we address that. | 1204 | ;; python-send-region. Fixme: uncomment these if we address that. |
| 1205 | 1205 | ||
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 7860bb35200..f9b7e18d467 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -212,7 +212,6 @@ | |||
| 212 | 212 | ||
| 213 | (defgroup sh nil | 213 | (defgroup sh nil |
| 214 | "Shell programming utilities." | 214 | "Shell programming utilities." |
| 215 | :group 'unix | ||
| 216 | :group 'languages) | 215 | :group 'languages) |
| 217 | 216 | ||
| 218 | (defgroup sh-script nil | 217 | (defgroup sh-script nil |
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el index c7576a27114..f9fd7beffd2 100644 --- a/lisp/progmodes/tcl.el +++ b/lisp/progmodes/tcl.el | |||
| @@ -126,11 +126,13 @@ | |||
| 126 | "*Indentation of Tcl statements with respect to containing block." | 126 | "*Indentation of Tcl statements with respect to containing block." |
| 127 | :type 'integer | 127 | :type 'integer |
| 128 | :group 'tcl) | 128 | :group 'tcl) |
| 129 | (put 'tcl-indent-level 'safe-local-variable 'integerp) | ||
| 129 | 130 | ||
| 130 | (defcustom tcl-continued-indent-level 4 | 131 | (defcustom tcl-continued-indent-level 4 |
| 131 | "*Indentation of continuation line relative to first line of command." | 132 | "*Indentation of continuation line relative to first line of command." |
| 132 | :type 'integer | 133 | :type 'integer |
| 133 | :group 'tcl) | 134 | :group 'tcl) |
| 135 | (put 'tcl-continued-indent-level 'safe-local-variable 'integerp) | ||
| 134 | 136 | ||
| 135 | (defcustom tcl-auto-newline nil | 137 | (defcustom tcl-auto-newline nil |
| 136 | "*Non-nil means automatically newline before and after braces you insert." | 138 | "*Non-nil means automatically newline before and after braces you insert." |
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 2762e8dbd55..5307445dc04 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el | |||
| @@ -232,7 +232,7 @@ It creates the Imenu index for the buffer, if necessary." | |||
| 232 | When Which Function mode is enabled, the current function name is | 232 | When Which Function mode is enabled, the current function name is |
| 233 | continuously displayed in the mode line, in certain major modes. | 233 | continuously displayed in the mode line, in certain major modes. |
| 234 | 234 | ||
| 235 | With prefix ARG, turn Which Function mode on iff arg is positive, | 235 | With prefix ARG, turn Which Function mode on if arg is positive, |
| 236 | and off otherwise." | 236 | and off otherwise." |
| 237 | :global t :group 'which-func | 237 | :global t :group 'which-func |
| 238 | (if which-function-mode | 238 | (if which-function-mode |
diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index 0beca9e985e..a820ca4cede 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el | |||
| @@ -868,7 +868,7 @@ Control returns to the top level rep loop." | |||
| 868 | (sleep-for 1))) | 868 | (sleep-for 1))) |
| 869 | 869 | ||
| 870 | (defun xscheme-process-running-p () | 870 | (defun xscheme-process-running-p () |
| 871 | "True iff there is a Scheme process whose status is `run'." | 871 | "True if there is a Scheme process whose status is `run'." |
| 872 | (let ((process (get-process xscheme-process-name))) | 872 | (let ((process (get-process xscheme-process-name))) |
| 873 | (and process | 873 | (and process |
| 874 | (eq (process-status process) 'run)))) | 874 | (eq (process-status process) 'run)))) |
| @@ -882,7 +882,7 @@ Control returns to the top level rep loop." | |||
| 882 | (and buffer (get-buffer-window buffer)))) | 882 | (and buffer (get-buffer-window buffer)))) |
| 883 | 883 | ||
| 884 | (defun xscheme-process-buffer-current-p () | 884 | (defun xscheme-process-buffer-current-p () |
| 885 | "True iff the current buffer is the Scheme process buffer." | 885 | "True if the current buffer is the Scheme process buffer." |
| 886 | (eq (xscheme-process-buffer) (current-buffer))) | 886 | (eq (xscheme-process-buffer) (current-buffer))) |
| 887 | 887 | ||
| 888 | ;;;; Process Filter Operations | 888 | ;;;; Process Filter Operations |
diff --git a/lisp/select.el b/lisp/select.el index b1fa729a664..60259142522 100644 --- a/lisp/select.el +++ b/lisp/select.el | |||
| @@ -178,7 +178,7 @@ Cut buffers are considered obsolete; you should use selections instead." | |||
| 178 | If it is valid, set the register `r0' to 1, else set it to 0.") | 178 | If it is valid, set the register `r0' to 1, else set it to 0.") |
| 179 | 179 | ||
| 180 | (defun string-utf-8-p (string) | 180 | (defun string-utf-8-p (string) |
| 181 | "Return non-nil iff STRING is a unibyte string of valid UTF-8 sequence." | 181 | "Return non-nil if STRING is a unibyte string of valid UTF-8 sequence." |
| 182 | (if (or (not (stringp string)) | 182 | (if (or (not (stringp string)) |
| 183 | (multibyte-string-p string)) | 183 | (multibyte-string-p string)) |
| 184 | (error "Not a unibyte string: %s" string)) | 184 | (error "Not a unibyte string: %s" string)) |
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index ee6dcc15b7e..d1de8be3910 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el | |||
| @@ -285,7 +285,7 @@ information defining the cluster. For interactive use, call | |||
| 285 | ans))) | 285 | ans))) |
| 286 | 286 | ||
| 287 | (defun shadow-site-match (site1 site2) | 287 | (defun shadow-site-match (site1 site2) |
| 288 | "Non-nil iff SITE1 is or includes SITE2. | 288 | "Non-nil if SITE1 is or includes SITE2. |
| 289 | Each may be a host or cluster name; if they are clusters, regexp of SITE1 will | 289 | Each may be a host or cluster name; if they are clusters, regexp of SITE1 will |
| 290 | be matched against the primary of SITE2." | 290 | be matched against the primary of SITE2." |
| 291 | (or (string-equal site1 site2) ; quick check | 291 | (or (string-equal site1 site2) ; quick check |
diff --git a/lisp/simple.el b/lisp/simple.el index de1220ce21c..fa825663783 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -4329,13 +4329,6 @@ If optional arg REALLY-WORD is non-nil, it finds just a word." | |||
| 4329 | regexp) | 4329 | regexp) |
| 4330 | :group 'fill) | 4330 | :group 'fill) |
| 4331 | 4331 | ||
| 4332 | (defvar comment-line-break-function 'comment-indent-new-line | ||
| 4333 | "*Mode-specific function which line breaks and continues a comment. | ||
| 4334 | |||
| 4335 | This function is only called during auto-filling of a comment section. | ||
| 4336 | The function should take a single optional argument, which is a flag | ||
| 4337 | indicating whether it should use soft newlines.") | ||
| 4338 | |||
| 4339 | ;; This function is used as the auto-fill-function of a buffer | 4332 | ;; This function is used as the auto-fill-function of a buffer |
| 4340 | ;; when Auto-Fill mode is enabled. | 4333 | ;; when Auto-Fill mode is enabled. |
| 4341 | ;; It returns t if it really did any work. | 4334 | ;; It returns t if it really did any work. |
| @@ -4409,10 +4402,10 @@ indicating whether it should use soft newlines.") | |||
| 4409 | (if (save-excursion | 4402 | (if (save-excursion |
| 4410 | (skip-chars-backward " \t") | 4403 | (skip-chars-backward " \t") |
| 4411 | (= (point) fill-point)) | 4404 | (= (point) fill-point)) |
| 4412 | (funcall comment-line-break-function t) | 4405 | (default-indent-new-line t) |
| 4413 | (save-excursion | 4406 | (save-excursion |
| 4414 | (goto-char fill-point) | 4407 | (goto-char fill-point) |
| 4415 | (funcall comment-line-break-function t))) | 4408 | (default-indent-new-line t))) |
| 4416 | ;; Now do justification, if required | 4409 | ;; Now do justification, if required |
| 4417 | (if (not (eq justify 'left)) | 4410 | (if (not (eq justify 'left)) |
| 4418 | (save-excursion | 4411 | (save-excursion |
| @@ -4427,6 +4420,43 @@ indicating whether it should use soft newlines.") | |||
| 4427 | (justify-current-line justify t t) | 4420 | (justify-current-line justify t t) |
| 4428 | t))) | 4421 | t))) |
| 4429 | 4422 | ||
| 4423 | (defvar comment-line-break-function 'comment-indent-new-line | ||
| 4424 | "*Mode-specific function which line breaks and continues a comment. | ||
| 4425 | This function is called during auto-filling when a comment syntax | ||
| 4426 | is defined. | ||
| 4427 | The function should take a single optional argument, which is a flag | ||
| 4428 | indicating whether it should use soft newlines.") | ||
| 4429 | |||
| 4430 | (defun default-indent-new-line (&optional soft) | ||
| 4431 | "Break line at point and indent. | ||
| 4432 | If a comment syntax is defined, call `comment-indent-new-line'. | ||
| 4433 | |||
| 4434 | The inserted newline is marked hard if variable `use-hard-newlines' is true, | ||
| 4435 | unless optional argument SOFT is non-nil." | ||
| 4436 | (interactive) | ||
| 4437 | (if comment-start | ||
| 4438 | (funcall comment-line-break-function soft) | ||
| 4439 | ;; Insert the newline before removing empty space so that markers | ||
| 4440 | ;; get preserved better. | ||
| 4441 | (if soft (insert-and-inherit ?\n) (newline 1)) | ||
| 4442 | (save-excursion (forward-char -1) (delete-horizontal-space)) | ||
| 4443 | (delete-horizontal-space) | ||
| 4444 | |||
| 4445 | (if (and fill-prefix (not adaptive-fill-mode)) | ||
| 4446 | ;; Blindly trust a non-adaptive fill-prefix. | ||
| 4447 | (progn | ||
| 4448 | (indent-to-left-margin) | ||
| 4449 | (insert-before-markers-and-inherit fill-prefix)) | ||
| 4450 | |||
| 4451 | (cond | ||
| 4452 | ;; If there's an adaptive prefix, use it unless we're inside | ||
| 4453 | ;; a comment and the prefix is not a comment starter. | ||
| 4454 | (fill-prefix | ||
| 4455 | (indent-to-left-margin) | ||
| 4456 | (insert-and-inherit fill-prefix)) | ||
| 4457 | ;; If we're not inside a comment, just try to indent. | ||
| 4458 | (t (indent-according-to-mode)))))) | ||
| 4459 | |||
| 4430 | (defvar normal-auto-fill-function 'do-auto-fill | 4460 | (defvar normal-auto-fill-function 'do-auto-fill |
| 4431 | "The function to use for `auto-fill-function' if Auto Fill mode is turned on. | 4461 | "The function to use for `auto-fill-function' if Auto Fill mode is turned on. |
| 4432 | Some major modes set this.") | 4462 | Some major modes set this.") |
| @@ -4505,8 +4535,9 @@ The variable `selective-display' has a separate value for each buffer." | |||
| 4505 | 4535 | ||
| 4506 | (defun toggle-truncate-lines (&optional arg) | 4536 | (defun toggle-truncate-lines (&optional arg) |
| 4507 | "Toggle whether to fold or truncate long lines for the current buffer. | 4537 | "Toggle whether to fold or truncate long lines for the current buffer. |
| 4508 | With arg, truncate long lines iff arg is positive. | 4538 | With prefix argument ARG, truncate long lines if ARG is positive, |
| 4509 | Note that in side-by-side windows, truncation is always enabled." | 4539 | otherwise don't truncate them. Note that in side-by-side |
| 4540 | windows, truncation is always enabled." | ||
| 4510 | (interactive "P") | 4541 | (interactive "P") |
| 4511 | (setq truncate-lines | 4542 | (setq truncate-lines |
| 4512 | (if (null arg) | 4543 | (if (null arg) |
| @@ -4529,11 +4560,11 @@ Note that in side-by-side windows, truncation is always enabled." | |||
| 4529 | 4560 | ||
| 4530 | (defun overwrite-mode (arg) | 4561 | (defun overwrite-mode (arg) |
| 4531 | "Toggle overwrite mode. | 4562 | "Toggle overwrite mode. |
| 4532 | With arg, turn overwrite mode on iff arg is positive. | 4563 | With prefix argument ARG, turn overwrite mode on if ARG is positive, |
| 4533 | In overwrite mode, printing characters typed in replace existing text | 4564 | otherwise turn it off. In overwrite mode, printing characters typed |
| 4534 | on a one-for-one basis, rather than pushing it to the right. At the | 4565 | in replace existing text on a one-for-one basis, rather than pushing |
| 4535 | end of a line, such characters extend the line. Before a tab, | 4566 | it to the right. At the end of a line, such characters extend the line. |
| 4536 | such characters insert until the tab is filled in. | 4567 | Before a tab, such characters insert until the tab is filled in. |
| 4537 | \\[quoted-insert] still inserts characters in overwrite mode; this | 4568 | \\[quoted-insert] still inserts characters in overwrite mode; this |
| 4538 | is supposed to make it easier to insert characters when necessary." | 4569 | is supposed to make it easier to insert characters when necessary." |
| 4539 | (interactive "P") | 4570 | (interactive "P") |
| @@ -4545,14 +4576,13 @@ is supposed to make it easier to insert characters when necessary." | |||
| 4545 | 4576 | ||
| 4546 | (defun binary-overwrite-mode (arg) | 4577 | (defun binary-overwrite-mode (arg) |
| 4547 | "Toggle binary overwrite mode. | 4578 | "Toggle binary overwrite mode. |
| 4548 | With arg, turn binary overwrite mode on iff arg is positive. | 4579 | With prefix argument ARG, turn binary overwrite mode on if ARG is |
| 4549 | In binary overwrite mode, printing characters typed in replace | 4580 | positive, otherwise turn it off. In binary overwrite mode, printing |
| 4550 | existing text. Newlines are not treated specially, so typing at the | 4581 | characters typed in replace existing text. Newlines are not treated |
| 4551 | end of a line joins the line to the next, with the typed character | 4582 | specially, so typing at the end of a line joins the line to the next, |
| 4552 | between them. Typing before a tab character simply replaces the tab | 4583 | with the typed character between them. Typing before a tab character |
| 4553 | with the character typed. | 4584 | simply replaces the tab with the character typed. \\[quoted-insert] |
| 4554 | \\[quoted-insert] replaces the text at the cursor, just as ordinary | 4585 | replaces the text at the cursor, just as ordinary typing characters do. |
| 4555 | typing characters do. | ||
| 4556 | 4586 | ||
| 4557 | Note that binary overwrite mode is not its own minor mode; it is a | 4587 | Note that binary overwrite mode is not its own minor mode; it is a |
| 4558 | specialization of overwrite mode, entered by setting the | 4588 | specialization of overwrite mode, entered by setting the |
| @@ -4567,9 +4597,9 @@ specialization of overwrite mode, entered by setting the | |||
| 4567 | 4597 | ||
| 4568 | (define-minor-mode line-number-mode | 4598 | (define-minor-mode line-number-mode |
| 4569 | "Toggle Line Number mode. | 4599 | "Toggle Line Number mode. |
| 4570 | With arg, turn Line Number mode on iff arg is positive. | 4600 | With arg, turn Line Number mode on if arg is positive, otherwise |
| 4571 | When Line Number mode is enabled, the line number appears | 4601 | turn it off. When Line Number mode is enabled, the line number |
| 4572 | in the mode line. | 4602 | appears in the mode line. |
| 4573 | 4603 | ||
| 4574 | Line numbers do not appear for very large buffers and buffers | 4604 | Line numbers do not appear for very large buffers and buffers |
| 4575 | with very long lines; see variables `line-number-display-limit' | 4605 | with very long lines; see variables `line-number-display-limit' |
| @@ -4578,16 +4608,16 @@ and `line-number-display-limit-width'." | |||
| 4578 | 4608 | ||
| 4579 | (define-minor-mode column-number-mode | 4609 | (define-minor-mode column-number-mode |
| 4580 | "Toggle Column Number mode. | 4610 | "Toggle Column Number mode. |
| 4581 | With arg, turn Column Number mode on iff arg is positive. | 4611 | With arg, turn Column Number mode on if arg is positive, |
| 4582 | When Column Number mode is enabled, the column number appears | 4612 | otherwise turn it off. When Column Number mode is enabled, the |
| 4583 | in the mode line." | 4613 | column number appears in the mode line." |
| 4584 | :global t :group 'mode-line) | 4614 | :global t :group 'mode-line) |
| 4585 | 4615 | ||
| 4586 | (define-minor-mode size-indication-mode | 4616 | (define-minor-mode size-indication-mode |
| 4587 | "Toggle Size Indication mode. | 4617 | "Toggle Size Indication mode. |
| 4588 | With arg, turn Size Indication mode on iff arg is positive. When | 4618 | With arg, turn Size Indication mode on if arg is positive, |
| 4589 | Size Indication mode is enabled, the size of the accessible part | 4619 | otherwise turn it off. When Size Indication mode is enabled, the |
| 4590 | of the buffer appears in the mode line." | 4620 | size of the accessible part of the buffer appears in the mode line." |
| 4591 | :global t :group 'mode-line) | 4621 | :global t :group 'mode-line) |
| 4592 | 4622 | ||
| 4593 | (defgroup paren-blinking nil | 4623 | (defgroup paren-blinking nil |
| @@ -5122,7 +5152,7 @@ With prefix argument N, move N items (negative N means move backward)." | |||
| 5122 | These functions are called in order with four arguments: | 5152 | These functions are called in order with four arguments: |
| 5123 | CHOICE - the string to insert in the buffer, | 5153 | CHOICE - the string to insert in the buffer, |
| 5124 | BUFFER - the buffer in which the choice should be inserted, | 5154 | BUFFER - the buffer in which the choice should be inserted, |
| 5125 | MINI-P - non-nil iff BUFFER is a minibuffer, and | 5155 | MINI-P - non-nil if BUFFER is a minibuffer, and |
| 5126 | BASE-SIZE - the number of characters in BUFFER before | 5156 | BASE-SIZE - the number of characters in BUFFER before |
| 5127 | the string being completed. | 5157 | the string being completed. |
| 5128 | 5158 | ||
| @@ -5730,7 +5760,8 @@ See also `normal-erase-is-backspace'." | |||
| 5730 | 5760 | ||
| 5731 | (define-minor-mode visible-mode | 5761 | (define-minor-mode visible-mode |
| 5732 | "Toggle Visible mode. | 5762 | "Toggle Visible mode. |
| 5733 | With argument ARG turn Visible mode on iff ARG is positive. | 5763 | With argument ARG turn Visible mode on if ARG is positive, otherwise |
| 5764 | turn it off. | ||
| 5734 | 5765 | ||
| 5735 | Enabling Visible mode makes all invisible text temporarily visible. | 5766 | Enabling Visible mode makes all invisible text temporarily visible. |
| 5736 | Disabling Visible mode turns off that effect. Visible mode | 5767 | Disabling Visible mode turns off that effect. Visible mode |
diff --git a/lisp/skeleton.el b/lisp/skeleton.el index 33e223e4b2b..4425bb0389a 100644 --- a/lisp/skeleton.el +++ b/lisp/skeleton.el | |||
| @@ -209,8 +209,8 @@ If ELEMENT is a string or a character it gets inserted (see also | |||
| 209 | interesting point set by _ | 209 | interesting point set by _ |
| 210 | > indent line (or interregion if > _) according to major mode | 210 | > indent line (or interregion if > _) according to major mode |
| 211 | @ add position to `skeleton-positions' | 211 | @ add position to `skeleton-positions' |
| 212 | & do next ELEMENT iff previous moved point | 212 | & do next ELEMENT if previous moved point |
| 213 | | do next ELEMENT iff previous didn't move point | 213 | | do next ELEMENT if previous didn't move point |
| 214 | -num delete num preceding characters (see `skeleton-untabify') | 214 | -num delete num preceding characters (see `skeleton-untabify') |
| 215 | resume: skipped, continue here if quit is signaled | 215 | resume: skipped, continue here if quit is signaled |
| 216 | nil skipped | 216 | nil skipped |
diff --git a/lisp/strokes.el b/lisp/strokes.el index 528ea477363..de4123453f5 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el | |||
| @@ -1370,7 +1370,7 @@ If STROKES-MAP is not given, `strokes-global-map' will be used instead." | |||
| 1370 | (goto-char (point-min)))) | 1370 | (goto-char (point-min)))) |
| 1371 | 1371 | ||
| 1372 | (defun strokes-alphabetic-lessp (stroke1 stroke2) | 1372 | (defun strokes-alphabetic-lessp (stroke1 stroke2) |
| 1373 | "T iff command name for STROKE1 is less than STROKE2's in lexicographic order." | 1373 | "T if command name for STROKE1 is less than STROKE2's in lexicographic order." |
| 1374 | (let ((command-name-1 (symbol-name (cdr stroke1))) | 1374 | (let ((command-name-1 (symbol-name (cdr stroke1))) |
| 1375 | (command-name-2 (symbol-name (cdr stroke2)))) | 1375 | (command-name-2 (symbol-name (cdr stroke2)))) |
| 1376 | (string-lessp command-name-1 command-name-2))) | 1376 | (string-lessp command-name-1 command-name-2))) |
| @@ -1520,7 +1520,7 @@ Encode/decode your strokes with \\[strokes-encode-buffer], | |||
| 1520 | (eq char ?*))) | 1520 | (eq char ?*))) |
| 1521 | 1521 | ||
| 1522 | ;;(defsubst strokes-xor (a b) ### Should I make this an inline function? ### | 1522 | ;;(defsubst strokes-xor (a b) ### Should I make this an inline function? ### |
| 1523 | ;; "T iff one and only one of A and B is non-nil; otherwise, returns nil. | 1523 | ;; "T if one and only one of A and B is non-nil; otherwise, returns nil. |
| 1524 | ;;NOTE: Don't use this as a numeric xor since it treats all non-nil | 1524 | ;;NOTE: Don't use this as a numeric xor since it treats all non-nil |
| 1525 | ;; values as t including `0' (zero)." | 1525 | ;; values as t including `0' (zero)." |
| 1526 | ;; (eq (null a) (not (null b)))) | 1526 | ;; (eq (null a) (not (null b)))) |
diff --git a/lisp/subr.el b/lisp/subr.el index 97f73251c03..a74b6828dd5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2836,11 +2836,10 @@ Modifies the match data; use `save-match-data' if necessary." | |||
| 2836 | list))) | 2836 | list))) |
| 2837 | (nreverse list))) | 2837 | (nreverse list))) |
| 2838 | 2838 | ||
| 2839 | ;; (string->strings (strings->string X)) == X | 2839 | (defun combine-and-quote-strings (strings &optional separator) |
| 2840 | (defun strings->string (strings &optional separator) | ||
| 2841 | "Concatenate the STRINGS, adding the SEPARATOR (default \" \"). | 2840 | "Concatenate the STRINGS, adding the SEPARATOR (default \" \"). |
| 2842 | This tries to quote the strings to avoid ambiguity such that | 2841 | This tries to quote the strings to avoid ambiguity such that |
| 2843 | (string->strings (strings->string strs)) == strs | 2842 | (split-string-and-unquote (combine-and-quote-strings strs)) == strs |
| 2844 | Only some SEPARATORs will work properly." | 2843 | Only some SEPARATORs will work properly." |
| 2845 | (let ((sep (or separator " "))) | 2844 | (let ((sep (or separator " "))) |
| 2846 | (mapconcat | 2845 | (mapconcat |
| @@ -2850,20 +2849,20 @@ Only some SEPARATORs will work properly." | |||
| 2850 | str)) | 2849 | str)) |
| 2851 | strings sep))) | 2850 | strings sep))) |
| 2852 | 2851 | ||
| 2853 | ;; (string->strings (strings->string X)) == X | 2852 | (defun split-string-and-unquote (string &optional separator) |
| 2854 | (defun string->strings (string &optional separator) | ||
| 2855 | "Split the STRING into a list of strings. | 2853 | "Split the STRING into a list of strings. |
| 2856 | It understands elisp style quoting within STRING such that | 2854 | It understands Emacs Lisp quoting within STRING, such that |
| 2857 | (string->strings (strings->string strs)) == strs | 2855 | (split-string-and-unquote (combine-and-quote-strings strs)) == strs |
| 2858 | The SEPARATOR regexp defaults to \"\\s-+\"." | 2856 | The SEPARATOR regexp defaults to \"\\s-+\"." |
| 2859 | (let ((sep (or separator "\\s-+")) | 2857 | (let ((sep (or separator "\\s-+")) |
| 2860 | (i (string-match "[\"]" string))) | 2858 | (i (string-match "[\"]" string))) |
| 2861 | (if (null i) (split-string string sep t) ; no quoting: easy | 2859 | (if (null i) |
| 2860 | (split-string string sep t) ; no quoting: easy | ||
| 2862 | (append (unless (eq i 0) (split-string (substring string 0 i) sep t)) | 2861 | (append (unless (eq i 0) (split-string (substring string 0 i) sep t)) |
| 2863 | (let ((rfs (read-from-string string i))) | 2862 | (let ((rfs (read-from-string string i))) |
| 2864 | (cons (car rfs) | 2863 | (cons (car rfs) |
| 2865 | (string->strings (substring string (cdr rfs)) | 2864 | (split-string-and-unquote (substring string (cdr rfs)) |
| 2866 | sep))))))) | 2865 | sep))))))) |
| 2867 | 2866 | ||
| 2868 | 2867 | ||
| 2869 | ;;;; Replacement in strings. | 2868 | ;;;; Replacement in strings. |
diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el index c97f5afcf9c..821bad4e819 100644 --- a/lisp/t-mouse.el +++ b/lisp/t-mouse.el | |||
| @@ -42,7 +42,8 @@ | |||
| 42 | ;;;###autoload | 42 | ;;;###autoload |
| 43 | (define-minor-mode t-mouse-mode | 43 | (define-minor-mode t-mouse-mode |
| 44 | "Toggle t-mouse mode to use the mouse in Linux consoles. | 44 | "Toggle t-mouse mode to use the mouse in Linux consoles. |
| 45 | With prefix arg, turn t-mouse mode on iff arg is positive. | 45 | With prefix arg, turn t-mouse mode on if arg is positive, otherwise turn it |
| 46 | off. | ||
| 46 | 47 | ||
| 47 | This allows the use of the mouse when operating on a Linux console, in the | 48 | This allows the use of the mouse when operating on a Linux console, in the |
| 48 | same way as you can use the mouse under X11. | 49 | same way as you can use the mouse under X11. |
diff --git a/lisp/term.el b/lisp/term.el index 78c384475c1..21e7aa4f957 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -407,8 +407,7 @@ | |||
| 407 | 407 | ||
| 408 | (defgroup term nil | 408 | (defgroup term nil |
| 409 | "General command interpreter in a window." | 409 | "General command interpreter in a window." |
| 410 | :group 'processes | 410 | :group 'processes) |
| 411 | :group 'unix) | ||
| 412 | 411 | ||
| 413 | 412 | ||
| 414 | ;;; Buffer Local Variables: | 413 | ;;; Buffer Local Variables: |
| @@ -470,7 +469,7 @@ | |||
| 470 | (defvar term-scroll-with-delete nil) ;; term-scroll-with-delete is t if | 469 | (defvar term-scroll-with-delete nil) ;; term-scroll-with-delete is t if |
| 471 | ;; forward scrolling should be implemented by delete to | 470 | ;; forward scrolling should be implemented by delete to |
| 472 | ;; top-most line(s); and nil if scrolling should be implemented | 471 | ;; top-most line(s); and nil if scrolling should be implemented |
| 473 | ;; by moving term-home-marker. It is set to t iff there is a | 472 | ;; by moving term-home-marker. It is set to t if there is a |
| 474 | ;; (non-default) scroll-region OR the alternate buffer is used. | 473 | ;; (non-default) scroll-region OR the alternate buffer is used. |
| 475 | (defvar term-pending-delete-marker) ;; New user input in line mode needs to | 474 | (defvar term-pending-delete-marker) ;; New user input in line mode needs to |
| 476 | ;; be deleted, because it gets echoed by the inferior. | 475 | ;; be deleted, because it gets echoed by the inferior. |
| @@ -695,12 +694,12 @@ Buffer local variable.") | |||
| 695 | 694 | ||
| 696 | ;;; faces -mm | 695 | ;;; faces -mm |
| 697 | 696 | ||
| 698 | (defcustom term-default-fg-color 'unspecified | 697 | (defcustom term-default-fg-color (face-foreground term-current-face) |
| 699 | "Default color for foreground in `term'." | 698 | "Default color for foreground in `term'." |
| 700 | :group 'term | 699 | :group 'term |
| 701 | :type 'string) | 700 | :type 'string) |
| 702 | 701 | ||
| 703 | (defcustom term-default-bg-color 'unspecified | 702 | (defcustom term-default-bg-color (face-background term-current-face) |
| 704 | "Default color for background in `term'." | 703 | "Default color for background in `term'." |
| 705 | :group 'term | 704 | :group 'term |
| 706 | :type 'string) | 705 | :type 'string) |
| @@ -1096,6 +1095,8 @@ Entry to this mode runs the hooks on `term-mode-hook'." | |||
| 1096 | (make-local-variable 'term-pending-delete-marker) | 1095 | (make-local-variable 'term-pending-delete-marker) |
| 1097 | (setq term-pending-delete-marker (make-marker)) | 1096 | (setq term-pending-delete-marker (make-marker)) |
| 1098 | (make-local-variable 'term-current-face) | 1097 | (make-local-variable 'term-current-face) |
| 1098 | (setq term-current-face (list :background term-default-bg-color | ||
| 1099 | :foreground term-default-fg-color)) | ||
| 1099 | (make-local-variable 'term-pending-frame) | 1100 | (make-local-variable 'term-pending-frame) |
| 1100 | (setq term-pending-frame nil) | 1101 | (setq term-pending-frame nil) |
| 1101 | ;; Cua-mode's keybindings interfere with the term keybindings, disable it. | 1102 | ;; Cua-mode's keybindings interfere with the term keybindings, disable it. |
| @@ -3053,7 +3054,8 @@ See `term-prompt-regexp'." | |||
| 3053 | (setq term-scroll-start 0) | 3054 | (setq term-scroll-start 0) |
| 3054 | (setq term-scroll-end term-height) | 3055 | (setq term-scroll-end term-height) |
| 3055 | (setq term-insert-mode nil) | 3056 | (setq term-insert-mode nil) |
| 3056 | (setq term-current-face nil) | 3057 | (setq term-current-face (list :background term-default-bg-color |
| 3058 | :foreground term-default-fg-color)) | ||
| 3057 | (setq term-ansi-current-underline nil) | 3059 | (setq term-ansi-current-underline nil) |
| 3058 | (setq term-ansi-current-bold nil) | 3060 | (setq term-ansi-current-bold nil) |
| 3059 | (setq term-ansi-current-reverse nil) | 3061 | (setq term-ansi-current-reverse nil) |
| @@ -3115,7 +3117,8 @@ See `term-prompt-regexp'." | |||
| 3115 | 3117 | ||
| 3116 | ;;; 0 (Reset) or unknown (reset anyway) | 3118 | ;;; 0 (Reset) or unknown (reset anyway) |
| 3117 | (t | 3119 | (t |
| 3118 | (setq term-current-face nil) | 3120 | (setq term-current-face (list :background term-default-bg-color |
| 3121 | :foreground term-default-fg-color)) | ||
| 3119 | (setq term-ansi-current-underline nil) | 3122 | (setq term-ansi-current-underline nil) |
| 3120 | (setq term-ansi-current-bold nil) | 3123 | (setq term-ansi-current-bold nil) |
| 3121 | (setq term-ansi-current-reverse nil) | 3124 | (setq term-ansi-current-reverse nil) |
| @@ -3152,11 +3155,11 @@ See `term-prompt-regexp'." | |||
| 3152 | (setq term-current-face | 3155 | (setq term-current-face |
| 3153 | (list :background | 3156 | (list :background |
| 3154 | (if (= term-ansi-current-color 0) | 3157 | (if (= term-ansi-current-color 0) |
| 3155 | (face-foreground 'default) | 3158 | term-default-fg-color |
| 3156 | (elt ansi-term-color-vector term-ansi-current-color)) | 3159 | (elt ansi-term-color-vector term-ansi-current-color)) |
| 3157 | :foreground | 3160 | :foreground |
| 3158 | (if (= term-ansi-current-bg-color 0) | 3161 | (if (= term-ansi-current-bg-color 0) |
| 3159 | (face-background 'default) | 3162 | term-default-bg-color |
| 3160 | (elt ansi-term-color-vector term-ansi-current-bg-color)))) | 3163 | (elt ansi-term-color-vector term-ansi-current-bg-color)))) |
| 3161 | (when term-ansi-current-bold | 3164 | (when term-ansi-current-bold |
| 3162 | (setq term-current-face | 3165 | (setq term-current-face |
| @@ -3179,9 +3182,13 @@ See `term-prompt-regexp'." | |||
| 3179 | ) | 3182 | ) |
| 3180 | (setq term-current-face | 3183 | (setq term-current-face |
| 3181 | (list :foreground | 3184 | (list :foreground |
| 3182 | (elt ansi-term-color-vector term-ansi-current-color) | 3185 | (if (= term-ansi-current-color 0) |
| 3186 | term-default-fg-color | ||
| 3187 | (elt ansi-term-color-vector term-ansi-current-color)) | ||
| 3183 | :background | 3188 | :background |
| 3184 | (elt ansi-term-color-vector term-ansi-current-bg-color))) | 3189 | (if (= term-ansi-current-bg-color 0) |
| 3190 | term-default-bg-color | ||
| 3191 | (elt ansi-term-color-vector term-ansi-current-bg-color)))) | ||
| 3185 | (when term-ansi-current-bold | 3192 | (when term-ansi-current-bold |
| 3186 | (setq term-current-face | 3193 | (setq term-current-face |
| 3187 | (append '(:weight bold) term-current-face))) | 3194 | (append '(:weight bold) term-current-face))) |
| @@ -3713,12 +3720,12 @@ all pending output has been dealt with.")) | |||
| 3713 | (defun term-erase-in-display (kind) | 3720 | (defun term-erase-in-display (kind) |
| 3714 | "Erases (that is blanks out) part of the window. | 3721 | "Erases (that is blanks out) part of the window. |
| 3715 | If KIND is 0, erase from (point) to (point-max); | 3722 | If KIND is 0, erase from (point) to (point-max); |
| 3716 | if KIND is 1, erase from home to point; else erase from home to point-max. | 3723 | if KIND is 1, erase from home to point; else erase from home to point-max." |
| 3717 | Should only be called when point is at the start of a screen line." | ||
| 3718 | (term-handle-deferred-scroll) | 3724 | (term-handle-deferred-scroll) |
| 3719 | (cond ((eq term-terminal-parameter 0) | 3725 | (cond ((eq term-terminal-parameter 0) |
| 3720 | (delete-region (point) (point-max)) | 3726 | (let ((need-unwrap (bolp))) |
| 3721 | (term-unwrap-line)) | 3727 | (delete-region (point) (point-max)) |
| 3728 | (when need-unwrap (term-unwrap-line)))) | ||
| 3722 | ((let ((row (term-current-row)) | 3729 | ((let ((row (term-current-row)) |
| 3723 | (col (term-horizontal-column)) | 3730 | (col (term-horizontal-column)) |
| 3724 | (start-region term-home-marker) | 3731 | (start-region term-home-marker) |
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index af4c7e29525..6d3d4de11e3 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el | |||
| @@ -1760,6 +1760,19 @@ in `selection-converter-alist', which see." | |||
| 1760 | (setq modifiers (cons (car modifier-mask) modifiers))))) | 1760 | (setq modifiers (cons (car modifier-mask) modifiers))))) |
| 1761 | modifiers)) | 1761 | modifiers)) |
| 1762 | 1762 | ||
| 1763 | (defun mac-ae-reopen-application (event) | ||
| 1764 | "Show some frame in response to the Apple event EVENT. | ||
| 1765 | The frame to be shown is chosen from visible or iconified frames | ||
| 1766 | if possible. If there's no such frame, a new frame is created." | ||
| 1767 | (interactive "e") | ||
| 1768 | (unless (frame-visible-p (selected-frame)) | ||
| 1769 | (let ((frame (or (car (visible-frame-list)) | ||
| 1770 | (car (filtered-frame-list 'frame-visible-p))))) | ||
| 1771 | (if frame | ||
| 1772 | (select-frame frame) | ||
| 1773 | (switch-to-buffer-other-frame "*scratch*")))) | ||
| 1774 | (select-frame-set-input-focus (selected-frame))) | ||
| 1775 | |||
| 1763 | (defun mac-ae-open-documents (event) | 1776 | (defun mac-ae-open-documents (event) |
| 1764 | "Open the documents specified by the Apple event EVENT." | 1777 | "Open the documents specified by the Apple event EVENT." |
| 1765 | (interactive "e") | 1778 | (interactive "e") |
| @@ -1816,9 +1829,9 @@ Currently the `mailto' scheme is supported." | |||
| 1816 | (define-key mac-apple-event-map [core-event open-application] 0) | 1829 | (define-key mac-apple-event-map [core-event open-application] 0) |
| 1817 | 1830 | ||
| 1818 | ;; Received when a dock or application icon is clicked and Emacs is | 1831 | ;; Received when a dock or application icon is clicked and Emacs is |
| 1819 | ;; already running. Simply ignored. Another idea is to make a new | 1832 | ;; already running. |
| 1820 | ;; frame if all frames are invisible. | 1833 | (define-key mac-apple-event-map [core-event reopen-application] |
| 1821 | (define-key mac-apple-event-map [core-event reopen-application] 'ignore) | 1834 | 'mac-ae-reopen-application) |
| 1822 | 1835 | ||
| 1823 | (define-key mac-apple-event-map [core-event open-documents] | 1836 | (define-key mac-apple-event-map [core-event open-documents] |
| 1824 | 'mac-ae-open-documents) | 1837 | 'mac-ae-open-documents) |
diff --git a/lisp/term/sun-mouse.el b/lisp/term/sun-mouse.el index 280bfb67081..65ebe193c71 100644 --- a/lisp/term/sun-mouse.el +++ b/lisp/term/sun-mouse.el | |||
| @@ -230,7 +230,7 @@ Handles wrapped and horizontally scrolled lines correctly." | |||
| 230 | 230 | ||
| 231 | 231 | ||
| 232 | (defun minibuffer-window-p (window) | 232 | (defun minibuffer-window-p (window) |
| 233 | "True iff this WINDOW is minibuffer." | 233 | "True if this WINDOW is minibuffer." |
| 234 | (= (frame-height) | 234 | (= (frame-height) |
| 235 | (nth 3 (window-edges window)) ; The bottom edge. | 235 | (nth 3 (window-edges window)) ; The bottom edge. |
| 236 | )) | 236 | )) |
diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el index 4af21f08522..1c0bda519ac 100644 --- a/lisp/term/tvi970.el +++ b/lisp/term/tvi970.el | |||
| @@ -106,8 +106,8 @@ | |||
| 106 | 106 | ||
| 107 | ;;; Should keypad numbers send ordinary digits or distinct escape sequences? | 107 | ;;; Should keypad numbers send ordinary digits or distinct escape sequences? |
| 108 | (defvar tvi970-keypad-numeric nil | 108 | (defvar tvi970-keypad-numeric nil |
| 109 | "The terminal should be in numeric keypad mode iff this variable is non-nil. | 109 | "Non-nil means the terminal should be in numeric keypad mode. |
| 110 | Do not set this variable! Call the function ``tvi970-set-keypad-mode''.") | 110 | Do not set this variable! Call the function `tvi970-set-keypad-mode'.") |
| 111 | 111 | ||
| 112 | (defun tvi970-set-keypad-mode (&optional arg) | 112 | (defun tvi970-set-keypad-mode (&optional arg) |
| 113 | "Set the current mode of the TVI 970 numeric keypad. | 113 | "Set the current mode of the TVI 970 numeric keypad. |
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index dbb41f13ec0..274de28e6a0 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el | |||
| @@ -1768,7 +1768,7 @@ info-variant-part." | |||
| 1768 | ;; Macro that won't funcall the function if it is nil. | 1768 | ;; Macro that won't funcall the function if it is nil. |
| 1769 | ;; | 1769 | ;; |
| 1770 | (defmacro artist-funcall (fn &rest args) | 1770 | (defmacro artist-funcall (fn &rest args) |
| 1771 | "Call function FN with ARGS iff FN is not nil." | 1771 | "Call function FN with ARGS, if FN is not nil." |
| 1772 | (list 'if fn (cons 'funcall (cons fn args)))) | 1772 | (list 'if fn (cons 'funcall (cons fn args)))) |
| 1773 | 1773 | ||
| 1774 | (defun artist-uniq (l) | 1774 | (defun artist-uniq (l) |
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 8b95a159477..0b5dfa4cc54 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -457,7 +457,8 @@ See also `flyspell-duplicate-distance'." | |||
| 457 | This spawns a single Ispell process and checks each word. | 457 | This spawns a single Ispell process and checks each word. |
| 458 | The default flyspell behavior is to highlight incorrect words. | 458 | The default flyspell behavior is to highlight incorrect words. |
| 459 | With no argument, this command toggles Flyspell mode. | 459 | With no argument, this command toggles Flyspell mode. |
| 460 | With a prefix argument ARG, turn Flyspell minor mode on iff ARG is positive. | 460 | With a prefix argument ARG, turn Flyspell minor mode on if ARG is positive, |
| 461 | otherwise turn it off. | ||
| 461 | 462 | ||
| 462 | Bindings: | 463 | Bindings: |
| 463 | \\[ispell-word]: correct words (using Ispell). | 464 | \\[ispell-word]: correct words (using Ispell). |
| @@ -1621,7 +1622,7 @@ FLYSPELL-BUFFER." | |||
| 1621 | ;;* flyspell-overlay-p ... */ | 1622 | ;;* flyspell-overlay-p ... */ |
| 1622 | ;;*---------------------------------------------------------------------*/ | 1623 | ;;*---------------------------------------------------------------------*/ |
| 1623 | (defun flyspell-overlay-p (o) | 1624 | (defun flyspell-overlay-p (o) |
| 1624 | "A predicate that return true iff O is an overlay used by flyspell." | 1625 | "Return true if O is an overlay used by flyspell." |
| 1625 | (and (overlayp o) (overlay-get o 'flyspell-overlay))) | 1626 | (and (overlayp o) (overlay-get o 'flyspell-overlay))) |
| 1626 | 1627 | ||
| 1627 | ;;*---------------------------------------------------------------------*/ | 1628 | ;;*---------------------------------------------------------------------*/ |
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index f23940d480f..bf1487f02e2 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -3294,7 +3294,8 @@ available on the net." | |||
| 3294 | ;;;###autoload | 3294 | ;;;###autoload |
| 3295 | (defun ispell-minor-mode (&optional arg) | 3295 | (defun ispell-minor-mode (&optional arg) |
| 3296 | "Toggle Ispell minor mode. | 3296 | "Toggle Ispell minor mode. |
| 3297 | With prefix arg, turn Ispell minor mode on iff arg is positive. | 3297 | With prefix argument ARG, turn Ispell minor mode on if ARG is positive, |
| 3298 | otherwise turn it off. | ||
| 3298 | 3299 | ||
| 3299 | In Ispell minor mode, pressing SPC or RET | 3300 | In Ispell minor mode, pressing SPC or RET |
| 3300 | warns you if the previous word is incorrectly spelled. | 3301 | warns you if the previous word is incorrectly spelled. |
diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el index 45d407b2565..31ec234fddc 100644 --- a/lisp/textmodes/nroff-mode.el +++ b/lisp/textmodes/nroff-mode.el | |||
| @@ -263,7 +263,7 @@ automatically inserts the matching closing request after point." | |||
| 263 | `nroff-electric-newline' forces Emacs to check for an nroff request at the | 263 | `nroff-electric-newline' forces Emacs to check for an nroff request at the |
| 264 | beginning of the line, and insert the matching closing request if necessary. | 264 | beginning of the line, and insert the matching closing request if necessary. |
| 265 | This command toggles that mode (off->on, on->off), with an argument, | 265 | This command toggles that mode (off->on, on->off), with an argument, |
| 266 | turns it on iff arg is positive, otherwise off." | 266 | turns it on if arg is positive, otherwise off." |
| 267 | :lighter " Electric" | 267 | :lighter " Electric" |
| 268 | (or (derived-mode-p 'nroff-mode) (error "Must be in nroff mode"))) | 268 | (or (derived-mode-p 'nroff-mode) (error "Must be in nroff mode"))) |
| 269 | 269 | ||
diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el index a20a482a1c9..3717faa8ad2 100644 --- a/lisp/textmodes/refill.el +++ b/lisp/textmodes/refill.el | |||
| @@ -217,7 +217,7 @@ complex processing.") | |||
| 217 | ;;;###autoload | 217 | ;;;###autoload |
| 218 | (define-minor-mode refill-mode | 218 | (define-minor-mode refill-mode |
| 219 | "Toggle Refill minor mode. | 219 | "Toggle Refill minor mode. |
| 220 | With prefix arg, turn Refill mode on iff arg is positive. | 220 | With prefix arg, turn Refill mode on if arg is positive, otherwise turn it off. |
| 221 | 221 | ||
| 222 | When Refill mode is on, the current paragraph will be formatted when | 222 | When Refill mode is on, the current paragraph will be formatted when |
| 223 | changes are made within it. Self-inserting characters only cause | 223 | changes are made within it. Self-inserting characters only cause |
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el index c551083240c..2a39949431c 100644 --- a/lisp/textmodes/reftex-global.el +++ b/lisp/textmodes/reftex-global.el | |||
| @@ -431,7 +431,7 @@ the current TeX document. | |||
| 431 | 431 | ||
| 432 | With no argument, this command toggles | 432 | With no argument, this command toggles |
| 433 | `reftex-isearch-minor-mode'. With a prefix argument ARG, turn | 433 | `reftex-isearch-minor-mode'. With a prefix argument ARG, turn |
| 434 | `reftex-isearch-minor-mode' on iff ARG is positive." | 434 | `reftex-isearch-minor-mode' on if ARG is positive, otherwise turn it off." |
| 435 | (interactive "P") | 435 | (interactive "P") |
| 436 | (let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode)) | 436 | (let ((old-reftex-isearch-minor-mode reftex-isearch-minor-mode)) |
| 437 | (setq reftex-isearch-minor-mode | 437 | (setq reftex-isearch-minor-mode |
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index b5d734bc19a..181234e429a 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -824,7 +824,7 @@ Return non-nil if we skipped over matched tags." | |||
| 824 | (defun sgml-skip-tag-forward (arg) | 824 | (defun sgml-skip-tag-forward (arg) |
| 825 | "Skip to end of tag or matching closing tag if present. | 825 | "Skip to end of tag or matching closing tag if present. |
| 826 | With prefix argument ARG, repeat this ARG times. | 826 | With prefix argument ARG, repeat this ARG times. |
| 827 | Return t iff after a closing tag." | 827 | Return t if after a closing tag." |
| 828 | (interactive "p") | 828 | (interactive "p") |
| 829 | ;; FIXME: Use sgml-get-context or something similar. | 829 | ;; FIXME: Use sgml-get-context or something similar. |
| 830 | ;; It currently might jump to an unrelated </P> if the <P> | 830 | ;; It currently might jump to an unrelated </P> if the <P> |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 240ebbcb229..44bc31d36d6 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -249,14 +249,12 @@ Normally set to either `plain-tex-mode' or `latex-mode'." | |||
| 249 | :group 'tex) | 249 | :group 'tex) |
| 250 | (put 'tex-fontify-script 'safe-local-variable 'booleanp) | 250 | (put 'tex-fontify-script 'safe-local-variable 'booleanp) |
| 251 | 251 | ||
| 252 | (defcustom tex-font-script-display '(-0.2 . 0.2) | 252 | (defcustom tex-font-script-display '(-0.2 0.2) |
| 253 | "Display specification for subscript and superscript content. | 253 | "Display specification for subscript and superscript content. |
| 254 | The car is used for subscript, the cdr is used for superscripts." | 254 | The first is used for subscript, the second is used for superscripts." |
| 255 | :group 'tex | 255 | :group 'tex |
| 256 | :type '(cons (choice (float :tag "Subscript") | 256 | :type '(list (float :tag "Subscript") |
| 257 | (const :tag "No lowering" nil)) | 257 | (float :tag "Superscript"))) |
| 258 | (choice (float :tag "Superscript") | ||
| 259 | (const :tag "No raising" nil)))) | ||
| 260 | 258 | ||
| 261 | (defvar tex-last-temp-file nil | 259 | (defvar tex-last-temp-file nil |
| 262 | "Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. | 260 | "Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. |
| @@ -609,7 +607,7 @@ An alternative value is \" . \", if you use a font with a narrow period." | |||
| 609 | odd)) | 607 | odd)) |
| 610 | (if (eq (char-after pos) ?_) | 608 | (if (eq (char-after pos) ?_) |
| 611 | `(face subscript display (raise ,(car tex-font-script-display))) | 609 | `(face subscript display (raise ,(car tex-font-script-display))) |
| 612 | `(face superscript display (raise ,(cdr tex-font-script-display)))))) | 610 | `(face superscript display (raise ,(cadr tex-font-script-display)))))) |
| 613 | 611 | ||
| 614 | (defun tex-font-lock-match-suscript (limit) | 612 | (defun tex-font-lock-match-suscript (limit) |
| 615 | "Match subscript and superscript patterns up to LIMIT." | 613 | "Match subscript and superscript patterns up to LIMIT." |
| @@ -669,7 +667,7 @@ An alternative value is \" . \", if you use a font with a narrow period." | |||
| 669 | (let ((next (next-single-property-change beg 'display nil end)) | 667 | (let ((next (next-single-property-change beg 'display nil end)) |
| 670 | (prop (get-text-property beg 'display))) | 668 | (prop (get-text-property beg 'display))) |
| 671 | (if (and (eq (car-safe prop) 'raise) | 669 | (if (and (eq (car-safe prop) 'raise) |
| 672 | (member (car-safe (cdr prop)) '(-0.3 +0.3)) | 670 | (member (car-safe (cdr prop)) tex-font-script-display) |
| 673 | (null (cddr prop))) | 671 | (null (cddr prop))) |
| 674 | (put-text-property beg next 'display nil)) | 672 | (put-text-property beg next 'display nil)) |
| 675 | (setq beg next)))) | 673 | (setq beg next)))) |
diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index 2568b53fe36..e1f55c0dece 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el | |||
| @@ -347,8 +347,8 @@ When called again, restores the screen layout with the current buffer | |||
| 347 | first and the associated buffer to its right." | 347 | first and the associated buffer to its right." |
| 348 | (interactive "P") | 348 | (interactive "P") |
| 349 | ;; first go to full width, so that we can certainly split into two windows | 349 | ;; first go to full width, so that we can certainly split into two windows |
| 350 | (if (< (window-width) (frame-width)) | 350 | (unless (window-full-width-p) |
| 351 | (enlarge-window 99999 t)) | 351 | (enlarge-window 99999 t)) |
| 352 | (split-window-horizontally | 352 | (split-window-horizontally |
| 353 | (max window-min-width (min 2C-window-width | 353 | (max window-min-width (min 2C-window-width |
| 354 | (- (frame-width) window-min-width)))) | 354 | (- (frame-width) window-min-width)))) |
| @@ -533,8 +533,8 @@ off trailing spaces with \\[delete-trailing-whitespace]." | |||
| 533 | (insert 2C-separator string)) | 533 | (insert 2C-separator string)) |
| 534 | (next-line 1) ; add one if necessary | 534 | (next-line 1) ; add one if necessary |
| 535 | (set-buffer b2)))) | 535 | (set-buffer b2)))) |
| 536 | (if (< (window-width) (frame-width)) | 536 | (unless (window-full-width-p) |
| 537 | (enlarge-window 99999 t))) | 537 | (enlarge-window 99999 t))) |
| 538 | 538 | ||
| 539 | ;;;;; utility functions ;;;;; | 539 | ;;;;; utility functions ;;;;; |
| 540 | 540 | ||
| @@ -561,8 +561,10 @@ off trailing spaces with \\[delete-trailing-whitespace]." | |||
| 561 | (newline arg)) | 561 | (newline arg)) |
| 562 | 562 | ||
| 563 | (defun 2C-toggle-autoscroll (arg) | 563 | (defun 2C-toggle-autoscroll (arg) |
| 564 | "Toggle autoscrolling, or set it iff prefix ARG is non-nil and positive. | 564 | "Toggle autoscrolling. |
| 565 | When autoscrolling is turned on, this also realigns the two buffers." | 565 | With prefix argument ARG, turn on autoscrolling if ARG is |
| 566 | positive, otherwise turn it off. When autoscrolling is turned | ||
| 567 | on, this also realigns the two buffers." | ||
| 566 | (interactive "P") | 568 | (interactive "P") |
| 567 | ;(sit-for 0) | 569 | ;(sit-for 0) |
| 568 | (setq 2C-autoscroll-start (window-start)) | 570 | (setq 2C-autoscroll-start (window-start)) |
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 8bf3ca4aead..46a2bb62a75 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-08-08 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * url-auth.el, url-cache.el, url-dav.el, url-file.el, vc-dav.el: | ||
| 4 | Replace `iff' in doc-strings and comments. | ||
| 5 | |||
| 1 | 2007-07-25 Glenn Morris <rgm@gnu.org> | 6 | 2007-07-25 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * Relicense all FSF files to GPLv3 or later. | 8 | * Relicense all FSF files to GPLv3 or later. |
diff --git a/lisp/url/url-auth.el b/lisp/url/url-auth.el index c57a96cc81b..3c33fd914e5 100644 --- a/lisp/url/url-auth.el +++ b/lisp/url/url-auth.el | |||
| @@ -68,7 +68,9 @@ instead of the pathname inheritance method." | |||
| 68 | (server (url-host href)) | 68 | (server (url-host href)) |
| 69 | (port (url-port href)) | 69 | (port (url-port href)) |
| 70 | (path (url-filename href)) | 70 | (path (url-filename href)) |
| 71 | user pass byserv retval data) | 71 | (user (url-user href)) |
| 72 | (pass (url-password href)) | ||
| 73 | byserv retval data) | ||
| 72 | (setq server (format "%s:%d" server port) | 74 | (setq server (format "%s:%d" server port) |
| 73 | path (cond | 75 | path (cond |
| 74 | (realm realm) | 76 | (realm realm) |
| @@ -79,8 +81,8 @@ instead of the pathname inheritance method." | |||
| 79 | (cond | 81 | (cond |
| 80 | ((and prompt (not byserv)) | 82 | ((and prompt (not byserv)) |
| 81 | (setq user (read-string (url-auth-user-prompt url realm) | 83 | (setq user (read-string (url-auth-user-prompt url realm) |
| 82 | (user-real-login-name)) | 84 | (or user (user-real-login-name))) |
| 83 | pass (read-passwd "Password: ")) | 85 | pass (read-passwd "Password: " nil (or pass ""))) |
| 84 | (set url-basic-auth-storage | 86 | (set url-basic-auth-storage |
| 85 | (cons (list server | 87 | (cons (list server |
| 86 | (cons path | 88 | (cons path |
| @@ -310,7 +312,7 @@ RATING a rating between 1 and 10 of the strength of the authentication. | |||
| 310 | url-registered-auth-schemes))))) | 312 | url-registered-auth-schemes))))) |
| 311 | 313 | ||
| 312 | (defun url-auth-registered (scheme) | 314 | (defun url-auth-registered (scheme) |
| 313 | ;; Return non-nil iff SCHEME is registered as an auth type | 315 | "Return non-nil if SCHEME is registered as an auth type." |
| 314 | (assoc scheme url-registered-auth-schemes)) | 316 | (assoc scheme url-registered-auth-schemes)) |
| 315 | 317 | ||
| 316 | (provide 'url-auth) | 318 | (provide 'url-auth) |
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el index 8fbe01d472a..6db30eacda9 100644 --- a/lisp/url/url-cache.el +++ b/lisp/url/url-cache.el | |||
| @@ -186,7 +186,7 @@ Very fast if you have an `md5' primitive function, suitably fast otherwise." | |||
| 186 | 186 | ||
| 187 | ;;;###autoload | 187 | ;;;###autoload |
| 188 | (defun url-cache-expired (url mod) | 188 | (defun url-cache-expired (url mod) |
| 189 | "Return t iff a cached file has expired." | 189 | "Return t if a cached file has expired." |
| 190 | (let* ((urlobj (if (vectorp url) url (url-generic-parse-url url))) | 190 | (let* ((urlobj (if (vectorp url) url (url-generic-parse-url url))) |
| 191 | (type (url-type urlobj))) | 191 | (type (url-type urlobj))) |
| 192 | (cond | 192 | (cond |
diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el index afae0041b68..b58c1672865 100644 --- a/lisp/url/url-dav.el +++ b/lisp/url/url-dav.el | |||
| @@ -562,7 +562,7 @@ FAILURE-RESULTS is a list of (URL STATUS)." | |||
| 562 | 562 | ||
| 563 | (defun url-dav-unlock-resource (url lock-token) | 563 | (defun url-dav-unlock-resource (url lock-token) |
| 564 | "Release the lock on URL represented by LOCK-TOKEN. | 564 | "Release the lock on URL represented by LOCK-TOKEN. |
| 565 | Returns t iff the lock was successfully released." | 565 | Returns t if the lock was successfully released." |
| 566 | (declare (special url-http-response-status)) | 566 | (declare (special url-http-response-status)) |
| 567 | (let* ((url-request-extra-headers (list (cons "Lock-Token" | 567 | (let* ((url-request-extra-headers (list (cons "Lock-Token" |
| 568 | (concat "<" lock-token ">")))) | 568 | (concat "<" lock-token ">")))) |
| @@ -654,13 +654,13 @@ Returns t iff the lock was successfully released." | |||
| 654 | (or (plist-get properties 'DAV:getcontentlength) 0) | 654 | (or (plist-get properties 'DAV:getcontentlength) 0) |
| 655 | 655 | ||
| 656 | ;; file modes as a string like `ls -l' | 656 | ;; file modes as a string like `ls -l' |
| 657 | ;; | 657 | ;; |
| 658 | ;; Should be able to build this up from the | 658 | ;; Should be able to build this up from the |
| 659 | ;; DAV:supportedlock attribute pretty easily. Getting | 659 | ;; DAV:supportedlock attribute pretty easily. Getting |
| 660 | ;; the group info could be impossible though. | 660 | ;; the group info could be impossible though. |
| 661 | (url-dav-file-attributes-mode-string properties) | 661 | (url-dav-file-attributes-mode-string properties) |
| 662 | 662 | ||
| 663 | ;; t iff file's gid would change if it were deleted & | 663 | ;; t if file's gid would change if it were deleted & |
| 664 | ;; recreated. No way for us to know that thru DAV. | 664 | ;; recreated. No way for us to know that thru DAV. |
| 665 | nil | 665 | nil |
| 666 | 666 | ||
diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el index e899493f1ce..6e771c9cd69 100644 --- a/lisp/url/url-file.el +++ b/lisp/url/url-file.el | |||
| @@ -52,7 +52,7 @@ to them." | |||
| 52 | found)) | 52 | found)) |
| 53 | 53 | ||
| 54 | (defun url-file-host-is-local-p (host) | 54 | (defun url-file-host-is-local-p (host) |
| 55 | "Return t iff HOST references our local machine." | 55 | "Return t if HOST references our local machine." |
| 56 | (let ((case-fold-search t)) | 56 | (let ((case-fold-search t)) |
| 57 | (or | 57 | (or |
| 58 | (null host) | 58 | (null host) |
diff --git a/lisp/url/vc-dav.el b/lisp/url/vc-dav.el index ce0d3275a5f..7e9b6606ca4 100644 --- a/lisp/url/vc-dav.el +++ b/lisp/url/vc-dav.el | |||
| @@ -31,7 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | ;;; Required functions for a vc backend | 32 | ;;; Required functions for a vc backend |
| 33 | (defun vc-dav-registered (url) | 33 | (defun vc-dav-registered (url) |
| 34 | "Return t iff URL is registered with a DAV aware server." | 34 | "Return t if URL is registered with a DAV aware server." |
| 35 | (url-dav-vc-registered url)) | 35 | (url-dav-vc-registered url)) |
| 36 | 36 | ||
| 37 | (defun vc-dav-state (url) | 37 | (defun vc-dav-state (url) |
diff --git a/lisp/userlock.el b/lisp/userlock.el index 17cbc0c3e55..8e4a6753a31 100644 --- a/lisp/userlock.el +++ b/lisp/userlock.el | |||
| @@ -134,7 +134,7 @@ The buffer in question is current when this function is called." | |||
| 134 | (setq answer nil)) | 134 | (setq answer nil)) |
| 135 | ((eq answer 'revert) | 135 | ((eq answer 'revert) |
| 136 | (revert-buffer nil (not (buffer-modified-p))) | 136 | (revert-buffer nil (not (buffer-modified-p))) |
| 137 | ; ask confirmation iff buffer modified | 137 | ; ask confirmation if buffer modified |
| 138 | (signal 'file-supersession | 138 | (signal 'file-supersession |
| 139 | (list "File reverted" fn))) | 139 | (list "File reverted" fn))) |
| 140 | ((eq answer 'yield) | 140 | ((eq answer 'yield) |
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index b2011a7176e..20a9ca9b2fb 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el | |||
| @@ -2,15 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; NOTE: THIS IS A MODIFIED VERSION OF Dave Love's vc-bzr.el, | ||
| 6 | ;; which you can find at: http://www.loveshack.ukfsn.org/emacs/vc-bzr.el | ||
| 7 | ;; I could not get in touch with Dave Love by email, so | ||
| 8 | ;; I am releasing my changes separately. -- Riccardo | ||
| 9 | |||
| 10 | ;; Author: Dave Love <fx@gnu.org>, Riccardo Murri <riccardo.murri@gmail.com> | 5 | ;; Author: Dave Love <fx@gnu.org>, Riccardo Murri <riccardo.murri@gmail.com> |
| 11 | ;; Keywords: tools | 6 | ;; Keywords: tools |
| 12 | ;; Created: Sept 2006 | 7 | ;; Created: Sept 2006 |
| 13 | ;; Version: 2007-05-24 | 8 | ;; Version: 2007-08-03 |
| 14 | ;; URL: http://launchpad.net/vc-bzr | 9 | ;; URL: http://launchpad.net/vc-bzr |
| 15 | 10 | ||
| 16 | ;; This file is free software; you can redistribute it and/or modify | 11 | ;; This file is free software; you can redistribute it and/or modify |
| @@ -31,9 +26,6 @@ | |||
| 31 | 26 | ||
| 32 | ;;; Commentary: | 27 | ;;; Commentary: |
| 33 | 28 | ||
| 34 | ;; NOTE: THIS IS A MODIFIED VERSION OF Dave Love's vc-bzr.el, | ||
| 35 | ;; which you can find at: http://www.loveshack.ukfsn.org/emacs/vc-bzr.el | ||
| 36 | |||
| 37 | ;; See <URL:http://bazaar-vcs.org/> concerning bzr. | 29 | ;; See <URL:http://bazaar-vcs.org/> concerning bzr. |
| 38 | 30 | ||
| 39 | ;; Load this library to register bzr support in VC. It covers basic VC | 31 | ;; Load this library to register bzr support in VC. It covers basic VC |
| @@ -96,34 +88,73 @@ Invoke the bzr command adding `BZR_PROGRESS_BAR=none' to the environment." | |||
| 96 | (let ((process-environment | 88 | (let ((process-environment |
| 97 | (list* "BZR_PROGRESS_BAR=none" ; Suppress progress output (bzr >=0.9) | 89 | (list* "BZR_PROGRESS_BAR=none" ; Suppress progress output (bzr >=0.9) |
| 98 | "LC_ALL=C" ; Force English output | 90 | "LC_ALL=C" ; Force English output |
| 99 | process-environment)) | 91 | process-environment))) |
| 100 | ;; bzr may attempt some kind of user interaction if its stdin/stdout | ||
| 101 | ;; is connected to a PTY; therefore, ask Emacs to use a pipe to | ||
| 102 | ;; communicate with it. | ||
| 103 | ;; This is redundant because vc-do-command does it already. --Stef | ||
| 104 | (process-connection-type nil)) | ||
| 105 | (apply 'vc-do-command buffer okstatus vc-bzr-program | 92 | (apply 'vc-do-command buffer okstatus vc-bzr-program |
| 106 | file-or-list bzr-command (append vc-bzr-program-args args)))) | 93 | file-or-list bzr-command (append vc-bzr-program-args args)))) |
| 107 | 94 | ||
| 108 | 95 | ||
| 109 | ;;;###autoload | 96 | ;;;###autoload |
| 110 | (defconst vc-bzr-admin-dirname ".bzr") ; FIXME: "_bzr" on w32? | 97 | (defconst vc-bzr-admin-dirname ".bzr" ; FIXME: "_bzr" on w32? |
| 98 | "Name of the directory containing Bzr repository status files.") | ||
| 99 | ;;;###autoload | ||
| 100 | (defconst vc-bzr-admin-checkout-format-file | ||
| 101 | (concat vc-bzr-admin-dirname "/checkout/format")) | ||
| 102 | (defconst vc-bzr-admin-dirstate | ||
| 103 | (concat vc-bzr-admin-dirname "/checkout/dirstate")) | ||
| 104 | (defconst vc-bzr-admin-branch-format-file | ||
| 105 | (concat vc-bzr-admin-dirname "/branch/format")) | ||
| 106 | (defconst vc-bzr-admin-revhistory | ||
| 107 | (concat vc-bzr-admin-dirname "/branch/revision-history")) | ||
| 111 | 108 | ||
| 112 | ;;;###autoload (defun vc-bzr-registered (file) | 109 | ;;;###autoload (defun vc-bzr-registered (file) |
| 113 | ;;;###autoload (if (vc-find-root file vc-bzr-admin-dirname) | 110 | ;;;###autoload (if (vc-find-root file vc-bzr-admin-checkout-format-file) |
| 114 | ;;;###autoload (progn | 111 | ;;;###autoload (progn |
| 115 | ;;;###autoload (load "vc-bzr") | 112 | ;;;###autoload (load "vc-bzr") |
| 116 | ;;;###autoload (vc-bzr-registered file)))) | 113 | ;;;###autoload (vc-bzr-registered file)))) |
| 117 | 114 | ||
| 118 | (defun vc-bzr-root-dir (file) | 115 | (defun vc-bzr-root (file) |
| 119 | "Return the root directory in the hierarchy above FILE. | 116 | "Return the root directory of the bzr repository containing FILE." |
| 120 | Return nil if there isn't one." | 117 | ;; Cache technique copied from vc-arch.el. |
| 121 | (vc-find-root file vc-bzr-admin-dirname)) | 118 | (or (vc-file-getprop file 'bzr-root) |
| 119 | (vc-file-setprop | ||
| 120 | file 'bzr-root | ||
| 121 | (vc-find-root file vc-bzr-admin-checkout-format-file)))) | ||
| 122 | 122 | ||
| 123 | (defun vc-bzr-registered (file) | 123 | (defun vc-bzr-registered (file) |
| 124 | "Return non-nil if FILE is registered with bzr." | 124 | "Return non-nil if FILE is registered with bzr. |
| 125 | (if (vc-bzr-root-dir file) ; Short cut. | 125 | |
| 126 | (vc-bzr-state file))) ; Expensive. | 126 | For speed, this function tries first to parse Bzr internal file |
| 127 | `checkout/dirstate', but it may fail if Bzr internal file format | ||
| 128 | has changed. As a safeguard, the `checkout/dirstate' file is | ||
| 129 | only parsed if it contains the string `#bazaar dirstate flat | ||
| 130 | format 3' in the first line. | ||
| 131 | |||
| 132 | If the `checkout/dirstate' file cannot be parsed, fall back to | ||
| 133 | running `vc-bzr-state'." | ||
| 134 | (condition-case nil | ||
| 135 | (lexical-let ((root (vc-bzr-root file))) | ||
| 136 | (and root ; Short cut. | ||
| 137 | ;; This looks at internal files. May break if they change | ||
| 138 | ;; their format. | ||
| 139 | (lexical-let | ||
| 140 | ((dirstate-file (expand-file-name vc-bzr-admin-dirstate root))) | ||
| 141 | (if (file-exists-p dirstate-file) | ||
| 142 | (with-temp-buffer | ||
| 143 | (insert-file-contents dirstate-file) | ||
| 144 | (goto-char (point-min)) | ||
| 145 | (when (looking-at "#bazaar dirstate flat format 3") | ||
| 146 | (let* ((relfile (file-relative-name file root)) | ||
| 147 | (reldir (file-name-directory relfile))) | ||
| 148 | (re-search-forward | ||
| 149 | (concat "^\0" | ||
| 150 | (if reldir (regexp-quote (directory-file-name reldir))) | ||
| 151 | "\0" | ||
| 152 | (regexp-quote (file-name-nondirectory relfile)) | ||
| 153 | "\0") | ||
| 154 | nil t)))) | ||
| 155 | t)) | ||
| 156 | (vc-bzr-state file))) ; Expensive. | ||
| 157 | (file-error nil))) ; vc-bzr-program not found | ||
| 127 | 158 | ||
| 128 | (defun vc-bzr-buffer-nonblank-p (&optional buffer) | 159 | (defun vc-bzr-buffer-nonblank-p (&optional buffer) |
| 129 | "Return non-nil if BUFFER contains any non-blank characters." | 160 | "Return non-nil if BUFFER contains any non-blank characters." |
| @@ -134,15 +165,34 @@ Return nil if there isn't one." | |||
| 134 | (re-search-forward "[^ \t\n]" (point-max) t)))) | 165 | (re-search-forward "[^ \t\n]" (point-max) t)))) |
| 135 | 166 | ||
| 136 | (defconst vc-bzr-state-words | 167 | (defconst vc-bzr-state-words |
| 137 | "added\\|ignored\\|modified\\|removed\\|renamed\\|unknown" | 168 | "added\\|ignored\\|kind changed\\|modified\\|removed\\|renamed\\|unknown" |
| 138 | "Regexp matching file status words as reported in `bzr' output.") | 169 | "Regexp matching file status words as reported in `bzr' output.") |
| 139 | 170 | ||
| 171 | (defun vc-bzr-file-name-relative (filename) | ||
| 172 | "Return file name FILENAME stripped of the initial Bzr repository path." | ||
| 173 | (lexical-let* | ||
| 174 | ((filename* (expand-file-name filename)) | ||
| 175 | (rootdir (vc-bzr-root (file-name-directory filename*)))) | ||
| 176 | (and rootdir | ||
| 177 | (file-relative-name filename* rootdir)))) | ||
| 178 | |||
| 140 | ;; FIXME: Also get this in a non-registered sub-directory. | 179 | ;; FIXME: Also get this in a non-registered sub-directory. |
| 141 | (defun vc-bzr-state (file) | 180 | ;; It already works for me. -- Riccardo |
| 181 | (defun vc-bzr-status (file) | ||
| 182 | "Return FILE status according to Bzr. | ||
| 183 | Return value is a cons (STATUS . WARNING), where WARNING is a | ||
| 184 | string or nil, and STATUS is one of the symbols: 'added, | ||
| 185 | 'ignored, 'kindchange, 'modified, 'removed, 'renamed, 'unknown, | ||
| 186 | which directly correspond to `bzr status' output, or 'unchanged | ||
| 187 | for files whose copy in the working tree is identical to the one | ||
| 188 | in the branch repository, or nil for files that are not | ||
| 189 | registered with Bzr. | ||
| 190 | |||
| 191 | If any error occurred in running `bzr status', then return nil." | ||
| 192 | (condition-case nil | ||
| 142 | (with-temp-buffer | 193 | (with-temp-buffer |
| 143 | (cd (file-name-directory file)) | 194 | (let ((ret (vc-bzr-command "status" t 0 file)) |
| 144 | (let ((ret (vc-bzr-command "status" t 255 file)) | 195 | (status 'unchanged)) |
| 145 | (state 'up-to-date)) | ||
| 146 | ;; the only secure status indication in `bzr status' output | 196 | ;; the only secure status indication in `bzr status' output |
| 147 | ;; is a couple of lines following the pattern:: | 197 | ;; is a couple of lines following the pattern:: |
| 148 | ;; | <status>: | 198 | ;; | <status>: |
| @@ -153,45 +203,93 @@ Return nil if there isn't one." | |||
| 153 | (goto-char (point-min)) | 203 | (goto-char (point-min)) |
| 154 | (when | 204 | (when |
| 155 | (re-search-forward | 205 | (re-search-forward |
| 206 | ;; bzr prints paths relative to the repository root | ||
| 156 | (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+" | 207 | (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+" |
| 157 | (file-name-nondirectory file) "[ \t\n]*$") | 208 | (regexp-quote (vc-bzr-file-name-relative file)) |
| 209 | (if (file-directory-p file) "/?" "") | ||
| 210 | "[ \t\n]*$") | ||
| 158 | (point-max) t) | 211 | (point-max) t) |
| 159 | (let ((start (match-beginning 0)) | 212 | (let ((start (match-beginning 0)) |
| 160 | (end (match-end 0))) | 213 | (end (match-end 0))) |
| 161 | (goto-char start) | 214 | (goto-char start) |
| 162 | (setq state | 215 | (setq status |
| 163 | (cond | 216 | (cond |
| 164 | ((not (equal ret 0)) nil) | 217 | ((not (equal ret 0)) nil) |
| 165 | ((looking-at "added\\|renamed\\|modified\\|removed") 'edited) | 218 | ((looking-at "added") 'added) |
| 166 | ((looking-at "unknown\\|ignored") nil))) | 219 | ((looking-at "kind changed") 'kindchange) |
| 220 | ((looking-at "renamed") 'renamed) | ||
| 221 | ((looking-at "modified") 'modified) | ||
| 222 | ((looking-at "removed") 'removed) | ||
| 223 | ((looking-at "ignored") 'ignored) | ||
| 224 | ((looking-at "unknown") 'unknown))) | ||
| 167 | ;; erase the status text that matched | 225 | ;; erase the status text that matched |
| 168 | (delete-region start end))) | 226 | (delete-region start end))) |
| 169 | (when (vc-bzr-buffer-nonblank-p) | 227 | (if status |
| 170 | ;; "bzr" will output some warnings and informational messages | 228 | (cons status |
| 171 | ;; to the user to stderr; due to Emacs' `vc-do-command' (and, | 229 | ;; "bzr" will output warnings and informational messages to |
| 172 | ;; it seems, `start-process' itself), we cannot catch stderr | 230 | ;; stderr; due to Emacs' `vc-do-command' (and, it seems, |
| 231 | ;; `start-process' itself) limitations, we cannot catch stderr | ||
| 173 | ;; and stdout into different buffers. So, if there's anything | 232 | ;; and stdout into different buffers. So, if there's anything |
| 174 | ;; left in the buffer after removing the above status | 233 | ;; left in the buffer after removing the above status |
| 175 | ;; keywords, let us just presume that any other message from | 234 | ;; keywords, let us just presume that any other message from |
| 176 | ;; "bzr" is a user warning, and display it. | 235 | ;; "bzr" is a user warning, and display it. |
| 177 | (message "Warnings in `bzr' output: %s" | 236 | (if (vc-bzr-buffer-nonblank-p) |
| 178 | (buffer-substring (point-min) (point-max)))) | 237 | (buffer-substring (point-min) (point-max))))))) |
| 179 | (when state | 238 | (file-error nil))) ; vc-bzr-program not found |
| 180 | (vc-file-setprop file 'vc-workfile-version | 239 | |
| 181 | (vc-bzr-workfile-version file)) | 240 | (defun vc-bzr-state (file) |
| 182 | (vc-file-setprop file 'vc-state state)) | 241 | (lexical-let ((result (vc-bzr-status file))) |
| 183 | state))) | 242 | (when (consp result) |
| 243 | (if (cdr result) | ||
| 244 | (message "Warnings in `bzr' output: %s" (cdr result))) | ||
| 245 | (cdr (assq (car result) | ||
| 246 | '((added . edited) | ||
| 247 | (kindchange . edited) | ||
| 248 | (renamed . edited) | ||
| 249 | (modified . edited) | ||
| 250 | (removed . edited) | ||
| 251 | (ignored . nil) | ||
| 252 | (unknown . nil) | ||
| 253 | (unchanged . up-to-date))))))) | ||
| 184 | 254 | ||
| 185 | (defun vc-bzr-workfile-unchanged-p (file) | 255 | (defun vc-bzr-workfile-unchanged-p (file) |
| 186 | (eq 'up-to-date (vc-bzr-state file))) | 256 | (eq 'unchanged (car (vc-bzr-status file)))) |
| 187 | 257 | ||
| 188 | (defun vc-bzr-workfile-version (file) | 258 | (defun vc-bzr-workfile-version (file) |
| 189 | ;; Looks like this could be obtained via counting lines in | 259 | (lexical-let* |
| 190 | ;; .bzr/branch/revision-history. | 260 | ((rootdir (vc-bzr-root file)) |
| 261 | (branch-format-file (concat rootdir "/" vc-bzr-admin-branch-format-file)) | ||
| 262 | (revhistory-file (concat rootdir "/" vc-bzr-admin-revhistory)) | ||
| 263 | (lastrev-file (concat rootdir "/" "branch/last-revision"))) | ||
| 264 | ;; Count lines in .bzr/branch/revision-history to avoid forking a | ||
| 265 | ;; bzr process. This looks at internal files. May break if they | ||
| 266 | ;; change their format. | ||
| 267 | (if (file-exists-p branch-format-file) | ||
| 191 | (with-temp-buffer | 268 | (with-temp-buffer |
| 192 | (vc-bzr-command "revno" t 0 file) | 269 | (insert-file-contents branch-format-file) |
| 193 | (goto-char (point-min)) | 270 | (goto-char (point-min)) |
| 194 | (buffer-substring (point) (line-end-position)))) | 271 | (cond |
| 272 | ((or | ||
| 273 | (looking-at "Bazaar-NG branch, format 0.0.4") | ||
| 274 | (looking-at "Bazaar-NG branch format 5")) | ||
| 275 | ;; count lines in .bzr/branch/revision-history | ||
| 276 | (insert-file-contents revhistory-file) | ||
| 277 | (number-to-string (count-lines (line-end-position) (point-max)))) | ||
| 278 | ((looking-at "Bazaar Branch Format 6 (bzr 0.15)") | ||
| 279 | ;; revno is the first number in .bzr/branch/last-revision | ||
| 280 | (insert-file-contents lastrev-file) | ||
| 281 | (goto-char (line-end-position)) | ||
| 282 | (if (re-search-forward "[0-9]+" nil t) | ||
| 283 | (buffer-substring (match-beginning 0) (match-end 0)))))) | ||
| 284 | ;; fallback to calling "bzr revno" | ||
| 285 | (lexical-let* | ||
| 286 | ((result (vc-bzr-command-discarding-stderr | ||
| 287 | vc-bzr-program "revno" file)) | ||
| 288 | (exitcode (car result)) | ||
| 289 | (output (cdr result))) | ||
| 290 | (cond | ||
| 291 | ((eq exitcode 0) (substring output 0 -1)) | ||
| 292 | (t nil)))))) | ||
| 195 | 293 | ||
| 196 | (defun vc-bzr-checkout-model (file) | 294 | (defun vc-bzr-checkout-model (file) |
| 197 | 'implicit) | 295 | 'implicit) |
| @@ -209,7 +307,7 @@ COMMENT is ignored." | |||
| 209 | 307 | ||
| 210 | ;; Could run `bzr status' in the directory and see if it succeeds, but | 308 | ;; Could run `bzr status' in the directory and see if it succeeds, but |
| 211 | ;; that's relatively expensive. | 309 | ;; that's relatively expensive. |
| 212 | (defalias 'vc-bzr-responsible-p 'vc-bzr-root-dir | 310 | (defalias 'vc-bzr-responsible-p 'vc-bzr-root |
| 213 | "Return non-nil if FILE is (potentially) controlled by bzr. | 311 | "Return non-nil if FILE is (potentially) controlled by bzr. |
| 214 | The criterion is that there is a `.bzr' directory in the same | 312 | The criterion is that there is a `.bzr' directory in the same |
| 215 | or a superior directory.") | 313 | or a superior directory.") |
| @@ -250,7 +348,7 @@ EDITABLE is ignored." | |||
| 250 | 348 | ||
| 251 | (defun vc-bzr-revert (file &optional contents-done) | 349 | (defun vc-bzr-revert (file &optional contents-done) |
| 252 | (unless contents-done | 350 | (unless contents-done |
| 253 | (with-temp-buffer (vc-bzr-command "revert" t 'async file)))) | 351 | (with-temp-buffer (vc-bzr-command "revert" t 0 file)))) |
| 254 | 352 | ||
| 255 | (defvar log-view-message-re) | 353 | (defvar log-view-message-re) |
| 256 | (defvar log-view-file-re) | 354 | (defvar log-view-file-re) |
| @@ -294,13 +392,11 @@ EDITABLE is ignored." | |||
| 294 | (beginning-of-line 0) | 392 | (beginning-of-line 0) |
| 295 | (goto-char (point-min))))) | 393 | (goto-char (point-min))))) |
| 296 | 394 | ||
| 297 | ;; Fixem: vc-bzr-wash-log | ||
| 298 | |||
| 299 | (autoload 'vc-diff-switches-list "vc" nil nil t) | 395 | (autoload 'vc-diff-switches-list "vc" nil nil t) |
| 300 | 396 | ||
| 301 | (defun vc-bzr-diff (files &optional rev1 rev2 buffer) | 397 | (defun vc-bzr-diff (files &optional rev1 rev2 buffer) |
| 302 | "VC bzr backend for diff." | 398 | "VC bzr backend for diff." |
| 303 | (let ((working (vc-workfile-version (car files)))) | 399 | (let ((working (vc-workfile-version (if (consp files) (car files) files)))) |
| 304 | (if (and (equal rev1 working) (not rev2)) | 400 | (if (and (equal rev1 working) (not rev2)) |
| 305 | (setq rev1 nil)) | 401 | (setq rev1 nil)) |
| 306 | (if (and (not rev1) rev2) | 402 | (if (and (not rev1) rev2) |
| @@ -317,9 +413,8 @@ EDITABLE is ignored." | |||
| 317 | 413 | ||
| 318 | (defalias 'vc-bzr-diff-tree 'vc-bzr-diff) | 414 | (defalias 'vc-bzr-diff-tree 'vc-bzr-diff) |
| 319 | 415 | ||
| 320 | ;; Fixme: implement vc-bzr-dir-state, vc-bzr-dired-state-info | ||
| 321 | 416 | ||
| 322 | ;; Fixme: vc-{next,previous}-version need fixing in vc.el to deal with | 417 | ;; FIXME: vc-{next,previous}-version need fixing in vc.el to deal with |
| 323 | ;; straight integer versions. | 418 | ;; straight integer versions. |
| 324 | 419 | ||
| 325 | (defun vc-bzr-delete-file (file) | 420 | (defun vc-bzr-delete-file (file) |
| @@ -399,17 +494,16 @@ Return nil if current line isn't annotated." | |||
| 399 | (if next-time | 494 | (if next-time |
| 400 | (- (vc-annotate-convert-time (current-time)) next-time)))) | 495 | (- (vc-annotate-convert-time (current-time)) next-time)))) |
| 401 | 496 | ||
| 402 | ;; FIXME: `bzr root' will return the real path to the repository root, | 497 | (defun vc-bzr-command-discarding-stderr (command &rest args) |
| 403 | ;; that is, it can differ from the buffer's current directory name | 498 | "Execute shell command COMMAND (with ARGS); return its output and exitcode. |
| 404 | ;; if there are any symbolic links. | 499 | Return value is a cons (EXITCODE . OUTPUT), where EXITCODE is |
| 405 | (defun vc-bzr-root (dir) | 500 | the (numerical) exit code of the process, and OUTPUT is a string |
| 406 | "Return the root directory of the bzr repository containing DIR." | 501 | containing whatever the process sent to its standard output |
| 407 | ;; Cache technique copied from vc-arch.el. | 502 | stream. Standard error output is discarded." |
| 408 | (or (vc-file-getprop dir 'bzr-root) | 503 | (with-temp-buffer |
| 409 | (vc-file-setprop | 504 | (cons |
| 410 | dir 'bzr-root | 505 | (apply #'call-process command nil (list (current-buffer) nil) nil args) |
| 411 | (substring | 506 | (buffer-substring (point-min) (point-max))))) |
| 412 | (shell-command-to-string (concat vc-bzr-program " root " dir)) 0 -1)))) | ||
| 413 | 507 | ||
| 414 | ;; TODO: it would be nice to mark the conflicted files in VC Dired, | 508 | ;; TODO: it would be nice to mark the conflicted files in VC Dired, |
| 415 | ;; and implement a command to run ediff and `bzr resolve' once the | 509 | ;; and implement a command to run ediff and `bzr resolve' once the |
| @@ -453,6 +547,9 @@ Optional argument LOCALP is always ignored." | |||
| 453 | ((looking-at "^added") | 547 | ((looking-at "^added") |
| 454 | (setq current-vc-state 'edited) | 548 | (setq current-vc-state 'edited) |
| 455 | (setq current-bzr-state 'added)) | 549 | (setq current-bzr-state 'added)) |
| 550 | ((looking-at "^kind changed") | ||
| 551 | (setq current-vc-state 'edited) | ||
| 552 | (setq current-bzr-state 'kindchange)) | ||
| 456 | ((looking-at "^modified") | 553 | ((looking-at "^modified") |
| 457 | (setq current-vc-state 'edited) | 554 | (setq current-vc-state 'edited) |
| 458 | (setq current-bzr-state 'modified)) | 555 | (setq current-bzr-state 'modified)) |
| @@ -499,7 +596,7 @@ Optional argument LOCALP is always ignored." | |||
| 499 | (add-to-list 'vc-handled-backends 'Bzr) | 596 | (add-to-list 'vc-handled-backends 'Bzr) |
| 500 | 597 | ||
| 501 | (eval-after-load "vc" | 598 | (eval-after-load "vc" |
| 502 | '(add-to-list 'vc-directory-exclusion-list ".bzr" t)) | 599 | '(add-to-list 'vc-directory-exclusion-list vc-bzr-admin-dirname t)) |
| 503 | 600 | ||
| 504 | (defconst vc-bzr-unload-hook | 601 | (defconst vc-bzr-unload-hook |
| 505 | (lambda () | 602 | (lambda () |
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 09001e59691..aa121457a40 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el | |||
| @@ -279,7 +279,10 @@ It is usually called via the `vc-call' macro." | |||
| 279 | (t (apply f args))))) | 279 | (t (apply f args))))) |
| 280 | 280 | ||
| 281 | (defmacro vc-call (fun file &rest args) | 281 | (defmacro vc-call (fun file &rest args) |
| 282 | ;; BEWARE!! `file' is evaluated twice!! | 282 | "A convenience macro for calling VC backend functions. |
| 283 | Functions called by this macro must accept FILE as the first argument. | ||
| 284 | ARGS specifies any additional arguments. FUN should be unquoted. | ||
| 285 | BEWARE!! `file' is evaluated twice!!" | ||
| 283 | `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args)) | 286 | `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args)) |
| 284 | 287 | ||
| 285 | (defsubst vc-parse-buffer (pattern i) | 288 | (defsubst vc-parse-buffer (pattern i) |
| @@ -873,13 +876,9 @@ Used in `find-file-not-found-functions'." | |||
| 873 | (if backend (vc-call-backend backend 'find-file-not-found-hook)))) | 876 | (if backend (vc-call-backend backend 'find-file-not-found-hook)))) |
| 874 | 877 | ||
| 875 | (defun vc-default-find-file-not-found-hook (backend) | 878 | (defun vc-default-find-file-not-found-hook (backend) |
| 876 | (if (yes-or-no-p | 879 | ;; This used to do what vc-rcs-find-file-not-found-hook does, but it only |
| 877 | (format "File %s was lost; check out from version control? " | 880 | ;; really makes sense for RCS. For other backends, better not do anything. |
| 878 | (file-name-nondirectory buffer-file-name))) | 881 | nil) |
| 879 | (save-excursion | ||
| 880 | (require 'vc) | ||
| 881 | (setq default-directory (file-name-directory buffer-file-name)) | ||
| 882 | (not (vc-error-occurred (vc-checkout buffer-file-name)))))) | ||
| 883 | 882 | ||
| 884 | (add-hook 'find-file-not-found-functions 'vc-file-not-found-hook) | 883 | (add-hook 'find-file-not-found-functions 'vc-file-not-found-hook) |
| 885 | 884 | ||
diff --git a/lisp/vc-rcs.el b/lisp/vc-rcs.el index dcd3adcd8c9..1cda8849219 100644 --- a/lisp/vc-rcs.el +++ b/lisp/vc-rcs.el | |||
| @@ -234,6 +234,14 @@ When VERSION is given, perform check for that version." | |||
| 234 | ;; The workfile is unchanged if rcsdiff found no differences. | 234 | ;; The workfile is unchanged if rcsdiff found no differences. |
| 235 | (zerop status))) | 235 | (zerop status))) |
| 236 | 236 | ||
| 237 | (defun vc-rcs-find-file-not-found-hook () | ||
| 238 | (if (yes-or-no-p | ||
| 239 | (format "File %s was lost; check out from version control? " | ||
| 240 | (file-name-nondirectory buffer-file-name))) | ||
| 241 | (save-excursion | ||
| 242 | (require 'vc) | ||
| 243 | (let ((default-directory (file-name-directory buffer-file-name))) | ||
| 244 | (not (vc-error-occurred (vc-checkout buffer-file-name))))))) | ||
| 237 | 245 | ||
| 238 | ;;; | 246 | ;;; |
| 239 | ;;; State-changing functions | 247 | ;;; State-changing functions |
diff --git a/lisp/vc.el b/lisp/vc.el index 78e098d874f..3fc3784fdf1 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -1145,7 +1145,7 @@ Used by `vc-restore-buffer-context' to later restore the context." | |||
| 1145 | ;; ;; We may want to reparse the compilation buffer after revert | 1145 | ;; ;; We may want to reparse the compilation buffer after revert |
| 1146 | ;; (reparse (and (boundp 'compilation-error-list) ;compile loaded | 1146 | ;; (reparse (and (boundp 'compilation-error-list) ;compile loaded |
| 1147 | ;; ;; Construct a list; each elt is nil or a buffer | 1147 | ;; ;; Construct a list; each elt is nil or a buffer |
| 1148 | ;; ;; iff that buffer is a compilation output buffer | 1148 | ;; ;; if that buffer is a compilation output buffer |
| 1149 | ;; ;; that contains markers into the current buffer. | 1149 | ;; ;; that contains markers into the current buffer. |
| 1150 | ;; (save-current-buffer | 1150 | ;; (save-current-buffer |
| 1151 | ;; (mapcar (lambda (buffer) | 1151 | ;; (mapcar (lambda (buffer) |
| @@ -2636,6 +2636,9 @@ changes found in the master file; use \\[universal-argument] \\[vc-next-action] | |||
| 2636 | (message "Reverting %s...done" file))) | 2636 | (message "Reverting %s...done" file))) |
| 2637 | 2637 | ||
| 2638 | ;;;###autoload | 2638 | ;;;###autoload |
| 2639 | (define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1") | ||
| 2640 | |||
| 2641 | ;;;###autoload | ||
| 2639 | (defun vc-update () | 2642 | (defun vc-update () |
| 2640 | "Update the current buffer's file to the latest version on its branch. | 2643 | "Update the current buffer's file to the latest version on its branch. |
| 2641 | If the file contains no changes, and is not locked, then this simply replaces | 2644 | If the file contains no changes, and is not locked, then this simply replaces |
| @@ -2718,8 +2721,9 @@ return its name; otherwise return nil." | |||
| 2718 | (vc-resynch-buffer file t t)) | 2721 | (vc-resynch-buffer file t t)) |
| 2719 | 2722 | ||
| 2720 | ;;;###autoload | 2723 | ;;;###autoload |
| 2721 | (defun vc-rollback () | 2724 | (defun vc-rollback (&optional norevert) |
| 2722 | "Get rid of most recently checked in version of this file." | 2725 | "Get rid of most recently checked in version of this file. |
| 2726 | A prefix argument NOREVERT means do not revert the buffer afterwards." | ||
| 2723 | (interactive "P") | 2727 | (interactive "P") |
| 2724 | (vc-ensure-vc-buffer) | 2728 | (vc-ensure-vc-buffer) |
| 2725 | (let* ((file buffer-file-name) | 2729 | (let* ((file buffer-file-name) |
| @@ -3268,12 +3272,19 @@ colors. `vc-annotate-background' specifies the background color." | |||
| 3268 | (set (make-local-variable 'vc-annotate-parent-display-mode) | 3272 | (set (make-local-variable 'vc-annotate-parent-display-mode) |
| 3269 | display-mode))) | 3273 | display-mode))) |
| 3270 | 3274 | ||
| 3271 | (vc-exec-after | 3275 | (with-current-buffer temp-buffer-name |
| 3272 | `(progn | 3276 | (vc-exec-after |
| 3273 | (when ,current-line | 3277 | `(progn |
| 3274 | (goto-line ,current-line ,temp-buffer-name)) | 3278 | ;; Ideally, we'd rather not move point if the user has already |
| 3275 | (unless (active-minibuffer-window) | 3279 | ;; moved it elsewhere, but really point here is not the position |
| 3276 | (message "Annotating... done")))))) | 3280 | ;; of the user's cursor :-( |
| 3281 | (when ,current-line ;(and (bobp)) | ||
| 3282 | (let ((win (get-buffer-window (current-buffer) 0))) | ||
| 3283 | (when win | ||
| 3284 | (with-selected-window win | ||
| 3285 | (goto-line ,current-line))))) | ||
| 3286 | (unless (active-minibuffer-window) | ||
| 3287 | (message "Annotating... done"))))))) | ||
| 3277 | 3288 | ||
| 3278 | (defun vc-annotate-prev-version (prefix) | 3289 | (defun vc-annotate-prev-version (prefix) |
| 3279 | "Visit the annotation of the version previous to this one. | 3290 | "Visit the annotation of the version previous to this one. |
diff --git a/lisp/view.el b/lisp/view.el index 2f541fbf360..f6722f53756 100644 --- a/lisp/view.el +++ b/lisp/view.el | |||
| @@ -375,7 +375,8 @@ Use this argument instead of explicitly setting `view-exit-action'." | |||
| 375 | ;; bindings instead of using the \\[] construction. The reason for this | 375 | ;; bindings instead of using the \\[] construction. The reason for this |
| 376 | ;; is that most commands have more than one key binding. | 376 | ;; is that most commands have more than one key binding. |
| 377 | "Toggle View mode, a minor mode for viewing text but not editing it. | 377 | "Toggle View mode, a minor mode for viewing text but not editing it. |
| 378 | With ARG, turn View mode on iff ARG is positive. | 378 | With prefix argument ARG, turn View mode on if ARG is positive, otherwise |
| 379 | turn it off. | ||
| 379 | 380 | ||
| 380 | Emacs commands that do not change the buffer contents are available as usual. | 381 | Emacs commands that do not change the buffer contents are available as usual. |
| 381 | Kill commands insert text in kill buffers but do not delete. Other commands | 382 | Kill commands insert text in kill buffers but do not delete. Other commands |
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index c38b6563592..3ea8394b0b7 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -763,7 +763,7 @@ If timer is not set, then set it to scan the files in | |||
| 763 | ;;;###autoload | 763 | ;;;###autoload |
| 764 | (define-minor-mode whitespace-global-mode | 764 | (define-minor-mode whitespace-global-mode |
| 765 | "Toggle using Whitespace mode in new buffers. | 765 | "Toggle using Whitespace mode in new buffers. |
| 766 | With ARG, turn the mode on iff ARG is positive. | 766 | With ARG, turn the mode on if ARG is positive, otherwise turn it off. |
| 767 | 767 | ||
| 768 | When this mode is active, `whitespace-buffer' is added to | 768 | When this mode is active, `whitespace-buffer' is added to |
| 769 | `find-file-hook' and `kill-buffer-hook'." | 769 | `find-file-hook' and `kill-buffer-hook'." |
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 5e5dbd48ad6..72cff55805b 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -483,7 +483,7 @@ new value.") | |||
| 483 | 483 | ||
| 484 | ;;;###autoload | 484 | ;;;###autoload |
| 485 | (defun widgetp (widget) | 485 | (defun widgetp (widget) |
| 486 | "Return non-nil iff WIDGET is a widget." | 486 | "Return non-nil if WIDGET is a widget." |
| 487 | (if (symbolp widget) | 487 | (if (symbolp widget) |
| 488 | (get widget 'widget-type) | 488 | (get widget 'widget-type) |
| 489 | (and (consp widget) | 489 | (and (consp widget) |
| @@ -500,7 +500,7 @@ Otherwise, just return the value." | |||
| 500 | value))) | 500 | value))) |
| 501 | 501 | ||
| 502 | (defun widget-member (widget property) | 502 | (defun widget-member (widget property) |
| 503 | "Non-nil iff there is a definition in WIDGET for PROPERTY." | 503 | "Non-nil if there is a definition in WIDGET for PROPERTY." |
| 504 | (cond ((plist-member (cdr widget) property) | 504 | (cond ((plist-member (cdr widget) property) |
| 505 | t) | 505 | t) |
| 506 | ((car widget) | 506 | ((car widget) |
| @@ -1606,7 +1606,7 @@ If that does not exists, call the value of `widget-complete-field'." | |||
| 1606 | (widget-princ-to-string (widget-get widget :value)))) | 1606 | (widget-princ-to-string (widget-get widget :value)))) |
| 1607 | 1607 | ||
| 1608 | (defun widget-default-active (widget) | 1608 | (defun widget-default-active (widget) |
| 1609 | "Return t iff this widget active (user modifiable)." | 1609 | "Return t if this widget is active (user modifiable)." |
| 1610 | (or (widget-get widget :always-active) | 1610 | (or (widget-get widget :always-active) |
| 1611 | (and (not (widget-get widget :inactive)) | 1611 | (and (not (widget-get widget :inactive)) |
| 1612 | (let ((parent (widget-get widget :parent))) | 1612 | (let ((parent (widget-get widget :parent))) |
diff --git a/lisp/window.el b/lisp/window.el index f0a30d811ab..26d1bdc9d3f 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -120,7 +120,7 @@ bars (top, bottom, or nil)." | |||
| 120 | PROC is called with a window as argument. | 120 | PROC is called with a window as argument. |
| 121 | 121 | ||
| 122 | Optional second arg MINIBUF t means count the minibuffer window even | 122 | Optional second arg MINIBUF t means count the minibuffer window even |
| 123 | if not active. MINIBUF nil or omitted means count the minibuffer iff | 123 | if not active. MINIBUF nil or omitted means count the minibuffer only if |
| 124 | it is active. MINIBUF neither t nor nil means not to count the | 124 | it is active. MINIBUF neither t nor nil means not to count the |
| 125 | minibuffer even if it is active. | 125 | minibuffer even if it is active. |
| 126 | 126 | ||
| @@ -165,7 +165,7 @@ value is returned. If no window satisfies PREDICATE, DEFAULT is | |||
| 165 | returned. | 165 | returned. |
| 166 | 166 | ||
| 167 | Optional second arg MINIBUF t means count the minibuffer window even | 167 | Optional second arg MINIBUF t means count the minibuffer window even |
| 168 | if not active. MINIBUF nil or omitted means count the minibuffer iff | 168 | if not active. MINIBUF nil or omitted means count the minibuffer only if |
| 169 | it is active. MINIBUF neither t nor nil means not to count the | 169 | it is active. MINIBUF neither t nor nil means not to count the |
| 170 | minibuffer even if it is active. | 170 | minibuffer even if it is active. |
| 171 | 171 | ||
| @@ -927,7 +927,7 @@ means suspend autoselection." | |||
| 927 | (defun mouse-autoselect-window-select () | 927 | (defun mouse-autoselect-window-select () |
| 928 | "Select window with delayed window autoselection. | 928 | "Select window with delayed window autoselection. |
| 929 | If the mouse position has stabilized in a non-selected window, select | 929 | If the mouse position has stabilized in a non-selected window, select |
| 930 | that window. The minibuffer window is selected iff the minibuffer is | 930 | that window. The minibuffer window is selected only if the minibuffer is |
| 931 | active. This function is run by `mouse-autoselect-window-timer'." | 931 | active. This function is run by `mouse-autoselect-window-timer'." |
| 932 | (condition-case nil | 932 | (condition-case nil |
| 933 | (let* ((mouse-position (mouse-position)) | 933 | (let* ((mouse-position (mouse-position)) |
| @@ -952,14 +952,14 @@ active. This function is run by `mouse-autoselect-window-timer'." | |||
| 952 | ;; If `mouse-autoselect-window' is positive, select | 952 | ;; If `mouse-autoselect-window' is positive, select |
| 953 | ;; window if the window is the same as before. | 953 | ;; window if the window is the same as before. |
| 954 | (eq window mouse-autoselect-window-window)) | 954 | (eq window mouse-autoselect-window-window)) |
| 955 | ;; Otherwise select window iff the mouse is at the same | 955 | ;; Otherwise select window if the mouse is at the same |
| 956 | ;; position as before. Observe that the first test after | 956 | ;; position as before. Observe that the first test after |
| 957 | ;; starting autoselection usually fails since the value of | 957 | ;; starting autoselection usually fails since the value of |
| 958 | ;; `mouse-autoselect-window-position' recorded there is the | 958 | ;; `mouse-autoselect-window-position' recorded there is the |
| 959 | ;; position where the mouse has entered the new window and | 959 | ;; position where the mouse has entered the new window and |
| 960 | ;; not necessarily where the mouse has stopped moving. | 960 | ;; not necessarily where the mouse has stopped moving. |
| 961 | (equal mouse-position mouse-autoselect-window-position)) | 961 | (equal mouse-position mouse-autoselect-window-position)) |
| 962 | ;; The minibuffer is a candidate window iff it's active. | 962 | ;; The minibuffer is a candidate window if it's active. |
| 963 | (or (not (window-minibuffer-p window)) | 963 | (or (not (window-minibuffer-p window)) |
| 964 | (eq window (active-minibuffer-window)))) | 964 | (eq window (active-minibuffer-window)))) |
| 965 | ;; Mouse position has stabilized in non-selected window: Cancel | 965 | ;; Mouse position has stabilized in non-selected window: Cancel |
diff --git a/lisp/winner.el b/lisp/winner.el index bc7503b963c..ed840d37622 100644 --- a/lisp/winner.el +++ b/lisp/winner.el | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | 5 | ||
| 6 | ;; Author: Ivar Rummelhoff <ivarru@math.uio.no> | 6 | ;; Author: Ivar Rummelhoff <ivarru@math.uio.no> |
| 7 | ;; Created: 27 Feb 1997 | 7 | ;; Created: 27 Feb 1997 |
| 8 | ;; Time-stamp: <2006-02-06 15:13:57 ttn> | ||
| 9 | ;; Keywords: convenience frames | 8 | ;; Keywords: convenience frames |
| 10 | 9 | ||
| 11 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| @@ -286,7 +285,7 @@ You may want to include buffer names such as *Help*, *Apropos*, | |||
| 286 | 285 | ||
| 287 | (defun winner-get-point (buf win) | 286 | (defun winner-get-point (buf win) |
| 288 | ;; Consult (and possibly extend) `winner-point-alist'. | 287 | ;; Consult (and possibly extend) `winner-point-alist'. |
| 289 | ;; Returns nil iff buf no longer exists. | 288 | ;; Returns nil if buf no longer exists. |
| 290 | (when (buffer-name buf) | 289 | (when (buffer-name buf) |
| 291 | (let ((entry (assq buf winner-point-alist))) | 290 | (let ((entry (assq buf winner-point-alist))) |
| 292 | (cond | 291 | (cond |
| @@ -306,7 +305,7 @@ You may want to include buffer names such as *Help*, *Apropos*, | |||
| 306 | 305 | ||
| 307 | ;; Make sure point does not end up in the minibuffer and delete | 306 | ;; Make sure point does not end up in the minibuffer and delete |
| 308 | ;; windows displaying dead or boring buffers | 307 | ;; windows displaying dead or boring buffers |
| 309 | ;; (c.f. `winner-boring-buffers'). Return nil iff all the windows | 308 | ;; (c.f. `winner-boring-buffers'). Return nil if all the windows |
| 310 | ;; should be deleted. Preserve correct points and marks. | 309 | ;; should be deleted. Preserve correct points and marks. |
| 311 | (defun winner-set (conf) | 310 | (defun winner-set (conf) |
| 312 | ;; For the format of `conf', see `winner-conf'. | 311 | ;; For the format of `conf', see `winner-conf'. |
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index bf4eeab2259..8ce93e2293e 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el | |||
| @@ -190,7 +190,8 @@ | |||
| 190 | ;;;###autoload | 190 | ;;;###autoload |
| 191 | (define-minor-mode xterm-mouse-mode | 191 | (define-minor-mode xterm-mouse-mode |
| 192 | "Toggle XTerm mouse mode. | 192 | "Toggle XTerm mouse mode. |
| 193 | With prefix arg, turn XTerm mouse mode on iff arg is positive. | 193 | With prefix arg, turn XTerm mouse mode on if arg is positive, otherwise turn |
| 194 | it off. | ||
| 194 | 195 | ||
| 195 | Turn it on to use Emacs mouse commands, and off to use xterm mouse commands. | 196 | Turn it on to use Emacs mouse commands, and off to use xterm mouse commands. |
| 196 | This works in terminal emulators compatible with xterm. It only | 197 | This works in terminal emulators compatible with xterm. It only |