aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2004-09-29 08:38:15 +0000
committerKaroly Lorentey2004-09-29 08:38:15 +0000
commit181bb49001b52ee593c852377951f8f7b3cf4f38 (patch)
treef4413632929b45d3936621a7c65d7fc6eee16fd6 /lisp
parentd73d547a20c1a36612dc637d860113551d4ddc6a (diff)
parentc1d7d28589c020b2b72d795638e100eda852d6aa (diff)
downloademacs-181bb49001b52ee593c852377951f8f7b3cf4f38.tar.gz
emacs-181bb49001b52ee593c852377951f8f7b3cf4f38.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-567 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-568 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-569 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-570 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-571 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-572 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-573 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-574 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-575 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-576 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-577 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-578 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-579 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-580 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-31 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-32 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-33 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-34 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-35 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-36 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-37 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-251
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog114
-rw-r--r--lisp/calendar/diary-lib.el227
-rw-r--r--lisp/dired.el134
-rw-r--r--lisp/files.el3
-rw-r--r--lisp/fringe.el46
-rw-r--r--lisp/gnus/ChangeLog74
-rw-r--r--lisp/gnus/flow-fill.el2
-rw-r--r--lisp/gnus/gnus-art.el2
-rw-r--r--lisp/gnus/gnus-cache.el5
-rw-r--r--lisp/gnus/gnus-diary.el2
-rw-r--r--lisp/gnus/gnus-fun.el7
-rw-r--r--lisp/gnus/gnus-msg.el20
-rw-r--r--lisp/gnus/gnus-picon.el3
-rw-r--r--lisp/gnus/gnus.el39
-rw-r--r--lisp/gnus/html2text.el5
-rw-r--r--lisp/gnus/message.el2
-rw-r--r--lisp/gnus/mm-bodies.el11
-rw-r--r--lisp/gnus/mm-decode.el8
-rw-r--r--lisp/gnus/mm-util.el17
-rw-r--r--lisp/gnus/mml-sec.el2
-rw-r--r--lisp/gnus/mml-smime.el3
-rw-r--r--lisp/gnus/mml.el3
-rw-r--r--lisp/gnus/nnfolder.el2
-rw-r--r--lisp/gnus/nnheader.el4
-rw-r--r--lisp/gnus/nnml.el2
-rw-r--r--lisp/gnus/rfc2047.el35
-rw-r--r--lisp/gnus/spam.el6
-rw-r--r--lisp/ido.el118
-rw-r--r--lisp/ls-lisp.el2
-rw-r--r--lisp/printing.el26
-rw-r--r--lisp/progmodes/gdb-ui.el16
-rw-r--r--lisp/subr.el2
-rw-r--r--lisp/term.el167
-rw-r--r--lisp/textmodes/enriched.el22
34 files changed, 785 insertions, 346 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0842def464e..187fc607c27 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,4 +1,116 @@
12004-09-23 H,Ae(Bkon Malmedal <hmalmedal@yahoo.no> 12004-09-28 Stefan <monnier@iro.umontreal.ca>
2
3 * dired.el (dired-view-command-alist): Use more efficient regexps.
4 Remove dubious arguments.
5 (dired-align-file): New function.
6 (dired-insert-directory): Use it.
7 (dired-move-to-end-of-filename): Make the " -> " search more specific.
8 (dired-buffers-for-dir): Remove unused var `pattern'.
9
102004-09-29 Kim F. Storm <storm@cua.dk>
11
12 * progmodes/gdb-ui.el (breakpoint): Define as fringe bitmap.
13 (gdb-mouse-toggle-breakpoint): Fix fringe-bitmaps-at-pos usage.
14 (gdb-put-breakpoint-icon): Use breakpoint bitmap.
15
16 * fringe.el (fringe-bitmap-p): New macro.
17 (fringe-bitmaps): Add standard fringe bitmaps on load.
18
192004-09-28 Matthew Mundell <matt@mundell.ukfsn.org> (tiny change)
20
21 * calendar/diary-lib.el (list-diary-entries): Save diary buffer
22 from diary display excursion. Store diary buffer's point for
23 `simple-diary-display'.
24 (simple-diary-display): Set window point and start when
25 displaying buffer, to preserve point.
26
272004-09-27 Luc Teirlinck <teirllm@auburn.edu>
28
29 * textmodes/enriched.el (enriched-translations): Replace defconst
30 with defvar.
31
322004-09-26 Vinicius Jose Latorre <viniciusjl@ig.com.br>
33
34 * printing.el: Doc fix.
35 (pr-version): New version number (6.8.1).
36 (pr-ps-file-using-ghostscript): Use make-temp-file instead of
37 make-temp-name.
38 (pr-delete-file): Check if file exists before deleting it. Reported by
39 Lennart Borgman <lennart.borgman.073@student.lu.se>.
40
412004-09-26 Stefan <monnier@iro.umontreal.ca>
42
43 * term.el (term-display-table): New variable.
44 (term-mode): Use it.
45 (term-exec-1): Set the coding system to binary.
46 (term-emulate-terminal): Decode the string before inserting it.
47
482004-09-26 Dan Nicolaescu <dann@ics.uci.edu>
49
50 * term.el (term-ansi-at-eval-string, term-ansi-default-fg)
51 (term-ansi-default-bg, term-ansi-current-temp): Delete unused
52 vars.
53 (map): Bind S-prior, S-next and S-insert.
54 (term-mode): Set `indent-tabs-mode' to nil.
55 (term-paste): New function to be bound to S-insert.
56 (term-send-del, term-send-backspace): Change the strings sent.
57 (term-termcap-format): Synchronyze with etc/e/eterm.ti.
58 (term-handle-colors-array): Fix handling of underline and reverse.
59 (term-handle-ansi-escape): Do not handle smcup/rmcup. Add
60 comments.
61 (term-erase-in-line): Fix comparison.
62 (term-emulate-terminal): Fix line wrap handling.
63 (term-start-output-log): Renamed from `term-set-output-log'.
64 (term-stop-output-log): Renamed from `term-stop-photo'.
65 (term-switch-to-alternate-sub-buffer): Comment out, unused.
66
672004-09-25 Stefan <monnier@iro.umontreal.ca>
68
69 * dired.el (dired-move-to-filename): Don't output a message if
70 raise-error is non-nil. Fix return position and value.
71
72 * files.el (insert-directory): Obey --dired even with symlinks.
73
742004-09-25 Lars Hansen <larsh@math.ku.dk>
75
76 * ls-lisp.el (ls-lisp-format): Mark file names with property
77 dired-filename.
78
792004-09-25 Kim F. Storm <storm@cua.dk>
80
81 * ido.el (ido-max-directory-size): New defcustom.
82 (ido-decorations): Add "too big" element.
83 (ido-directory-too-big): New dynamic var.
84 (ido-may-cache-directory): Don't cache big directories.
85 (ido-directory-too-big-p): New defun.
86 (ido-set-current-directory): Update ido-directory-too-big.
87 (ido-read-internal): Make empty ido-cur-item if too-big.
88 (ido-buffer-internal): Use ido-read-internal directly instead of
89 ido-read-buffer.
90 (ido-file-internal): Init ido-directory-too-big.
91 (ido-complete): <TAB> If ido-directory-too-big is set, clear it,
92 and redo completion with full list.
93 (ido-toggle-ignore): <C-a> If ido-directory-too-big is set, clear
94 it, and show completions.
95 (ido-all-completions): Let bind ido-directory-too-big to nil.
96 (ido-exhibit): Handle ido-directory-too-big.
97 (ido-read-buffer): Handle fallback to read-buffer.
98 Init ido-directory-too-big.
99 (ido-read-file-name, ido-read-directory-name, ido-completing-read):
100 Init ido-directory-too-big.
101
1022004-09-24 Luc Teirlinck <teirllm@auburn.edu>
103
104 * subr.el (delay-mode-hooks): Doc fix.
105
1062004-09-23 Luc Teirlinck <teirllm@auburn.edu>
107
108 * textmodes/enriched.el
109 (enriched-default-text-properties-local-flag): New variable.
110 (enriched-mode): Make sure that enabling and disabling the mode is
111 a no-op. Doc fix.
112
1132004-09-23 H,Ae(Bkon Malmedal <hmalmedal@yahoo.no> (tiny change)
2 114
3 * calendar/holidays.el (holiday-advent): Report on a specified day 115 * calendar/holidays.el (holiday-advent): Report on a specified day
4 offset from advent, not just advent. 116 offset from advent, not just advent.
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 45bb3c0e4c0..945119f06df 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -4,6 +4,7 @@
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <gmorris@ast.cam.ac.uk>
7;; Keywords: calendar 8;; Keywords: calendar
8 9
9;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -296,6 +297,8 @@ Only used if `diary-header-line-flag' is non-nil."
296 :type 'sexp 297 :type 'sexp
297 :version "21.4") 298 :version "21.4")
298 299
300(defvar diary-saved-point) ; internal
301
299(defun list-diary-entries (date number) 302(defun list-diary-entries (date number)
300 "Create and display a buffer containing the relevant lines in diary-file. 303 "Create and display a buffer containing the relevant lines in diary-file.
301The arguments are DATE and NUMBER; the entries selected are those 304The arguments are DATE and NUMBER; the entries selected are those
@@ -345,112 +348,116 @@ These hooks have the following distinct roles:
345 (set-buffer diary-buffer) 348 (set-buffer diary-buffer)
346 (or (verify-visited-file-modtime diary-buffer) 349 (or (verify-visited-file-modtime diary-buffer)
347 (revert-buffer t t)))) 350 (revert-buffer t t))))
348 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil ""))) 351 ;; d-s-p is passed to the diary display function.
349 (setq selective-display t) 352 (let ((diary-saved-point (point)))
350 (setq selective-display-ellipses nil) 353 (save-excursion
351 (if diary-header-line-flag 354 (setq file-glob-attrs (nth 1 (diary-pull-attrs nil "")))
352 (setq header-line-format diary-header-line-format)) 355 (setq selective-display t)
353 (setq old-diary-syntax-table (syntax-table)) 356 (setq selective-display-ellipses nil)
354 (set-syntax-table diary-syntax-table) 357 (if diary-header-line-flag
355 (unwind-protect 358 (setq header-line-format diary-header-line-format))
356 (let ((buffer-read-only nil) 359 (setq old-diary-syntax-table (syntax-table))
357 (diary-modified (buffer-modified-p)) 360 (set-syntax-table diary-syntax-table)
358 (mark (regexp-quote diary-nonmarking-symbol))) 361 (unwind-protect
359 ;; First and last characters must be ^M or \n for 362 (let ((buffer-read-only nil)
360 ;; selective display to work properly 363 (diary-modified (buffer-modified-p))
361 (goto-char (1- (point-max))) 364 (mark (regexp-quote diary-nonmarking-symbol)))
362 (if (not (looking-at "\^M\\|\n")) 365 ;; First and last characters must be ^M or \n for
363 (progn 366 ;; selective display to work properly
364 (goto-char (point-max)) 367 (goto-char (1- (point-max)))
365 (insert "\^M"))) 368 (if (not (looking-at "\^M\\|\n"))
366 (goto-char (point-min)) 369 (progn
367 (if (not (looking-at "\^M\\|\n")) 370 (goto-char (point-max))
368 (insert "\^M")) 371 (insert "\^M")))
369 (subst-char-in-region (point-min) (point-max) ?\n ?\^M t) 372 (goto-char (point-min))
370 (calendar-for-loop i from 1 to number do 373 (if (not (looking-at "\^M\\|\n"))
371 (let ((d diary-date-forms) 374 (insert "\^M"))
372 (month (extract-calendar-month date)) 375 (subst-char-in-region (point-min) (point-max) ?\n ?\^M t)
373 (day (extract-calendar-day date)) 376 (calendar-for-loop
374 (year (extract-calendar-year date)) 377 i from 1 to number do
375 (entry-found (list-sexp-diary-entries date))) 378 (let ((d diary-date-forms)
376 (while d 379 (month (extract-calendar-month date))
377 (let* 380 (day (extract-calendar-day date))
378 ((date-form (if (equal (car (car d)) 'backup) 381 (year (extract-calendar-year date))
379 (cdr (car d)) 382 (entry-found (list-sexp-diary-entries date)))
380 (car d))) 383 (while d
381 (backup (equal (car (car d)) 'backup)) 384 (let*
382 (dayname 385 ((date-form (if (equal (car (car d)) 'backup)
383 (format "%s\\|%s\\.?" 386 (cdr (car d))
384 (calendar-day-name date) 387 (car d)))
385 (calendar-day-name date 'abbrev))) 388 (backup (equal (car (car d)) 'backup))
386 (monthname 389 (dayname
387 (format "\\*\\|%s\\|%s\\.?" 390 (format "%s\\|%s\\.?"
388 (calendar-month-name month) 391 (calendar-day-name date)
389 (calendar-month-name month 'abbrev))) 392 (calendar-day-name date 'abbrev)))
390 (month (concat "\\*\\|0*" (int-to-string month))) 393 (monthname
391 (day (concat "\\*\\|0*" (int-to-string day))) 394 (format "\\*\\|%s\\|%s\\.?"
392 (year 395 (calendar-month-name month)
393 (concat 396 (calendar-month-name month 'abbrev)))
394 "\\*\\|0*" (int-to-string year) 397 (month (concat "\\*\\|0*" (int-to-string month)))
395 (if abbreviated-calendar-year 398 (day (concat "\\*\\|0*" (int-to-string day)))
396 (concat "\\|" (format "%02d" (% year 100))) 399 (year
397 ""))) 400 (concat
398 (regexp 401 "\\*\\|0*" (int-to-string year)
399 (concat 402 (if abbreviated-calendar-year
400 "\\(\\`\\|\^M\\|\n\\)" mark "?\\(" 403 (concat "\\|" (format "%02d" (% year 100)))
401 (mapconcat 'eval date-form "\\)\\(") 404 "")))
402 "\\)")) 405 (regexp
403 (case-fold-search t)) 406 (concat
404 (goto-char (point-min)) 407 "\\(\\`\\|\^M\\|\n\\)" mark "?\\("
405 (while (re-search-forward regexp nil t) 408 (mapconcat 'eval date-form "\\)\\(")
406 (if backup (re-search-backward "\\<" nil t)) 409 "\\)"))
407 (if (and (or (char-equal (preceding-char) ?\^M) 410 (case-fold-search t))
408 (char-equal (preceding-char) ?\n)) 411 (goto-char (point-min))
409 (not (looking-at " \\|\^I"))) 412 (while (re-search-forward regexp nil t)
410 ;; Diary entry that consists only of date. 413 (if backup (re-search-backward "\\<" nil t))
411 (backward-char 1) 414 (if (and (or (char-equal (preceding-char) ?\^M)
412 ;; Found a nonempty diary entry--make it visible and 415 (char-equal (preceding-char) ?\n))
413 ;; add it to the list. 416 (not (looking-at " \\|\^I")))
414 (setq entry-found t) 417 ;; Diary entry that consists only of date.
415 (let ((entry-start (point)) 418 (backward-char 1)
416 date-start temp) 419 ;; Found a nonempty diary entry--make it
417 (re-search-backward "\^M\\|\n\\|\\`") 420 ;; visible and add it to the list.
418 (setq date-start (point)) 421 (setq entry-found t)
419 (re-search-forward "\^M\\|\n" nil t 2) 422 (let ((entry-start (point))
420 (while (looking-at " \\|\^I") 423 date-start temp)
421 (re-search-forward "\^M\\|\n" nil t)) 424 (re-search-backward "\^M\\|\n\\|\\`")
422 (backward-char 1) 425 (setq date-start (point))
423 (subst-char-in-region date-start 426 (re-search-forward "\^M\\|\n" nil t 2)
424 (point) ?\^M ?\n t) 427 (while (looking-at " \\|\^I")
425 (setq entry (buffer-substring entry-start (point)) 428 (re-search-forward "\^M\\|\n" nil t))
426 temp (diary-pull-attrs entry file-glob-attrs) 429 (backward-char 1)
427 entry (nth 0 temp)) 430 (subst-char-in-region date-start
428 (add-to-diary-list 431 (point) ?\^M ?\n t)
429 date 432 (setq entry (buffer-substring entry-start (point))
430 entry 433 temp (diary-pull-attrs entry file-glob-attrs)
431 (buffer-substring 434 entry (nth 0 temp))
432 (1+ date-start) (1- entry-start)) 435 (add-to-diary-list
433 (copy-marker entry-start) (nth 1 temp)))))) 436 date
434 (setq d (cdr d))) 437 entry
435 (or entry-found 438 (buffer-substring
436 (not diary-list-include-blanks) 439 (1+ date-start) (1- entry-start))
437 (setq diary-entries-list 440 (copy-marker entry-start) (nth 1 temp))))))
438 (append diary-entries-list 441 (setq d (cdr d)))
439 (list (list date "" "" "" ""))))) 442 (or entry-found
440 (setq date 443 (not diary-list-include-blanks)
441 (calendar-gregorian-from-absolute 444 (setq diary-entries-list
442 (1+ (calendar-absolute-from-gregorian date)))) 445 (append diary-entries-list
443 (setq entry-found nil))) 446 (list (list date "" "" "" "")))))
444 (set-buffer-modified-p diary-modified)) 447 (setq date
445 (set-syntax-table old-diary-syntax-table)) 448 (calendar-gregorian-from-absolute
446 (goto-char (point-min)) 449 (1+ (calendar-absolute-from-gregorian date))))
447 (run-hooks 'nongregorian-diary-listing-hook 450 (setq entry-found nil)))
448 'list-diary-entries-hook) 451 (set-buffer-modified-p diary-modified))
449 (if diary-display-hook 452 (set-syntax-table old-diary-syntax-table))
450 (run-hooks 'diary-display-hook) 453 (goto-char (point-min))
451 (simple-diary-display)) 454 (run-hooks 'nongregorian-diary-listing-hook
452 (run-hooks 'diary-hook) 455 'list-diary-entries-hook)
453 diary-entries-list)))) 456 (if diary-display-hook
457 (run-hooks 'diary-display-hook)
458 (simple-diary-display))
459 (run-hooks 'diary-hook)
460 diary-entries-list))))))
454 461
455(defun include-other-diary-files () 462(defun include-other-diary-files ()
456 "Include the diary entries from other diary files with those of diary-file. 463 "Include the diary entries from other diary files with those of diary-file.
@@ -528,8 +535,12 @@ changing the variable `diary-include-string'."
528 (setq buffer-read-only t) 535 (setq buffer-read-only t)
529 (display-buffer holiday-buffer) 536 (display-buffer holiday-buffer)
530 (message "No diary entries for %s" date-string)) 537 (message "No diary entries for %s" date-string))
531 (display-buffer (find-buffer-visiting 538 (with-current-buffer
532 (substitute-in-file-name diary-file))) 539 (find-buffer-visiting (substitute-in-file-name diary-file))
540 (let ((window (display-buffer (current-buffer))))
541 ;; d-s-p is passed from list-diary-entries.
542 (set-window-point window diary-saved-point)
543 (set-window-start window (point-min))))
533 (message "Preparing diary...done")))) 544 (message "Preparing diary...done"))))
534 545
535(defface diary-button-face '((((type pc) (class color)) 546(defface diary-button-face '((((type pc) (class color))
diff --git a/lisp/dired.el b/lisp/dired.el
index 43eec9408d4..96b2905337e 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -202,10 +202,11 @@ with the buffer narrowed to the listing."
202 202
203;; Fixme: This should use mailcap. 203;; Fixme: This should use mailcap.
204(defcustom dired-view-command-alist 204(defcustom dired-view-command-alist
205 '(("[.]\\(ps\\|ps_pages\\|eps\\)\\'" . "gv -spartan -color -watch %s") 205 '(("\\.\\(ps\\|ps_pages\\|eps\\)\\'" . "gv %s")
206 ("[.]pdf\\'" . "xpdf %s") 206 ("\\.pdf\\'" . "xpdf %s")
207 ("[.]\\(jpe?g\\|gif\\|png\\)\\'" . "eog %s") 207 ;; ("\\.pod\\'" . "perldoc %s")
208 ("[.]dvi\\'" . "xdvi -sidemargin 0.5 -topmargin 1 %s")) 208 ("\\.\\(jpe?g\\|gif\\|png\\)\\'" . "eog %s")
209 ("\\.dvi\\'" . "xdvi %s"))
209 "Alist specifying how to view special types of files. 210 "Alist specifying how to view special types of files.
210Each element has the form (REGEXP . SHELL-COMMAND). 211Each element has the form (REGEXP . SHELL-COMMAND).
211When the file name matches REGEXP, `dired-view-file' 212When the file name matches REGEXP, `dired-view-file'
@@ -797,6 +798,112 @@ wildcards, erases the buffer, and builds the subdir-alist anew
797 (dired-insert-directory dir dired-actual-switches 798 (dired-insert-directory dir dired-actual-switches
798 file-list (not file-list) t))))) 799 file-list (not file-list) t)))))
799 800
801(defun dired-align-file (beg end)
802 "Align the fields of a file to the ones of surrounding lines.
803BEG..END is the line where the file info is located."
804 ;; Some versions of ls try to adjust the size of each field so as to just
805 ;; hold the largest element ("largest" in the current invocation, of
806 ;; course). So when a single line is output, the size of each field is
807 ;; just big enough for that one output. Thus when dired refreshes one
808 ;; line, the alignment if this line w.r.t the rest is messed up because
809 ;; the fields of that one line will generally be smaller.
810 ;;
811 ;; To work around this problem, we here add spaces to try and re-align the
812 ;; fields as needed. Since this is purely aesthetic, it is of utmost
813 ;; importance that it doesn't mess up anything like
814 ;; `dired-move-to-filename'. To this end, we limit ourselves to adding
815 ;; spaces only, and to only add them at places where there was already at
816 ;; least one space. This way, as long as `dired-move-to-filename-regexp'
817 ;; always matches spaces with "*" or "+", we know we haven't made anything
818 ;; worse. There is one spot where the exact number of spaces is
819 ;; important, which is just before the actual filename, so we refrain from
820 ;; adding spaces there (and within the filename as well, of course).
821 (save-excursion
822 (let (file file-col other other-col)
823 ;; Check the there is indeed a file, and that there is anoter adjacent
824 ;; file with which to align, and that additional spaces are needed to
825 ;; align the filenames.
826 (when (and (setq file (progn (goto-char beg)
827 (dired-move-to-filename nil end)))
828 (setq file-col (current-column))
829 (setq other
830 (or (and (goto-char beg)
831 (zerop (forward-line -1))
832 (dired-move-to-filename))
833 (and (goto-char beg)
834 (zerop (forward-line 1))
835 (dired-move-to-filename))))
836 (setq other-col (current-column))
837 (/= file other)
838 ;; Make sure there is some work left to do.
839 (> other-col file-col))
840 ;; If we've only looked at the line above, check to see if the line
841 ;; below exists as well and if so, align with the shorter one.
842 (when (and (< other file)
843 (goto-char beg)
844 (zerop (forward-line 1))
845 (dired-move-to-filename))
846 (let ((alt-col (current-column)))
847 (when (< alt-col other-col)
848 (setq other-col alt-col)
849 (setq other (point)))))
850 ;; Keep positions uptodate when we insert stuff.
851 (if (> other file) (setq other (copy-marker other)))
852 (setq file (copy-marker file))
853 ;; Main loop.
854 (goto-char beg)
855 (while (and (> other-col file-col)
856 (skip-chars-forward "^ ")
857 ;; Skip the spaces, and make sure there's at least one.
858 (> (skip-chars-forward " ") 0)
859 ;; Don't touch anything just before (and after) the
860 ;; beginning of the filename.
861 (> file (point)))
862 ;; We're now just in front of a field, with a space behind us.
863 (let* ((curcol (current-column))
864 ;; Nums are right-aligned.
865 (num-align (looking-at "[0-9]"))
866 ;; Let's look at the other line, in the same column: we
867 ;; should be either near the end of the previous field, or
868 ;; in the space between that field and the next.
869 ;; [ Of course, it's also possible that we're already within
870 ;; the next field or even past it, but that's unlikely since
871 ;; other-col > file-col. ]
872 ;; Let's find the distance to the alignment-point (either
873 ;; the beginning or the end of the next field, depending on
874 ;; whether this field is left or right aligned).
875 (align-pt-offset
876 (save-excursion
877 (goto-char other)
878 (move-to-column curcol)
879 (when (looking-at
880 (concat
881 (if (eq (char-before) ?\ ) " *" "[^ ]* *")
882 (if num-align "[0-9][^ ]*")))
883 (- (match-end 0) (match-beginning 0)))))
884 ;; Now, the number of spaces to insert is align-pt-offset
885 ;; minus the distance to the equivalent point on the
886 ;; current line.
887 (spaces
888 (if (not num-align)
889 align-pt-offset
890 (and align-pt-offset
891 (save-excursion
892 (skip-chars-forward "^ ")
893 (- align-pt-offset (- (current-column) curcol)))))))
894 (when (and spaces (> spaces 0))
895 (setq file-col (+ spaces file-col))
896 (if (> file-col other-col)
897 (setq spaces (- spaces (- file-col other-col))))
898 (insert-char ?\s spaces)
899 ;; Let's just make really sure we did not mess up.
900 (unless (save-excursion
901 (equal (dired-move-to-filename) (marker-position file)))
902 ;; Damn! We messed up: let's revert the change.
903 (delete-char (- spaces))))))
904 (set-marker file nil)))))
905
906
800(defun dired-insert-directory (dir switches &optional file-list wildcard hdr) 907(defun dired-insert-directory (dir switches &optional file-list wildcard hdr)
801 "Insert a directory listing of DIR, Dired style. 908 "Insert a directory listing of DIR, Dired style.
802Use SWITCHES to make the listings. 909Use SWITCHES to make the listings.
@@ -815,7 +922,10 @@ If HDR is non-nil, insert a header line with the directory name."
815 ;; with the new value of dired-move-to-filename-regexp. 922 ;; with the new value of dired-move-to-filename-regexp.
816 (if file-list 923 (if file-list
817 (dolist (f file-list) 924 (dolist (f file-list)
818 (insert-directory f switches nil nil)) 925 (let ((beg (point)))
926 (insert-directory f switches nil nil)
927 ;; Re-align fields, if necessary.
928 (dired-align-file beg (point))))
819 (insert-directory dir switches wildcard (not wildcard))) 929 (insert-directory dir switches wildcard (not wildcard)))
820 ;; Quote certain characters, unless ls quoted them for us. 930 ;; Quote certain characters, unless ls quoted them for us.
821 (if (not (string-match "b" dired-actual-switches)) 931 (if (not (string-match "b" dired-actual-switches))
@@ -1762,6 +1872,8 @@ regardless of the language.")
1762;; Move to first char of filename on this line. 1872;; Move to first char of filename on this line.
1763;; Returns position (point) or nil if no filename on this line." 1873;; Returns position (point) or nil if no filename on this line."
1764(defun dired-move-to-filename (&optional raise-error eol) 1874(defun dired-move-to-filename (&optional raise-error eol)
1875 "Move to the beginning of the filename on the current line.
1876Return the position of the beginning of the filename, or nil if none found."
1765 ;; This is the UNIX version. 1877 ;; This is the UNIX version.
1766 (or eol (setq eol (line-end-position))) 1878 (or eol (setq eol (line-end-position)))
1767 (beginning-of-line) 1879 (beginning-of-line)
@@ -1774,8 +1886,10 @@ regardless of the language.")
1774 (goto-char (match-end 0))) 1886 (goto-char (match-end 0)))
1775 ((re-search-forward dired-permission-flags-regexp eol t) 1887 ((re-search-forward dired-permission-flags-regexp eol t)
1776 ;; Ha! There *is* a file. Our regexp-from-hell just failed to find it. 1888 ;; Ha! There *is* a file. Our regexp-from-hell just failed to find it.
1777 (funcall (if raise-error 'error 'message) 1889 (if raise-error
1778 "Unrecognized line! Check dired-move-to-filename-regexp")) 1890 (error "Unrecognized line! Check dired-move-to-filename-regexp"))
1891 (beginning-of-line)
1892 nil)
1779 (raise-error 1893 (raise-error
1780 (error "No file on this line"))))) 1894 (error "No file on this line")))))
1781 1895
@@ -1818,9 +1932,9 @@ regardless of the language.")
1818 (or no-error (error "No file on this line")))) 1932 (or no-error (error "No file on this line"))))
1819 ;; Move point to end of name: 1933 ;; Move point to end of name:
1820 (if symlink 1934 (if symlink
1821 (if (search-forward " ->" eol t) 1935 (if (search-forward " -> " eol t)
1822 (progn 1936 (progn
1823 (forward-char -3) 1937 (forward-char -4)
1824 (and used-F 1938 (and used-F
1825 dired-ls-F-marks-symlinks 1939 dired-ls-F-marks-symlinks
1826 (eq (preceding-char) ?@) ;; did ls really mark the link? 1940 (eq (preceding-char) ?@) ;; did ls really mark the link?
@@ -1885,7 +1999,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
1885;; As a side effect, killed dired buffers for DIR are removed from 1999;; As a side effect, killed dired buffers for DIR are removed from
1886;; dired-buffers. 2000;; dired-buffers.
1887 (setq dir (file-name-as-directory dir)) 2001 (setq dir (file-name-as-directory dir))
1888 (let ((alist dired-buffers) result elt buf pattern) 2002 (let ((alist dired-buffers) result elt buf)
1889 (while alist 2003 (while alist
1890 (setq elt (car alist) 2004 (setq elt (car alist)
1891 buf (cdr elt)) 2005 buf (cdr elt))
diff --git a/lisp/files.el b/lisp/files.el
index 40d434b2ecc..7c06316a487 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4376,7 +4376,8 @@ normally equivalent short `-D' option is just passed on to
4376 (while (< (point) end) 4376 (while (< (point) end)
4377 (let ((start (+ beg (read (current-buffer)))) 4377 (let ((start (+ beg (read (current-buffer))))
4378 (end (+ beg (read (current-buffer))))) 4378 (end (+ beg (read (current-buffer)))))
4379 (if (= (char-after end) ?\n) 4379 (if (memq (char-after end) '(?\n ?\ ))
4380 ;; End is followed by \n or by " -> ".
4380 (put-text-property start end 'dired-filename t) 4381 (put-text-property start end 'dired-filename t)
4381 ;; It seems that we can't trust ls's output as to 4382 ;; It seems that we can't trust ls's output as to
4382 ;; byte positions of filenames. 4383 ;; byte positions of filenames.
diff --git a/lisp/fringe.el b/lisp/fringe.el
index f52ecdf64d2..07c93d39f40 100644
--- a/lisp/fringe.el
+++ b/lisp/fringe.el
@@ -37,27 +37,29 @@
37 37
38;; Standard fringe bitmaps 38;; Standard fringe bitmaps
39 39
40(defconst no-fringe-bitmap 0) 40(defmacro fringe-bitmap-p (symbol)
41(defconst undef-fringe-bitmap 1) 41 "Return non-nil if SYMBOL is a fringe bitmap."
42(defconst left-truncation-fringe-bitmap 2) 42 `(get ,symbol 'fringe))
43(defconst right-truncation-fringe-bitmap 3) 43
44(defconst up-arrow-fringe-bitmap 4) 44(defvar fringe-bitmaps)
45(defconst down-arrow-fringe-bitmap 5) 45
46(defconst continued-line-fringe-bitmap 6) 46(unless (get 'left-truncation 'fringe)
47(defconst continuation-line-fringe-bitmap 7) 47 (let ((bitmaps '(left-truncation right-truncation
48(defconst overlay-arrow-fringe-bitmap 8) 48 up-arrow down-arrow
49(defconst top-left-angle-fringe-bitmap 9) 49 continued-line continuation-line
50(defconst top-right-angle-fringe-bitmap 10) 50 overlay-arrow
51(defconst bottom-left-angle-fringe-bitmap 11) 51 top-left-angle top-right-angle
52(defconst bottom-right-angle-fringe-bitmap 12) 52 bottom-left-angle bottom-right-angle
53(defconst left-bracket-fringe-bitmap 13) 53 left-bracket right-bracket
54(defconst right-bracket-fringe-bitmap 14) 54 filled-box-cursor hollow-box-cursor hollow-square
55(defconst filled-box-cursor-fringe-bitmap 15) 55 bar-cursor hbar-cursor
56(defconst hollow-box-cursor-fringe-bitmap 16) 56 empty-line))
57(defconst hollow-square-fringe-bitmap 17) 57 (bn 2))
58(defconst bar-cursor-fringe-bitmap 18) 58 (while bitmaps
59(defconst hbar-cursor-fringe-bitmap 19) 59 (push (car bitmaps) fringe-bitmaps)
60(defconst empty-line-fringe-bitmap 20) 60 (put (car bitmaps) 'fringe bn)
61 (setq bitmaps (cdr bitmaps)
62 bn (1+ bn)))))
61 63
62 64
63;; Control presence of fringes 65;; Control presence of fringes
@@ -228,7 +230,7 @@ SIDE must be the symbol `left' or `right'."
228 (window-fringes)) 230 (window-fringes))
229 0) 231 0)
230 (float (frame-char-width)))) 232 (float (frame-char-width))))
231 233
232(provide 'fringe) 234(provide 'fringe)
233 235
234;;; arch-tag: 6611ef60-0869-47ed-8b93-587ee7d3ff5d 236;;; arch-tag: 6611ef60-0869-47ed-8b93-587ee7d3ff5d
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 60ad776347c..3cdda661e86 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,77 @@
12004-09-28 Jesper Harder <harder@ifa.au.dk>
2
3 * gnus-picon.el: Require cl.
4
5 * mml-sec.el (mml-signencrypt-style): Don't depend on Gnus.
6
7 * mml-smime.el: Require cl. Autoload message-fetch-field.
8
9 * gnus-fun.el: Require gnus-ems and gnus-util.
10
11 * gnus-diary.el (gnus-diary-header-schedule): caddr -> car (cddr
12
13 * gnus-art.el (gnus-article-edit-mode): Define before first
14 reference.
15
16 * gnus.el (gnus-method-to-server): Move defsubst before first use.
17
18 * spam.el (spam-check-spamoracle, spam-spamoracle-learn): Fix
19 format string mismatch.
20 * nnml.el (nnml-request-set-mark, nnml-save-marks): do.
21 * nnfolder.el (nnfolder-request-set-mark, nnfolder-save-marks): do.
22
232004-09-27 Reiner Steib <Reiner.Steib@gmx.de>
24
25 * gnus.el (gnus-version-number): Set to 5.11.
26
272004-09-27 Katsumi Yamaoka <yamaoka@jpl.org>
28
29 * mm-decode.el (mm-copy-to-buffer): Don't use set-buffer-multibyte.
30
312004-09-26 Jesper Harder <harder@ifa.au.dk>
32
33 * gnus-msg.el (gnus-post-news): Use blank Newsgroups line if
34 GROUP is a virtual group.
35
36 * mm-util.el (mm-charset-synonym-alist): Remove obsolete entries
37 for big5 and gb2312.
38
39 * rfc2047.el (rfc2047-pad-base64): Deal with more cases of invalid
40 padding.
41
42 * mm-bodies.el (mm-7bit-chars): Don't include \r.
43
44 * mml.el (mml-compute-boundary-1): Don't uncompress files.
45
46 * rfc2047.el (rfc2047-qp-or-base64): New function to reduce
47 dependencies.
48 (rfc2047-encode): Use it.
49
50 * flow-fill.el: Typo.
51
52 * mml.el (mml-generate-mime-1): Don't use format=flowed with
53 inline PGP.
54
55 * gnus.el (gnus-getenv-nntpserver): Strip whitespace.
56
57 * gnus-cache.el (gnus-cache-save-buffers): Check if buffer is
58 alive. Reported by Laurent Martelli <laurent@aopsys.com>.
59
60 * mm-util.el (mm-image-load-path): Handle nil in load-path.
61 From Christian Neukirchen <chneukirchen@yahoo.de>.
62
63 * html2text.el (html2text-replace-list): Add &amp; and &apos;.
64
65 * nnheader.el (nnheader-max-head-length): Increase to 8192.
66
67 * message.el (message-clone-locals): Clone sendmail and smtp
68 variables.
69
702004-09-23 Reiner Steib <Reiner.Steib@gmx.de>
71
72 * gnus-msg.el (gnus-configure-posting-styles): Narrow to headers
73 in `header' match. Reported by Svend Tollak Munkejord.
74
12004-09-20 Stefan Monnier <monnier@iro.umontreal.ca> 752004-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2 76
3 * mm-decode.el (mm-copy-to-buffer): Preserve the data's unibyteness. 77 * mm-decode.el (mm-copy-to-buffer): Preserve the data's unibyteness.
diff --git a/lisp/gnus/flow-fill.el b/lisp/gnus/flow-fill.el
index a22f2a5af07..8a8098727fe 100644
--- a/lisp/gnus/flow-fill.el
+++ b/lisp/gnus/flow-fill.el
@@ -1,4 +1,4 @@
1;;; flow-fill.el --- interprete RFC2646 "flowed" text 1;;; flow-fill.el --- interpret RFC2646 "flowed" text
2 2
3;; Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
4 4
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 5544c28f967..d4dbe1319e0 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1464,6 +1464,8 @@ Initialized from `text-mode-syntax-table.")
1464 1464
1465(defvar gnus-inhibit-hiding nil) 1465(defvar gnus-inhibit-hiding nil)
1466 1466
1467(defvar gnus-article-edit-mode nil)
1468
1467;;; Macros for dealing with the article buffer. 1469;;; Macros for dealing with the article buffer.
1468 1470
1469(defmacro gnus-with-article-headers (&rest forms) 1471(defmacro gnus-with-article-headers (&rest forms)
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index bc09b3a2368..99e77b18f68 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -125,9 +125,8 @@ it's not cached."
125 (overview-file (gnus-cache-file-name 125 (overview-file (gnus-cache-file-name
126 (car gnus-cache-buffer) ".overview"))) 126 (car gnus-cache-buffer) ".overview")))
127 ;; write the overview only if it was modified 127 ;; write the overview only if it was modified
128 (when (buffer-modified-p buffer) 128 (when (and (buffer-live-p buffer) (buffer-modified-p buffer))
129 (save-excursion 129 (with-current-buffer buffer
130 (set-buffer buffer)
131 (if (> (buffer-size) 0) 130 (if (> (buffer-size) 0)
132 ;; Non-empty overview, write it to a file. 131 ;; Non-empty overview, write it to a file.
133 (let ((coding-system-for-write 132 (let ((coding-system-for-write
diff --git a/lisp/gnus/gnus-diary.el b/lisp/gnus/gnus-diary.el
index 120b812c209..e82d77fa58b 100644
--- a/lisp/gnus/gnus-diary.el
+++ b/lisp/gnus/gnus-diary.el
@@ -204,7 +204,7 @@ There are currently two built-in format functions:
204 (let ((head (cdr (assoc (intern (format "X-Diary-%s" (car elt))) 204 (let ((head (cdr (assoc (intern (format "X-Diary-%s" (car elt)))
205 headers)))) 205 headers))))
206 (when head 206 (when head
207 (nndiary-parse-schedule-value head (cadr elt) (caddr elt))))) 207 (nndiary-parse-schedule-value head (cadr elt) (car (cddr elt))))))
208 nndiary-headers)) 208 nndiary-headers))
209 209
210;; #### NOTE: Gnus sometimes gives me a HEADER not corresponding to any 210;; #### NOTE: Gnus sometimes gives me a HEADER not corresponding to any
diff --git a/lisp/gnus/gnus-fun.el b/lisp/gnus/gnus-fun.el
index 087c30da5df..82282e084f7 100644
--- a/lisp/gnus/gnus-fun.el
+++ b/lisp/gnus/gnus-fun.el
@@ -26,8 +26,11 @@
26;;; Code: 26;;; Code:
27 27
28(eval-when-compile 28(eval-when-compile
29 (require 'cl) 29 (require 'cl))
30 (require 'mm-util)) 30
31(require 'mm-util)
32(require 'gnus-ems)
33(require 'gnus-util)
31 34
32(defcustom gnus-x-face-directory (expand-file-name "x-faces" gnus-directory) 35(defcustom gnus-x-face-directory (expand-file-name "x-faces" gnus-directory)
33 "*Directory where X-Face PBM files are stored." 36 "*Directory where X-Face PBM files are stored."
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index f986e451c02..33531e7f8a4 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -915,7 +915,9 @@ header line with the old Message-ID."
915 (not to-address))) 915 (not to-address)))
916 ;; This is news. 916 ;; This is news.
917 (if post 917 (if post
918 (message-news (or to-group group)) 918 (message-news
919 (or to-group
920 (and (not (gnus-virtual-group-p pgroup)) group)))
919 (set-buffer gnus-article-copy) 921 (set-buffer gnus-article-copy)
920 (gnus-msg-treat-broken-reply-to) 922 (gnus-msg-treat-broken-reply-to)
921 (message-followup (if (or newsgroup-p force-news) 923 (message-followup (if (or newsgroup-p force-news)
@@ -1801,9 +1803,11 @@ this is a reply."
1801 ;; Obsolete format of header match. 1803 ;; Obsolete format of header match.
1802 (and (gnus-buffer-live-p gnus-article-copy) 1804 (and (gnus-buffer-live-p gnus-article-copy)
1803 (with-current-buffer gnus-article-copy 1805 (with-current-buffer gnus-article-copy
1804 (let ((header (message-fetch-field (pop style)))) 1806 (save-restriction
1805 (and header 1807 (nnheader-narrow-to-headers)
1806 (string-match (pop style) header)))))) 1808 (let ((header (message-fetch-field (pop style))))
1809 (and header
1810 (string-match (pop style) header)))))))
1807 ((or (symbolp match) 1811 ((or (symbolp match)
1808 (functionp match)) 1812 (functionp match))
1809 (cond 1813 (cond
@@ -1819,9 +1823,11 @@ this is a reply."
1819 ;; New format of header match. 1823 ;; New format of header match.
1820 (and (gnus-buffer-live-p gnus-article-copy) 1824 (and (gnus-buffer-live-p gnus-article-copy)
1821 (with-current-buffer gnus-article-copy 1825 (with-current-buffer gnus-article-copy
1822 (let ((header (message-fetch-field (nth 1 match)))) 1826 (save-restriction
1823 (and header 1827 (nnheader-narrow-to-headers)
1824 (string-match (nth 2 match) header)))))) 1828 (let ((header (message-fetch-field (nth 1 match))))
1829 (and header
1830 (string-match (nth 2 match) header)))))))
1825 (t 1831 (t
1826 ;; This is a form to be evaled. 1832 ;; This is a form to be evaled.
1827 (eval match))))) 1833 (eval match)))))
diff --git a/lisp/gnus/gnus-picon.el b/lisp/gnus/gnus-picon.el
index dbb96333d75..817696ed974 100644
--- a/lisp/gnus/gnus-picon.el
+++ b/lisp/gnus/gnus-picon.el
@@ -40,8 +40,9 @@
40;; 40;;
41;;; Code: 41;;; Code:
42 42
43(eval-when-compile (require 'cl))
44
43(require 'gnus) 45(require 'gnus)
44(require 'custom)
45(require 'gnus-art) 46(require 'gnus-art)
46 47
47;;; User variables: 48;;; User variables:
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 3b7c8c916d8..28ef2c22a15 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -282,7 +282,7 @@ is restarted, and sometimes reloaded."
282 :link '(custom-manual "(gnus)Exiting Gnus") 282 :link '(custom-manual "(gnus)Exiting Gnus")
283 :group 'gnus) 283 :group 'gnus)
284 284
285(defconst gnus-version-number "5.10.6" 285(defconst gnus-version-number "5.11"
286 "Version number for this version of Gnus.") 286 "Version number for this version of Gnus.")
287 287
288(defconst gnus-version (format "Gnus v%s" gnus-version-number) 288(defconst gnus-version (format "Gnus v%s" gnus-version-number)
@@ -1104,9 +1104,8 @@ Check the NNTPSERVER environment variable and the
1104 (and (file-readable-p gnus-nntpserver-file) 1104 (and (file-readable-p gnus-nntpserver-file)
1105 (with-temp-buffer 1105 (with-temp-buffer
1106 (insert-file-contents gnus-nntpserver-file) 1106 (insert-file-contents gnus-nntpserver-file)
1107 (let ((name (buffer-string))) 1107 (when (re-search-forward "[^ \t\n\r]+" nil t)
1108 (unless (string-match "\\`[ \t\n]*$" name) 1108 (match-string 0))))))
1109 name))))))
1110 1109
1111(defcustom gnus-select-method 1110(defcustom gnus-select-method
1112 (condition-case nil 1111 (condition-case nil
@@ -3309,38 +3308,6 @@ that that variable is buffer-local to the summary buffers."
3309 (push (cons server result) gnus-server-method-cache)) 3308 (push (cons server result) gnus-server-method-cache))
3310 result))) 3309 result)))
3311 3310
3312(defsubst gnus-method-to-server (method)
3313 (catch 'server-name
3314 (setq method (or method gnus-select-method))
3315
3316 ;; Perhaps it is already in the cache.
3317 (mapc (lambda (name-method)
3318 (if (equal (cdr name-method) method)
3319 (throw 'server-name (car name-method))))
3320 gnus-server-method-cache)
3321
3322 (mapc
3323 (lambda (server-alist)
3324 (mapc (lambda (name-method)
3325 (when (gnus-methods-equal-p (cdr name-method) method)
3326 (unless (member name-method gnus-server-method-cache)
3327 (push name-method gnus-server-method-cache))
3328 (throw 'server-name (car name-method))))
3329 server-alist))
3330 (let ((alists (list gnus-server-alist
3331 gnus-predefined-server-alist)))
3332 (if gnus-select-method
3333 (push (list (cons "native" gnus-select-method)) alists))
3334 alists))
3335
3336 (let* ((name (if (member (cadr method) '(nil ""))
3337 (format "%s" (car method))
3338 (format "%s:%s" (car method) (cadr method))))
3339 (name-method (cons name method)))
3340 (unless (member name-method gnus-server-method-cache)
3341 (push name-method gnus-server-method-cache))
3342 name)))
3343
3344(defsubst gnus-server-get-method (group method) 3311(defsubst gnus-server-get-method (group method)
3345 ;; Input either a server name, and extended server name, or a 3312 ;; Input either a server name, and extended server name, or a
3346 ;; select method, and return a select method. 3313 ;; select method, and return a select method.
diff --git a/lisp/gnus/html2text.el b/lisp/gnus/html2text.el
index f2aefbef993..6f1ef3b0289 100644
--- a/lisp/gnus/html2text.el
+++ b/lisp/gnus/html2text.el
@@ -1,5 +1,5 @@
1;;; html2text.el --- a simple html to plain text converter 1;;; html2text.el --- a simple html to plain text converter
2;; Copyright (C) 2002, 2003 Free Software Foundation, Inc. 2;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Joakim Hove <hove@phys.ntnu.no> 4;; Author: Joakim Hove <hove@phys.ntnu.no>
5 5
@@ -42,7 +42,8 @@
42(defvar html2text-format-single-element-list '(("hr" . html2text-clean-hr))) 42(defvar html2text-format-single-element-list '(("hr" . html2text-clean-hr)))
43 43
44(defvar html2text-replace-list 44(defvar html2text-replace-list
45 '(("&nbsp;" . " ") ("&gt;" . ">") ("&lt;" . "<") ("&quot;" . "\"")) 45 '(("&nbsp;" . " ") ("&gt;" . ">") ("&lt;" . "<") ("&quot;" . "\"")
46 ("&amp;" . "&") ("&apos;" . "'"))
46 "The map of entity to text. 47 "The map of entity to text.
47 48
48This is an alist were each element is a dotted pair consisting of an 49This is an alist were each element is a dotted pair consisting of an
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 21c386b86ce..8e5edbc048a 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -6685,7 +6685,7 @@ regexp VARSTR."
6685 (let ((locals (save-excursion 6685 (let ((locals (save-excursion
6686 (set-buffer buffer) 6686 (set-buffer buffer)
6687 (buffer-local-variables))) 6687 (buffer-local-variables)))
6688 (regexp "^gnus\\|^nn\\|^message\\|^user-mail-address")) 6688 (regexp "^gnus\\|^nn\\|^message\\|^sendmail\\|^smtp\\|^user-mail-address"))
6689 (mapcar 6689 (mapcar
6690 (lambda (local) 6690 (lambda (local)
6691 (when (and (consp local) 6691 (when (and (consp local)
diff --git a/lisp/gnus/mm-bodies.el b/lisp/gnus/mm-bodies.el
index 7e95ef3986b..b3148fe04ac 100644
--- a/lisp/gnus/mm-bodies.el
+++ b/lisp/gnus/mm-bodies.el
@@ -38,9 +38,16 @@
38(require 'rfc2047) 38(require 'rfc2047)
39(require 'mm-encode) 39(require 'mm-encode)
40 40
41;; 8bit treatment gets any char except: 0x32 - 0x7f, CR, LF, TAB, BEL, 41;; 8bit treatment gets any char except: 0x32 - 0x7f, LF, TAB, BEL,
42;; BS, vertical TAB, form feed, and ^_ 42;; BS, vertical TAB, form feed, and ^_
43(defvar mm-7bit-chars "\x20-\x7f\r\n\t\x7\x8\xb\xc\x1f") 43;;
44;; Note that CR is *not* included, as that would allow a non-paired CR
45;; in the body contrary to RFC 2822:
46;;
47;; - CR and LF MUST only occur together as CRLF; they MUST NOT
48;; appear independently in the body.
49
50(defvar mm-7bit-chars "\x20-\x7f\n\t\x7\x8\xb\xc\x1f")
44 51
45(defcustom mm-body-charset-encoding-alist 52(defcustom mm-body-charset-encoding-alist
46 '((iso-2022-jp . 7bit) 53 '((iso-2022-jp . 7bit)
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index ff05393415d..51ec38dc387 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -623,14 +623,14 @@ Postpone undisplaying of viewers for types in
623 "Copy the contents of the current buffer to a fresh buffer." 623 "Copy the contents of the current buffer to a fresh buffer."
624 (save-excursion 624 (save-excursion
625 (let ((obuf (current-buffer)) 625 (let ((obuf (current-buffer))
626 (multibyte enable-multibyte-characters)
627 beg) 626 beg)
628 (goto-char (point-min)) 627 (goto-char (point-min))
629 (search-forward-regexp "^\n" nil t) 628 (search-forward-regexp "^\n" nil t)
630 (setq beg (point)) 629 (setq beg (point))
631 (set-buffer (generate-new-buffer " *mm*")) 630 (set-buffer
632 ;; Preserve the data's unibyteness (for url-insert-file-contents). 631 ;; Preserve the data's unibyteness (for url-insert-file-contents).
633 (set-buffer-multibyte multibyte) 632 (let ((default-enable-multibyte-characters (mm-multibyte-p)))
633 (generate-new-buffer " *mm*")))
634 (insert-buffer-substring obuf beg) 634 (insert-buffer-substring obuf beg)
635 (current-buffer)))) 635 (current-buffer))))
636 636
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 5a4650db1b5..c608820c8ed 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -133,15 +133,9 @@ In XEmacs, also return non-nil if CS is a coding system object."
133 133
134(defvar mm-charset-synonym-alist 134(defvar mm-charset-synonym-alist
135 `( 135 `(
136 ;; Perfectly fine? A valid MIME name, anyhow.
137 ,@(unless (mm-coding-system-p 'big5)
138 '((big5 . cn-big5)))
139 ;; Not in XEmacs, but it's not a proper MIME charset anyhow. 136 ;; Not in XEmacs, but it's not a proper MIME charset anyhow.
140 ,@(unless (mm-coding-system-p 'x-ctext) 137 ,@(unless (mm-coding-system-p 'x-ctext)
141 '((x-ctext . ctext))) 138 '((x-ctext . ctext)))
142 ;; Apparently not defined in Emacs 20, but is a valid MIME name.
143 ,@(unless (mm-coding-system-p 'gb2312)
144 '((gb2312 . cn-gb-2312)))
145 ;; ISO-8859-15 is very similar to ISO-8859-1. But it's _different_! 139 ;; ISO-8859-15 is very similar to ISO-8859-1. But it's _different_!
146 ,@(unless (mm-coding-system-p 'iso-8859-15) 140 ,@(unless (mm-coding-system-p 'iso-8859-15)
147 '((iso-8859-15 . iso-8859-1))) 141 '((iso-8859-15 . iso-8859-1)))
@@ -785,11 +779,12 @@ If INHIBIT is non-nil, inhibit `mm-inhibit-file-name-handlers'."
785(defun mm-image-load-path (&optional package) 779(defun mm-image-load-path (&optional package)
786 (let (dir result) 780 (let (dir result)
787 (dolist (path load-path (nreverse result)) 781 (dolist (path load-path (nreverse result))
788 (if (file-directory-p 782 (when (and path
789 (setq dir (concat (file-name-directory 783 (file-directory-p
790 (directory-file-name path)) 784 (setq dir (concat (file-name-directory
791 "etc/" (or package "gnus/")))) 785 (directory-file-name path))
792 (push dir result)) 786 "etc/" (or package "gnus/")))))
787 (push dir result))
793 (push path result)))) 788 (push path result))))
794 789
795;; Fixme: This doesn't look useful where it's used. 790;; Fixme: This doesn't look useful where it's used.
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index c9f5cb80190..b8107364411 100644
--- a/lisp/gnus/mml-sec.el
+++ b/lisp/gnus/mml-sec.el
@@ -113,7 +113,7 @@ You can also customize or set `mml-signencrypt-style-alist' instead."
113 (setf (second style-item) style) 113 (setf (second style-item) style)
114 ;; otherwise, just return the current value 114 ;; otherwise, just return the current value
115 (second style-item)) 115 (second style-item))
116 (gnus-message 3 "Warning, attempt to set invalid signencrypt-style")))) 116 (message "Warning, attempt to set invalid signencrypt style"))))
117 117
118;;; Security functions 118;;; Security functions
119 119
diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el
index 596585afc72..3313d6a4118 100644
--- a/lisp/gnus/mml-smime.el
+++ b/lisp/gnus/mml-smime.el
@@ -25,9 +25,12 @@
25 25
26;;; Code: 26;;; Code:
27 27
28(eval-when-compile (require 'cl))
29
28(require 'smime) 30(require 'smime)
29(require 'mm-decode) 31(require 'mm-decode)
30(autoload 'message-narrow-to-headers "message") 32(autoload 'message-narrow-to-headers "message")
33(autoload 'message-fetch-field "message")
31 34
32(defun mml-smime-sign (cont) 35(defun mml-smime-sign (cont)
33 (when (null smime-keys) 36 (when (null smime-keys)
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 21633fb4152..c2c5bbf91e3 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -450,6 +450,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
450 ;; actually are hard newlines in the text. 450 ;; actually are hard newlines in the text.
451 (let (use-hard-newlines) 451 (let (use-hard-newlines)
452 (when (and (string= type "text/plain") 452 (when (and (string= type "text/plain")
453 (not (string= (cdr (assq 'sign cont)) "pgp"))
453 (or (null (assq 'format cont)) 454 (or (null (assq 'format cont))
454 (string= (cdr (assq 'format cont)) 455 (string= (cdr (assq 'format cont))
455 "flowed")) 456 "flowed"))
@@ -591,7 +592,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
591 (insert-buffer-substring (cdr (assq 'buffer cont)))) 592 (insert-buffer-substring (cdr (assq 'buffer cont))))
592 ((and (setq filename (cdr (assq 'filename cont))) 593 ((and (setq filename (cdr (assq 'filename cont)))
593 (not (equal (cdr (assq 'nofile cont)) "yes"))) 594 (not (equal (cdr (assq 'nofile cont)) "yes")))
594 (mm-insert-file-contents filename)) 595 (mm-insert-file-contents filename nil nil nil nil t))
595 (t 596 (t
596 (insert (cdr (assq 'contents cont))))) 597 (insert (cdr (assq 'contents cont)))))
597 (goto-char (point-min)) 598 (goto-char (point-min))
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el
index 142202cb4d2..369631ce653 100644
--- a/lisp/gnus/nnfolder.el
+++ b/lisp/gnus/nnfolder.el
@@ -1174,7 +1174,7 @@ This command does not work if you use short group names."
1174 (let ((range (nth 0 action)) 1174 (let ((range (nth 0 action))
1175 (what (nth 1 action)) 1175 (what (nth 1 action))
1176 (marks (nth 2 action))) 1176 (marks (nth 2 action)))
1177 (assert (or (eq what 'add) (eq what 'del)) t 1177 (assert (or (eq what 'add) (eq what 'del)) nil
1178 "Unknown request-set-mark action: %s" what) 1178 "Unknown request-set-mark action: %s" what)
1179 (dolist (mark marks) 1179 (dolist (mark marks)
1180 (setq nnfolder-marks (gnus-update-alist-soft 1180 (setq nnfolder-marks (gnus-update-alist-soft
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index 0ff82c69523..1b6ec636734 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -1,7 +1,7 @@
1;;; nnheader.el --- header access macros for Gnus and its backends 1;;; nnheader.el --- header access macros for Gnus and its backends
2 2
3;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996, 3;; Copyright (C) 1987, 1988, 1989, 1990, 1993, 1994, 1995, 1996,
4;; 1997, 1998, 2000, 2001, 2002, 2003 4;; 1997, 1998, 2000, 2001, 2002, 2003, 2004
5;; Free Software Foundation, Inc. 5;; Free Software Foundation, Inc.
6 6
7;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet> 7;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
@@ -58,7 +58,7 @@ they will keep on jabbering all the time."
58 :group 'gnus-server 58 :group 'gnus-server
59 :type 'boolean) 59 :type 'boolean)
60 60
61(defvar nnheader-max-head-length 4096 61(defvar nnheader-max-head-length 8192
62 "*Max length of the head of articles. 62 "*Max length of the head of articles.
63 63
64Value is an integer, nil, or t. nil means read in chunks of a file 64Value is an integer, nil, or t. nil means read in chunks of a file
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index cb820b094c1..4a9cfd32943 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -923,7 +923,7 @@ Use the nov database for the current group if available."
923 (let ((range (nth 0 action)) 923 (let ((range (nth 0 action))
924 (what (nth 1 action)) 924 (what (nth 1 action))
925 (marks (nth 2 action))) 925 (marks (nth 2 action)))
926 (assert (or (eq what 'add) (eq what 'del)) t 926 (assert (or (eq what 'add) (eq what 'del)) nil
927 "Unknown request-set-mark action: %s" what) 927 "Unknown request-set-mark action: %s" what)
928 (dolist (mark marks) 928 (dolist (mark marks)
929 (setq nnml-marks (gnus-update-alist-soft 929 (setq nnml-marks (gnus-update-alist-soft
diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el
index 978bec3c361..cbb5a1fc5b0 100644
--- a/lisp/gnus/rfc2047.el
+++ b/lisp/gnus/rfc2047.el
@@ -126,6 +126,25 @@ quoted-printable and base64 respectively.")
126;;; Functions for encoding RFC2047 messages 126;;; Functions for encoding RFC2047 messages
127;;; 127;;;
128 128
129(defun rfc2047-qp-or-base64 ()
130 "Return the type with which to encode the buffer.
131This is either `base64' or `quoted-printable'."
132 (save-excursion
133 (let ((limit (min (point-max) (+ 2000 (point-min))))
134 (n8bit 0))
135 (goto-char (point-min))
136 (skip-chars-forward "\x20-\x7f\r\n\t" limit)
137 (while (< (point) limit)
138 (incf n8bit)
139 (forward-char 1)
140 (skip-chars-forward "\x20-\x7f\r\n\t" limit))
141 (if (or (< (* 6 n8bit) (- limit (point-min)))
142 ;; Don't base64, say, a short line with a single
143 ;; non-ASCII char when splitting parts by charset.
144 (= n8bit 1))
145 'quoted-printable
146 'base64))))
147
129(defun rfc2047-narrow-to-field () 148(defun rfc2047-narrow-to-field ()
130 "Narrow the buffer to the header on the current line." 149 "Narrow the buffer to the header on the current line."
131 (beginning-of-line) 150 (beginning-of-line)
@@ -411,7 +430,7 @@ By default, the region is treated as containing addresses (see
411 ;; encoding, choose the one that's shorter. 430 ;; encoding, choose the one that's shorter.
412 (save-restriction 431 (save-restriction
413 (narrow-to-region b e) 432 (narrow-to-region b e)
414 (if (eq (mm-qp-or-base64) 'base64) 433 (if (eq (rfc2047-qp-or-base64) 'base64)
415 'B 434 'B
416 'Q)))) 435 'Q))))
417 (start (concat 436 (start (concat
@@ -720,11 +739,15 @@ decodable."
720 ;; Be more liberal to accept buggy base64 strings. If 739 ;; Be more liberal to accept buggy base64 strings. If
721 ;; base64-decode-string accepts buggy strings, this function could 740 ;; base64-decode-string accepts buggy strings, this function could
722 ;; be aliased to identity. 741 ;; be aliased to identity.
723 (case (mod (length string) 4) 742 (if (= 0 (mod (length string) 4))
724 (0 string) 743 string
725 (1 string) ;; Error, don't pad it. 744 (when (string-match "=+$" string)
726 (2 (concat string "==")) 745 (setq string (substring string 0 (match-beginning 0))))
727 (3 (concat string "=")))) 746 (case (mod (length string) 4)
747 (0 string)
748 (1 string) ;; Error, don't pad it.
749 (2 (concat string "=="))
750 (3 (concat string "=")))))
728 751
729(defun rfc2047-decode (charset encoding string) 752(defun rfc2047-decode (charset encoding string)
730 "Decode STRING from the given MIME CHARSET in the given ENCODING. 753 "Decode STRING from the given MIME CHARSET in the given ENCODING.
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 6fb99db157a..85534f3828c 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -1746,7 +1746,7 @@ REMOVE not nil, remove the ADDRESSES."
1746 (goto-char (point-min)) 1746 (goto-char (point-min))
1747 (when (re-search-forward "^X-Spam: yes;" nil t) 1747 (when (re-search-forward "^X-Spam: yes;" nil t)
1748 spam-split-group)) 1748 spam-split-group))
1749 (error "Error running spamoracle" status)))))))) 1749 (error "Error running spamoracle: %s" status))))))))
1750 1750
1751(defun spam-spamoracle-learn (articles article-is-spam-p &optional unregister) 1751(defun spam-spamoracle-learn (articles article-is-spam-p &optional unregister)
1752 "Run spamoracle in training mode." 1752 "Run spamoracle in training mode."
@@ -1768,8 +1768,8 @@ REMOVE not nil, remove the ADDRESSES."
1768 `("-f" ,spam-spamoracle-database 1768 `("-f" ,spam-spamoracle-database
1769 "add" ,arg) 1769 "add" ,arg)
1770 `("add" ,arg))))) 1770 `("add" ,arg)))))
1771 (when (not (eq 0 status)) 1771 (unless (eq 0 status)
1772 (error "Error running spamoracle" status))))))) 1772 (error "Error running spamoracle: %s" status)))))))
1773 1773
1774(defun spam-spamoracle-learn-ham (articles &optional unregister) 1774(defun spam-spamoracle-learn-ham (articles &optional unregister)
1775 (spam-spamoracle-learn articles nil unregister)) 1775 (spam-spamoracle-learn articles nil unregister))
diff --git a/lisp/ido.el b/lisp/ido.el
index 7f149af1e87..f9066544e1f 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -666,6 +666,14 @@ See also `ido-dir-file-cache' and `ido-save-directory-list-file'."
666 :type 'integer 666 :type 'integer
667 :group 'ido) 667 :group 'ido)
668 668
669(defcustom ido-max-directory-size 30000
670 "*Maximum size (in bytes) for directories to use ido completion.
671If you enter a directory with a size larger than this size, ido will
672not provide the normal completion. To show the completions, use C-a."
673 :type '(choice (const :tag "No limit" nil)
674 (integer :tag "Size in bytes" 30000))
675 :group 'ido)
676
669(defcustom ido-rotate-file-list-default nil 677(defcustom ido-rotate-file-list-default nil
670 "*Non-nil means that `ido' will always rotate file list to get default in front." 678 "*Non-nil means that `ido' will always rotate file list to get default in front."
671 :type 'boolean 679 :type 'boolean
@@ -699,9 +707,9 @@ Obsolete. Set 3rd element of `ido-decorations' instead."
699 :type '(choice string (const nil)) 707 :type '(choice string (const nil))
700 :group 'ido) 708 :group 'ido)
701 709
702(defcustom ido-decorations '( "{" "}" " | " " | ..." "[" "]" " [No match]" " [Matched]" " [Not readable]") 710(defcustom ido-decorations '( "{" "}" " | " " | ..." "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]")
703 "*List of strings used by ido to display the alternatives in the minibuffer. 711 "*List of strings used by ido to display the alternatives in the minibuffer.
704There are 9 elements in this list: 712There are 10 elements in this list:
7051st and 2nd elements are used as brackets around the prospect list, 7131st and 2nd elements are used as brackets around the prospect list,
7063rd element is the separator between prospects (ignored if ido-separator is set), 7143rd element is the separator between prospects (ignored if ido-separator is set),
7074th element is the string inserted at the end of a truncated list of prospects, 7154th element is the string inserted at the end of a truncated list of prospects,
@@ -709,7 +717,8 @@ There are 9 elements in this list:
709can be completed using TAB, 717can be completed using TAB,
7107th element is the string displayed when there are a no matches, and 7187th element is the string displayed when there are a no matches, and
7118th element is displayed if there is a single match (and faces are not used). 7198th element is displayed if there is a single match (and faces are not used).
7129th element is displayed when the current directory is non-readable." 7209th element is displayed when the current directory is non-readable.
72110th element is displayed when directory exceeds `ido-max-directory-size'."
713 :type '(repeat string) 722 :type '(repeat string)
714 :group 'ido) 723 :group 'ido)
715 724
@@ -952,6 +961,9 @@ it doesn't interfere with other minibuffer usage.")
952;; Remember if current directory is non-readable (so we cannot do completion). 961;; Remember if current directory is non-readable (so we cannot do completion).
953(defvar ido-directory-nonreadable) 962(defvar ido-directory-nonreadable)
954 963
964;; Remember if current directory is 'huge' (so we don't want to do completion).
965(defvar ido-directory-too-big)
966
955;; Keep current item list if non-nil. 967;; Keep current item list if non-nil.
956(defvar ido-keep-item-list) 968(defvar ido-keep-item-list)
957 969
@@ -1082,6 +1094,8 @@ it doesn't interfere with other minibuffer usage.")
1082(defun ido-may-cache-directory (&optional dir) 1094(defun ido-may-cache-directory (&optional dir)
1083 (setq dir (or dir ido-current-directory)) 1095 (setq dir (or dir ido-current-directory))
1084 (cond 1096 (cond
1097 ((ido-directory-too-big-p dir)
1098 nil)
1085 ((and (ido-is-root-directory dir) 1099 ((and (ido-is-root-directory dir)
1086 (or ido-enable-tramp-completion 1100 (or ido-enable-tramp-completion
1087 (memq system-type '(windows-nt ms-dos)))) 1101 (memq system-type '(windows-nt ms-dos))))
@@ -1425,6 +1439,16 @@ This function also adds a hook to the minibuffer."
1425 (file-directory-p dir) 1439 (file-directory-p dir)
1426 (not (file-readable-p dir))))) 1440 (not (file-readable-p dir)))))
1427 1441
1442(defun ido-directory-too-big-p (dir)
1443 ;; Return t if dir is a directory, but too big to show
1444 ;; Do not check for non-readable directories via tramp, as this causes a premature
1445 ;; connect on incomplete tramp paths (after entring just method:).
1446 (let ((ido-enable-tramp-completion nil))
1447 (and (numberp ido-max-directory-size)
1448 (ido-final-slash dir)
1449 (file-directory-p dir)
1450 (> (nth 7 (file-attributes dir)) ido-max-directory-size))))
1451
1428(defun ido-set-current-directory (dir &optional subdir no-merge) 1452(defun ido-set-current-directory (dir &optional subdir no-merge)
1429 ;; Set ido's current directory to DIR or DIR/SUBDIR 1453 ;; Set ido's current directory to DIR or DIR/SUBDIR
1430 (setq dir (ido-final-slash dir t)) 1454 (setq dir (ido-final-slash dir t))
@@ -1439,6 +1463,8 @@ This function also adds a hook to the minibuffer."
1439 (if (get-buffer ido-completion-buffer) 1463 (if (get-buffer ido-completion-buffer)
1440 (kill-buffer ido-completion-buffer)) 1464 (kill-buffer ido-completion-buffer))
1441 (setq ido-directory-nonreadable (ido-nonreadable-directory-p dir)) 1465 (setq ido-directory-nonreadable (ido-nonreadable-directory-p dir))
1466 (setq ido-directory-too-big (and (not ido-directory-nonreadable)
1467 (ido-directory-too-big-p dir)))
1442 t)) 1468 t))
1443 1469
1444(defun ido-set-current-home (&optional dir) 1470(defun ido-set-current-home (&optional dir)
@@ -1623,10 +1649,14 @@ If INITIAL is non-nil, it specifies the initial input string."
1623 ido-rescan nil)) 1649 ido-rescan nil))
1624 ((eq ido-cur-item 'file) 1650 ((eq ido-cur-item 'file)
1625 (setq ido-ignored-list nil 1651 (setq ido-ignored-list nil
1626 ido-cur-list (ido-make-file-list ido-default-item))) 1652 ido-cur-list (and (not ido-directory-nonreadable)
1653 (not ido-directory-too-big)
1654 (ido-make-file-list ido-default-item))))
1627 ((eq ido-cur-item 'dir) 1655 ((eq ido-cur-item 'dir)
1628 (setq ido-ignored-list nil 1656 (setq ido-ignored-list nil
1629 ido-cur-list (ido-make-dir-list ido-default-item))) 1657 ido-cur-list (and (not ido-directory-nonreadable)
1658 (not ido-directory-too-big)
1659 (ido-make-dir-list ido-default-item))))
1630 ((eq ido-cur-item 'buffer) 1660 ((eq ido-cur-item 'buffer)
1631 (setq ido-ignored-list nil 1661 (setq ido-ignored-list nil
1632 ido-cur-list (ido-make-buffer-list ido-default-item))) 1662 ido-cur-list (ido-make-buffer-list ido-default-item)))
@@ -1802,7 +1832,10 @@ If INITIAL is non-nil, it specifies the initial input string."
1802 (if (not ido-mode) 1832 (if (not ido-mode)
1803 (call-interactively (or fallback 'switch-to-buffer)) 1833 (call-interactively (or fallback 'switch-to-buffer))
1804 (let* ((ido-context-switch-command switch-cmd) 1834 (let* ((ido-context-switch-command switch-cmd)
1805 (buf (ido-read-buffer (or prompt "Buffer: ") default nil initial))) 1835 (ido-current-directory nil)
1836 (ido-directory-nonreadable nil)
1837 (ido-directory-too-big nil)
1838 (buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default nil initial)))
1806 1839
1807 ;; Choose the buffer name: either the text typed in, or the head 1840 ;; Choose the buffer name: either the text typed in, or the head
1808 ;; of the list of matches 1841 ;; of the list of matches
@@ -1845,19 +1878,6 @@ If INITIAL is non-nil, it specifies the initial input string."
1845 (set-buffer-major-mode buf)) 1878 (set-buffer-major-mode buf))
1846 (ido-visit-buffer buf method t)))))) 1879 (ido-visit-buffer buf method t))))))
1847 1880
1848;;;###autoload
1849(defun ido-read-buffer (prompt &optional default require-match initial)
1850 "Replacement for the built-in `read-buffer'.
1851Return the name of a buffer selected.
1852PROMPT is the prompt to give to the user. DEFAULT if given is the default
1853buffer to be selected, which will go to the front of the list.
1854If REQUIRE-MATCH is non-nil, an existing-buffer must be selected.
1855If INITIAL is non-nil, it specifies the initial input string."
1856 (let ((ido-current-directory nil)
1857 (ido-directory-nonreadable nil)
1858 (ido-context-switch-command (if (boundp 'ido-context-switch-command) ido-context-switch-command 'ignore)))
1859 (ido-read-internal 'buffer prompt 'ido-buffer-history default require-match initial)))
1860
1861(defun ido-record-work-directory (&optional dir) 1881(defun ido-record-work-directory (&optional dir)
1862 (when (and (numberp ido-max-work-directory-list) (> ido-max-work-directory-list 0)) 1882 (when (and (numberp ido-max-work-directory-list) (> ido-max-work-directory-list 0))
1863 (if (and (setq dir (or dir ido-current-directory)) (> (length dir) 0)) 1883 (if (and (setq dir (or dir ido-current-directory)) (> (length dir) 0))
@@ -1905,6 +1925,8 @@ If INITIAL is non-nil, it specifies the initial input string."
1905 (setq item 'file)) 1925 (setq item 'file))
1906 (let* ((ido-current-directory (ido-expand-directory default)) 1926 (let* ((ido-current-directory (ido-expand-directory default))
1907 (ido-directory-nonreadable (ido-nonreadable-directory-p ido-current-directory)) 1927 (ido-directory-nonreadable (ido-nonreadable-directory-p ido-current-directory))
1928 (ido-directory-too-big (and (not ido-directory-nonreadable)
1929 (ido-directory-too-big-p ido-current-directory)))
1908 (ido-context-switch-command switch-cmd) 1930 (ido-context-switch-command switch-cmd)
1909 filename) 1931 filename)
1910 1932
@@ -2079,6 +2101,12 @@ If INITIAL is non-nil, it specifies the initial input string."
2079 (setq ido-exit 'refresh) 2101 (setq ido-exit 'refresh)
2080 (exit-minibuffer)))) 2102 (exit-minibuffer))))
2081 2103
2104 (ido-directory-too-big
2105 (setq ido-directory-too-big nil)
2106 (setq ido-text-init ido-text)
2107 (setq ido-exit 'refresh)
2108 (exit-minibuffer))
2109
2082 ((not ido-matches) 2110 ((not ido-matches)
2083 (when ido-completion-buffer 2111 (when ido-completion-buffer
2084 (call-interactively (setq this-command ido-cannot-complete-command)))) 2112 (call-interactively (setq this-command ido-cannot-complete-command))))
@@ -2182,7 +2210,9 @@ If no merge has yet taken place, toggle automatic merging option."
2182(defun ido-toggle-ignore () 2210(defun ido-toggle-ignore ()
2183 "Toggle ignoring files specified with `ido-ignore-files'." 2211 "Toggle ignoring files specified with `ido-ignore-files'."
2184 (interactive) 2212 (interactive)
2185 (setq ido-process-ignore-lists (not ido-process-ignore-lists)) 2213 (if ido-directory-too-big
2214 (setq ido-directory-too-big nil)
2215 (setq ido-process-ignore-lists (not ido-process-ignore-lists)))
2186 (setq ido-text-init ido-text) 2216 (setq ido-text-init ido-text)
2187 (setq ido-exit 'refresh) 2217 (setq ido-exit 'refresh)
2188 (exit-minibuffer)) 2218 (exit-minibuffer))
@@ -2324,6 +2354,7 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one.
2324 (not (equal dir ido-current-directory)) 2354 (not (equal dir ido-current-directory))
2325 (file-directory-p dir) 2355 (file-directory-p dir)
2326 (or (not must-match) 2356 (or (not must-match)
2357 ;; TODO. check for nonreadable and too-big.
2327 (ido-set-matches1 2358 (ido-set-matches1
2328 (if (eq ido-cur-item 'file) 2359 (if (eq ido-cur-item 'file)
2329 (ido-make-file-list1 dir) 2360 (ido-make-file-list1 dir)
@@ -2581,7 +2612,8 @@ for first matching file."
2581 2612
2582(defun ido-all-completions () 2613(defun ido-all-completions ()
2583 ;; Return unsorted list of all competions. 2614 ;; Return unsorted list of all competions.
2584 (let ((ido-process-ignore-lists nil)) 2615 (let ((ido-process-ignore-lists nil)
2616 (ido-directory-too-big nil))
2585 (cond 2617 (cond
2586 ((eq ido-cur-item 'file) 2618 ((eq ido-cur-item 'file)
2587 (ido-make-file-list1 ido-current-directory)) 2619 (ido-make-file-list1 ido-current-directory))
@@ -2700,6 +2732,7 @@ for first matching file."
2700 (or ido-merge-ftp-work-directories 2732 (or ido-merge-ftp-work-directories
2701 (not (ido-is-ftp-directory dir))) 2733 (not (ido-is-ftp-directory dir)))
2702 (file-directory-p dir) 2734 (file-directory-p dir)
2735 ;; TODO. check for nonreadable and too-big.
2703 (setq fl (if (eq ido-cur-item 'file) 2736 (setq fl (if (eq ido-cur-item 'file)
2704 (ido-make-file-list1 dir t) 2737 (ido-make-file-list1 dir t)
2705 (ido-make-dir-list1 dir t)))) 2738 (ido-make-dir-list1 dir t))))
@@ -2780,6 +2813,8 @@ for first matching file."
2780(defun ido-file-name-all-completions1 (dir) 2813(defun ido-file-name-all-completions1 (dir)
2781 (cond 2814 (cond
2782 ((ido-nonreadable-directory-p dir) '()) 2815 ((ido-nonreadable-directory-p dir) '())
2816 ;; do not check (ido-directory-too-big-p dir) here.
2817 ;; Caller must have done that if necessary.
2783 ((and ido-enable-tramp-completion 2818 ((and ido-enable-tramp-completion
2784 (string-match "\\`/\\([^/:]+:\\([^/:@]+@\\)?\\)\\'" dir)) 2819 (string-match "\\`/\\([^/:]+:\\([^/:@]+@\\)?\\)\\'" dir))
2785 2820
@@ -3616,7 +3651,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3616 (expand-file-name "/" ido-current-directory) 3651 (expand-file-name "/" ido-current-directory)
3617 "/")) 3652 "/"))
3618 (setq refresh t)) 3653 (setq refresh t))
3619 ((and ido-directory-nonreadable 3654 ((and (or ido-directory-nonreadable ido-directory-too-big)
3620 (file-directory-p (concat ido-current-directory (file-name-directory contents)))) 3655 (file-directory-p (concat ido-current-directory (file-name-directory contents))))
3621 (ido-set-current-directory 3656 (ido-set-current-directory
3622 (concat ido-current-directory (file-name-directory contents))) 3657 (concat ido-current-directory (file-name-directory contents)))
@@ -3678,6 +3713,7 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3678 3713
3679 (when (and (not ido-matches) 3714 (when (and (not ido-matches)
3680 (not ido-directory-nonreadable) 3715 (not ido-directory-nonreadable)
3716 (not ido-directory-too-big)
3681 ;; ido-rescan ? 3717 ;; ido-rescan ?
3682 ido-process-ignore-lists 3718 ido-process-ignore-lists
3683 ido-ignored-list) 3719 ido-ignored-list)
@@ -3701,7 +3737,8 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3701 (not (ido-is-root-directory)) 3737 (not (ido-is-root-directory))
3702 (> (length contents) 1) 3738 (> (length contents) 1)
3703 (not (string-match "[$]" contents)) 3739 (not (string-match "[$]" contents))
3704 (not ido-directory-nonreadable)) 3740 (not ido-directory-nonreadable)
3741 (not ido-directory-too-big))
3705 (ido-trace "merge?") 3742 (ido-trace "merge?")
3706 (if ido-use-merged-list 3743 (if ido-use-merged-list
3707 (ido-undo-merge-work-directory contents nil) 3744 (ido-undo-merge-work-directory contents nil)
@@ -3766,6 +3803,8 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3766 (cond 3803 (cond
3767 (ido-directory-nonreadable 3804 (ido-directory-nonreadable
3768 (or (nth 8 ido-decorations) " [Not readable]")) 3805 (or (nth 8 ido-decorations) " [Not readable]"))
3806 (ido-directory-too-big
3807 (or (nth 9 ido-decorations) " [Too big]"))
3769 (ido-report-no-match 3808 (ido-report-no-match
3770 (nth 6 ido-decorations)) ;; [No match] 3809 (nth 6 ido-decorations)) ;; [No match]
3771 (t ""))) 3810 (t "")))
@@ -3872,8 +3911,26 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
3872(put 'dired-do-rename 'ido 'ignore) 3911(put 'dired-do-rename 'ido 'ignore)
3873 3912
3874;;;###autoload 3913;;;###autoload
3914(defun ido-read-buffer (prompt &optional default require-match)
3915 "Ido replacement for the built-in `read-buffer'.
3916Return the name of a buffer selected.
3917PROMPT is the prompt to give to the user. DEFAULT if given is the default
3918buffer to be selected, which will go to the front of the list.
3919If REQUIRE-MATCH is non-nil, an existing-buffer must be selected."
3920 (let* ((ido-current-directory nil)
3921 (ido-directory-nonreadable nil)
3922 (ido-directory-too-big nil)
3923 (ido-context-switch-command 'ignore)
3924 (buf (ido-read-internal 'buffer prompt 'ido-buffer-history default require-match)))
3925 (if (eq ido-exit 'fallback)
3926 (let ((read-buffer-function nil))
3927 (read-buffer prompt default require-match))
3928 buf)))
3929
3930;;;###autoload
3875(defun ido-read-file-name (prompt &optional dir default-filename mustmatch initial predicate) 3931(defun ido-read-file-name (prompt &optional dir default-filename mustmatch initial predicate)
3876 "Read file name, prompting with PROMPT and completing in directory DIR. 3932 "Ido replacement for the built-in `read-file-name'.
3933Read file name, prompting with PROMPT and completing in directory DIR.
3877See `read-file-name' for additional parameters." 3934See `read-file-name' for additional parameters."
3878 (let (filename) 3935 (let (filename)
3879 (cond 3936 (cond
@@ -3890,6 +3947,8 @@ See `read-file-name' for additional parameters."
3890 (vc-handled-backends (and (boundp 'vc-handled-backends) vc-handled-backends)) 3947 (vc-handled-backends (and (boundp 'vc-handled-backends) vc-handled-backends))
3891 (ido-current-directory (ido-expand-directory dir)) 3948 (ido-current-directory (ido-expand-directory dir))
3892 (ido-directory-nonreadable (not (file-readable-p ido-current-directory))) 3949 (ido-directory-nonreadable (not (file-readable-p ido-current-directory)))
3950 (ido-directory-too-big (and (not ido-directory-nonreadable)
3951 (ido-directory-too-big-p ido-current-directory)))
3893 (ido-work-directory-index -1) 3952 (ido-work-directory-index -1)
3894 (ido-work-file-index -1) 3953 (ido-work-file-index -1)
3895 (ido-find-literal nil)) 3954 (ido-find-literal nil))
@@ -3911,13 +3970,16 @@ See `read-file-name' for additional parameters."
3911 3970
3912;;;###autoload 3971;;;###autoload
3913(defun ido-read-directory-name (prompt &optional dir default-dirname mustmatch initial) 3972(defun ido-read-directory-name (prompt &optional dir default-dirname mustmatch initial)
3914 "Read directory name, prompting with PROMPT and completing in directory DIR. 3973 "Ido replacement for the built-in `read-directory-name'.
3915See `read-file-name' for additional parameters." 3974Read directory name, prompting with PROMPT and completing in directory DIR.
3975See `read-directory-name' for additional parameters."
3916 (let* (filename 3976 (let* (filename
3917 (ido-context-switch-command 'ignore) 3977 (ido-context-switch-command 'ignore)
3918 ido-saved-vc-hb 3978 ido-saved-vc-hb
3919 (ido-current-directory (ido-expand-directory dir)) 3979 (ido-current-directory (ido-expand-directory dir))
3920 (ido-directory-nonreadable (not (file-readable-p ido-current-directory))) 3980 (ido-directory-nonreadable (not (file-readable-p ido-current-directory)))
3981 (ido-directory-too-big (and (not ido-directory-nonreadable)
3982 (ido-directory-too-big-p ido-current-directory)))
3921 (ido-work-directory-index -1) 3983 (ido-work-directory-index -1)
3922 (ido-work-file-index -1)) 3984 (ido-work-file-index -1))
3923 (setq filename 3985 (setq filename
@@ -3929,7 +3991,8 @@ See `read-file-name' for additional parameters."
3929 3991
3930;;;###autoload 3992;;;###autoload
3931(defun ido-completing-read (prompt choices &optional predicate require-match initial-input hist def) 3993(defun ido-completing-read (prompt choices &optional predicate require-match initial-input hist def)
3932 "Read a string in the minibuffer with ido-style completion. 3994 "Ido replacement for the built-in `completing-read'.
3995Read a string in the minibuffer with ido-style completion.
3933PROMPT is a string to prompt with; normally it ends in a colon and a space. 3996PROMPT is a string to prompt with; normally it ends in a colon and a space.
3934CHOICES is a list of strings which are the possible completions. 3997CHOICES is a list of strings which are the possible completions.
3935PREDICATE is currently ignored; it is included to be compatible 3998PREDICATE is currently ignored; it is included to be compatible
@@ -3944,6 +4007,7 @@ HIST, if non-nil, specifies a history list.
3944DEF, if non-nil, is the default value." 4007DEF, if non-nil, is the default value."
3945 (let ((ido-current-directory nil) 4008 (let ((ido-current-directory nil)
3946 (ido-directory-nonreadable nil) 4009 (ido-directory-nonreadable nil)
4010 (ido-directory-too-big nil)
3947 (ido-context-switch-command 'ignore) 4011 (ido-context-switch-command 'ignore)
3948 (ido-choice-list choices)) 4012 (ido-choice-list choices))
3949 (ido-read-internal 'list prompt hist def require-match initial-input))) 4013 (ido-read-internal 'list prompt hist def require-match initial-input)))
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 521729b764f..8944d4c20c0 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -534,7 +534,7 @@ SWITCHES, TIME-INDEX and NOW give the full switch list and time data."
534 " " 534 " "
535 (ls-lisp-format-time file-attr time-index now) 535 (ls-lisp-format-time file-attr time-index now)
536 " " 536 " "
537 file-name 537 (propertize file-name 'dired-filename t)
538 (if (stringp file-type) ; is a symbolic link 538 (if (stringp file-type) ; is a symbolic link
539 (concat " -> " file-type)) 539 (concat " -> " file-type))
540 "\n" 540 "\n"
diff --git a/lisp/printing.el b/lisp/printing.el
index a406e09b8c0..3efb53111fd 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -5,13 +5,13 @@
5 5
6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
7;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> 7;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
8;; Time-stamp: <2004/09/21 22:51:58 vinicius> 8;; Time-stamp: <2004/09/26 22:11:24 vinicius>
9;; Keywords: wp, print, PostScript 9;; Keywords: wp, print, PostScript
10;; Version: 6.8 10;; Version: 6.8.1
11;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ 11;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
12 12
13(defconst pr-version "6.8" 13(defconst pr-version "6.8.1"
14 "printing.el, v 6.8 <2004/09/21 vinicius> 14 "printing.el, v 6.8.1 <2004/09/26 vinicius>
15 15
16Please send all bug fixes and enhancements to 16Please send all bug fixes and enhancements to
17 Vinicius Jose Latorre <viniciusjl@ig.com.br> 17 Vinicius Jose Latorre <viniciusjl@ig.com.br>
@@ -125,16 +125,16 @@ Please send all bug fixes and enhancements to
125;; Novices (First Users) 125;; Novices (First Users)
126;; --------------------- 126;; ---------------------
127;; 127;;
128;; First of all, take a glance of printing documentation only to have an idea 128;; First of all, see printing documentation only to get an idea of what
129;; of what `printing' is capable. 129;; `printing' is capable.
130;; 130;;
131;; Then try to set the variables: `pr-ps-name', `pr-ps-printer-alist', 131;; Then try to set the variables: `pr-ps-name', `pr-ps-printer-alist',
132;; `pr-txt-name', `pr-txt-printer-alist' and `pr-path-alist'. These variables 132;; `pr-txt-name', `pr-txt-printer-alist' and `pr-path-alist'. These variables
133;; are the main variables for printing processing. 133;; are the main variables for printing processing.
134;; 134;;
135;; Now, please, see these variables documentation more in deep. You can do 135;; Now, please, see these variables documentation deeper. You can do this by
136;; this by typing C-h v pr-ps-name RET (for example) if you already loaded 136;; typing C-h v pr-ps-name RET (for example) if you already loaded printing
137;; printing package, or by browsing printing.el source file. 137;; package, or by browsing printing.el source file.
138;; 138;;
139;; If the documentation isn't clear or if you find a way to improve the 139;; If the documentation isn't clear or if you find a way to improve the
140;; documentation, please, send an email to maintainer. All printing users 140;; documentation, please, send an email to maintainer. All printing users
@@ -263,7 +263,8 @@ Please send all bug fixes and enhancements to
263;; in Windows. The gsprint utility is faster than ghostscript to print 263;; in Windows. The gsprint utility is faster than ghostscript to print
264;; monochrome PostScript. 264;; monochrome PostScript.
265;; 265;;
266;; The efficiency is similar to print non-monochrome PostScript file. 266;; To print non-monochrome PostScript file, the efficiency of ghostscript
267;; is similar to gsprint.
267;; 268;;
268;; Also the gsprint utility comes together with gsview distribution. 269;; Also the gsprint utility comes together with gsview distribution.
269;; 270;;
@@ -3887,7 +3888,7 @@ image in a file with that name."
3887 (interactive (list (pr-ps-infile-preprint "Print preview "))) 3888 (interactive (list (pr-ps-infile-preprint "Print preview ")))
3888 (and (stringp filename) (file-exists-p filename) 3889 (and (stringp filename) (file-exists-p filename)
3889 (let* ((file (pr-expand-file-name filename)) 3890 (let* ((file (pr-expand-file-name filename))
3890 (tempfile (pr-dosify-file-name (make-temp-name file)))) 3891 (tempfile (pr-dosify-file-name (make-temp-file file))))
3891 ;; gs use 3892 ;; gs use
3892 (pr-call-process pr-gs-command 3893 (pr-call-process pr-gs-command
3893 (format "-sDEVICE=%s" pr-gs-device) 3894 (format "-sDEVICE=%s" pr-gs-device)
@@ -5221,7 +5222,8 @@ non-nil."
5221 5222
5222 5223
5223(defun pr-delete-file (file) 5224(defun pr-delete-file (file)
5224 (and pr-delete-temp-file (delete-file file))) 5225 (and pr-delete-temp-file (file-exists-p file)
5226 (delete-file file)))
5225 5227
5226 5228
5227(defun pr-expand-file-name (filename) 5229(defun pr-expand-file-name (filename)
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 1972074fdb1..612a2034e00 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -1069,8 +1069,9 @@ static char *magick[] = {
1069(defvar breakpoint-disabled-icon nil 1069(defvar breakpoint-disabled-icon nil
1070 "Icon for disabled breakpoint in display margin") 1070 "Icon for disabled breakpoint in display margin")
1071 1071
1072(defvar breakpoint-bitmap nil 1072;; Bitmap for breakpoint in fringe
1073 "Bitmap for breakpoint in fringe") 1073(define-fringe-bitmap 'breakpoint
1074 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")
1074 1075
1075(defface breakpoint-enabled-bitmap-face 1076(defface breakpoint-enabled-bitmap-face
1076 '((t 1077 '((t
@@ -1140,9 +1141,8 @@ static char *magick[] = {
1140 (save-excursion 1141 (save-excursion
1141 (goto-char (posn-point posn)) 1142 (goto-char (posn-point posn))
1142 (if (or (posn-object posn) 1143 (if (or (posn-object posn)
1143 (and breakpoint-bitmap 1144 (eq (car (fringe-bitmaps-at-pos (posn-point posn)))
1144 (eq (car (fringe-bitmaps-at-pos (posn-point posn))) 1145 'breakpoint))
1145 breakpoint-bitmap)))
1146 (gud-remove nil) 1146 (gud-remove nil)
1147 (gud-break nil))))))) 1147 (gud-break nil)))))))
1148 1148
@@ -1831,11 +1831,7 @@ BUFFER nil or omitted means use the current buffer."
1831 (if (>= (car (window-fringes)) 8) 1831 (if (>= (car (window-fringes)) 8)
1832 (gdb-put-string 1832 (gdb-put-string
1833 nil (1+ start) 1833 nil (1+ start)
1834 `(left-fringe 1834 `(left-fringe breakpoint
1835 ,(or breakpoint-bitmap
1836 (setq breakpoint-bitmap
1837 (define-fringe-bitmap
1838 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")))
1839 ,(if enabled 1835 ,(if enabled
1840 'breakpoint-enabled-bitmap-face 1836 'breakpoint-enabled-bitmap-face
1841 'breakpoint-disabled-bitmap-face))) 1837 'breakpoint-disabled-bitmap-face)))
diff --git a/lisp/subr.el b/lisp/subr.el
index 5a7d9249e83..d9262da2963 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1970,6 +1970,8 @@ Major mode functions should use this."
1970 1970
1971(defmacro delay-mode-hooks (&rest body) 1971(defmacro delay-mode-hooks (&rest body)
1972 "Execute BODY, but delay any `run-mode-hooks'. 1972 "Execute BODY, but delay any `run-mode-hooks'.
1973These hooks will be executed by the first following call to
1974`run-mode-hooks' that occurs outside any `delayed-mode-hooks' form.
1973Only affects hooks run in the current buffer." 1975Only affects hooks run in the current buffer."
1974 (declare (debug t)) 1976 (declare (debug t))
1975 `(progn 1977 `(progn
diff --git a/lisp/term.el b/lisp/term.el
index 0fbe5b2f154..e71163a822c 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1,6 +1,6 @@
1;;; term.el --- general command interpreter in a window stuff 1;;; term.el --- general command interpreter in a window stuff
2 2
3;;; Copyright (C) 1988, 1990, 1992, 1994, 1995 Free Software Foundation, Inc. 3;;; Copyright (C) 1988, 1990, 1992, 1994, 1995, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Per Bothner <bothner@cygnus.com> 5;; Author: Per Bothner <bothner@cygnus.com>
6;; Based on comint mode written by: Olin Shivers <shivers@cs.cmu.edu> 6;; Based on comint mode written by: Olin Shivers <shivers@cs.cmu.edu>
@@ -676,7 +676,6 @@ Buffer local variable.")
676(defvar term-terminal-menu) 676(defvar term-terminal-menu)
677 677
678;;; Let's silence the byte-compiler -mm 678;;; Let's silence the byte-compiler -mm
679(defvar term-ansi-at-eval-string nil)
680(defvar term-ansi-at-host nil) 679(defvar term-ansi-at-host nil)
681(defvar term-ansi-at-dir nil) 680(defvar term-ansi-at-dir nil)
682(defvar term-ansi-at-user nil) 681(defvar term-ansi-at-user nil)
@@ -692,9 +691,6 @@ Buffer local variable.")
692(defvar term-ansi-current-highlight 0) 691(defvar term-ansi-current-highlight 0)
693(defvar term-ansi-current-reverse 0) 692(defvar term-ansi-current-reverse 0)
694(defvar term-ansi-current-invisible 0) 693(defvar term-ansi-current-invisible 0)
695(defvar term-ansi-default-fg 0)
696(defvar term-ansi-default-bg 0)
697(defvar term-ansi-current-temp 0)
698 694
699;;; Four should be enough, if you want more, just add. -mm 695;;; Four should be enough, if you want more, just add. -mm
700(defvar term-terminal-more-parameters 0) 696(defvar term-terminal-more-parameters 0)
@@ -917,6 +913,9 @@ is buffer-local.")
917 (define-key term-raw-map [backspace] 'term-send-backspace) 913 (define-key term-raw-map [backspace] 'term-send-backspace)
918 (define-key term-raw-map [home] 'term-send-home) 914 (define-key term-raw-map [home] 'term-send-home)
919 (define-key term-raw-map [end] 'term-send-end) 915 (define-key term-raw-map [end] 'term-send-end)
916 (define-key term-raw-map [S-prior] 'scroll-down)
917 (define-key term-raw-map [S-next] 'scroll-up)
918 (define-key term-raw-map [S-insert] 'term-paste)
920 (define-key term-raw-map [prior] 'term-send-prior) 919 (define-key term-raw-map [prior] 'term-send-prior)
921 (define-key term-raw-map [next] 'term-send-next))) 920 (define-key term-raw-map [next] 'term-send-next)))
922 921
@@ -932,6 +931,27 @@ is buffer-local.")
932 931
933(put 'term-mode 'mode-class 'special) 932(put 'term-mode 'mode-class 'special)
934 933
934
935;;; Use this variable as a display table for `term-mode'.
936(defvar term-display-table
937 (let ((dt (or (copy-sequence standard-display-table)
938 (make-display-table)))
939 i)
940 ;; avoid changing the display table for ^J
941 (setq i 0)
942 (while (< i 10)
943 (aset dt i (vector i))
944 (setq i (1+ i)))
945 (setq i 11)
946 (while (< i 32)
947 (aset dt i (vector i))
948 (setq i (1+ i)))
949 (setq i 128)
950 (while (< i 256)
951 (aset dt i (vector i))
952 (setq i (1+ i)))
953 dt))
954
935(defun term-mode () 955(defun term-mode ()
936 "Major mode for interacting with an inferior interpreter. 956 "Major mode for interacting with an inferior interpreter.
937The interpreter name is same as buffer name, sans the asterisks. 957The interpreter name is same as buffer name, sans the asterisks.
@@ -981,6 +1001,9 @@ Entry to this mode runs the hooks on `term-mode-hook'."
981 (setq major-mode 'term-mode) 1001 (setq major-mode 'term-mode)
982 (setq mode-name "Term") 1002 (setq mode-name "Term")
983 (use-local-map term-mode-map) 1003 (use-local-map term-mode-map)
1004 ;; we do not want indent to sneak in any tabs
1005 (setq indent-tabs-mode nil)
1006 (setq buffer-display-table term-display-table)
984 (make-local-variable 'term-home-marker) 1007 (make-local-variable 'term-home-marker)
985 (setq term-home-marker (copy-marker 0)) 1008 (setq term-home-marker (copy-marker 0))
986 (make-local-variable 'term-saved-home-marker) 1009 (make-local-variable 'term-saved-home-marker)
@@ -1184,6 +1207,11 @@ without any interpretation."
1184 ((eq arg '-) -1) 1207 ((eq arg '-) -1)
1185 (t (1- arg))))))) 1208 (t (1- arg)))))))
1186 1209
1210(defun term-paste ()
1211 "Insert the last stretch of killed text at point."
1212 (interactive)
1213 (term-send-raw-string (current-kill 0)))
1214
1187;; Which would be better: "\e[A" or "\eOA"? readline accepts either. 1215;; Which would be better: "\e[A" or "\eOA"? readline accepts either.
1188;; For my configuration it's definitely better \eOA but YMMV. -mm 1216;; For my configuration it's definitely better \eOA but YMMV. -mm
1189;; For example: vi works with \eOA while elm wants \e[A ... 1217;; For example: vi works with \eOA while elm wants \e[A ...
@@ -1195,8 +1223,8 @@ without any interpretation."
1195(defun term-send-end () (interactive) (term-send-raw-string "\e[4~")) 1223(defun term-send-end () (interactive) (term-send-raw-string "\e[4~"))
1196(defun term-send-prior () (interactive) (term-send-raw-string "\e[5~")) 1224(defun term-send-prior () (interactive) (term-send-raw-string "\e[5~"))
1197(defun term-send-next () (interactive) (term-send-raw-string "\e[6~")) 1225(defun term-send-next () (interactive) (term-send-raw-string "\e[6~"))
1198(defun term-send-del () (interactive) (term-send-raw-string "\C-?")) 1226(defun term-send-del () (interactive) (term-send-raw-string "\e[3~"))
1199(defun term-send-backspace () (interactive) (term-send-raw-string "\C-H")) 1227(defun term-send-backspace () (interactive) (term-send-raw-string "\C-?"))
1200 1228
1201(defun term-char-mode () 1229(defun term-char-mode ()
1202 "Switch to char (\"raw\") sub-mode of term mode. 1230 "Switch to char (\"raw\") sub-mode of term mode.
@@ -1366,14 +1394,15 @@ The main purpose is to get rid of the local keymap."
1366 "%s%s:li#%d:co#%d:cl=\\E[H\\E[J:cd=\\E[J:bs:am:xn:cm=\\E[%%i%%d;%%dH\ 1394 "%s%s:li#%d:co#%d:cl=\\E[H\\E[J:cd=\\E[J:bs:am:xn:cm=\\E[%%i%%d;%%dH\
1367:nd=\\E[C:up=\\E[A:ce=\\E[K:ho=\\E[H:pt\ 1395:nd=\\E[C:up=\\E[A:ce=\\E[K:ho=\\E[H:pt\
1368:al=\\E[L:dl=\\E[M:DL=\\E[%%dM:AL=\\E[%%dL:cs=\\E[%%i%%d;%%dr:sf=^J\ 1396:al=\\E[L:dl=\\E[M:DL=\\E[%%dM:AL=\\E[%%dL:cs=\\E[%%i%%d;%%dr:sf=^J\
1369:te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\
1370:dc=\\E[P:DC=\\E[%%dP:IC=\\E[%%d@:im=\\E[4h:ei=\\E[4l:mi:\ 1397:dc=\\E[P:DC=\\E[%%dP:IC=\\E[%%d@:im=\\E[4h:ei=\\E[4l:mi:\
1371:so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:md=\\E[1m:mr=\\E[7m:me=\\E[m\ 1398:so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:md=\\E[1m:mr=\\E[7m:me=\\E[m\
1372:UP=\\E[%%dA:DO=\\E[%%dB:LE=\\E[%%dD:RI=\\E[%%dC\ 1399:UP=\\E[%%dA:DO=\\E[%%dB:LE=\\E[%%dD:RI=\\E[%%dC\
1373:kl=\\EOD:kd=\\EOB:kr=\\EOC:ku=\\EOA:kN=\\E[6~:kP=\\E[5~:@7=\\E[4~:kh=\\E[1~\ 1400:kl=\\EOD:kd=\\EOB:kr=\\EOC:ku=\\EOA:kN=\\E[6~:kP=\\E[5~:@7=\\E[4~:kh=\\E[1~\
1374:mk=\\E[8m:cb=\\E[1K:op=\\E[39;49m:Co#8:pa#64:AB=\\E[4%%dm:AF=\\E[3%%dm:cr=^M\ 1401:mk=\\E[8m:cb=\\E[1K:op=\\E[39;49m:Co#8:pa#64:AB=\\E[4%%dm:AF=\\E[3%%dm:cr=^M\
1375:bl=^G:do=^J:le=^H:ta=^I:se=\E[27m:ue=\E24m:" 1402:bl=^G:do=^J:le=^H:ta=^I:se=\E[27m:ue=\E24m\
1403:kb=^?:kD=^[[3~:sc=\E7:rc=\E8:"
1376;;; : -undefine ic 1404;;; : -undefine ic
1405;;; don't define :te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\
1377 "termcap capabilities supported") 1406 "termcap capabilities supported")
1378 1407
1379;;; This auxiliary function cranks up the process for term-exec in 1408;;; This auxiliary function cranks up the process for term-exec in
@@ -1400,9 +1429,10 @@ The main purpose is to get rid of the local keymap."
1400 (process-connection-type t) 1429 (process-connection-type t)
1401 ;; We should suppress conversion of end-of-line format. 1430 ;; We should suppress conversion of end-of-line format.
1402 (inhibit-eol-conversion t) 1431 (inhibit-eol-conversion t)
1403 ;; inhibit-eol-conversion doesn't seem to do the job, but this does. 1432 ;; The process's output contains not just chars but also binary
1404 (coding-system-for-read 'unknown-unix) 1433 ;; escape codes, so we need to see the raw output. We will have to
1405 ) 1434 ;; do the decoding by hand on the parts that are made of chars.
1435 (coding-system-for-read 'binary))
1406 (apply 'start-process name buffer 1436 (apply 'start-process name buffer
1407 "/bin/sh" "-c" 1437 "/bin/sh" "-c"
1408 (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\ 1438 (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\
@@ -2693,7 +2723,12 @@ See `term-prompt-regexp'."
2693 (if (not funny) (setq funny str-length)) 2723 (if (not funny) (setq funny str-length))
2694 (cond ((> funny i) 2724 (cond ((> funny i)
2695 (cond ((eq term-terminal-state 1) 2725 (cond ((eq term-terminal-state 1)
2696 (term-move-columns 1) 2726 ;; We are in state 1, we need to wrap
2727 ;; around. Go to the beginning of
2728 ;; the next line and switch to state
2729 ;; 0.
2730 (term-down 1)
2731 (term-move-columns (- (term-current-column)))
2697 (setq term-terminal-state 0))) 2732 (setq term-terminal-state 0)))
2698 (setq count (- funny i)) 2733 (setq count (- funny i))
2699 (setq temp (- (+ (term-horizontal-column) count) 2734 (setq temp (- (+ (term-horizontal-column) count)
@@ -2702,6 +2737,7 @@ See `term-prompt-regexp'."
2702 ((> count temp) ;; Some chars fit. 2737 ((> count temp) ;; Some chars fit.
2703 ;; This iteration, handle only what fits. 2738 ;; This iteration, handle only what fits.
2704 (setq count (- count temp)) 2739 (setq count (- count temp))
2740 (setq temp 0)
2705 (setq funny (+ count i))) 2741 (setq funny (+ count i)))
2706 ((or (not (or term-pager-count 2742 ((or (not (or term-pager-count
2707 term-scroll-with-delete)) 2743 term-scroll-with-delete))
@@ -2722,7 +2758,7 @@ See `term-prompt-regexp'."
2722 ;; following point if not eob nor insert-mode. 2758 ;; following point if not eob nor insert-mode.
2723 (let ((old-column (current-column)) 2759 (let ((old-column (current-column))
2724 columns pos) 2760 columns pos)
2725 (insert (substring str i funny)) 2761 (insert (decode-coding-string (substring str i funny) locale-coding-system))
2726 (setq term-current-column (current-column) 2762 (setq term-current-column (current-column)
2727 columns (- term-current-column old-column)) 2763 columns (- term-current-column old-column))
2728 (when (not (or (eobp) term-insert-mode)) 2764 (when (not (or (eobp) term-insert-mode))
@@ -2741,7 +2777,7 @@ See `term-prompt-regexp'."
2741 (setq term-terminal-state 1))) 2777 (setq term-terminal-state 1)))
2742 (setq i (1- funny))) 2778 (setq i (1- funny)))
2743 ((and (setq term-terminal-state 0) 2779 ((and (setq term-terminal-state 0)
2744 (eq char ?\^I)) ; TAB 2780 (eq char ?\^I)) ; TAB (terminfo: ht)
2745 ;; FIXME: Does not handle line wrap! 2781 ;; FIXME: Does not handle line wrap!
2746 (setq count (term-current-column)) 2782 (setq count (term-current-column))
2747 (setq count (+ count 8 (- (mod count 8)))) 2783 (setq count (+ count 8 (- (mod count 8))))
@@ -2768,7 +2804,7 @@ See `term-prompt-regexp'."
2768 (if (not (and term-kill-echo-list 2804 (if (not (and term-kill-echo-list
2769 (term-check-kill-echo-list))) 2805 (term-check-kill-echo-list)))
2770 (term-down 1 t))) 2806 (term-down 1 t)))
2771 ((eq char ?\b) 2807 ((eq char ?\b) ;; (terminfo: cub1)
2772 (term-move-columns -1)) 2808 (term-move-columns -1))
2773 ((eq char ?\033) ; Escape 2809 ((eq char ?\033) ; Escape
2774 (setq term-terminal-state 2)) 2810 (setq term-terminal-state 2))
@@ -2818,13 +2854,13 @@ See `term-prompt-regexp'."
2818 ((eq char ?M) ;; scroll reversed 2854 ((eq char ?M) ;; scroll reversed
2819 (term-insert-lines 1) 2855 (term-insert-lines 1)
2820 (setq term-terminal-state 0)) 2856 (setq term-terminal-state 0))
2821 ((eq char ?7) ;; Save cursor 2857 ((eq char ?7) ;; Save cursor (terminfo: sc)
2822 (term-handle-deferred-scroll) 2858 (term-handle-deferred-scroll)
2823 (setq term-saved-cursor 2859 (setq term-saved-cursor
2824 (cons (term-current-row) 2860 (cons (term-current-row)
2825 (term-horizontal-column))) 2861 (term-horizontal-column)))
2826 (setq term-terminal-state 0)) 2862 (setq term-terminal-state 0))
2827 ((eq char ?8) ;; Restore cursor 2863 ((eq char ?8) ;; Restore cursor (terminfo: rc)
2828 (if term-saved-cursor 2864 (if term-saved-cursor
2829 (term-goto (car term-saved-cursor) 2865 (term-goto (car term-saved-cursor)
2830 (cdr term-saved-cursor))) 2866 (cdr term-saved-cursor)))
@@ -2976,13 +3012,13 @@ See `term-prompt-regexp'."
2976 ((eq parameter 8) 3012 ((eq parameter 8)
2977 (setq term-ansi-current-invisible 1)) 3013 (setq term-ansi-current-invisible 1))
2978 3014
2979;;; Reset reverse (i.e. terminfo rmso) 3015;;; Reset underline (i.e. terminfo rmul)
2980 ((eq parameter 24) 3016 ((eq parameter 24)
2981 (setq term-ansi-current-reverse 0)) 3017 (setq term-ansi-current-underline 0))
2982 3018
2983;;; Reset underline (i.e. terminfo rmul) 3019;;; Reset reverse (i.e. terminfo rmso)
2984 ((eq parameter 27) 3020 ((eq parameter 27)
2985 (setq term-ansi-current-underline 0)) 3021 (setq term-ansi-current-reverse 0))
2986 3022
2987;;; Foreground 3023;;; Foreground
2988 ((and (>= parameter 30) (<= parameter 37)) 3024 ((and (>= parameter 30) (<= parameter 37))
@@ -3097,7 +3133,7 @@ See `term-prompt-regexp'."
3097 (term-goto 3133 (term-goto
3098 (1- term-terminal-previous-parameter) 3134 (1- term-terminal-previous-parameter)
3099 (1- term-terminal-parameter))) 3135 (1- term-terminal-parameter)))
3100 ;; \E[A - cursor up 3136 ;; \E[A - cursor up (terminfo: cuu1)
3101 ((eq char ?A) 3137 ((eq char ?A)
3102 (term-handle-deferred-scroll) 3138 (term-handle-deferred-scroll)
3103 (term-down (- (max 1 term-terminal-parameter)) t)) 3139 (term-down (- (max 1 term-terminal-parameter)) t))
@@ -3110,13 +3146,13 @@ See `term-prompt-regexp'."
3110 ;; \E[D - cursor left 3146 ;; \E[D - cursor left
3111 ((eq char ?D) 3147 ((eq char ?D)
3112 (term-move-columns (- (max 1 term-terminal-parameter)))) 3148 (term-move-columns (- (max 1 term-terminal-parameter))))
3113 ;; \E[J - clear to end of screen 3149 ;; \E[J - clear to end of screen (terminfo: ed, clear)
3114 ((eq char ?J) 3150 ((eq char ?J)
3115 (term-erase-in-display term-terminal-parameter)) 3151 (term-erase-in-display term-terminal-parameter))
3116 ;; \E[K - clear to end of line 3152 ;; \E[K - clear to end of line (terminfo: el, el1)
3117 ((eq char ?K) 3153 ((eq char ?K)
3118 (term-erase-in-line term-terminal-parameter)) 3154 (term-erase-in-line term-terminal-parameter))
3119 ;; \E[L - insert lines 3155 ;; \E[L - insert lines (terminfo: il, il1)
3120 ((eq char ?L) 3156 ((eq char ?L)
3121 (term-insert-lines (max 1 term-terminal-parameter))) 3157 (term-insert-lines (max 1 term-terminal-parameter)))
3122 ;; \E[M - delete lines 3158 ;; \E[M - delete lines
@@ -3130,19 +3166,22 @@ See `term-prompt-regexp'."
3130 (term-insert-spaces (max 1 term-terminal-parameter))) 3166 (term-insert-spaces (max 1 term-terminal-parameter)))
3131 ;; \E[?h - DEC Private Mode Set 3167 ;; \E[?h - DEC Private Mode Set
3132 ((eq char ?h) 3168 ((eq char ?h)
3133 (cond ((eq term-terminal-parameter 4) 3169 (cond ((eq term-terminal-parameter 4) ;; (terminfo: smir)
3134 (setq term-insert-mode t)) 3170 (setq term-insert-mode t))
3135 ((eq term-terminal-parameter 47) 3171 ;; ((eq term-terminal-parameter 47) ;; (terminfo: smcup)
3136 (term-switch-to-alternate-sub-buffer t)))) 3172 ;; (term-switch-to-alternate-sub-buffer t))
3173 ))
3137 ;; \E[?l - DEC Private Mode Reset 3174 ;; \E[?l - DEC Private Mode Reset
3138 ((eq char ?l) 3175 ((eq char ?l)
3139 (cond ((eq term-terminal-parameter 4) 3176 (cond ((eq term-terminal-parameter 4) ;; (terminfo: rmir)
3140 (setq term-insert-mode nil)) 3177 (setq term-insert-mode nil))
3141 ((eq term-terminal-parameter 47) 3178 ;; ((eq term-terminal-parameter 47) ;; (terminfo: rmcup)
3142 (term-switch-to-alternate-sub-buffer nil)))) 3179 ;; (term-switch-to-alternate-sub-buffer nil))
3180 ))
3143 3181
3144;;; Modified to allow ansi coloring -mm 3182;;; Modified to allow ansi coloring -mm
3145 ;; \E[m - Set/reset standard mode 3183 ;; \E[m - Set/reset modes, set bg/fg
3184 ;;(terminfo: smso,rmso,smul,rmul,rev,bold,sgr0,invis,op,setab,setaf)
3146 ((eq char ?m) 3185 ((eq char ?m)
3147 (when (= term-terminal-more-parameters 1) 3186 (when (= term-terminal-more-parameters 1)
3148 (if (>= term-terminal-previous-parameter-4 0) 3187 (if (>= term-terminal-previous-parameter-4 0)
@@ -3186,32 +3225,32 @@ The top-most line is line 0."
3186 (not (and (= term-scroll-start 0) 3225 (not (and (= term-scroll-start 0)
3187 (= term-scroll-end term-height)))))) 3226 (= term-scroll-end term-height))))))
3188 3227
3189(defun term-switch-to-alternate-sub-buffer (set) 3228;; (defun term-switch-to-alternate-sub-buffer (set)
3190 ;; If asked to switch to (from) the alternate sub-buffer, and already (not) 3229;; ;; If asked to switch to (from) the alternate sub-buffer, and already (not)
3191 ;; using it, do nothing. This test is needed for some programs (including 3230;; ;; using it, do nothing. This test is needed for some programs (including
3192 ;; Emacs) that emit the ti termcap string twice, for unknown reason. 3231;; ;; Emacs) that emit the ti termcap string twice, for unknown reason.
3193 (term-handle-deferred-scroll) 3232;; (term-handle-deferred-scroll)
3194 (if (eq set (not (term-using-alternate-sub-buffer))) 3233;; (if (eq set (not (term-using-alternate-sub-buffer)))
3195 (let ((row (term-current-row)) 3234;; (let ((row (term-current-row))
3196 (col (term-horizontal-column))) 3235;; (col (term-horizontal-column)))
3197 (cond (set 3236;; (cond (set
3198 (goto-char (point-max)) 3237;; (goto-char (point-max))
3199 (if (not (eq (preceding-char) ?\n)) 3238;; (if (not (eq (preceding-char) ?\n))
3200 (term-insert-char ?\n 1)) 3239;; (term-insert-char ?\n 1))
3201 (setq term-scroll-with-delete t) 3240;; (setq term-scroll-with-delete t)
3202 (setq term-saved-home-marker (copy-marker term-home-marker)) 3241;; (setq term-saved-home-marker (copy-marker term-home-marker))
3203 (set-marker term-home-marker (point))) 3242;; (set-marker term-home-marker (point)))
3204 (t 3243;; (t
3205 (setq term-scroll-with-delete 3244;; (setq term-scroll-with-delete
3206 (not (and (= term-scroll-start 0) 3245;; (not (and (= term-scroll-start 0)
3207 (= term-scroll-end term-height)))) 3246;; (= term-scroll-end term-height))))
3208 (set-marker term-home-marker term-saved-home-marker) 3247;; (set-marker term-home-marker term-saved-home-marker)
3209 (set-marker term-saved-home-marker nil) 3248;; (set-marker term-saved-home-marker nil)
3210 (setq term-saved-home-marker nil) 3249;; (setq term-saved-home-marker nil)
3211 (goto-char term-home-marker))) 3250;; (goto-char term-home-marker)))
3212 (setq term-current-column nil) 3251;; (setq term-current-column nil)
3213 (setq term-current-row 0) 3252;; (setq term-current-row 0)
3214 (term-goto row col)))) 3253;; (term-goto row col))))
3215 3254
3216;; Default value for the symbol term-command-hook. 3255;; Default value for the symbol term-command-hook.
3217 3256
@@ -3521,11 +3560,11 @@ all pending output has been dealt with."))
3521 (if (not (bolp)) (insert-before-markers ?\n))) 3560 (if (not (bolp)) (insert-before-markers ?\n)))
3522 3561
3523(defun term-erase-in-line (kind) 3562(defun term-erase-in-line (kind)
3524 (if (> kind 1) ;; erase left of point 3563 (if (= kind 1) ;; erase left of point
3525 (let ((cols (term-horizontal-column)) (saved-point (point))) 3564 (let ((cols (term-horizontal-column)) (saved-point (point)))
3526 (term-vertical-motion 0) 3565 (term-vertical-motion 0)
3527 (delete-region (point) saved-point) 3566 (delete-region (point) saved-point)
3528 (term-insert-char ?\n cols))) 3567 (term-insert-char ? cols)))
3529 (if (not (eq kind 1)) ;; erase right of point 3568 (if (not (eq kind 1)) ;; erase right of point
3530 (let ((saved-point (point)) 3569 (let ((saved-point (point))
3531 (wrapped (and (zerop (term-horizontal-column)) 3570 (wrapped (and (zerop (term-horizontal-column))
@@ -3624,7 +3663,7 @@ Should only be called when point is at the start of a screen line."
3624 (term-insert-char ?\n lines) 3663 (term-insert-char ?\n lines)
3625 (goto-char start))) 3664 (goto-char start)))
3626 3665
3627(defun term-set-output-log (name) 3666(defun term-start-output-log (name)
3628 "Record raw inferior process output in a buffer." 3667 "Record raw inferior process output in a buffer."
3629 (interactive (list (if term-log-buffer 3668 (interactive (list (if term-log-buffer
3630 nil 3669 nil
@@ -3646,10 +3685,10 @@ Should only be called when point is at the start of a screen line."
3646 (message "Recording terminal emulator output into buffer \"%s\"" 3685 (message "Recording terminal emulator output into buffer \"%s\""
3647 (buffer-name term-log-buffer)))) 3686 (buffer-name term-log-buffer))))
3648 3687
3649(defun term-stop-photo () 3688(defun term-stop-output-log ()
3650 "Discontinue raw inferior process logging." 3689 "Discontinue raw inferior process logging."
3651 (interactive) 3690 (interactive)
3652 (term-set-output-log nil)) 3691 (term-start-output-log nil))
3653 3692
3654(defun term-show-maximum-output () 3693(defun term-show-maximum-output ()
3655 "Put the end of the buffer at the bottom of the window." 3694 "Put the end of the buffer at the bottom of the window."
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
index f25bec2d841..c2ed47cb48d 100644
--- a/lisp/textmodes/enriched.el
+++ b/lisp/textmodes/enriched.el
@@ -102,7 +102,7 @@ expression, which is evaluated to get the string to insert.")
102(defconst enriched-annotation-regexp "<\\(/\\)?\\([-A-Za-z0-9]+\\)>" 102(defconst enriched-annotation-regexp "<\\(/\\)?\\([-A-Za-z0-9]+\\)>"
103 "Regular expression matching enriched-text annotations.") 103 "Regular expression matching enriched-text annotations.")
104 104
105(defconst enriched-translations 105(defvar enriched-translations
106 '((face (bold-italic "bold" "italic") 106 '((face (bold-italic "bold" "italic")
107 (bold "bold") 107 (bold "bold")
108 (italic "italic") 108 (italic "italic")
@@ -154,6 +154,12 @@ them and their old values to `enriched-old-bindings'."
154The value is a list of \(VAR VALUE VAR VALUE...).") 154The value is a list of \(VAR VALUE VAR VALUE...).")
155(make-variable-buffer-local 'enriched-old-bindings) 155(make-variable-buffer-local 'enriched-old-bindings)
156 156
157;; The next variable is buffer local if and only if Enriched mode is
158;; enabled. The buffer local value records whether
159;; `default-text-properties' should remain buffer local when disabling
160;; Enriched mode. For technical reasons, the default value should be t.
161(defvar enriched-default-text-properties-local-flag t)
162
157;; Technical internal variable. Bound to t if `enriched-mode' is 163;; Technical internal variable. Bound to t if `enriched-mode' is
158;; being rerun by a major mode to allow it to restore buffer-local 164;; being rerun by a major mode to allow it to restore buffer-local
159;; variables and to correctly update `enriched-old-bindings'. 165;; variables and to correctly update `enriched-old-bindings'.
@@ -169,7 +175,7 @@ The value is a list of \(VAR VALUE VAR VALUE...).")
169 "Minor mode for editing text/enriched files. 175 "Minor mode for editing text/enriched files.
170These are files with embedded formatting information in the MIME standard 176These are files with embedded formatting information in the MIME standard
171text/enriched format. 177text/enriched format.
172Turning the mode on runs `enriched-mode-hook'. 178Turning the mode on or off runs `enriched-mode-hook'.
173 179
174More information about Enriched mode is available in the file 180More information about Enriched mode is available in the file
175etc/enriched.doc in the Emacs distribution directory. 181etc/enriched.doc in the Emacs distribution directory.
@@ -183,7 +189,11 @@ Commands:
183 (setq buffer-file-format (delq 'text/enriched buffer-file-format)) 189 (setq buffer-file-format (delq 'text/enriched buffer-file-format))
184 ;; restore old variable values 190 ;; restore old variable values
185 (while enriched-old-bindings 191 (while enriched-old-bindings
186 (set (pop enriched-old-bindings) (pop enriched-old-bindings)))) 192 (set (pop enriched-old-bindings) (pop enriched-old-bindings)))
193 (unless enriched-default-text-properties-local-flag
194 (kill-local-variable 'default-text-properties))
195 (kill-local-variable 'enriched-default-text-properties-local-flag)
196 (unless use-hard-newlines (use-hard-newlines 0)))
187 197
188 ((and (memq 'text/enriched buffer-file-format) 198 ((and (memq 'text/enriched buffer-file-format)
189 (not enriched-rerun-flag)) 199 (not enriched-rerun-flag))
@@ -196,7 +206,11 @@ Commands:
196 ;; These will be restored if we exit Enriched mode. 206 ;; These will be restored if we exit Enriched mode.
197 (setq enriched-old-bindings 207 (setq enriched-old-bindings
198 (list 'buffer-display-table buffer-display-table 208 (list 'buffer-display-table buffer-display-table
199 'default-text-properties default-text-properties)) 209 'default-text-properties default-text-properties
210 'use-hard-newlines use-hard-newlines))
211 (make-local-variable 'enriched-default-text-properties-local-flag)
212 (setq enriched-default-text-properties-local-flag
213 (local-variable-p 'default-text-properties))
200 (make-local-variable 'default-text-properties) 214 (make-local-variable 'default-text-properties)
201 (setq buffer-display-table enriched-display-table) 215 (setq buffer-display-table enriched-display-table)
202 (use-hard-newlines 1 (if enriched-rerun-flag 'never nil)) 216 (use-hard-newlines 1 (if enriched-rerun-flag 'never nil))