From 9586e1d3a4255c58bf827400ab7c038a3ee988a3 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Fri, 23 Jul 2004 01:16:06 +0000 Subject: [PATCH 001/341] Improve DSC compliance. --- lisp/ChangeLog | 9 +++++++++ lisp/ps-print.el | 51 ++++++++++++++++++++++++++++++++++++------------ 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6ee3d9313c2..3ece6ce0fb8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2004-07-22 Vinicius Jose Latorre + + * ps-print.el: Doc fix. Improve the DSC compliance of the generated + PostScript. Suggested by Michael Piotrowski . + (ps-print-version): New version 6.6.5. + (ps-printing-region): Doc fix. + (ps-generate-string-list): Comment fix. + (ps-message-log-max, ps-begin-file): Code fix. + 2004-07-22 Kim F. Storm * progmodes/make-mode.el: Fix comments. diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 72ba4c24eed..9dca7986e7c 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -10,12 +10,12 @@ ;; Maintainer: Kenichi Handa (multi-byte characters) ;; Vinicius Jose Latorre ;; Keywords: wp, print, PostScript -;; Time-stamp: <2004/03/10 18:57:00 vinicius> -;; Version: 6.6.4 +;; Time-stamp: <2004/07/21 23:12:05 vinicius> +;; Version: 6.6.5 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ -(defconst ps-print-version "6.6.4" - "ps-print.el, v 6.6.4 <2004/03/10 vinicius> +(defconst ps-print-version "6.6.5" + "ps-print.el, v 6.6.5 <2004/07/21 vinicius> Vinicius's last change version -- this file may have been edited as part of Emacs without changes to the version number. When reporting bugs, please also @@ -1353,6 +1353,9 @@ Please send all bug fixes and enhancements to ;; Acknowledgments ;; --------------- ;; +;; Thanks to Michael Piotrowski for improving the DSC +;; compliance of the generated PostScript. +;; ;; Thanks to Adam Doppelt for face mapping suggestion ;; for black/white PostScript printers. ;; @@ -1424,7 +1427,7 @@ Please send all bug fixes and enhancements to ;; initial port to Emacs 19. His code is no longer part of ps-print, but his ;; work is still appreciated. ;; -;; Thanks to Remi Houdaille and Michel Train, michel@metasoft.fdn.org, for +;; Thanks to Remi Houdaille and Michel Train for ;; adding underline support. Their code also is no longer part of ps-print, ;; but their efforts are not forgotten. ;; @@ -4162,6 +4165,7 @@ If EXTENSION is any other symbol, it is ignored." (defun ps-message-log-max () (and (not (string= (buffer-name) "*Messages*")) + (boundp 'message-log-max) message-log-max)) @@ -4210,7 +4214,7 @@ If EXTENSION is any other symbol, it is ignored." (defvar ps-printing-region nil - "Variable used to indicate if the region that ps-print is printing. + "Variable used to indicate the region that ps-print is printing. It is a cons, the car of which is the line number where the region begins, and its cdr is the total number of lines in the buffer. Formatting functions can use this information to print the original line number (and not the number of @@ -4729,12 +4733,16 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th (let (str) (while content (setq str (cons (cond + ;; string ((stringp (car content)) (car content)) + ;; function symbol ((and (symbolp (car content)) (fboundp (car content))) (concat "(" (funcall (car content)) ")")) + ;; variable symbol ((and (symbolp (car content)) (boundp (car content))) (concat "(" (symbol-value (car content)) ")")) + ;; otherwise, empty string (t "")) str) @@ -5424,9 +5432,9 @@ XSTART YSTART are the relative position for the first page in a sheet.") ps-adobe-tag "%%Title: " (buffer-name) ; Take job name from name of ; first buffer printed - "\n%%Creator: " (user-full-name) - " (using ps-print v" ps-print-version - ")\n%%CreationDate: " (format-time-string "%T %b %d %Y") + "\n%%Creator: ps-print v" ps-print-version + "\n%%For: " (user-full-name) + "\n%%CreationDate: " (format-time-string "%T %b %d %Y") "\n%%Orientation: " (if ps-landscape-mode "Landscape" "Portrait") "\n%%DocumentNeededResources: font Times-Roman Times-Italic\n%%+ font " @@ -5434,8 +5442,11 @@ XSTART YSTART are the relative position for the first page in a sheet.") (ps-remove-duplicates (append (ps-fonts 'ps-font-for-text) (list (ps-font 'ps-font-for-header 'normal) - (ps-font 'ps-font-for-header 'bold)))) + (ps-font 'ps-font-for-header 'bold) + (ps-font 'ps-font-for-footer 'normal) + (ps-font 'ps-font-for-footer 'bold)))) "\n%%+ font ") + "\n%%DocumentSuppliedResources: procset PSPrintUserDefinedPrologue-" (user-login-name) " 0 0" "\n%%DocumentMedia: " (ps-page-dimensions-get-media dimensions) (format " %d" (round (ps-page-dimensions-get-width dimensions))) (format " %d" (round (ps-page-dimensions-get-height dimensions))) @@ -5455,11 +5466,11 @@ XSTART YSTART are the relative position for the first page in a sheet.") ps-error-handler-alist)) 1)) ; send to paper ps-print-prologue-0 - "\n%%BeginProcSet: UserDefinedPrologue\n\n") + "\n%%BeginResource: procset PSPrintUserDefinedPrologue-" (user-login-name) " 0 0\n\n") (ps-insert-string ps-user-defined-prologue) - (ps-output "\n%%EndProcSet\n\n") + (ps-output "\n%%EndResource\n\n") (ps-output-boolean "LandscapeMode " (or ps-landscape-mode @@ -5571,6 +5582,21 @@ XSTART YSTART are the relative position for the first page in a sheet.") (mapcar 'ps-output ps-background-all-pages) (ps-output "}def\n/printLocalBackground{\n}def\n") + (ps-output "\n%%EndProlog\n\n%%BeginSetup\n") + + (ps-output + "\n%%IncludeResource: font Times-Roman" + "\n%%IncludeResource: font Times-Italic\n%%IncludeResource: font " + (mapconcat 'identity + (ps-remove-duplicates + (append (ps-fonts 'ps-font-for-text) + (list (ps-font 'ps-font-for-header 'normal) + (ps-font 'ps-font-for-header 'bold) + (ps-font 'ps-font-for-footer 'normal) + (ps-font 'ps-font-for-footer 'bold)))) + "\n%%IncludeResource: font ") + "\n") + ;; Header/line number fonts (ps-output (format "/h0 %s(%s)cvn DefFont\n" ; /h0 14/Helvetica-Bold DefFont ps-header-title-font-size-internal @@ -5614,7 +5640,6 @@ XSTART YSTART are the relative position for the first page in a sheet.") (ps-output (format "/SpaceWidthRatio %f def\n" (/ (ps-lookup 'space-width) (ps-lookup 'size))))) - (ps-output "\n%%EndProlog\n\n%%BeginSetup\n") (unless (eq ps-spool-config 'lpr-switches) (ps-output "\n%%BeginFeature: *Duplex " (ps-boolean-capitalized ps-spool-duplex) From 55c4a67ca8fe8e5ffd67b70bdb7d278bc99c84ea Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 23 Jul 2004 11:53:07 +0000 Subject: [PATCH 002/341] (completion-setup-function): Compute the common parts and the first difference place correctly when partial-completion-mode is on. --- lisp/ChangeLog | 6 ++++++ lisp/simple.el | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3ece6ce0fb8..92246d2f95c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-07-23 Matt Hodges (tiny change) + + * simple.el (completion-setup-function): Compute the common parts + and the first difference place correctly when + partial-completion-mode is on. + 2004-07-22 Vinicius Jose Latorre * ps-print.el: Doc fix. Improve the DSC compliance of the generated diff --git a/lisp/simple.el b/lisp/simple.el index 9d61a390575..1e112b1be74 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4313,6 +4313,13 @@ of the differing parts is, by contrast, slightly highlighted." (if minibuffer-completing-file-name (with-current-buffer mainbuf (setq default-directory (file-name-directory mbuf-contents)))) + ;; If partial-completion-mode is on, point might not be after the + ;; last character in the minibuffer. + ;; FIXME: This still doesn't work if the text to be completed + ;; starts with a `-'. + (when (and partial-completion-mode (not (eobp))) + (setq mbuf-contents + (substring mbuf-contents 0 (- (point) (point-max))))) (with-current-buffer standard-output (completion-list-mode) (make-local-variable 'completion-reference-buffer) From d398de43be1a0a9197b2eef624fd4e2e7ae1e762 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 23 Jul 2004 12:20:22 +0000 Subject: [PATCH 003/341] (modify-all-frames-parameters): Minor doc fix. (set-frame-configuration): Doc fix. --- lisp/ChangeLog | 4 ++++ lisp/frame.el | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 92246d2f95c..866a88eb30e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-07-23 Luc Teirlinck + + * frame.el (modify-all-frames-parameters): Minor doc fix. + 2004-07-23 Matt Hodges (tiny change) * simple.el (completion-setup-function): Compute the common parts diff --git a/lisp/frame.el b/lisp/frame.el index 521938cfc18..bd63f9f46d1 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -520,7 +520,7 @@ React to settings of `default-frame-alist', `initial-frame-alist' there." ;;;; Creation of additional frames, and other frame miscellanea (defun modify-all-frames-parameters (alist) - "Modify all current and future frames parameters according to ALIST. + "Modify all current and future frames' parameters according to ALIST. This changes `default-frame-alist' and possibly `initial-frame-alist'. See help of `modify-frame-parameters' for more information." (let (element) ;; temp @@ -789,6 +789,8 @@ where "Restore the frames to the state described by CONFIGURATION. Each frame listed in CONFIGURATION has its position, size, window configuration, and other parameters set as specified in CONFIGURATION. +However, this function does not restore deleted frames. + Ordinarily, this function deletes all existing frames not listed in CONFIGURATION. But if optional second argument NODELETE is given and non-nil, the unwanted frames are iconified instead." From 833a249e8abe83b87a5a2321d870c351986649f8 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 23 Jul 2004 12:27:18 +0000 Subject: [PATCH 004/341] *** empty log message *** --- lisp/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 866a88eb30e..3f1f6ed7363 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,7 @@ 2004-07-23 Luc Teirlinck * frame.el (modify-all-frames-parameters): Minor doc fix. + (set-frame-configuration): Doc fix. 2004-07-23 Matt Hodges (tiny change) From bc135062b596bd876a72f9016fa6274ecd28b275 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Fri, 23 Jul 2004 18:25:57 +0000 Subject: [PATCH 005/341] (Defining Macros): Declaration keyword is `debug' not `edebug'. --- lispref/ChangeLog | 5 +++++ lispref/macros.texi | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 14b0fcb4606..f21788d526d 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +2004-07-23 John Paul Wallington + + * macros.texi (Defining Macros): Declaration keyword for setting + Edebug spec is `debug' not `edebug'. + 2004-07-19 Luc Teirlinck * windows.texi: Various small changes in addition to: diff --git a/lispref/macros.texi b/lispref/macros.texi index e903a159c27..e28ab80ac6b 100644 --- a/lispref/macros.texi +++ b/lispref/macros.texi @@ -239,7 +239,7 @@ additional information about it. Two kinds of specification are currently supported: @table @code -@item (edebug @var{edebug-form-spec}) +@item (debug @var{edebug-form-spec}) Specify how to step through macro calls for Edebug. @xref{Instrumenting Macro Calls}, for more details. From d5ef6196df647d17dfc608d82925965518ba6bb5 Mon Sep 17 00:00:00 2001 From: Ben Key Date: Sat, 24 Jul 2004 04:52:27 +0000 Subject: [PATCH 006/341] Removed the various "echo." lines from lisp\makefile.w32-in and nt\makefile.w32-in. They caused mingw32-make.exe bootstrap to fail with the following error if cmd.exe was being used as the shell: "process_begin: CreateProcess((null), echo., ...) failed." I replaced the "@echo." lines in nt\makefile.w32-in with "@echo ." This writes a . to the screen but that is far more desirable than make bootstrap failing. I replaced the "echo. ..." line in lisp\makefile.w32-in with "echo ;;; ...". This writes an extra comment line to loaddefs.el. Again this is far more desirable than make bootstrap failing. NOTE: I am using cmd.exe as my shell when building Emacs with MinGW instead of the sh.exe that comes with msys because when I use sh.exe as my shell, loaddefs.el does not get properly generated and I get various auto load errors. --- lisp/makefile.w32-in | 2 +- nt/makefile.w32-in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/makefile.w32-in b/lisp/makefile.w32-in index 826cf89bfec..b2694bc2b78 100644 --- a/lisp/makefile.w32-in +++ b/lisp/makefile.w32-in @@ -209,7 +209,7 @@ loaddefs.el-CMD: echo (autoload 'define-derived-mode "derived")>> $@ echo (autoload 'encoded-kbd-mode "encoded-kb")>> $@ echo (defvar cvs-global-menu nil)>> $@ - echo. >> $@ + echo ;;; >> $@ echo ;;; Local Variables:>> $@ echo ;;; version-control: never>> $@ echo ;;; no-byte-compile: t>> $@ diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in index adbb3fd57b8..ec30853ed29 100644 --- a/nt/makefile.w32-in +++ b/nt/makefile.w32-in @@ -111,10 +111,10 @@ maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE) doit: maybe-bootstrap-CMD: doit - @echo. + @echo . @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow - @echo. + @echo . @if not EXIST ..\lisp\abbrev.elc exit -1 maybe-bootstrap-SH: doit From 289978b5e2fb86a4d433e84c0de9a1f8f7f8e809 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 24 Jul 2004 12:52:44 +0000 Subject: [PATCH 007/341] (x_icon_verify): New function. (Fx_create_frame): Use it. (From Richard M. Stallman.) --- src/ChangeLog | 5 +++++ src/xfns.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index e51cdf554ce..8d9d72de9d2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-07-24 Richard M. Stallman + + * xfns.c (x_icon_verify): New function. + (Fx_create_frame): Use it. + 2004-07-22 Barry Fishman (tiny change) * s/gnu-linux.h: Use GC_MARK_STACK if __amd64__ is defined. diff --git a/src/xfns.c b/src/xfns.c index 931d31bcedf..dd8b4a4cb12 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -2633,6 +2633,28 @@ x_window (f) #endif /* not USE_GTK */ #endif /* not USE_X_TOOLKIT */ +/* Verify that the icon position args for this window are valid. */ + +static void +x_icon_verify (f, parms) + struct frame *f; + Lisp_Object parms; +{ + Lisp_Object icon_x, icon_y; + + /* Set the position of the icon. Note that twm groups all + icons in an icon window. */ + icon_x = x_frame_get_and_record_arg (f, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER); + icon_y = x_frame_get_and_record_arg (f, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER); + if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) + { + CHECK_NUMBER (icon_x); + CHECK_NUMBER (icon_y); + } + else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound)) + error ("Both left and top icon corners of icon must be specified"); +} + /* Handle the icon stuff for this window. Perhaps later we might want an x_set_icon_position which can be called interactively as well. */ @@ -3117,6 +3139,8 @@ This function is an internal primitive--use `make-frame' instead. */) tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); f->no_split = minibuffer_only || EQ (tem, Qt); + x_icon_verify (f, parms); + /* Create the X widget or window. */ #ifdef USE_X_TOOLKIT x_window (f, window_prompting, minibuffer_only); From 9a4ff31b1c0c2eb2bc52a4c5b5c61cceb70d9117 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 24 Jul 2004 15:33:15 +0000 Subject: [PATCH 008/341] Add 2004 Copyright. (Choosing Window): Add anchor. --- lispref/windows.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lispref/windows.texi b/lispref/windows.texi index a01dc79d1f1..0fdc6734181 100644 --- a/lispref/windows.texi +++ b/lispref/windows.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Emacs Lisp Reference Manual. -@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 +@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2004 @c Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. @setfilename ../info/windows @@ -1089,6 +1089,7 @@ presumably the window was previously made by this function. @end defun @defopt special-display-frame-alist +@anchor{Definition of special-display-frame-alist} This variable holds frame parameters for @code{special-display-popup-frame} to use when it creates a frame. @end defopt From 38f442c6259c98f519da00ffe8bf7f955a1ebb0a Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 24 Jul 2004 15:40:09 +0000 Subject: [PATCH 009/341] Add 2004 Copyright. --- lisp/autorevert.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/autorevert.el b/lisp/autorevert.el index ef438eb4b97..796ebaa27c8 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -1,6 +1,6 @@ ;;; autorevert.el --- revert buffers when files on disk change -;; Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc. ;; Author: Anders Lindgren ;; Keywords: convenience From e4ed805e9d3b9f2019cb9376682bb53dafaf81fb Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 24 Jul 2004 20:44:06 +0000 Subject: [PATCH 010/341] (Fselect_frame, Fset_frame_selected_window) (Fframe_visible_p, Fraise_frame): Doc fixes. --- src/frame.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/frame.c b/src/frame.c index 691ff8c44d5..78d803abc8d 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1,5 +1,5 @@ /* Generic frame functions. - Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2003 + Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2003, 2004 Free Software Foundation. This file is part of GNU Emacs. @@ -733,7 +733,12 @@ DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e", Subsequent editing commands apply to its selected window. The selection of FRAME lasts until the next time the user does something to select a different frame, or until the next time this -function is called. */) +function is called. If you are using a window system, the previously +selected frame may be restored as the selected frame after return to +the command loop, because it still may have the window system's input +focus. On a text-only terminal, the next redisplay will display FRAME. + +This function returns FRAME, or nil if FRAME has been deleted. */) (frame, no_enter) Lisp_Object frame, no_enter; { @@ -861,6 +866,7 @@ If omitted, FRAME defaults to the currently selected frame. */) DEFUN ("set-frame-selected-window", Fset_frame_selected_window, Sset_frame_selected_window, 2, 2, 0, doc: /* Set the selected window of frame object FRAME to WINDOW. +Return WINDOW. If FRAME is nil, the selected frame is used. If FRAME is the selected frame, this makes WINDOW the selected window. */) (frame, window) @@ -1711,7 +1717,11 @@ DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p, doc: /* Return t if FRAME is now \"visible\" (actually in use for display). A frame that is not \"visible\" is not updated and, if it works through a window system, it may not show at all. -Return the symbol `icon' if frame is visible only as an icon. */) +Return the symbol `icon' if frame is visible only as an icon. + +On a text-only terminal, all frames are considered visible, whether +they are currently being displayed or not, and this function returns t +for all frames. */) (frame) Lisp_Object frame; { @@ -1751,7 +1761,7 @@ DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list, DEFUN ("raise-frame", Fraise_frame, Sraise_frame, 0, 1, "", doc: /* Bring FRAME to the front, so it occludes any frames it overlaps. -If FRAME is invisible, make it visible. +If FRAME is invisible or iconified, make it visible. If you don't specify a frame, the selected frame is used. If Emacs is displaying on an ordinary terminal or some other device which doesn't support multiple overlapping frames, this function does nothing. */) From fc820cc5400e444db02b891dca8e728e692fef4d Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 24 Jul 2004 20:56:59 +0000 Subject: [PATCH 011/341] (Fcolor_supported_p): Doc fix. --- src/ChangeLog | 7 +++++++ src/xfaces.c | 1 + 2 files changed, 8 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 8d9d72de9d2..d10452c7fa5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2004-07-24 Luc Teirlinck + + * xfaces.c (Fcolor_supported_p): Doc fix. + + * frame.c (Fselect_frame, Fset_frame_selected_window) + (Fframe_visible_p, Fraise_frame): Doc fixes. + 2004-07-24 Richard M. Stallman * xfns.c (x_icon_verify): New function. diff --git a/src/xfaces.c b/src/xfaces.c index 7f5012f3e0a..f78ecacee1a 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1544,6 +1544,7 @@ DEFUN ("color-supported-p", Fcolor_supported_p, Scolor_supported_p, 1, 3, 0, doc: /* Return non-nil if COLOR can be displayed on FRAME. BACKGROUND-P non-nil means COLOR is used as a background. +Otherwise, this function tells whether it can be used as a foreground. If FRAME is nil or omitted, use the selected frame. COLOR must be a valid color name. */) (color, frame, background_p) From f22a74063c8024ab3012b511b668392ebef6995f Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Jul 2004 21:34:47 +0000 Subject: [PATCH 012/341] (occur-next-error): Call set-window-point. (occur-engine): Handle negative NLINES. --- lisp/replace.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/replace.el b/lisp/replace.el index f81c6f53914..f09868cc6d3 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -732,6 +732,8 @@ Compatibility function for \\[next-error] invocations." #'previous-single-property-change #'next-single-property-change) "No more matches") + ;; In case the *Occur* buffer is visible in a nonselected window. + (set-window-point (get-buffer-window (current-buffer)) (point)) (occur-mode-goto-occurrence)) @@ -1009,9 +1011,11 @@ See also `multi-occur'." ;; concatenate them all together. (apply #'concat (nconc - (occur-engine-add-prefix (nreverse (cdr (occur-accumulate-lines (- (1+ nlines)) keep-props)))) + (occur-engine-add-prefix (nreverse (cdr (occur-accumulate-lines (- (1+ (abs nlines))) keep-props)))) (list out-line) - (occur-engine-add-prefix (cdr (occur-accumulate-lines (1+ nlines) keep-props)))))))) + (if (> nlines 0) + (occur-engine-add-prefix + (cdr (occur-accumulate-lines (1+ nlines) keep-props))))))))) ;; Actually insert the match display data (with-current-buffer out-buf (let ((beg (point)) From ae1a6952defdd7e3bab25d2ce6be80e6c4bff315 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Jul 2004 21:35:32 +0000 Subject: [PATCH 013/341] (rmail-mime-charset-pattern): Don't include semicolon in the charset value. --- lisp/mail/rmail.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index bdf04be519a..f8e31dfda04 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -484,7 +484,7 @@ the variable `rmail-mime-feature'.") ;;;###autoload (defvar rmail-mime-charset-pattern - "^content-type:[ ]*text/plain;[ \t\n]*charset=\"?\\([^ \t\n\"]+\\)\"?" + "^content-type:[ ]*text/plain;[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?" "Regexp to match MIME-charset specification in a header of message. The first parenthesized expression should match the MIME-charset name.") From 2da347886f2b22ab497a39b3f07cc14664f2bc5d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Jul 2004 21:35:56 +0000 Subject: [PATCH 014/341] Update author email address. --- lisp/textmodes/flyspell.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index aff42866349..5238e131ab6 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -2,7 +2,7 @@ ;; Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. -;; Author: Manuel Serrano +;; Author: Manuel Serrano ;; Maintainer: FSF ;; Keywords: convenience From f70de7583e9312348f59b51fb1c7a826178eea52 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Jul 2004 21:37:11 +0000 Subject: [PATCH 015/341] (Fexpand_abbrev): Run Qpre_abbrev_expand_hook only when a real abbrev is present. --- src/abbrev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/abbrev.c b/src/abbrev.c index ac132f20023..37ab640ee43 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -248,8 +248,6 @@ Returns the abbrev symbol, if expansion took place. */) value = Qnil; - Frun_hooks (1, &Qpre_abbrev_expand_hook); - wordstart = 0; if (!(BUFFERP (Vabbrev_start_location_buffer) && XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) @@ -326,6 +324,8 @@ Returns the abbrev symbol, if expansion took place. */) if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) return value; + Frun_hooks (1, &Qpre_abbrev_expand_hook); + if (INTERACTIVE && !EQ (minibuf_window, selected_window)) { /* Add an undo boundary, in case we are doing this for From 2c77cf3b924db00738fd2f27afdc457dd79a9932 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Jul 2004 21:38:22 +0000 Subject: [PATCH 016/341] (Fwindow_at): Take account of FRAME_INTERNAL_BORDER_WIDTH. --- src/window.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/window.c b/src/window.c index 5aafd8a741a..409d0972fdd 100644 --- a/src/window.c +++ b/src/window.c @@ -938,8 +938,10 @@ column 0. */) CHECK_NUMBER_OR_FLOAT (y); return window_from_coordinates (f, - FRAME_PIXEL_X_FROM_CANON_X (f, x), - FRAME_PIXEL_Y_FROM_CANON_Y (f, y), + (FRAME_PIXEL_X_FROM_CANON_X (f, x) + + FRAME_INTERNAL_BORDER_WIDTH (f)), + (FRAME_PIXEL_Y_FROM_CANON_Y (f, y) + + FRAME_INTERNAL_BORDER_WIDTH (f)), 0, 0, 0, 0); } From 36e50520bb16e3b234c79500565a0dc1535ee383 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Jul 2004 21:39:32 +0000 Subject: [PATCH 017/341] (Fwrite_region): Doc fix. --- src/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index 1615bca3781..c417dcdf339 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4866,7 +4866,7 @@ instead of any buffer contents; END is ignored. Optional fourth argument APPEND if non-nil means append to existing file contents (if any). If it is an integer, seek to that offset in the file before writing. -Optional fifth argument VISIT if t means +Optional fifth argument VISIT, if t or a string, means set the last-save-file-modtime of buffer to this file's modtime and mark buffer not modified. If VISIT is a string, it is a second file name; From c2fb5878570cd785e16cf2a83d64023f25ff5c2d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Jul 2004 21:40:19 +0000 Subject: [PATCH 018/341] (not_single_kboard_state): Declared. --- src/keyboard.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/keyboard.h b/src/keyboard.h index d92f13a5059..4e14257359f 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -307,6 +307,7 @@ extern void echo_now P_ ((void)); extern void init_kboard P_ ((KBOARD *)); extern void delete_kboard P_ ((KBOARD *)); extern void single_kboard_state P_ ((void)); +extern void not_single_kboard_state P_ ((KBOARD *)); extern void push_frame_kboard P_ ((struct frame *)); extern void pop_frame_kboard P_ ((void)); extern void record_asynch_buffer_change P_ ((void)); From 074f1b8b8f3a9249a35254ce82dad8ab8a3b05c6 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Jul 2004 21:44:45 +0000 Subject: [PATCH 019/341] (Regexp Replace): Further update text for new replacement operators. --- man/search.texi | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/man/search.texi b/man/search.texi index 5fa130a2e50..c31bc60af62 100644 --- a/man/search.texi +++ b/man/search.texi @@ -1038,20 +1038,21 @@ text to replace with, you must enter @samp{\\}. You can also use Lisp expressions to calculate parts of the replacement string. To do this, write @samp{\,} followed by the expression in the replacement string. Each replacement calculates the -value of the expression, which ought to be a string, and uses it in +value of the expression and converts it to text without quoting (if +it's a string, this means using the string's contents), and uses it in the replacement string in place of the expression itself. If the expression is a symbol, one space in the replacement string after the -symbol name counts as part of the symbol name, so the value replaces -them both. +symbol name goes with the symbol name, so the value replaces them +both. - Inside such an expression, @samp{\&} and @samp{\@var{n}} used as -subexpressions refer respectively to the entire match as a string, and -to a submatch as a string. @var{n} may exceed 9 here, and the value -of @samp{\@var{n}} is @code{nil} if subexpression @var{n} did not -match. You can also use @samp{\#&} and @samp{\#@var{n}} refer to -those matches converted to numbers (this is valid when the match or -submatch has the form of a number). @samp{\#} stands for the number -of already-completed replacements. + Inside such an expression, you can use some special sequences. +@samp{\&} and @samp{\@var{n}} refer here, as usual, to the entire +match as a string, and to a submatch as a string. @var{n} may be +multiple digits, and the value of @samp{\@var{n}} is @code{nil} if +subexpression @var{n} did not match. You can also use @samp{\#&} and +@samp{\#@var{n}} to refer to those matches as numbers (this is valid +when the match or submatch has the form of a numeral). @samp{\#} here +too stands for the number of already-completed replacements. Repeating our example to exchange @samp{x} and @samp{y}, we can thus do it also this way: @@ -1061,9 +1062,9 @@ M-x replace-regexp @key{RET} \(x\)\|y @key{RET} \,(if \1 "y" "x") @key{RET} @end example - The @code{format} function (@pxref{Formatting Strings,,,elisp, GNU -Emacs Lisp Reference Manual}) comes in handy for computing replacement -strings for @samp{\,}. For example, to add consecutively numbered + For computing replacement strings for @samp{\,}, the @code{format} +function is often useful (@pxref{Formatting Strings,,,elisp, GNU Emacs +Lisp Reference Manual}). For example, to add consecutively numbered strings like @samp{ABC00042} to columns 73 @w{to 80} (unless they are already occupied), you can use @@ -1074,8 +1075,8 @@ M-x replace-regexp @key{RET} ^.\@{0,72\@}$ @key{RET} If you want to enter part of the replacement string by hand each time, use @samp{\?} in the replacement string. Each replacement will -enter a recursive edit, with point at the position where the @samp{\?} -was. For example, +ask you to edit the replacement string in the minibuffer, putting +point where the @samp{\?} was. For example, @example M-x replace-regexp @key{RET} \footnote@{ @key{RET} From 8de9d3f63168cc38e2bcb1878bb2344568a9200e Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 24 Jul 2004 21:45:28 +0000 Subject: [PATCH 020/341] (make-frame): Doc fix. --- lisp/frame.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/frame.el b/lisp/frame.el index bd63f9f46d1..a364d7f491b 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -612,7 +612,13 @@ You cannot specify either `width' or `height', you must use neither or both. Before the frame is created (via `frame-creation-function'), functions on the hook `before-make-frame-hook' are run. After the frame is created, functions -on `after-make-frame-functions' are run with one arg, the newly created frame." +on `after-make-frame-functions' are run with one arg, the newly created frame. + +This function itself does not make the new frame the selected frame. +The previously selected frame remains selected. However, the +window system may select the new frame for its own reasons, for +instance if the frame appears under the mouse pointer and your +setup is for focus to follow the pointer." (interactive) (run-hooks 'before-make-frame-hook) (let ((frame (funcall frame-creation-function parameters))) From d3d3f35df9782d8d812d175b47eed5fb8f79e6b3 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Jul 2004 21:46:06 +0000 Subject: [PATCH 021/341] (Paragraphs): Update how paragraphs are separated and the default for paragraph-separate. --- man/text.texi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/man/text.texi b/man/text.texi index 45c7e504d8a..dbf990a2b57 100644 --- a/man/text.texi +++ b/man/text.texi @@ -264,10 +264,10 @@ Put point and mark around this or next paragraph (@code{mark-paragraph}). @kbd{M-@{} moves to the beginning of the current or previous paragraph, while @kbd{M-@}} moves to the end of the current or next paragraph. Blank lines and text-formatter command lines separate -paragraphs and are not considered part of any paragraph. In Fundamental -mode, but not in Text mode, an indented line also starts a new -paragraph. (If a paragraph is preceded by a blank line, these commands -treat that blank line as the beginning of the paragraph.) +paragraphs and are not considered part of any paragraph. In Indented +Text mode, but not in Text mode, an indented line also starts a new +paragraph. (If a paragraph is preceded by a blank line, these +commands treat that blank line as the beginning of the paragraph.) In major modes for programs, paragraphs begin and end only at blank lines. This makes the paragraph commands continue to be useful even @@ -300,7 +300,7 @@ example, blank lines). Lines that start a new paragraph and are contained in it must match only @code{paragraph-start}, not @code{paragraph-separate}. For example, in Fundamental mode, @code{paragraph-start} is @w{@code{"[ \t\n\f]"}}, and -@code{paragraph-separate} is @w{@code{"[ \t\f]*$"}}. +@code{paragraph-separate} is @w{@code{"\f\\|[ \t]*$"}}. Normally it is desirable for page boundaries to separate paragraphs. The default values of these variables recognize the usual separator for From 7630911d6162623297a052bd75d8866440b73a68 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Jul 2004 21:46:27 +0000 Subject: [PATCH 022/341] *** empty log message *** --- lisp/ChangeLog | 8 ++++++++ man/ChangeLog | 8 ++++++++ src/ChangeLog | 9 +++++++++ 3 files changed, 25 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3f1f6ed7363..e5e354befb7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2004-07-24 Richard M. Stallman + + * mail/rmail.el (rmail-mime-charset-pattern): + Don't include semicolon in the charset value. + + * replace.el (occur-next-error): Call set-window-point. + (occur-engine): Handle negative NLINES. + 2004-07-23 Luc Teirlinck * frame.el (modify-all-frames-parameters): Minor doc fix. diff --git a/man/ChangeLog b/man/ChangeLog index e4aba6ce722..a36b0c75fe4 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,11 @@ +2004-07-24 Richard M. Stallman + + * text.texi (Paragraphs): Update how paragraphs are separated + and the default for paragraph-separate. + + * search.texi (Regexp Replace): Further update text for new + replacement operators. + 2004-07-18 Luc Teirlinck * emacs-xtra.texi (Subdir switches): Dired does not remember the diff --git a/src/ChangeLog b/src/ChangeLog index d10452c7fa5..398538484d7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -7,6 +7,15 @@ 2004-07-24 Richard M. Stallman + * keyboard.h (not_single_kboard_state): Declared. + + * fileio.c (Fwrite_region): Doc fix. + + * window.c (Fwindow_at): Take account of FRAME_INTERNAL_BORDER_WIDTH. + + * abbrev.c (Fexpand_abbrev): Run Qpre_abbrev_expand_hook + only when a real abbrev is present. + * xfns.c (x_icon_verify): New function. (Fx_create_frame): Use it. From 15a24762a411d82cb4b5ae1305c5ef0d60b130cf Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 24 Jul 2004 21:53:10 +0000 Subject: [PATCH 023/341] (x-get-selection, x-set-selection): Doc fixes. --- lisp/select.el | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/lisp/select.el b/lisp/select.el index c095ea50c44..565ddd7d22e 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -3,7 +3,7 @@ ;; Maintainer: FSF ;; Keywords: internal -;; Copyright (c) 1993, 1994 Free Software Foundation, Inc. +;; Copyright (c) 1993, 1994, 2004 Free Software Foundation, Inc. ;; Based partially on earlier release by Lucid. ;; This file is part of GNU Emacs. @@ -35,7 +35,11 @@ The argument TYPE (default `PRIMARY') says which selection, and the argument DATA-TYPE (default `STRING') says how to convert the data. -TYPE may be `SECONDARY' or `CLIPBOARD', in addition to `PRIMARY'. +TYPE may be any symbol \(but nil stands for `PRIMARY'). However, +only a few symbols are commonly used. They conventionally have +all upper-case names. The most often used ones, in addition to +`PRIMARY', are `SECONDARY' and `CLIPBOARD'. + DATA-TYPE is usually `STRING', but can also be one of the symbols in `selection-converter-alist', which see." (let ((data (x-get-selection-internal (or type 'PRIMARY) @@ -57,9 +61,11 @@ in `selection-converter-alist', which see." (defun x-set-selection (type data) "Make an X Windows selection of type TYPE and value DATA. -The argument TYPE (default `PRIMARY') says which selection, -and DATA specifies the contents. DATA may be a string, -a symbol, an integer (or a cons of two integers or list of two integers). +The argument TYPE (nil means `PRIMARY') says which selection, and +DATA specifies the contents. TYPE must be a symbol. \(It can also +be a string, which stands for the symbol with that name, but this +is considered obsolete.) DATA may be a string, a symbol, an +integer (or a cons of two integers or list of two integers). The selection may also be a cons of two markers pointing to the same buffer, or an overlay. In these cases, the selection is considered to be the text @@ -69,8 +75,11 @@ can alter the effective value of the selection. The data may also be a vector of valid non-vector selection values. -Interactively, the text of the region is used as the selection value -if the prefix arg is set." +The return value is DATA. + +Interactively, this command sets the primary selection. Without +prefix argument, it reads the selection in the minibuffer. With +prefix argument, it uses the text of the region as the selection value ." (interactive (if (not current-prefix-arg) (list 'PRIMARY (read-string "Set text for pasting: ")) (list 'PRIMARY (buffer-substring (region-beginning) (region-end))))) From b96b979c74bc652a77687e94a186727931e34058 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 24 Jul 2004 21:58:34 +0000 Subject: [PATCH 024/341] (tty-color-approximate): Doc fix. --- lisp/ChangeLog | 8 ++++++++ lisp/term/tty-colors.el | 13 ++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e5e354befb7..2b9ee25d96e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2004-07-24 Luc Teirlinck + + * term/tty-colors.el (tty-color-approximate): Doc fix. + + * select.el (x-get-selection, x-set-selection): Doc fixes. + + * frame.el (make-frame): Doc fix. + 2004-07-24 Richard M. Stallman * mail/rmail.el (rmail-mime-charset-pattern): diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el index 956d46738df..1de35822b39 100644 --- a/lisp/term/tty-colors.el +++ b/lisp/term/tty-colors.el @@ -864,15 +864,10 @@ of gray, thus the name." (if (< mag 1) 0 (acos (/ (+ r g b) mag))))) (defun tty-color-approximate (rgb &optional frame) - "Given a list of 3 rgb values in RGB, find the color in `tty-color-alist' -which is the best approximation in the 3-dimensional RGB space, -and return its description. - -Value is a list of the form \(NAME INDEX R G B\). Note that the returned -NAME is not necessarily the same string as the argument COLOR, because -the latter might need to be approximated if it is not supported directly. - -Each value of the RGB triplet should be in the range 0..65535 range. + "Find the color in `tty-color-alist' that best approximates RGB. +Value is a list of the form \(NAME INDEX R G B\). +The argument RGB should be an rgb value, that is, a list of three +integers in the 0..65535 range. FRAME defaults to the selected frame." (let* ((color-list (tty-color-alist frame)) (candidate (car color-list)) From b1895e7380ab93274b17e6458b27be2d7d10a985 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 24 Jul 2004 22:51:30 +0000 Subject: [PATCH 025/341] (Minibuffer Misc): Add anchor. --- lispref/minibuf.texi | 1 + 1 file changed, 1 insertion(+) diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi index bf858eff475..c0ee5c85881 100644 --- a/lispref/minibuf.texi +++ b/lispref/minibuf.texi @@ -1773,6 +1773,7 @@ This function returns the currently active minibuffer window, or @end defun @defun minibuffer-window &optional frame +@anchor{Definition of minibuffer-window} This function returns the minibuffer window used for frame @var{frame}. If @var{frame} is @code{nil}, that stands for the current frame. Note that the minibuffer window used by a frame need not be part of that From f478a72a621f6be3e3abea871adac762f81d34f8 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 24 Jul 2004 23:48:49 +0000 Subject: [PATCH 026/341] Various changes in addition to: (Creating Frames): Expand and clarify description of `make-frame'. (Window Frame Parameters): Either none or both of the `icon-left' and `icon-top' parameters must be specified. Put descriptions of `menu-bar-lines' and `toolbar-lines' closer together and change them accordingly. (Frame Titles): `multiple-frames' is not guaranteed to be accurate except while processing `frame-title-format' or `icon-title-format'. (Deleting Frames): Correct description of `delete-frame'. Non-nil return values of `frame-live-p' are like those of `framep'. (Frames and Windows): mention return value of `set-frame-selected-window'. (Visibility of Frames): Mention `force' argument to `make-frame-invisible'. `frame-visible-p' returns t for all frames on text-only terminals. (Frame Configurations): Restoring a frame configuration does not restore deleted frames. (Window System Selections): `x-set-selection' returns DATA. (Resources): Add example. (Display Feature Testing): Clarify descriptions of `display-pixel-height', `display-pixel-width', `x-server-version' and `x-server-vendor'. --- lispref/ChangeLog | 28 +++++++ lispref/frames.texi | 197 +++++++++++++++++++++++++++++--------------- 2 files changed, 158 insertions(+), 67 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index f21788d526d..146f2173864 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,31 @@ +2004-07-24 Luc Teirlinck + + * frames.texi: Various changes in addition to: + (Creating Frames): Expand and clarify description of `make-frame'. + (Window Frame Parameters): Either none or both of the `icon-left' + and `icon-top' parameters must be specified. Put descriptions of + `menu-bar-lines' and `toolbar-lines' closer together and change + them accordingly. + (Frame Titles): `multiple-frames' is not guaranteed to be accurate + except while processing `frame-title-format' or `icon-title-format'. + (Deleting Frames): Correct description of `delete-frame'. + Non-nil return values of `frame-live-p' are like those of `framep'. + (Frames and Windows): mention return value of + `set-frame-selected-window'. + (Visibility of Frames): Mention `force' argument to + `make-frame-invisible'. `frame-visible-p' returns t for all + frames on text-only terminals. + (Frame Configurations): Restoring a frame configuration does not + restore deleted frames. + (Window System Selections): `x-set-selection' returns DATA. + (Resources): Add example. + (Display Feature Testing): Clarify descriptions of + `display-pixel-height', `display-pixel-width', `x-server-version' + and `x-server-vendor'. + + * windows.texi (Choosing Window): Add anchor. + * minibuf.texi (Minibuffer Misc): Add anchor. + 2004-07-23 John Paul Wallington * macros.texi (Defining Macros): Declaration keyword for setting diff --git a/lispref/frames.texi b/lispref/frames.texi index 61522e3598c..6d7b956af64 100644 --- a/lispref/frames.texi +++ b/lispref/frames.texi @@ -79,8 +79,9 @@ controlling Emacs redisplay. To create a new frame, call the function @code{make-frame}. @defun make-frame &optional alist -This function creates a new frame. If you are using a supported window -system, it makes a window frame; otherwise, it makes a terminal frame. +This function creates and returns a new frame, displaying the current +buffer. If you are using a supported window system, it makes a window +frame; otherwise, it makes a terminal frame. The argument is an alist specifying frame parameters. Any parameters not mentioned in @var{alist} default according to the value of the @@ -91,6 +92,12 @@ your system. The set of possible parameters depends in principle on what kind of window system Emacs uses to display its frames. @xref{Window Frame Parameters}, for documentation of individual parameters you can specify. + +This function itself does not make the new frame the selected frame. +@xref{Input Focus}. The previously selected frame remains selected. +However, the window system may select the new frame for its own reasons, +for instance if the frame appears under the mouse pointer and your +setup is for focus to follow the pointer. @end defun @defvar before-make-frame-hook @@ -138,9 +145,10 @@ names that they share a single keyboard, and it treats them as a single terminal. @deffn Command make-frame-on-display display &optional parameters -This creates a new frame on display @var{display}, taking the other -frame parameters from @var{parameters}. Aside from the @var{display} -argument, it is like @code{make-frame} (@pxref{Creating Frames}). +This creates and returns a new frame on display @var{display}, taking +the other frame parameters from @var{parameters}. Aside from the +@var{display} argument, it is like @code{make-frame} (@pxref{Creating +Frames}). @end deffn @defun x-display-list @@ -165,7 +173,7 @@ look like: "*BorderWidth: 3\n*InternalBorder: 2\n" @end example -@xref{Resources}. +@xref{X Resources,, X Resources, emacs, The GNU Emacs Manual}. If @var{must-succeed} is non-@code{nil}, failure to open the connection terminates Emacs. Otherwise, it is an ordinary Lisp error. @@ -207,9 +215,10 @@ frame. @defun frame-parameter frame parameter @tindex frame-parameter -This function returns the value of the parameter named @var{parameter} -of @var{frame}. If @var{frame} is @code{nil}, it returns the -selected frame's parameter. +This function returns the value of the parameter @var{parameter} (a +symbol) of @var{frame}. If @var{frame} is @code{nil}, it returns the +selected frame's parameter. If @var{frame} has no setting for +@var{parameter}, this function returns @code{nil}. @end defun @defun frame-parameters &optional frame @@ -230,8 +239,8 @@ frame. @defun modify-all-frames-parameters alist This function alters the frame parameters of all existing frames according to @var{alist}, then modifies @code{default-frame-alist} -to apply the same parameter values to frames that will be created -henceforth. +(and, if necessary, @code{initial-frame-alist}) to apply the same +parameter values to frames that will be created henceforth. @end defun @node Initial Parameters @@ -285,9 +294,12 @@ This is an alist specifying default values of frame parameters for all Emacs frames---the first frame, and subsequent frames. When using the X Window System, you can get the same results by means of X resources in many cases. + +Setting this variable does not affect existing frames. @end defvar -See also @code{special-display-frame-alist}, in @ref{Choosing Window}. +See also @code{special-display-frame-alist}. @xref{Definition of +special-display-frame-alist}. If you use options that specify window appearance when you invoke Emacs, they take effect by adding elements to @code{default-frame-alist}. One @@ -368,6 +380,10 @@ The screen position of the left edge @emph{of the frame's icon}, in pixels, counting from the left edge of the screen. This takes effect if and when the frame is iconified. +If you specify a value for this parameter, then you must also specify +a value for @code{icon-top} and vice versa. The window manager may +ignore these two parameters. + @item icon-top The screen position of the top edge @emph{of the frame's icon}, in pixels, counting from the top edge of the screen. This takes effect if @@ -528,8 +544,8 @@ The combined fringe widths must add up to an integral number of columns, so the actual default fringe widths for the frame may be larger than the specified values. The extra width needed to reach an acceptable total is distributed evenly between the left and right -fringe. However, you can force one frame or the other to a precise -width by specifying that width a negative integer. If both widths are +fringe. However, you can force one fringe or the other to a precise +width by specifying that width as a negative integer. If both widths are negative, only the left fringe gets the specified width. @item unsplittable @@ -541,10 +557,15 @@ The state of visibility of the frame. There are three possibilities: iconified. @xref{Visibility of Frames}. @item menu-bar-lines -The number of lines to allocate at the top of the frame for a menu bar. -The default is 1. @xref{Menu Bar}. (In Emacs versions that use the X -toolkit or GTK, there is only one menu bar line; all that matters about the -number you specify is whether it is greater than zero.) +The number of lines to allocate at the top of the frame for a menu +bar. The default is 1. A value of @code{nil} means don't display a +menu bar. @xref{Menu Bar}. (The X toolkit and GTK allow at most one +menu bar line; they treat larger values as 1.) + +@item tool-bar-lines +The number of lines to use for the toolbar. A value of @code{nil} means +don't display a tool bar. (GTK allows at most one tool bar line; it +treats larger values as 1.) @item screen-gamma @cindex gamma correction @@ -557,7 +578,7 @@ Emacs, and in X windows generally, are calibrated to display properly on a monitor with that gamma value. If you specify 2.2 for @code{screen-gamma}, that means no correction is needed. Other values request correction, designed to make the corrected colors appear on -your screen they way they would have appeared without correction on an +your screen the way they would have appeared without correction on an ordinary monitor with a gamma value of 2.2. If your monitor displays colors too light, you should specify a @@ -565,14 +586,14 @@ If your monitor displays colors too light, you should specify a that makes colors darker. A screen gamma value of 1.5 may give good results for LCD color displays. -@item tool-bar-lines -The number of lines to use for the toolbar. A value of @code{nil} means -don't display a tool bar. (In Emacs versions that use GTK, there is -only one tool bar line; all that matters about the number you specify -is whether it is greater than zero.) - @item line-spacing -Additional space put below text lines in pixels (a positive integer). +Additional space put below text lines, in pixels (a positive integer) + +@item wait-for-wm +If non-@code{nil}, tell Xt to wait for the window manager to confirm +geometry changes. Some window managers, including versions of Fvwm2 +and KDE, fail to confirm, so Xt hangs. Set this to @code{nil} to +prevent hanging with those window managers. @ignore @item parent-id @@ -637,12 +658,6 @@ equivalent to the @code{:foreground} attribute of the If non-@code{nil}, the color for the background of scroll bars. It is equivalent to the @code{:background} attribute of the @code{scroll-bar} face. - -@item wait-for-wm -If non-@code{nil}, tell Xt to wait for the window manager to confirm -geometry changes. Some window managers, including versions of Fvwm2 -and KDE, fail to confirm, so Xt hangs. Set this to @code{nil} to -prevent hanging with those window managers. @end table @node Size and Position @@ -818,6 +833,10 @@ there are two or more frames (not counting minibuffer-only frames or invisible frames). The default value of @code{frame-title-format} uses @code{multiple-frames} so as to put the buffer name in the frame title only when there is more than one frame. + +The value of this variable is not guaranteed to be accurate except +while processing @code{frame-title-format} or +@code{icon-title-format}. @end defvar @node Deleting Frames @@ -826,16 +845,14 @@ only when there is more than one frame. Frames remain potentially visible until you explicitly @dfn{delete} them. A deleted frame cannot appear on the screen, but continues to -exist as a Lisp object until there are no references to it. There is no -way to cancel the deletion of a frame aside from restoring a saved frame -configuration (@pxref{Frame Configurations}); this is similar to the -way windows behave. +exist as a Lisp object until there are no references to it. @deffn Command delete-frame &optional frame force @vindex delete-frame-functions -This function deletes the frame @var{frame} after running the hook -@code{delete-frame-functions} (each function gets one argument, -@var{frame}). By default, @var{frame} is the selected frame. +This function deletes the frame @var{frame}. Unless @var{frame} is a +tooltip, it first runs the hook @code{delete-frame-functions} (each +function gets one argument, @var{frame}). By default, @var{frame} is +the selected frame. A frame cannot be deleted if its minibuffer is used by other frames. Normally, you cannot delete a frame if all other frames are invisible, @@ -844,7 +861,8 @@ but if the @var{force} is non-@code{nil}, then you are allowed to do so. @defun frame-live-p frame The function @code{frame-live-p} returns non-@code{nil} if the frame -@var{frame} has not been deleted. +@var{frame} has not been deleted. The possible non-@code{nil} return +values are like those of @code{framep}. @xref{Frames}. @end defun Some window managers provide a command to delete a window. These work @@ -929,29 +947,31 @@ frame also selects this window. You can get the frame's current selected window with @code{frame-selected-window}. @defun frame-selected-window &optional frame -This function returns the window on @var{frame} that is selected within -@var{frame}. If omitted or @code{nil}, @var{frame} defaults to the selected frame. +This function returns the window on @var{frame} that is selected +within @var{frame}. If omitted or @code{nil}, @var{frame} defaults to +the selected frame. @end defun @defun set-frame-selected-window frame window This sets the selected window of frame @var{frame} to @var{window}. If @var{frame} is @code{nil}, it operates on the selected frame. If @var{frame} is the selected frame, this makes @var{window} the -selected window. +selected window. This function returns @var{window}. @end defun Conversely, selecting a window for Emacs with @code{select-window} also makes that window selected within its frame. @xref{Selecting Windows}. Another function that (usually) returns one of the windows in a given -frame is @code{minibuffer-window}. @xref{Minibuffer Misc}. +frame is @code{minibuffer-window}. @xref{Definition of minibuffer-window}. @node Minibuffers and Frames @section Minibuffers and Frames Normally, each frame has its own minibuffer window at the bottom, which is used whenever that frame is selected. If the frame has a minibuffer, -you can get it with @code{minibuffer-window} (@pxref{Minibuffer Misc}). +you can get it with @code{minibuffer-window} (@pxref{Definition of +minibuffer-window}). However, you can also create a frame with no minibuffer. Such a frame must use the minibuffer window of some other frame. When you create the @@ -966,8 +986,9 @@ when you enter the minibuffer. If so, set the variable @defvar default-minibuffer-frame This variable specifies the frame to use for the minibuffer window, by -default. It is always local to the current terminal and cannot be -buffer-local. @xref{Multiple Displays}. +default. It does not affect existing frames. It is always local to +the current terminal and cannot be buffer-local. @xref{Multiple +Displays}. @end defvar @node Input Focus @@ -1026,7 +1047,10 @@ function is not significant. This function selects frame @var{frame}, temporarily disregarding the focus of the X server if any. The selection of @var{frame} lasts until the next time the user does something to select a different frame, or -until the next time this function is called. The specified @var{frame} +until the next time this function is called. (If you are using a +window system, the previously selected frame may be restored as the +selected frame after return to the command loop, because it still may +have the window system's input focus.) The specified @var{frame} becomes the selected frame, as explained above, and the terminal that @var{frame} is on becomes the selected terminal. This function returns @var{frame}, or @code{nil} if @var{frame} has been deleted. @@ -1107,9 +1131,12 @@ This function makes frame @var{frame} visible. If you omit @var{frame}, it makes the selected frame visible. @end deffn -@deffn Command make-frame-invisible &optional frame +@deffn Command make-frame-invisible &optional frame force This function makes frame @var{frame} invisible. If you omit @var{frame}, it makes the selected frame invisible. + +Unless @var{force} is non-@code{nil}, this function refuses to make +@var{frame} invisible if all other frames are invisible.. @end deffn @deffn Command iconify-frame &optional frame @@ -1121,6 +1148,10 @@ iconifies the selected frame. This returns the visibility status of frame @var{frame}. The value is @code{t} if @var{frame} is visible, @code{nil} if it is invisible, and @code{icon} if it is iconified. + +On a text-only terminal, all frames are considered visible, whether +they are currently being displayed or not, and this function returns +@code{t} for all frames. @end defun The visibility status of a frame is also available as a frame @@ -1155,6 +1186,7 @@ on the screen. @deffn Command raise-frame &optional frame This function raises frame @var{frame} (default, the selected frame). +If @var{frame} is invisible or iconified, this makes it visible. @end deffn @deffn Command lower-frame &optional frame @@ -1185,7 +1217,8 @@ the current arrangement of frames and their contents. @defun set-frame-configuration configuration &optional nodelete This function restores the state of frames described in -@var{configuration}. +@var{configuration}. However, this function does not restore deleted +frames. Ordinarily, this function deletes all existing frames not listed in @var{configuration}. But if @var{nodelete} is non-@code{nil}, the @@ -1467,7 +1500,7 @@ distinguished by @dfn{selection types}, represented in Emacs by symbols. X clients including Emacs can read or set the selection for any given type. -@defun x-set-selection type data +@deffn Command x-set-selection type data This function sets a ``selection'' in the X server. It takes two arguments: a selection type @var{type}, and the value to assign to it, @var{data}. If @var{data} is @code{nil}, it means to clear out the @@ -1482,9 +1515,11 @@ selection values. Each possible @var{type} has its own selection value, which changes independently. The usual values of @var{type} are @code{PRIMARY}, @code{SECONDARY} and @code{CLIPBOARD}; these are symbols with upper-case -names, in accord with X Window System conventions. The default is -@code{PRIMARY}. -@end defun +names, in accord with X Window System conventions. If @var{type} is +@code{nil}, that stands for @code{PRIMARY}. + +This function returns @var{data}. +@end deffn @defun x-get-selection &optional type data-type This function accesses selections set up by Emacs or by other X @@ -1578,6 +1613,7 @@ and that name is still supported as an alias. @tindex defined-colors This function returns a list of the color names that are defined and supported on frame @var{frame} (default, the selected frame). +If @var{frame} does not support colors, the value is @code{nil}. @findex x-defined-colors This function used to be called @code{x-defined-colors}, @@ -1602,18 +1638,18 @@ The argument @var{color} must be a valid color name. @tindex color-gray-p This returns @code{t} if @var{color} is a shade of gray, as defined on @var{frame}'s display. If @var{frame} is omitted or @code{nil}, the -question applies to the selected frame. The argument @var{color} must -be a valid color name. +question applies to the selected frame. If @var{color} is not a valid +color name, this function returns @code{nil}. @end defun @defun color-values color &optional frame @tindex color-values This function returns a value that describes what @var{color} should -ideally look like. If @var{color} is defined, the value is a list of -three integers, which give the amount of red, the amount of green, and -the amount of blue. Each integer ranges in principle from 0 to 65535, -but in practice no value seems to be above 65280. This kind -of three-element list is called an @dfn{rgb value}. +ideally look like on @var{frame}. If @var{color} is defined, the +value is a list of three integers, which give the amount of red, the +amount of green, and the amount of blue. Each integer ranges in +principle from 0 to 65535, but some displays may not use the full +range. This kind of three-element list is called an @dfn{rgb value}. If @var{color} is not defined, the value is @code{nil}. @@ -1658,8 +1694,7 @@ are used by Emacs. Several of these functions use or return @dfn{rgb values}. An rgb value is a list of three integers, which give the amount of red, the amount of green, and the amount of blue. Each integer ranges in -principle from 0 to 65535, but in practice the largest value used is -65280. +principle from 0 to 65535, but some displays may not use the full range. . These functions accept a display (either a frame or the name of a terminal) as an optional argument. We hope in the future to make Emacs @@ -1701,13 +1736,14 @@ actually looks like. @tindex tty-color-approximate This function finds the closest color, among the known colors supported for @var{display}, to that described by the rgb value @var{rgb}. +The return value is an element of @code{tty-color-alist}. @end defun @defun tty-color-translate color &optional display @tindex tty-color-translate This function finds the closest color to @var{color} among the known -colors supported for @var{display}. If the name @var{color} is not -defined, the value is @code{nil}. +colors supported for @var{display} and returns its index (an integer). +If the name @var{color} is not defined, the value is @code{nil}. @var{color} can be an X-style @code{"#@var{xxxyyyzzz}"} specification instead of an actual name. The format @@ -1747,6 +1783,29 @@ should look up. The default value is the name Emacs was invoked with, or the value specified with the @samp{-name} or @samp{-rn} switches. @end defvar +To illustrate some of the above, suppose that you have the line: + +@example +xterm.vt100.background: yellow +@end example + +@noindent +in in your X resources file (usually named @file{~/.Xdefaults} or +@file{~/.Xresources}). Then: + +@example +@group +(let ((x-resource-class "XTerm") (x-resource-name "xterm")) + (x-get-resource "vt100.background" "VT100.Background")) + @result{} "yellow" +@end group +@group +(let ((x-resource-class "XTerm") (x-resource-name "xterm")) + (x-get-resource "background" "VT100" "vt100" "Background")) + @result{} "yellow" +@end group +@end example + @xref{X Resources,, X Resources, emacs, The GNU Emacs Manual}. @node Display Feature Testing @@ -1854,6 +1913,7 @@ This function returns the number of screens associated with the display. @defun display-pixel-height &optional display @tindex display-pixel-height This function returns the height of the screen in pixels. +On a character terminal, it gives the height in characters. @end defun @defun display-mm-height &optional display @@ -1865,6 +1925,7 @@ or @code{nil} if Emacs cannot get that information. @defun display-pixel-width &optional display @tindex display-pixel-width This function returns the width of the screen in pixels. +On a character terminal, it gives the width in characters. @end defun @defun display-mm-width &optional display @@ -1918,11 +1979,13 @@ about X displays. @defun x-server-version &optional display This function returns the list of version numbers of the X server -running the display. +running the display. The value is a list of three integers: the major +and minor version numbers, and the vendor-specific release number. @end defun @defun x-server-vendor &optional display -This function returns the vendor that provided the X server software. +This function returns the ``vendor'' that provided the X server software +(as a string). @end defun @ignore From a3111ae4d80d4ca060d30ff9ebe6cec1c3e82e03 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sun, 25 Jul 2004 05:45:53 +0000 Subject: [PATCH 027/341] (butlast, event-modifiers, event-basic-type): Doc fixes. --- lisp/ChangeLog | 4 ++++ lisp/subr.el | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2b9ee25d96e..65648fbf3cb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-07-25 John Paul Wallington + + * subr.el (butlast, event-modifiers, event-basic-type): Doc fixes. + 2004-07-24 Luc Teirlinck * term/tty-colors.el (tty-color-approximate): Doc fix. diff --git a/lisp/subr.el b/lisp/subr.el index 9dd1e415212..1e30a127f71 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -198,7 +198,7 @@ If N is bigger than the length of LIST, return LIST." list)) (defun butlast (list &optional n) - "Returns a copy of LIST with the last N elements removed." + "Return a copy of LIST with the last N elements removed." (if (and n (<= n 0)) list (nbutlast (copy-sequence list) n))) @@ -641,7 +641,7 @@ The normal global definition of the character C-x indirects to this keymap.") (get (car obj) 'event-symbol-elements)))) (defun event-modifiers (event) - "Returns a list of symbols representing the modifier keys in event EVENT. + "Return a list of symbols representing the modifier keys in event EVENT. The elements of the list may include `meta', `control', `shift', `hyper', `super', `alt', `click', `double', `triple', `drag', and `down'." @@ -670,7 +670,7 @@ and `down'." list)))) (defun event-basic-type (event) - "Returns the basic type of the given event (all modifiers removed). + "Return the basic type of the given event (all modifiers removed). The value is a printing character (not upper case) or a symbol." (if (consp event) (setq event (car event))) From e3e56238b8aff037df727a5c11edb110c308e026 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 25 Jul 2004 17:35:04 +0000 Subject: [PATCH 028/341] (check_cons_list): New function (contents commented out). --- src/alloc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/alloc.c b/src/alloc.c index 5c2a6fb48c3..ece150f083c 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2395,6 +2395,17 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, return val; } +/* Get an error now if there's any junk in the cons free list. */ +void +check_cons_list () +{ + struct Lisp_Cons *tail = cons_free_list; + +#if 0 + while (tail) + tail = *(struct Lisp_Cons **)&tail->cdr; +#endif +} /* Make a list of 2, 3, 4 or 5 specified objects. */ From 81159bb955c88e1315e21be0df6c6cf7f0bd3766 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 25 Jul 2004 17:36:07 +0000 Subject: [PATCH 029/341] (Fcoordinates_in_window_p): Take account of FRAME_INTERNAL_BORDER_WIDTH. --- src/ChangeLog | 7 +++++++ src/window.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 398538484d7..55df91b982e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2004-07-25 Richard M. Stallman + + * window.c (Fcoordinates_in_window_p): + Take account of FRAME_INTERNAL_BORDER_WIDTH. + + * alloc.c (check_cons_list): New function (contents commented out). + 2004-07-24 Luc Teirlinck * xfaces.c (Fcolor_supported_p): Doc fix. diff --git a/src/window.c b/src/window.c index 409d0972fdd..8a574becd06 100644 --- a/src/window.c +++ b/src/window.c @@ -783,8 +783,8 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\ ly = Fcdr (coordinates); CHECK_NUMBER_OR_FLOAT (lx); CHECK_NUMBER_OR_FLOAT (ly); - x = FRAME_PIXEL_X_FROM_CANON_X (f, lx); - y = FRAME_PIXEL_Y_FROM_CANON_Y (f, ly); + x = FRAME_PIXEL_X_FROM_CANON_X (f, lx) + FRAME_INTERNAL_BORDER_WIDTH (f); + y = FRAME_PIXEL_Y_FROM_CANON_Y (f, ly) + FRAME_INTERNAL_BORDER_WIDTH (f); switch (coordinates_in_window (w, &x, &y)) { From 6487f669677b970c9b486cfeed6b6dff412ecec3 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 25 Jul 2004 17:43:57 +0000 Subject: [PATCH 030/341] (coordinates_in_window): Return ON_SCROLL_BAR instead of ON_VERTICAL_BORDER, when on scroll bar. (Fcoordinates_in_window_p): Handle ON_SCROLL_BAR--return nil. --- src/window.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/window.c b/src/window.c index 8a574becd06..c3603c2039f 100644 --- a/src/window.c +++ b/src/window.c @@ -579,6 +579,8 @@ display margins, fringes, header line, and/or mode line. */) if it is on the window's modeline, return ON_MODE_LINE; if it is on the border between the window and its right sibling, return ON_VERTICAL_BORDER. + if it is on a scroll bar, + return ON_SCROLL_BAR. if it is on the window's top line, return ON_HEADER_LINE; if it is in left or right fringe of the window, return ON_LEFT_FRINGE or ON_RIGHT_FRINGE, and convert *X and *Y @@ -673,7 +675,7 @@ coordinates_in_window (w, x, y) /* Outside any interesting column? */ if (*x < left_x || *x > right_x) - return ON_VERTICAL_BORDER; + return ON_SCROLL_BAR; lmargin_width = window_box_width (w, LEFT_MARGIN_AREA); rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA); @@ -818,6 +820,10 @@ If they are in the windows's left or right marginal areas, `left-margin'\n\ case ON_RIGHT_MARGIN: return Qright_margin; + case ON_SCROLL_BAR: + /* Historically we are supposed to return nil in this case. */ + return Qnil; + default: abort (); } From ab431b61cd97c306aee286644084d5e2d1923de9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 25 Jul 2004 17:44:33 +0000 Subject: [PATCH 031/341] (enum window_part): Add ON_SCROLL_BAR. --- src/ChangeLog | 6 ++++++ src/dispextern.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 55df91b982e..e0b34273209 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2004-07-25 Richard M. Stallman + * window.c (coordinates_in_window): Return ON_SCROLL_BAR + instead of ON_VERTICAL_BORDER, when on scroll bar. + (Fcoordinates_in_window_p): Handle ON_SCROLL_BAR--return nil. + + * dispextern.h (enum window_part): Add ON_SCROLL_BAR. + * window.c (Fcoordinates_in_window_p): Take account of FRAME_INTERNAL_BORDER_WIDTH. diff --git a/src/dispextern.h b/src/dispextern.h index 10754a4c01d..0dd9f3ed428 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -99,7 +99,8 @@ enum window_part ON_LEFT_FRINGE, ON_RIGHT_FRINGE, ON_LEFT_MARGIN, - ON_RIGHT_MARGIN + ON_RIGHT_MARGIN, + ON_SCROLL_BAR }; /* Number of bits allocated to store fringe bitmap numbers. */ From e0db2366e7a4bd0719b8a0e7899f294243a6c946 Mon Sep 17 00:00:00 2001 From: Lars Hansen Date: Sun, 25 Jul 2004 19:55:21 +0000 Subject: [PATCH 032/341] (wdired-finish-edit): Require dired-aux before locally binding dired-backup-overwrite. --- lisp/ChangeLog | 5 +++++ lisp/wdired.el | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 65648fbf3cb..73c833245f8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-07-25 Lars Hansen + + * wdired.el (wdired-finish-edit): Require dired-aux before locally + binding dired-backup-overwrite. + 2004-07-25 John Paul Wallington * subr.el (butlast, event-modifiers, event-basic-type): Doc fixes. diff --git a/lisp/wdired.el b/lisp/wdired.el index 30ba2a3cd45..928ecd65339 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -455,6 +455,11 @@ non-nil means return old filename." (setq file-new (substitute-in-file-name file-new)) (if wdired-use-interactive-rename (wdired-search-and-rename file-ori file-new) + ;; If dired-rename-file autoloads dired-aux while + ;; dired-backup-overwrite is locally bound, + ;; dired-backup-overwrite won't be initialized. + ;; So we must ensure dired-aux is loaded. + (require 'dired-aux) (condition-case err (let ((dired-backup-overwrite nil)) (dired-rename-file file-ori file-new From f29ff8c7a4a0a3bded497ff08f64d3bb1b80c1b8 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 25 Jul 2004 22:14:29 +0000 Subject: [PATCH 033/341] *** empty log message *** --- src/ChangeLog | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index e0b34273209..3e6094bbca0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-07-26 Kim F. Storm + + * xdisp.c (move_it_in_display_line_to): If overflow-newline-into-fringe + is enabled, return MOVE_LINE_CONTINUED rather than MOVE_POS_MATCH_OR_ZV + if target position is at end of display line but char is not a newline. + 2004-07-25 Richard M. Stallman * window.c (coordinates_in_window): Return ON_SCROLL_BAR @@ -6,7 +12,7 @@ * dispextern.h (enum window_part): Add ON_SCROLL_BAR. - * window.c (Fcoordinates_in_window_p): + * window.c (Fcoordinates_in_window_p): Take account of FRAME_INTERNAL_BORDER_WIDTH. * alloc.c (check_cons_list): New function (contents commented out). From f516e857f7a8eaf5381c5f24f46800e991c7eace Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 25 Jul 2004 22:15:03 +0000 Subject: [PATCH 034/341] (move_it_in_display_line_to): If overflow-newline-into-fringe is enabled, return MOVE_LINE_CONTINUED rather than MOVE_POS_MATCH_OR_ZV if target position is at end of display line but char is not a newline. --- src/xdisp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 4083ce7a438..071e85ae29d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5738,12 +5738,19 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) #ifdef HAVE_WINDOW_SYSTEM if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) { - if (!get_next_display_element (it) - || BUFFER_POS_REACHED_P ()) + if (!get_next_display_element (it)) { result = MOVE_POS_MATCH_OR_ZV; break; } + if (BUFFER_POS_REACHED_P ()) + { + if (ITERATOR_AT_END_OF_LINE_P (it)) + result = MOVE_POS_MATCH_OR_ZV; + else + result = MOVE_LINE_CONTINUED; + break; + } if (ITERATOR_AT_END_OF_LINE_P (it)) { result = MOVE_NEWLINE_OR_CR; From 38357a23f4887991726185607297a98a82680ea8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 26 Jul 2004 21:16:08 +0000 Subject: [PATCH 035/341] (imenu-prev-index-position-function) (imenu-extract-index-name-function, imenu-name-lookup-function) (imenu--index-alist): Docstring redundancy fix. --- lisp/ChangeLog | 10 ++++++++-- lisp/imenu.el | 19 ++++++------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 73c833245f8..57ee67c60b5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-07-26 Stefan Monnier + + * imenu.el (imenu-prev-index-position-function) + (imenu-extract-index-name-function, imenu-name-lookup-function) + (imenu--index-alist): Docstring redundancy fix. + 2004-07-25 Lars Hansen * wdired.el (wdired-finish-edit): Require dired-aux before locally @@ -74,8 +80,8 @@ 2004-07-17 Kai Grossjohann - * net/tramp.el (tramp-handle-verify-visited-file-modtime): New - docstring. From Luc Teirlinck. + * net/tramp.el (tramp-handle-verify-visited-file-modtime): + New docstring. From Luc Teirlinck. 2004-07-17 Luc Teirlinck diff --git a/lisp/imenu.el b/lisp/imenu.el index e0b57440fd8..238adfe9505 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -1,6 +1,7 @@ ;;; imenu.el --- framework for mode-specific buffer indexes -;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 2003 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 2003, 2004 +;; Free Software Foundation, Inc. ;; Author: Ake Stenhoff ;; Lars Lindberg @@ -255,9 +256,7 @@ to a function that will find the next index, looking backwards in the file. The function should leave point at the place to be connected to the -index and it should return nil when it doesn't find another index. - -This variable is local in all buffers.") +index and it should return nil when it doesn't find another index.") ;;;###autoload (make-variable-buffer-local 'imenu-prev-index-position-function) @@ -267,9 +266,7 @@ This variable is local in all buffers.") This function is called after `imenu-prev-index-position-function' finds a position for an index item, with point at that position. -It should return the name for that index item. - -This variable is local in all buffers.") +It should return the name for that index item.") ;;;###autoload (make-variable-buffer-local 'imenu-extract-index-name-function) @@ -283,9 +280,7 @@ non-nil if they match. If nil, comparison is done with `string='. Set this to some other function for more advanced comparisons, such as \"begins with\" or \"name matches and number of -arguments match\". - -This variable is local in all buffers.") +arguments match\".") ;;;###autoload (make-variable-buffer-local 'imenu-name-lookup-function) @@ -453,9 +448,7 @@ The function in this variable is called when selecting a normal index-item.") "The buffer index computed for this buffer in Imenu. Simple elements in the alist look like (INDEX-NAME . INDEX-POSITION). Special elements look like (INDEX-NAME INDEX-POSITION FUNCTION ARGUMENTS...). -A nested sub-alist element looks like (INDEX-NAME SUB-ALIST). - -This variable is local in all buffers, once set.") +A nested sub-alist element looks like (INDEX-NAME SUB-ALIST).") (make-variable-buffer-local 'imenu--index-alist) From 3f911c94a230f144e410d790892acfab5bc2d757 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 26 Jul 2004 23:16:23 +0000 Subject: [PATCH 036/341] *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 3e6094bbca0..d06be958790 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-07-27 Kim F. Storm + + * xdisp.c (move_it_in_display_line_to): Check BUFFER_POS_REACHED_P after + we have ensured that the glyph fits on the current line (or returned + MOVE_LINE_CONTINUED otherwise). + 2004-07-26 Kim F. Storm * xdisp.c (move_it_in_display_line_to): If overflow-newline-into-fringe From 3553184981479cadb0af5e64f55f7ebe00415f25 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 26 Jul 2004 23:16:48 +0000 Subject: [PATCH 037/341] (move_it_in_display_line_to): Check BUFFER_POS_REACHED_P after we have ensured that the glyph fits on the current line (or returned MOVE_LINE_CONTINUED otherwise). --- src/xdisp.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 071e85ae29d..7a727938a2c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5649,9 +5649,13 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) { int x, i, ascent = 0, descent = 0; - /* Stop when ZV or TO_CHARPOS reached. */ + /* Stop when ZV reached. + We used to stop here when TO_CHARPOS reached as well, but that is + too soon if this glyph does not fit on this line. So we handle it + explicitly below. */ if (!get_next_display_element (it) - || BUFFER_POS_REACHED_P ()) + || (it->truncate_lines_p + && BUFFER_POS_REACHED_P ())) { result = MOVE_POS_MATCH_OR_ZV; break; @@ -5711,6 +5715,8 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) /* We want to leave anything reaching TO_X to the caller. */ if ((op & MOVE_TO_X) && new_x > to_x) { + if (BUFFER_POS_REACHED_P ()) + goto buffer_pos_reached; it->current_x = x; result = MOVE_X_REACHED; break; @@ -5772,6 +5778,8 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) result = MOVE_LINE_CONTINUED; break; } + else if (BUFFER_POS_REACHED_P ()) + goto buffer_pos_reached; else if (new_x > it->first_visible_x) { /* Glyph is visible. Increment number of glyphs that @@ -5788,6 +5796,15 @@ move_it_in_display_line_to (it, to_charpos, to_x, op) if (result != MOVE_UNDEFINED) break; } + else if (BUFFER_POS_REACHED_P ()) + { + buffer_pos_reached: + it->current_x = x; + it->max_ascent = ascent; + it->max_descent = descent; + result = MOVE_POS_MATCH_OR_ZV; + break; + } else if ((op & MOVE_TO_X) && it->current_x >= to_x) { /* Stop when TO_X specified and reached. This check is From 47a97a6db31119476194b4bb9f32d1891a3a2d1f Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Tue, 27 Jul 2004 02:10:51 +0000 Subject: [PATCH 038/341] Tiny change. --- lisp/ChangeLog | 11 ++++++++--- lisp/ps-print.el | 44 ++++++++++++++++++++------------------------ 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 57ee67c60b5..4f1d0859f65 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -42,12 +42,17 @@ 2004-07-22 Vinicius Jose Latorre - * ps-print.el: Doc fix. Improve the DSC compliance of the generated - PostScript. Suggested by Michael Piotrowski . + * ps-print.el: Doc fix. (ps-print-version): New version 6.6.5. (ps-printing-region): Doc fix. (ps-generate-string-list): Comment fix. - (ps-message-log-max, ps-begin-file): Code fix. + (ps-message-log-max): Code fix. + + +2004-07-22 Michael Piotrowski (tiny change) + + * ps-print.el (ps-begin-file): Improve the DSC compliance of the + generated PostScript. 2004-07-22 Kim F. Storm diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 9dca7986e7c..78a558baebe 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -5576,17 +5576,15 @@ XSTART YSTART are the relative position for the first page in a sheet.") (setq ps-background-all-pages (nreverse ps-background-all-pages) ps-background-pages (nreverse ps-background-pages)) - (ps-output "\n" ps-print-prologue-1) - - (ps-output "\n/printGlobalBackground{\n") + (ps-output "\n" ps-print-prologue-1 + "\n/printGlobalBackground{\n") (mapcar 'ps-output ps-background-all-pages) - (ps-output "}def\n/printLocalBackground{\n}def\n") - - (ps-output "\n%%EndProlog\n\n%%BeginSetup\n") - (ps-output + "}def\n/printLocalBackground{\n}def\n" + "\n%%EndProlog\n\n%%BeginSetup\n" "\n%%IncludeResource: font Times-Roman" - "\n%%IncludeResource: font Times-Italic\n%%IncludeResource: font " + "\n%%IncludeResource: font Times-Italic" + "\n%%IncludeResource: font " (mapconcat 'identity (ps-remove-duplicates (append (ps-fonts 'ps-font-for-text) @@ -5595,22 +5593,20 @@ XSTART YSTART are the relative position for the first page in a sheet.") (ps-font 'ps-font-for-footer 'normal) (ps-font 'ps-font-for-footer 'bold)))) "\n%%IncludeResource: font ") - "\n") - - ;; Header/line number fonts - (ps-output (format "/h0 %s(%s)cvn DefFont\n" ; /h0 14/Helvetica-Bold DefFont - ps-header-title-font-size-internal - (ps-font 'ps-font-for-header 'bold)) - (format "/h1 %s(%s)cvn DefFont\n" ; /h1 12/Helvetica DefFont - ps-header-font-size-internal - (ps-font 'ps-font-for-header 'normal)) - (format "/L0 %s(%s)cvn DefFont\n" ; /L0 6/Times-Italic DefFont - (ps-get-font-size 'ps-line-number-font-size) - ps-line-number-font) - (format "/H0 %s(%s)cvn DefFont\n" ; /H0 12/Helvetica DefFont - ps-footer-font-size-internal - (ps-font 'ps-font-for-footer 'normal)) - "\n\n% ---- These lines must be kept together because... + ;; Header/line number fonts + (format "\n/h0 %s(%s)cvn DefFont\n" ; /h0 14/Helvetica-Bold DefFont + ps-header-title-font-size-internal + (ps-font 'ps-font-for-header 'bold)) + (format "/h1 %s(%s)cvn DefFont\n" ; /h1 12/Helvetica DefFont + ps-header-font-size-internal + (ps-font 'ps-font-for-header 'normal)) + (format "/L0 %s(%s)cvn DefFont\n" ; /L0 6/Times-Italic DefFont + (ps-get-font-size 'ps-line-number-font-size) + ps-line-number-font) + (format "/H0 %s(%s)cvn DefFont\n" ; /H0 12/Helvetica DefFont + ps-footer-font-size-internal + (ps-font 'ps-font-for-footer 'normal)) + "\n\n% ---- These lines must be kept together because... /h0 F /HeaderTitleLineHeight FontHeight def From f9c0bc2e7385ea561827f9e99d689d44ff7b0640 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 27 Jul 2004 18:45:41 +0000 Subject: [PATCH 039/341] (font-lock-keywords): Docstring improvement. --- lisp/font-lock.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 36dac14f6a9..8cb43bc0bd8 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -358,8 +358,9 @@ Each element in a user-level keywords list should have one of these forms: (eval . FORM) where MATCHER can be either the regexp to search for, or the function name to -call to make the search (called with one argument, the limit of the search) and -return non-nil if it succeeds (and set `match-data' appropriately). +call to make the search (called with one argument, the limit of the search; +it should return non-nil, move point, and set `match-data' appropriately iff +it succeeds; like `re-search-forward' would). MATCHER regexps can be generated via the function `regexp-opt'. FORM is an expression, whose value should be a keyword element, evaluated when From 05ea6a2643f0e529760588fe105398889cf14ceb Mon Sep 17 00:00:00 2001 From: Werner LEMBERG Date: Tue, 27 Jul 2004 23:47:37 +0000 Subject: [PATCH 040/341] *** empty log message *** --- etc/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index aa1550122d5..5c86c060880 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2004-07-27 Werner Lemberg + + * NEWS: Document all new tutorials. + 2004-07-14 Luc Teirlinck * MORE.STUFF: Tramp is now distributed with Emacs. From b687047c72d2d13ced9ce55d38193b24ec722773 Mon Sep 17 00:00:00 2001 From: Werner LEMBERG Date: Tue, 27 Jul 2004 23:49:06 +0000 Subject: [PATCH 041/341] Document all new tutorials. --- etc/NEWS | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 7bb0ac87263..12d8f044637 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -22,7 +22,11 @@ the supported image types and their associated dynamic libraries by setting the variable `image-library-alist'. --- -** A Bulgarian translation of the Emacs Tutorial is available. +** New translations of the Emacs Tutorial are available in the following + languages: Brasilian, Bulgarian, Chinese (both with simplified and + traditional characters), French, and Italian. Type `C-u C-h t' to + choose one of them in case your language setup doesn't automatically + select the right one. ** You can build Emacs with Gtk+ widgets by specifying `--with-x-toolkit=gtk' when you run configure. This requires Gtk+ 2.0 or newer. This port @@ -88,7 +92,6 @@ See the files mac/README and mac/INSTALL for build instructions. ** A French translation of the `Emacs Survival Guide' is available. --- -** A French translation of the Emacs Tutorial is available. ** Building with -DENABLE_CHECKING does not automatically build with union types any more. Add -DUSE_LISP_UNION_TYPE if you want union types. From 31f98a937c1f1ef2576e5225e8007f1398df00fe Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Wed, 28 Jul 2004 09:05:23 +0000 Subject: [PATCH 042/341] (etags-tags-apropos): Show building progress. --- lisp/ChangeLog | 4 ++ lisp/progmodes/etags.el | 97 ++++++++++++++++++++++------------------- 2 files changed, 55 insertions(+), 46 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4f1d0859f65..5ec1cbb9ede 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-07-28 Masatake YAMATO + + * progmodes/etags.el (etags-tags-apropos): Show building progress. + 2004-07-26 Stefan Monnier * imenu.el (imenu-prev-index-position-function) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 184077f6a3a..4464df3a916 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1453,53 +1453,58 @@ where they were found." (tags-with-face 'highlight (princ buffer-file-name)) (princ "':\n\n")) (goto-char (point-min)) - (while (re-search-forward string nil t) - (beginning-of-line) + (let ((point-max (/ (float (point-max)) 100.0))) + (while (re-search-forward string nil t) + (message "Making tags apropos buffer for `%s'...%d%%" + string + (/ (point) point-max)) + (beginning-of-line) - (let* (;; Get the local value in the tags table - ;; buffer before switching buffers. - (goto-func goto-tag-location-function) - (tag-info (save-excursion (funcall snarf-tag-function))) - (tag (if (eq t (car tag-info)) nil (car tag-info))) - (file-path (save-excursion (if tag (file-of-tag) - (save-excursion (next-line 1) - (file-of-tag))))) - (file-label (if tag (file-of-tag t) - (save-excursion (next-line 1) - (file-of-tag t)))) - (pt (with-current-buffer standard-output (point)))) - (if tag - (progn - (princ (format "[%s]: " file-label)) - (princ tag) - (when (= (aref tag 0) ?\() (princ " ...)")) - (with-current-buffer standard-output - (make-text-button pt (point) - 'tag-info tag-info - 'file-path file-path - 'goto-func goto-func - 'action (lambda (button) - (let ((tag-info (button-get button 'tag-info)) - (goto-func (button-get button 'goto-func))) - (tag-find-file-of-tag (button-get button 'file-path)) - (widen) - (funcall goto-func tag-info))) - 'face 'tags-tag-face - 'type 'button))) - (princ (format "- %s" file-label)) - (with-current-buffer standard-output - (make-text-button pt (point) - 'file-path file-path - 'action (lambda (button) - (tag-find-file-of-tag (button-get button 'file-path)) - ;; Get the local value in the tags table - ;; buffer before switching buffers. - (goto-char (point-min))) - 'face 'tags-tag-face - 'type 'button)) - )) - (terpri) - (forward-line 1)) + (let* ( ;; Get the local value in the tags table + ;; buffer before switching buffers. + (goto-func goto-tag-location-function) + (tag-info (save-excursion (funcall snarf-tag-function))) + (tag (if (eq t (car tag-info)) nil (car tag-info))) + (file-path (save-excursion (if tag (file-of-tag) + (save-excursion (next-line 1) + (file-of-tag))))) + (file-label (if tag (file-of-tag t) + (save-excursion (next-line 1) + (file-of-tag t)))) + (pt (with-current-buffer standard-output (point)))) + (if tag + (progn + (princ (format "[%s]: " file-label)) + (princ tag) + (when (= (aref tag 0) ?\() (princ " ...)")) + (with-current-buffer standard-output + (make-text-button pt (point) + 'tag-info tag-info + 'file-path file-path + 'goto-func goto-func + 'action (lambda (button) + (let ((tag-info (button-get button 'tag-info)) + (goto-func (button-get button 'goto-func))) + (tag-find-file-of-tag (button-get button 'file-path)) + (widen) + (funcall goto-func tag-info))) + 'face 'tags-tag-face + 'type 'button))) + (princ (format "- %s" file-label)) + (with-current-buffer standard-output + (make-text-button pt (point) + 'file-path file-path + 'action (lambda (button) + (tag-find-file-of-tag (button-get button 'file-path)) + ;; Get the local value in the tags table + ;; buffer before switching buffers. + (goto-char (point-min))) + 'face 'tags-tag-face + 'type 'button)) + )) + (terpri) + (forward-line 1)) + (message nil)) (when tags-apropos-verbose (princ "\n"))) (defun etags-tags-table-files () From 733f68b6ec84cfe592f16a1c49a69b5693eabab9 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Thu, 29 Jul 2004 01:41:36 +0000 Subject: [PATCH 043/341] (Fdefvar, Fdefconst): Doc fixes. --- src/eval.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/eval.c b/src/eval.c index f28105ac987..ee74215b2ee 100644 --- a/src/eval.c +++ b/src/eval.c @@ -742,6 +742,13 @@ If DOCSTRING starts with *, this variable is identified as a user option. This means that M-x set-variable recognizes it. See also `user-variable-p'. If INITVALUE is missing, SYMBOL's value is not set. + +If SYMBOL has a local binding, then this form affects the local +binding. This is usually not what you want. Thus, if you need to +load a file defining variables, with this form or with `defconst' or +`defcustom', you should always load that file _outside_ any bindings +for these variables. \(`defconst' and `defcustom' behave similarly in +this respect.) usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) (args) Lisp_Object args; @@ -784,6 +791,10 @@ Always sets the value of SYMBOL to the result of evalling INITVALUE. If SYMBOL is buffer-local, its default value is what is set; buffer-local values are not affected. DOCSTRING is optional. + +If SYMBOL has a local binding, then this form sets the local binding's +value. However, you should normally not make local bindings for +variables defined with this form. usage: (defconst SYMBOL INITVALUE [DOCSTRING]) */) (args) Lisp_Object args; From 19229e5e7df38bee2f2d310d55d0b1eb66ebbfd5 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Thu, 29 Jul 2004 01:47:01 +0000 Subject: [PATCH 044/341] (defcustom): Doc fix. --- lisp/custom.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/custom.el b/lisp/custom.el index e86308c95e7..2ddd7ceb943 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -246,6 +246,13 @@ The following keywords are meaningful: Specifies that SYMBOL should be set after the list of variables VARIABLES when both have been customized. +If SYMBOL has a local binding, then this form affects the local +binding. This is normally not what you want. Thus, if you need +to load a file defining variables with this form, or with +`defvar' or `defconst', you should always load that file +_outside_ any bindings for these variables. \(`defvar' and +`defconst' behave similarly in this respect.) + Read the section about customization in the Emacs Lisp manual for more information." ;; It is better not to use backquote in this file, From ee945d083910ee9d0af23008806ba3cf2edcd5b4 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Thu, 29 Jul 2004 01:49:07 +0000 Subject: [PATCH 045/341] *** empty log message *** --- lisp/ChangeLog | 4 ++++ src/ChangeLog | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5ec1cbb9ede..ea1392783f6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-07-28 Luc Teirlinck + + * custom.el (defcustom): Doc fix. + 2004-07-28 Masatake YAMATO * progmodes/etags.el (etags-tags-apropos): Show building progress. diff --git a/src/ChangeLog b/src/ChangeLog index d06be958790..282d422beb1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-07-28 Luc Teirlinck + + * eval.c (Fdefvar, Fdefconst): Doc fixes. + 2004-07-27 Kim F. Storm * xdisp.c (move_it_in_display_line_to): Check BUFFER_POS_REACHED_P after From 7c111482b974625610a81b698556a47d8dfa772b Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 30 Jul 2004 12:05:32 +0000 Subject: [PATCH 046/341] (Fformat): Allocated extra (dummy) element in info. --- src/ChangeLog | 4 ++++ src/editfns.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 282d422beb1..11cc0f7ba89 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-07-30 Kim F. Storm + + * editfns.c (Fformat): Allocate extra (dummy) element in info. + 2004-07-28 Luc Teirlinck * eval.c (Fdefvar, Fdefconst): Doc fixes. diff --git a/src/editfns.c b/src/editfns.c index a506c5f4fc8..88a0e63118f 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3254,6 +3254,7 @@ usage: (format STRING &rest OBJECTS) */) /* Piggyback on this loop to initialize precision[N]. */ precision[n] = -1; } + precision[nargs] = -1; CHECK_STRING (args[0]); /* We may have to change "%S" to "%s". */ @@ -3277,11 +3278,11 @@ usage: (format STRING &rest OBJECTS) */) /* Allocate the info and discarded tables. */ { - int nbytes = nargs * sizeof *info; + int nbytes = (nargs+1) * sizeof *info; int i; info = (struct info *) alloca (nbytes); bzero (info, nbytes); - for (i = 0; i < nargs; i++) + for (i = 0; i <= nargs; i++) info[i].start = -1; discarded = (char *) alloca (SBYTES (args[0])); bzero (discarded, SBYTES (args[0])); From 4bcce19cc188070e06d7655e47b94f5809413da5 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 03:31:28 +0000 Subject: [PATCH 047/341] (utf-translate-cjk-mode): Doc fix. --- lisp/ChangeLog | 4 ++++ lisp/international/utf-8.el | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea1392783f6..d1ec8994edb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-07-30 Luc Teirlinck + + * international/utf-8.el (utf-translate-cjk-mode): Doc fix. + 2004-07-28 Luc Teirlinck * custom.el (defcustom): Doc fix. diff --git a/lisp/international/utf-8.el b/lisp/international/utf-8.el index 77a51abb43f..bad79b58743 100644 --- a/lisp/international/utf-8.el +++ b/lisp/international/utf-8.el @@ -273,7 +273,7 @@ The value nil means that the tables are not yet loaded.") (utf-translate-cjk-load-tables)) (gethash code-point (get 'utf-subst-table-for-decode 'translation-hash-table))) - + (defun utf-lookup-subst-table-for-encode (char) (if (and utf-translate-cjk-mode @@ -282,9 +282,11 @@ The value nil means that the tables are not yet loaded.") (utf-translate-cjk-load-tables)) (gethash char (get 'utf-subst-table-for-encode 'translation-hash-table))) - + (define-minor-mode utf-translate-cjk-mode - "Whether the UTF based coding systems should decode/encode CJK characters. + "Toggle whether UTF based coding systems de/encode CJK characters. +If ARG is an integer, enable if ARG is positive and disable if +zero or negative. This is a minor mode. Enabling this allows the coding systems mule-utf-8, mule-utf-16le and mule-utf-16be to encode characters in the charsets `korean-ksc5601', `chinese-gb2312', `chinese-big5-1', @@ -296,9 +298,10 @@ according to the language environment in effect when this option is turned on: ksc5601 for Korean, gb2312 for Chinese-GB, big5 for Chinese-Big5 and jisx for other environments. -This option is on by default. If you are not interested in CJK +This mode is on by default. If you are not interested in CJK characters and want to avoid some overhead on encoding/decoding -by the above coding systems, you can customize this option to nil." +by the above coding systems, you can customize the user option +`utf-translate-cjk-mode' to nil." :init-value t :version "21.4" :type 'boolean @@ -605,7 +608,7 @@ eight-bit-control and eight-bit-graphic characters.") ;; UTF-8 decoder generates an UTF-8 sequence represented by a ;; sequence eight-bit-control/graphic chars for an untranslatable ;; character and an invalid byte. - ;; + ;; ;; This CCL parses that sequence (the first byte is already in r1), ;; writes out the original bytes of that sequence, and sets r5 to ;; -1. @@ -624,7 +627,7 @@ eight-bit-control and eight-bit-graphic characters.") (read-multibyte-character r5 r6) (r0 = (r5 != ,(charset-id 'eight-bit-control))) (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0) - ((write r1) ; invalid UTF-8 + ((write r1) ; invalid UTF-8 (r1 = -1) (end))) @@ -641,7 +644,7 @@ eight-bit-control and eight-bit-graphic characters.") (r1 = -1) ;; Read the 3rd byte. (read-multibyte-character r5 r6) - (r0 = (r5 != ,(charset-id 'eight-bit-control))) + (r0 = (r5 != ,(charset-id 'eight-bit-control))) (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0) (end)) ; invalid UTF-8 (write r6) @@ -651,7 +654,7 @@ eight-bit-control and eight-bit-graphic characters.") (end))) ;; Read the 4th byte. (read-multibyte-character r5 r6) - (r0 = (r5 != ,(charset-id 'eight-bit-control))) + (r0 = (r5 != ,(charset-id 'eight-bit-control))) (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0) (end)) ; invalid UTF-8 ;; 4-byte sequence for an untranslated character. From 451eaa2138828c165b29f39fe7066dbb04850cb0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 31 Jul 2004 03:37:21 +0000 Subject: [PATCH 048/341] (Fexpand_abbrev): Undo previous change. --- src/abbrev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/abbrev.c b/src/abbrev.c index 37ab640ee43..ac132f20023 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -248,6 +248,8 @@ Returns the abbrev symbol, if expansion took place. */) value = Qnil; + Frun_hooks (1, &Qpre_abbrev_expand_hook); + wordstart = 0; if (!(BUFFERP (Vabbrev_start_location_buffer) && XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) @@ -324,8 +326,6 @@ Returns the abbrev symbol, if expansion took place. */) if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) return value; - Frun_hooks (1, &Qpre_abbrev_expand_hook); - if (INTERACTIVE && !EQ (minibuf_window, selected_window)) { /* Add an undo boundary, in case we are doing this for From 53a7160c9282d9577ec3f6a6168b0b7c824c5e45 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 31 Jul 2004 03:42:27 +0000 Subject: [PATCH 049/341] (with-local-quit): Doc fix. --- lisp/ChangeLog | 4 ++++ lisp/subr.el | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d1ec8994edb..05daa1d088b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-07-30 Richard M. Stallman + + * subr.el (with-local-quit): Doc fix. + 2004-07-30 Luc Teirlinck * international/utf-8.el (utf-translate-cjk-mode): Doc fix. diff --git a/lisp/subr.el b/lisp/subr.el index 1e30a127f71..8282e3a9316 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1894,7 +1894,10 @@ See also `with-temp-file' and `with-output-to-string'." (kill-buffer nil))))) (defmacro with-local-quit (&rest body) - "Execute BODY with `inhibit-quit' temporarily bound to nil." + "Execute BODY, allowing quits to terminate BODY but not escape further. +When a quit terminates BODY, `with-local-quit' requests another quit when +it finishes. That quit will be processed in turn, the next time quitting +is again allowed." (declare (debug t) (indent 0)) `(condition-case nil (let ((inhibit-quit nil)) From d9a68b6a5193dacd2e44ab7e4fe350420adc921a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 31 Jul 2004 09:23:36 +0000 Subject: [PATCH 050/341] Update URLs in the comments. --- ChangeLog | 4 ++++ config.bat | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index aa2233a5480..60fbc7e8723 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-07-31 Eli Zaretskii + + * config.bat: Update URLs in the comments. + 2004-07-05 Andreas Schwab * Makefile.in (install-arch-indep): Remove .arch-inventory files. diff --git a/config.bat b/config.bat index 732c4021aaf..c3e36975dec 100644 --- a/config.bat +++ b/config.bat @@ -24,17 +24,15 @@ rem ---------------------------------------------------------------------- rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS: rem rem + msdos version 3 or better. -rem + djgpp version 1.12maint1 or later (version 2.0 or later recommended). +rem + DJGPP version 1.12maint1 or later (version 2.03 or later recommended). rem + make utility that allows breaking of the 128 chars limit on rem command lines. ndmake (as of version 4.5) won't work due to a -rem line length limit. The make that comes with djgpp does work. +rem line length limit. The make that comes with DJGPP does work. rem + rm and mv (from GNU file utilities). rem + sed (you can use the port that comes with DJGPP). rem -rem You should be able to get all the above utilities from any SimTel -rem repository, e.g. ftp.simtel.net, in the directory -rem "pub/simtelnet/gnu/djgpp/v2gnu". As usual, please use your local -rem mirroring site to reduce trans-Atlantic traffic. +rem You should be able to get all the above utilities from the DJGPP FTP +rem site, ftp.delorie.com, in the directory "pub/djgpp/current/v2gnu". rem ---------------------------------------------------------------------- set X11= set nodebug= From 7a4d608f415d1a48af1c86624d57a5e86e370daf Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 15:43:26 +0000 Subject: [PATCH 051/341] (enable-command, disable-command): Doc fixes. --- lisp/novice.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/novice.el b/lisp/novice.el index 159c9a96780..1cb89066481 100644 --- a/lisp/novice.el +++ b/lisp/novice.el @@ -104,7 +104,8 @@ SPC to try the command just this once, but leave it disabled. ;;;###autoload (defun enable-command (command) "Allow COMMAND to be executed without special confirmation from now on. -The user's .emacs file is altered so that this will apply +COMMAND must be a symbol. +This command alters the user's .emacs file so that this will apply to future sessions." (interactive "CEnable command: ") (put command 'disabled nil) @@ -141,7 +142,8 @@ to future sessions." ;;;###autoload (defun disable-command (command) "Require special confirmation to execute COMMAND from now on. -The user's .emacs file is altered so that this will apply +COMMAND must be a symbol. +This command alters the user's .emacs file so that this will apply to future sessions." (interactive "CDisable command: ") (if (not (commandp command)) From 0e91dc923a0495534dba3d5b55093676d0321986 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 15:45:30 +0000 Subject: [PATCH 052/341] (event-modifiers, event-basic-type): Doc fixes. --- lisp/subr.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 8282e3a9316..0572446aefc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -644,7 +644,11 @@ The normal global definition of the character C-x indirects to this keymap.") "Return a list of symbols representing the modifier keys in event EVENT. The elements of the list may include `meta', `control', `shift', `hyper', `super', `alt', `click', `double', `triple', `drag', -and `down'." +and `down'. +EVENT may be an event or an event type. If EVENT is a symbol +that has never been used in an event that has been read as input +in the current Emacs session, then this function can return nil, +even when EVENT actually has modifiers." (let ((type event)) (if (listp type) (setq type (car type))) @@ -671,7 +675,10 @@ and `down'." (defun event-basic-type (event) "Return the basic type of the given event (all modifiers removed). -The value is a printing character (not upper case) or a symbol." +The value is a printing character (not upper case) or a symbol. +EVENT may be an event or an event type. If EVENT is a symbol +that has never been used in an event that has been read as input +in the current Emacs session, then this function may return nil." (if (consp event) (setq event (car event))) (if (symbolp event) From 5581edf5686a20f12cd42d330c45ceec9d5df821 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 15:50:46 +0000 Subject: [PATCH 053/341] (Fcall_interactively): Doc fix. --- src/callint.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/callint.c b/src/callint.c index a3e4984fd16..8b8cb032095 100644 --- a/src/callint.c +++ b/src/callint.c @@ -256,7 +256,8 @@ Optional second arg RECORD-FLAG non-nil means unconditionally put this command in the command-history. Otherwise, this is done only if an arg is read using the minibuffer. Optional third arg KEYS, if given, specifies the sequence of events to -supply if the command inquires which events were used to invoke it. */) +supply if the command inquires which events were used to invoke it. +If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) (function, record_flag, keys) Lisp_Object function, record_flag, keys; { From 5fee9a2f19d29289357ef0b9769a766a8154bee5 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 15:57:40 +0000 Subject: [PATCH 054/341] (syms_of_keyboard) : Doc fix. --- src/keyboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index eb2ed608856..07b91d16040 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -11371,8 +11371,8 @@ It's called with one argument, the help string to display. */); After a command is executed, if point is moved into a region that has special properties (e.g. composition, display), we adjust point to -the boundary of the region. But, several special commands sets this -variable to non-nil, then we suppress the point adjustment. +the boundary of the region. But, when a command sets this variable to +non-nil, we suppress the point adjustment. This variable is set to nil before reading a command, and is checked just after executing the command. */); From a523ade4cba3263a4b628affef813c7ca69b1383 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 16:03:08 +0000 Subject: [PATCH 055/341] (Fset_keymap_parent, Fdefine_prefix_command): Doc fixes. --- src/keymap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/keymap.c b/src/keymap.c index 48108fbfa12..858d0573c70 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -342,6 +342,7 @@ keymap_memberp (map, maps) DEFUN ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0, doc: /* Modify KEYMAP to set its parent map to PARENT. +Return PARENT. PARENT should be nil or another keymap. */) (keymap, parent) Lisp_Object keymap, parent; @@ -1686,7 +1687,8 @@ If a second optional argument MAPVAR is given, the map is stored as its value instead of as COMMAND's value; but COMMAND is still defined as a function. The third optional argument NAME, if given, supplies a menu name -string for the map. This is required to use the keymap as a menu. */) +string for the map. This is required to use the keymap as a menu. +This function returns COMMAND. */) (command, mapvar, name) Lisp_Object command, mapvar, name; { From 1492344029072d1f7ffaf276d1ce5cdc4dfd16b9 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 16:05:54 +0000 Subject: [PATCH 056/341] (Fset_keymap_parent): Minor doc fix. --- src/keymap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/keymap.c b/src/keymap.c index 858d0573c70..6cb7b8709d3 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -342,8 +342,7 @@ keymap_memberp (map, maps) DEFUN ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0, doc: /* Modify KEYMAP to set its parent map to PARENT. -Return PARENT. -PARENT should be nil or another keymap. */) +Return PARENT. PARENT should be nil or another keymap. */) (keymap, parent) Lisp_Object keymap, parent; { From 83f6422686cc5bda8643b36bd1fcb699897a8115 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 16:09:34 +0000 Subject: [PATCH 057/341] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ src/ChangeLog | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 05daa1d088b..113dfe2cf4d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-07-31 Luc Teirlinck + + * novice.el (enable-command, disable-command): Doc fixes. + + * subr.el (event-modifiers, event-basic-type): Doc fixes. + 2004-07-30 Richard M. Stallman * subr.el (with-local-quit): Doc fix. diff --git a/src/ChangeLog b/src/ChangeLog index 11cc0f7ba89..a891a6bb68c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-07-31 Luc Teirlinck + + * keymap.c (Fset_keymap_parent, Fdefine_prefix_command): Doc fixes. + + * keyboard.c (syms_of_keyboard) : Doc fix. + + * callint.c (Fcall_interactively): Doc fix. + 2004-07-30 Kim F. Storm * editfns.c (Fformat): Allocate extra (dummy) element in info. From e7fdaf6301d8f81df48720ab25ad21e5d9fb17d1 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sun, 1 Aug 2004 03:56:05 +0000 Subject: [PATCH 058/341] (only-global-abbrevs): Doc fix. (edit-abbrevs-map): Define within defvar. (quietly-read-abbrev-file): Doc fix. --- lisp/ChangeLog | 6 ++++++ lisp/abbrev.el | 15 +++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 113dfe2cf4d..c9f70c9f4be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-08-01 John Paul Wallington + + * abbrev.el (only-global-abbrevs): Doc fix. + (edit-abbrevs-map): Define within defvar. + (quietly-read-abbrev-file): Doc fix. + 2004-07-31 Luc Teirlinck * novice.el (enable-command, disable-command): Doc fixes. diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 3be0014fd0e..3580c136948 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -29,7 +29,7 @@ ;;; Code: (defcustom only-global-abbrevs nil - "*t means user plans to use global abbrevs only. + "Non-nil means user plans to use global abbrevs only. This makes the commands that normally define mode-specific abbrevs define global abbrevs instead." :type 'boolean @@ -59,13 +59,12 @@ to enable or disable Abbrev mode in the current buffer." :group 'abbrev-mode) -(defvar edit-abbrevs-map nil +(defvar edit-abbrevs-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-x\C-s" 'edit-abbrevs-redefine) + (define-key map "\C-c\C-c" 'edit-abbrevs-redefine) + map) "Keymap used in `edit-abbrevs'.") -(if edit-abbrevs-map - nil - (setq edit-abbrevs-map (make-sparse-keymap)) - (define-key edit-abbrevs-map "\C-x\C-s" 'edit-abbrevs-redefine) - (define-key edit-abbrevs-map "\C-c\C-c" 'edit-abbrevs-redefine)) (defun kill-all-abbrevs () "Undefine all defined abbrevs." @@ -195,7 +194,7 @@ Optional second argument QUIETLY non-nil means don't display a message." (setq abbrevs-changed nil)) (defun quietly-read-abbrev-file (&optional file) - "Read abbrev definitions from file written with write-abbrev-file. + "Read abbrev definitions from file written with `write-abbrev-file'. Optional argument FILE is the name of the file to read; it defaults to the value of `abbrev-file-name'. Does not display any message." From 747aa4cfc6879ed3e8b7861082572ca104c27380 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sun, 1 Aug 2004 05:52:30 +0000 Subject: [PATCH 059/341] (toplevel, pr-ps-fast-fire, pr-ps-set-utility) (pr-ps-set-printer, pr-txt-set-printer, pr-eval-setting-alist) (pr-switches): Remove period from end of error messages. --- lisp/printing.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/printing.el b/lisp/printing.el index 22a3f762ab6..08303e0595d 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -974,7 +974,7 @@ Please send all bug fixes and enhancements to (and (string< ps-print-version "6.6.4") - (error "`printing' requires `ps-print' package version 6.6.4 or later.")) + (error "`printing' requires `ps-print' package version 6.6.4 or later")) (eval-and-compile @@ -4254,7 +4254,7 @@ are both set to t." (pr-ps-buffer-ps-print (if (integerp n-up) (min (max n-up 1) 100) - (error "n-up must be an integer greater than zero.")) + (error "n-up must be an integer greater than zero")) filename))) @@ -5031,7 +5031,7 @@ non-nil." (let ((item (cdr (assq value pr-ps-utility-alist)))) (or item (error - "Invalid PostScript utility name `%s' for variable `pr-ps-utility'." + "Invalid PostScript utility name `%s' for variable `pr-ps-utility'" value)) (setq pr-ps-utility value) (pr-eval-alist (nthcdr 9 item))) @@ -5042,7 +5042,7 @@ non-nil." (let ((ps (cdr (assq value pr-ps-printer-alist)))) (or ps (error - "Invalid PostScript printer name `%s' for variable `pr-ps-name'." + "Invalid PostScript printer name `%s' for variable `pr-ps-name'" value)) (setq pr-ps-name value pr-ps-command (pr-dosify-file-name (nth 0 ps)) @@ -5068,7 +5068,7 @@ non-nil." (defun pr-txt-set-printer (value) (let ((txt (cdr (assq value pr-txt-printer-alist)))) (or txt - (error "Invalid text printer name `%s' for variable `pr-txt-name'." + (error "Invalid text printer name `%s' for variable `pr-txt-name'" value)) (setq pr-txt-name value pr-txt-command (pr-dosify-file-name (nth 0 txt)) @@ -5121,7 +5121,7 @@ non-nil." (setq global nil))) (and inherits (if (memq inherits old) - (error "Circular inheritance for `%S'." inherits) + (error "Circular inheritance for `%S'" inherits) (setq local-list (pr-eval-setting-alist inherits global (cons inherits old))))) @@ -5349,7 +5349,7 @@ non-nil." (defun pr-switches (switches mess) (or (listp switches) - (error "%S should have a list of strings." mess)) + (error "%S should have a list of strings" mess)) (ps-flatten-list ; dynamic evaluation (mapcar 'ps-eval-switch switches))) From fdeadcd1f6182517df0fcd908513b3f7207b1b55 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sun, 1 Aug 2004 05:54:54 +0000 Subject: [PATCH 060/341] (help-go-back): Delete period from end of error message. --- lisp/ChangeLog | 6 ++++++ lisp/help-mode.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c9f70c9f4be..c2336e478a8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2004-08-01 John Paul Wallington + * printing.el (toplevel, pr-ps-fast-fire, pr-ps-set-utility) + (pr-ps-set-printer, pr-txt-set-printer, pr-eval-setting-alist) + (pr-switches): Remove period from end of error messages. + + * help-mode.el (help-go-back): Likewise. + * abbrev.el (only-global-abbrevs): Doc fix. (edit-abbrevs-map): Define within defvar. (quietly-read-abbrev-file): Doc fix. diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 11656ec368c..a2dcdf91ed8 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -581,7 +581,7 @@ help buffer." (interactive) (if help-xref-stack (help-xref-go-back (current-buffer)) - (error "No previous help buffer."))) + (error "No previous help buffer"))) (defun help-do-xref (pos function args) "Call the help cross-reference function FUNCTION with args ARGS. From 78629844c64aab60083d74c5625d34a84970a14a Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 1 Aug 2004 12:59:09 +0000 Subject: [PATCH 061/341] (query-replace-read-from): Use `query-replace-compile-replacement'. (query-replace-compile-replacement): New function. (query-replace-read-to): Use `query-replace-compile-replacement' for repeating the last command. --- lisp/ChangeLog | 8 ++++++++ lisp/replace.el | 41 +++++++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c2336e478a8..f78140ae1d9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2004-08-01 David Kastrup + + * replace.el (query-replace-read-from): Use + `query-replace-compile-replacement'. + (query-replace-compile-replacement): New function. + (query-replace-read-to): Use `query-replace-compile-replacement' + for repeating the last command. + 2004-08-01 John Paul Wallington * printing.el (toplevel, pr-ps-fast-fire, pr-ps-set-utility) diff --git a/lisp/replace.el b/lisp/replace.el index f09868cc6d3..47437659923 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -94,7 +94,8 @@ wants to replace FROM with TO." query-replace-from-history-variable nil t)))) (if (and (zerop (length from)) lastto lastfrom) - (cons lastfrom lastto) + (cons lastfrom + (query-replace-compile-replacement lastto regexp-flag)) ;; Warn if user types \n or \t, but don't reject the input. (and regexp-flag (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) @@ -107,15 +108,12 @@ wants to replace FROM with TO." (sit-for 2))) from)))) -(defun query-replace-read-to (from string regexp-flag) - "Query and return the `from' argument of a query-replace operation." - (let ((to (save-excursion - (read-from-minibuffer - (format "%s %s with: " string (query-replace-descr from)) - nil nil nil - query-replace-to-history-variable from t)))) - (when (and regexp-flag - (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)) +(defun query-replace-compile-replacement (to regexp-flag) + "Maybe convert a regexp replacement TO to Lisp. +Returns a list suitable for `perform-replace' if necessary, +the original string if not." + (if (and regexp-flag + (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)) (let (pos list char) (while (progn @@ -142,14 +140,25 @@ wants to replace FROM with TO." (cdr pos)))) (setq to (substring to end))))) (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to))) - (setq to (nreverse (delete "" (cons to list))))) - (replace-match-string-symbols to) - (setq to (cons 'replace-eval-replacement - (if (> (length to) 1) - (cons 'concat to) - (car to))))) + (setq to (nreverse (delete "" (cons to list)))) + (replace-match-string-symbols to) + (cons 'replace-eval-replacement + (if (cdr to) + (cons 'concat to) + (car to)))) to)) + +(defun query-replace-read-to (from string regexp-flag) + "Query and return the `to' argument of a query-replace operation." + (query-replace-compile-replacement + (save-excursion + (read-from-minibuffer + (format "%s %s with: " string (query-replace-descr from)) + nil nil nil + query-replace-to-history-variable from t)) + regexp-flag)) + (defun query-replace-read-args (string regexp-flag &optional noerror) (unless noerror (barf-if-buffer-read-only)) From f491e1edab82eb6f7030889385f6d08fe85123fd Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 1 Aug 2004 23:09:43 +0000 Subject: [PATCH 062/341] *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index a891a6bb68c..74a2281988b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-08-02 Kim F. Storm + + * process.c (read_process_output): Use whole read buffer. + Don't trigger adaptive read buffering on errors. + 2004-07-31 Luc Teirlinck * keymap.c (Fset_keymap_parent, Fdefine_prefix_command): Doc fixes. From 39b1da208b66d626706391d06715c39bdce7adaa Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 1 Aug 2004 23:10:06 +0000 Subject: [PATCH 063/341] (read_process_output): Use whole read buffer. Don't trigger adaptive read buffering on errors. --- src/process.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/process.c b/src/process.c index aad36b904b5..5e83214f4f9 100644 --- a/src/process.c +++ b/src/process.c @@ -4195,7 +4195,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) present (for reading) at stdin, even when none is. This causes the call to SELECT below to return 1 and status_notify not to be called. As a result output of - subprocesses are incorrectly discarded. + subprocesses are incorrectly discarded. */ FD_CLR (0, &Atemp); #endif @@ -4762,16 +4762,16 @@ read_process_output (proc, channel) if (DATAGRAM_CHAN_P (channel)) { int len = datagram_address[channel].len; - nbytes = recvfrom (channel, chars + carryover, readmax - carryover, + nbytes = recvfrom (channel, chars + carryover, readmax, 0, datagram_address[channel].sa, &len); } else #endif if (proc_buffered_char[channel] < 0) { - nbytes = emacs_read (channel, chars + carryover, readmax - carryover); + nbytes = emacs_read (channel, chars + carryover, readmax); #ifdef ADAPTIVE_READ_BUFFERING - if (!NILP (p->adaptive_read_buffering)) + if (nbytes > 0 && !NILP (p->adaptive_read_buffering)) { int delay = XINT (p->read_output_delay); if (nbytes < 256) @@ -4783,7 +4783,7 @@ read_process_output (proc, channel) delay += READ_OUTPUT_DELAY_INCREMENT * 2; } } - else if (delay > 0 && (nbytes == readmax - carryover)) + else if (delay > 0 && (nbytes == readmax)) { delay -= READ_OUTPUT_DELAY_INCREMENT; if (delay == 0) @@ -4802,7 +4802,7 @@ read_process_output (proc, channel) { chars[carryover] = proc_buffered_char[channel]; proc_buffered_char[channel] = -1; - nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1 - carryover); + nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1); if (nbytes < 0) nbytes = 1; else From 361f14bf1184bbac4076cb123d109b034ee11fa4 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:06:06 +0000 Subject: [PATCH 064/341] (compute_motion): Use actual window width if WIDTH is -1, properly accounting for continuation glyph on non-window systems. (Fcompute_motion): Use actual window width if WIDTH is nil, and actual window width/height if TOPOS is nil, properly accounting for continuation glyphs on non-window systems, and optional header lines. (vmotion): Let compute_motion calculate actual window width. --- src/indent.c | 69 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/src/indent.c b/src/indent.c index 091c702ac2c..6cb82c18f04 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1131,6 +1131,9 @@ struct position val_compute_motion; WIDTH is the number of columns available to display text; compute_motion uses this to handle continuation lines and such. + If WIDTH is -1, use width of window's text area adjusted for + continuation glyph when needed. + HSCROLL is the number of columns not being displayed at the left margin; this is usually taken from a window's hscroll member. TAB_OFFSET is the number of columns of the first tab that aren't @@ -1245,6 +1248,17 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, if (tab_width <= 0 || tab_width > 1000) tab_width = 8; + /* Negative width means use all available text columns. */ + if (width < 0) + { + width = window_box_text_cols (win); + /* We must make room for continuation marks if we don't have fringes. */ +#ifdef HAVE_WINDOW_SYSTEM + if (!FRAME_WINDOW_P (XFRAME (win->frame))) +#endif + width -= 1; + } + immediate_quit = 1; QUIT; @@ -1368,7 +1382,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, { if (hscroll || (truncate_partial_width_windows - && width + 1 < FRAME_COLS (XFRAME (WINDOW_FRAME (win)))) + && width < FRAME_COLS (XFRAME (WINDOW_FRAME (win)))) || !NILP (current_buffer->truncate_lines)) { /* Truncating: skip to newline, unless we are already past @@ -1737,12 +1751,14 @@ assuming it is at position FROMPOS--a cons of the form (HPOS . VPOS)-- to position TO or position TOPOS--another cons of the form (HPOS . VPOS)-- and return the ending buffer position and screen location. +If TOPOS is nil, the actual width and height of the window's +text area are used. + There are three additional arguments: WIDTH is the number of columns available to display text; -this affects handling of continuation lines. -This is usually the value returned by `window-width', less one (to allow -for the continuation glyph). +this affects handling of continuation lines. A value of nil +corresponds to the actual number of available text columns. OFFSETS is either nil or a cons cell (HSCROLL . TAB-OFFSET). HSCROLL is the number of columns not being displayed at the left @@ -1774,6 +1790,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) Lisp_Object from, frompos, to, topos; Lisp_Object width, offsets, window; { + struct window *w; Lisp_Object bufpos, hpos, vpos, prevhpos; struct position *pos; int hscroll, tab_offset; @@ -1783,10 +1800,15 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) CHECK_NUMBER_CAR (frompos); CHECK_NUMBER_CDR (frompos); CHECK_NUMBER_COERCE_MARKER (to); - CHECK_CONS (topos); - CHECK_NUMBER_CAR (topos); - CHECK_NUMBER_CDR (topos); - CHECK_NUMBER (width); + if (!NILP (topos)) + { + CHECK_CONS (topos); + CHECK_NUMBER_CAR (topos); + CHECK_NUMBER_CDR (topos); + } + if (!NILP (width)) + CHECK_NUMBER (width); + if (!NILP (offsets)) { CHECK_CONS (offsets); @@ -1802,6 +1824,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) window = Fselected_window (); else CHECK_LIVE_WINDOW (window); + w = XWINDOW (window); if (XINT (from) < BEGV || XINT (from) > ZV) args_out_of_range_3 (from, make_number (BEGV), make_number (ZV)); @@ -1810,9 +1833,20 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) pos = compute_motion (XINT (from), XINT (XCDR (frompos)), XINT (XCAR (frompos)), 0, - XINT (to), XINT (XCDR (topos)), - XINT (XCAR (topos)), - XINT (width), hscroll, tab_offset, + XINT (to), + (NILP (topos) + ? window_internal_height (w) + : XINT (XCDR (topos))), + (NILP (topos) + ? (window_box_text_cols (w) + - ( +#ifdef HAVE_WINDOW_SYSTEM + FRAME_WINDOW_P (XFRAME (w->frame)) ? 0 : +#endif + 1)) + : XINT (XCAR (topos))), + (NILP (width) ? -1 : XINT (width)), + hscroll, tab_offset, XWINDOW (window)); XSETFASTINT (bufpos, pos->bufpos); @@ -1837,7 +1871,6 @@ vmotion (from, vtarget, w) register int from, vtarget; struct window *w; { - int width = window_box_text_cols (w); int hscroll = XINT (w->hscroll); struct position pos; /* vpos is cumulative vertical position, changed as from is changed */ @@ -1858,12 +1891,6 @@ vmotion (from, vtarget, w) XSETWINDOW (window, w); - /* We must make room for continuation marks if we don't have fringes. */ -#ifdef HAVE_WINDOW_SYSTEM - if (!FRAME_WINDOW_P (XFRAME (w->frame))) -#endif - width -= 1; - /* If the window contains this buffer, use it for getting text properties. Otherwise use the current buffer as arg for doing that. */ if (EQ (w->buffer, Fcurrent_buffer ())) @@ -1905,7 +1932,7 @@ vmotion (from, vtarget, w) 1 << (BITS_PER_SHORT - 1), /* ... nor HPOS. */ 1 << (BITS_PER_SHORT - 1), - width, hscroll, + -1, hscroll, /* This compensates for start_hpos so that a tab as first character still occupies 8 columns. */ @@ -1964,7 +1991,7 @@ vmotion (from, vtarget, w) 1 << (BITS_PER_SHORT - 1), /* ... nor HPOS. */ 1 << (BITS_PER_SHORT - 1), - width, hscroll, + -1, hscroll, (XFASTINT (prevline) == BEG ? -start_hpos : 0), w); did_motion = 1; @@ -1978,7 +2005,7 @@ vmotion (from, vtarget, w) } return compute_motion (from, vpos, pos.hpos, did_motion, ZV, vtarget, - (1 << (BITS_PER_SHORT - 1)), - width, hscroll, + -1, hscroll, pos.tab_offset - (from == BEG ? start_hpos : 0), w); } From ec2b66c4c23c702023938f994e87fd3b01c306be Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:06:25 +0000 Subject: [PATCH 065/341] (window_scroll_line_based): Let compute_motion calculate actual window width. --- src/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.c b/src/window.c index c3603c2039f..ad22e1df107 100644 --- a/src/window.c +++ b/src/window.c @@ -4707,7 +4707,7 @@ window_scroll_line_based (window, n, whole, noerror) posit = *compute_motion (startpos, 0, 0, 0, PT, ht, 0, - window_box_text_cols (w), XINT (w->hscroll), + -1, XINT (w->hscroll), 0, w); original_vpos = posit.vpos; From 5970bd01f02aee80ba8353f6f7c6e6e5512eaeb4 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:19:24 +0000 Subject: [PATCH 066/341] (mouse-avoidance-point-position): Use window-inside-edges and call compute-motion with nil for topos and width to get proper usable width and height for both window and non-window systems. --- lisp/avoid.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/avoid.el b/lisp/avoid.el index 5a5a09622cd..536b80abdbe 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el @@ -139,15 +139,15 @@ Only applies in mouse-avoidance-modes `animate' and `jump'." "Return the position of point as (FRAME X . Y). Analogous to mouse-position." (let* ((w (selected-window)) - (edges (window-edges w)) + (edges (window-inside-edges w)) (list (compute-motion (max (window-start w) (point-min)) ; start pos ;; window-start can be < point-min if the ;; latter has changed since the last redisplay '(0 . 0) ; start XY (point) ; stop pos - (cons (window-width) (window-height)); stop XY: none - (1- (window-width)) ; width + nil ; stop XY: none + nil ; width (cons (window-hscroll w) 0) ; 0 may not be right? (selected-window)))) ;; compute-motion returns (pos HPOS VPOS prevhpos contin) From c296856cee8f420a0d69ca8ceaa5dc4c718a7dca Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:20:05 +0000 Subject: [PATCH 067/341] (windmove-coordinates-of-position): Let compute-motion calculate usable window width and height. --- lisp/windmove.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/windmove.el b/lisp/windmove.el index 7008b86335e..642f04a1d8d 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -429,14 +429,12 @@ the return value from `windmove-coordinates-of-position' is (0 . 0) regardless of the where point is in the buffer and where the window is placed in the frame." (let* ((wind (if (null window) (selected-window) window)) - (usable-width (1- (window-width wind))) ; 1- for cont. column - (usable-height (1- (window-height wind))) ; 1- for mode line (big-hairy-result (compute-motion (window-start) '(0 . 0) pos - (cons usable-width usable-height) - usable-width + nil ; (window-width window-height) + nil ; window-width (cons (window-hscroll) 0) ; why zero? wind))) From 7316f52cab8b75ef9f9c1e3bee9198d4fd8c1c4b Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:20:18 +0000 Subject: [PATCH 068/341] (window-buffer-height): Call compute-motion with nil width. --- lisp/window.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/window.el b/lisp/window.el index 96bfc8b5581..5ec752f3f23 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -408,7 +408,7 @@ lines than are actually needed in the case where some error may be present." '(0 . 0) (- (point-max) (if ignore-final-newline 1 0)) (cons 0 100000000) - (window-width window) + nil nil window)))))) From 0f7a93c1c6d940cc7691834a7936b800af6c0d6f Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:30:37 +0000 Subject: [PATCH 069/341] *** empty log message *** --- etc/NEWS | 4 ++++ lisp/ChangeLog | 11 +++++++++++ src/ChangeLog | 12 ++++++++++++ 3 files changed, 27 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 12d8f044637..0693e063992 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2187,6 +2187,10 @@ configuration files. * Lisp Changes in Emacs 21.4 +** Function `compute-motion' now calculates the usable window +width if the WIDTH argument is nil. If the TOPOS argument is nil, +the usable window height and width is used. + +++ ** `visited-file-modtime' and `calendar-time-from-absolute' now return a list of two integers, instead of a cons. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f78140ae1d9..b5134b2647f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2004-08-02 Kim F. Storm + + * avoid.el (mouse-avoidance-point-position): Use window-inside-edges + and call compute-motion with nil for topos and width to get proper + usable width and height for both window and non-window systems. + + * windmove.el (windmove-coordinates-of-position): Let compute-motion + calculate usable window width and height. + + * window.el (window-buffer-height): Call compute-motion with nil width. + 2004-08-01 David Kastrup * replace.el (query-replace-read-from): Use diff --git a/src/ChangeLog b/src/ChangeLog index 74a2281988b..84538195917 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2004-08-02 Kim F. Storm + + * indent.c (compute_motion): Use actual window width if WIDTH is -1, + properly accounting for continuation glyph on non-window systems. + (Fcompute_motion): Use actual window width if WIDTH is nil, and + actual window width/height if TOPOS is nil, properly accounting for + continuation glyphs on non-window systems, and optional header lines. + (vmotion): Let compute_motion calculate actual window width. + + * window.c (window_scroll_line_based): Let compute_motion + calculate actual window width. + 2004-08-02 Kim F. Storm * process.c (read_process_output): Use whole read buffer. From df13361290318d0fd05c9c0ff8d187b731d73846 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 2 Aug 2004 20:50:09 +0000 Subject: [PATCH 070/341] (Finteractive_form): Doc fix. --- src/ChangeLog | 4 ++++ src/data.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 84538195917..94d8983e1c9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-08-02 Luc Teirlinck + + * data.c (Finteractive_form): Doc fix. + 2004-08-02 Kim F. Storm * indent.c (compute_motion): Use actual window width if WIDTH is -1, diff --git a/src/data.c b/src/data.c index 1259c5891a1..616e91c2d62 100644 --- a/src/data.c +++ b/src/data.c @@ -776,8 +776,8 @@ SUBR must be a built-in function. */) DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0, doc: /* Return the interactive form of CMD or nil if none. -CMD must be a command. Value, if non-nil, is a list -\(interactive SPEC). */) +If CMD is not a command, the return value is nil. +Value, if non-nil, is a list \(interactive SPEC). */) (cmd) Lisp_Object cmd; { From fb8b092b99720c028ecbf48bc9a423024786af86 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 23:41:59 +0000 Subject: [PATCH 071/341] *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 94d8983e1c9..0194c4b8c6f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-08-03 Kim F. Storm + + * indent.c (compute_motion): Fix check for full width window + in non-window case. Do not count left truncation glyph on + window systems. + 2004-08-02 Luc Teirlinck * data.c (Finteractive_form): Doc fix. From ed5c373cab5483317a8b6fca3d8d4d52432934fc Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 23:42:14 +0000 Subject: [PATCH 072/341] (compute_motion): Fix check for full width window in non-window case. Do not count left truncation glyph on window systems. --- src/indent.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/indent.c b/src/indent.c index 6cb82c18f04..63f1ed31930 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1231,6 +1231,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, int prev_vpos = 0; int contin_hpos; /* HPOS of last column of continued line. */ int prev_tab_offset; /* Previous tab offset. */ + int continuation_glyph_width; XSETBUFFER (buffer, current_buffer); XSETWINDOW (window, win); @@ -1259,6 +1260,12 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, width -= 1; } + continuation_glyph_width = 0; +#ifdef HAVE_WINDOW_SYSTEM + if (!FRAME_WINDOW_P (XFRAME (win->frame))) + continuation_glyph_width = 1; +#endif + immediate_quit = 1; QUIT; @@ -1382,7 +1389,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, { if (hscroll || (truncate_partial_width_windows - && width < FRAME_COLS (XFRAME (WINDOW_FRAME (win)))) + && ((width + continuation_glyph_width) + < FRAME_COLS (XFRAME (WINDOW_FRAME (win))))) || !NILP (current_buffer->truncate_lines)) { /* Truncating: skip to newline, unless we are already past @@ -1666,7 +1674,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, hpos -= hscroll; /* Count the truncation glyph on column 0 */ if (hscroll > 0) - hpos++; + hpos += continuation_glyph_width; tab_offset = 0; } contin_hpos = 0; From 8cc08515f406edb4f485c8bdad003be05d48a665 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 23:59:28 +0000 Subject: [PATCH 073/341] (compute_motion): Fix last change. --- src/indent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/indent.c b/src/indent.c index 63f1ed31930..de76464564e 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1260,10 +1260,10 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, width -= 1; } - continuation_glyph_width = 0; + continuation_glyph_width = 1; #ifdef HAVE_WINDOW_SYSTEM - if (!FRAME_WINDOW_P (XFRAME (win->frame))) - continuation_glyph_width = 1; + if (FRAME_WINDOW_P (XFRAME (win->frame))) + continuation_glyph_width = 0; /* In the fringe. */ #endif immediate_quit = 1; From 160a708c6f0841732ce9c5b3b3c3e3e6defa3e7c Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 3 Aug 2004 05:12:00 +0000 Subject: [PATCH 074/341] (decode_coding_string): Adjust coding->consumed, and etc. with shrinked_bytes. --- src/coding.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/coding.c b/src/coding.c index c1394d0f135..7f87abce34d 100644 --- a/src/coding.c +++ b/src/coding.c @@ -6238,6 +6238,11 @@ decode_coding_string (str, coding, nocopy) shrinked_bytes - from); free_conversion_buffer (&buf); + coding->consumed += shrinked_bytes; + coding->consumed_char += shrinked_bytes; + coding->produced += shrinked_bytes; + coding->produced_char += shrinked_bytes; + if (coding->cmp_data && coding->cmp_data->used) coding_restore_composition (coding, newstr); coding_free_composition_data (coding); From c8b20fb7c375d2a7810088356b192adb5187676b Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 3 Aug 2004 05:19:25 +0000 Subject: [PATCH 075/341] *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 0194c4b8c6f..2b0c47862d4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-08-03 Kenichi Handa + + * coding.c (decode_coding_string): Adjust coding->consumed, and + etc. with shrinked_bytes. + 2004-08-03 Kim F. Storm * indent.c (compute_motion): Fix check for full width window From 5dda46a34271234a885795bd3ec12ce6b9f908e5 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 3 Aug 2004 12:06:47 +0000 Subject: [PATCH 076/341] The following changes are to utilize key-translation-map instead of minor mode map. (encoded-kbd-iso2022-non-ascii-map): Delete it. (encoded-kbd-coding, encoded-kbd-handle-8bit): Delete them. (encoded-kbd-last-key): New function. (encoded-kbd-iso2022-single-shift): New function. (encoded-kbd-iso2022-designation) (encoded-kbd-self-insert-iso2022-7bit) (encoded-kbd-self-insert-iso2022-8bit) (encoded-kbd-self-insert-sjis, encoded-kbd-self-insert-big5) (encoded-kbd-self-insert-ccl): Make them suitable for bindings in key-translation-map. (encoded-kbd-setup-keymap): Setup key-translation-map. (saved-key-translation-map): New variable. (encoded-kbd-mode): Save/restore key-translation-map. Adjusted for the change of encoded-kbd-setup-keymap. --- lisp/international/encoded-kb.el | 315 +++++++++++++------------------ 1 file changed, 132 insertions(+), 183 deletions(-) diff --git a/lisp/international/encoded-kb.el b/lisp/international/encoded-kb.el index 6eae1011c40..962f741c81c 100644 --- a/lisp/international/encoded-kb.el +++ b/lisp/international/encoded-kb.el @@ -24,6 +24,10 @@ ;;; Code: +;; Usually this map is empty (even if Encoded-kbd mode is on), but if +;; the keyboard coding system is iso-2022-based, it defines dummy key +;; bindings for ESC $ ..., etc. so that those bindings in +;; key-translation-map take effect. (defconst encoded-kbd-mode-map (make-sparse-keymap) "Keymap for Encoded-kbd minor mode.") @@ -69,25 +73,6 @@ (fset 'encoded-kbd-iso2022-designation-prefix encoded-kbd-iso2022-designation-map) -(defvar encoded-kbd-iso2022-non-ascii-map - (let ((map (make-keymap)) - (i 32)) - (while (< i 128) - (define-key map (char-to-string i) 'encoded-kbd-self-insert-iso2022-7bit) - (setq i (1+ i))) - (define-key map "\e" 'encoded-kbd-iso2022-esc-prefix) - (setq i 160) - (while (< i 256) - (define-key map (vector i) 'encoded-kbd-handle-8bit) - (setq i (1+ i))) - map) - "Keymap for handling non-ASCII character set in Encoded-kbd mode.") - -;; One of the symbols `sjis', `iso2022-7', `iso2022-8', or `big5' to -;; denote what kind of coding-system we are now handling in -;; Encoded-kbd mode. -(defvar encoded-kbd-coding nil) - ;; Keep information of designation state of ISO2022 encoding. When ;; Encoded-kbd mode is on, this is set to a vector of length 4, the ;; elements are character sets currently designated to graphic @@ -104,11 +89,14 @@ (defvar encoded-kbd-iso2022-invocations nil) (put 'encoded-kbd-iso2022-invocations 'permanent-local t) -(defun encoded-kbd-iso2022-designation () +(defsubst encoded-kbd-last-key () + (let ((keys (this-single-command-keys))) + (aref keys (1- (length keys))))) + +(defun encoded-kbd-iso2022-designation (ignore) "Do ISO2022 designation according to the current key in Encoded-kbd mode. The following key sequence may cause multilingual text insertion." - (interactive) - (let ((key-seq (this-command-keys)) + (let ((key-seq (this-single-command-keys)) (prev-g0-charset (aref encoded-kbd-iso2022-designations (aref encoded-kbd-iso2022-invocations 0))) intermediate-char final-char @@ -132,143 +120,122 @@ The following key sequence may cause multilingual text insertion." chars (if (< intermediate-char ?,) 94 96) final-char (aref key-seq 2) reg (mod intermediate-char 4)))) - (if (setq charset (iso-charset dimension chars final-char)) - (aset encoded-kbd-iso2022-designations reg charset) - (error "Character set of DIMENSION %s, CHARS %s, FINAL-CHAR `%c' is not supported" - dimension chars final-char)) + (aset encoded-kbd-iso2022-designations reg + (iso-charset dimension chars final-char))) + "") - (if (memq (aref encoded-kbd-iso2022-designations - (aref encoded-kbd-iso2022-invocations 0)) - '(ascii latin-jisx0201)) - ;; Graphic plane 0 (0x20..0x7f) is for ASCII. We don't have - ;; to handle characters in this range specially. - (if (not (memq prev-g0-charset '(ascii latin-jisx0201))) - ;; We must exit recursive edit now. - (throw 'exit nil)) - ;; Graphic plane 0 is for non-ASCII. - (if (memq prev-g0-charset '(ascii latin-jisx0201)) - ;; We must handle keys specially. - (let ((overriding-local-map encoded-kbd-iso2022-non-ascii-map)) - (recursive-edit)))))) +(defun encoded-kbd-iso2022-single-shift (ignore) + (let ((char (encoded-kbd-last-key))) + (aset encoded-kbd-iso2022-invocations 2 + (aref encoded-kbd-iso2022-designations + (if (= char ?\216) 2 3)))) + "") -(defun encoded-kbd-handle-8bit () - "Handle an 8-bit character entered in Encoded-kbd mode." - (interactive) - (cond ((eq encoded-kbd-coding 'iso2022-7) - (error "Can't handle the character code %d" last-command-char)) - - ((eq encoded-kbd-coding 'iso2022-8) - (cond ((= last-command-char ?\216) - (aset encoded-kbd-iso2022-invocations 2 2)) - - ((= last-command-char ?\217) - (aset encoded-kbd-iso2022-invocations 2 3)) - - ((>= last-command-char ?\240) - (encoded-kbd-self-insert-iso2022-8bit)) - - (t - (error "Can't handle the character code %d" - last-command-char)))) - - ((eq encoded-kbd-coding 'sjis) - (encoded-kbd-self-insert-sjis)) - - (t - (encoded-kbd-self-insert-big5)))) - -(defun encoded-kbd-self-insert-iso2022-7bit () - (interactive) - (let* ((charset (aref encoded-kbd-iso2022-designations - (or (aref encoded-kbd-iso2022-invocations 2) - (aref encoded-kbd-iso2022-invocations 0)))) - (char (if (= (charset-dimension charset) 1) - (make-char charset last-command-char) - (make-char charset last-command-char (read-char-exclusive))))) +(defun encoded-kbd-self-insert-iso2022-7bit (ignore) + (let ((char (encoded-kbd-last-key)) + (charset (aref encoded-kbd-iso2022-designations + (or (aref encoded-kbd-iso2022-invocations 2) + (aref encoded-kbd-iso2022-invocations 0))))) (aset encoded-kbd-iso2022-invocations 2 nil) - (setq unread-command-events (cons char unread-command-events)))) + (vector (if (= (charset-dimension charset) 1) + (make-char charset char) + (make-char charset char (read-char-exclusive)))))) -(defun encoded-kbd-self-insert-iso2022-8bit () - (interactive) - (cond - ((= last-command-char ?\216) ; SS2 (Single Shift 2) - (aset encoded-kbd-iso2022-invocations 2 2)) - ((= last-command-char ?\217) ; SS3 (Single Shift 3) - (aset encoded-kbd-iso2022-invocations 2 3)) - (t - (let* ((charset (aref encoded-kbd-iso2022-designations - (or (aref encoded-kbd-iso2022-invocations 2) - (aref encoded-kbd-iso2022-invocations 1)))) - (char (if (= (charset-dimension charset) 1) - (make-char charset last-command-char) - (make-char charset last-command-char - (read-char-exclusive))))) - (aset encoded-kbd-iso2022-invocations 2 nil) - (setq unread-command-events (cons char unread-command-events)))))) +(defun encoded-kbd-self-insert-iso2022-8bit (ignore) + (let ((char (encoded-kbd-last-key)) + (charset (aref encoded-kbd-iso2022-designations + (or (aref encoded-kbd-iso2022-invocations 2) + (aref encoded-kbd-iso2022-invocations 1))))) + (aset encoded-kbd-iso2022-invocations 2 nil) + (vector (if (= (charset-dimension charset) 1) + (make-char charset char) + (make-char charset char (read-char-exclusive)))))) -(defun encoded-kbd-self-insert-sjis () - (interactive) - (let ((char (if (or (< last-command-char ?\xA0) (>= last-command-char ?\xE0)) - (decode-sjis-char (+ (ash last-command-char 8) - (read-char-exclusive))) - (make-char 'katakana-jisx0201 last-command-char)))) - (setq unread-command-events (cons char unread-command-events)))) +(defun encoded-kbd-self-insert-sjis (ignore) + (let ((char (encoded-kbd-last-key))) + (vector + (if (or (< char ?\xA0) (>= char ?\xE0)) + (decode-sjis-char (+ (ash char 8) (read-char-exclusive))) + (make-char 'katakana-jisx0201 char))))) -(defun encoded-kbd-self-insert-big5 () - (interactive) - (let ((char (decode-big5-char (+ (ash last-command-char 8) - (read-char-exclusive))))) - (setq unread-command-events (cons char unread-command-events)))) +(defun encoded-kbd-self-insert-big5 (ignore) + (let ((char (encoded-kbd-last-key))) + (vector + (decode-big5-char (+ (ash char 8) (read-char-exclusive)))))) -(defun encoded-kbd-self-insert-ccl () - (interactive) - (let ((str (char-to-string last-command-char)) +(defun encoded-kbd-self-insert-ccl (ignore) + (let ((str (char-to-string (encoded-kbd-last-key))) (ccl (car (aref (coding-system-spec (keyboard-coding-system)) 4))) (vec [nil nil nil nil nil nil nil nil nil]) result) (while (= (length (setq result (ccl-execute-on-string ccl vec str t))) 0) (dotimes (i 9) (aset vec i nil)) (setq str (format "%s%c" str (read-char-exclusive)))) - (setq unread-command-events - (append result unread-command-events)))) + (vector (aref result 0)))) (defun encoded-kbd-setup-keymap (coding) ;; At first, reset the keymap. - (setcdr encoded-kbd-mode-map nil) + (define-key encoded-kbd-mode-map "\e" nil) ;; Then setup the keymap according to the keyboard coding system. (cond - ((eq encoded-kbd-coding 'sjis) + ((eq (coding-system-type coding) 1) ; SJIS (let ((i 128)) (while (< i 256) (define-key encoded-kbd-mode-map (vector i) 'encoded-kbd-self-insert-sjis) - (setq i (1+ i))))) + (setq i (1+ i)))) + 8) - ((eq encoded-kbd-coding 'big5) + ((eq (coding-system-type coding) 3) ; Big5 (let ((i 161)) (while (< i 255) (define-key encoded-kbd-mode-map (vector i) 'encoded-kbd-self-insert-big5) - (setq i (1+ i))))) + (setq i (1+ i)))) + 8) - ((eq encoded-kbd-coding 'iso2022-7) - (define-key encoded-kbd-mode-map "\e" 'encoded-kbd-iso2022-esc-prefix)) + ((eq (coding-system-type coding) 2) ; ISO-2022 + (let ((flags (coding-system-flags coding)) + use-designation) + (if (aref flags 8) + nil ; Don't support locking-shift. + (setq encoded-kbd-iso2022-designations (make-vector 4 nil) + encoded-kbd-iso2022-invocations (make-vector 3 nil)) + (dotimes (i 4) + (if (aref flags i) + (if (charsetp (aref flags i)) + (aset encoded-kbd-iso2022-designations + i (aref flags i)) + (setq use-designation t) + (if (charsetp (car-safe (aref flags i))) + (aset encoded-kbd-iso2022-designations + i (car (aref flags i))))))) + (aset encoded-kbd-iso2022-invocations 0 0) + (if (aref encoded-kbd-iso2022-designations 1) + (aset encoded-kbd-iso2022-invocations 1 1)) + (when use-designation + (define-key encoded-kbd-mode-map "\e" 'encoded-kbd-iso2022-esc-prefix) + (define-key key-translation-map "\e" 'encoded-kbd-iso2022-esc-prefix)) + (when (or (aref flags 2) (aref flags 3)) + (define-key key-translation-map + [?\216] 'encoded-kbd-iso2022-single-shift) + (define-key key-translation-map + [?\217] 'encoded-kbd-iso2022-single-shift)) + (or (eq (aref flags 0) 'ascii) + (dotimes (i 96) + (define-key key-translation-map + (vector (+ 32 i)) 'encoded-kbd-self-insert-iso2022-7bit))) + (if (aref flags 7) + t + (dotimes (i 96) + (define-key key-translation-map + (vector (+ 160 i)) 'encoded-kbd-self-insert-iso2022-8bit)) + 8)))) - ((eq encoded-kbd-coding 'iso2022-8) - (define-key encoded-kbd-mode-map - (vector ?\216) 'encoded-kbd-self-insert-iso2022-8bit) - (define-key encoded-kbd-mode-map - (vector ?\217) 'encoded-kbd-self-insert-iso2022-8bit) - (let ((i 160)) - (while (< i 256) - (define-key encoded-kbd-mode-map - (vector i) 'encoded-kbd-self-insert-iso2022-8bit) - (setq i (1+ i))))) - - ((eq encoded-kbd-coding 'ccl) + ((eq (coding-system-type coding) 4) ; CCL-base (let ((valid-codes (or (coding-system-get coding 'valid-codes) '((128 . 255)))) - elt from to) + elt from to valid) (while valid-codes (setq elt (car valid-codes) valid-codes (cdr valid-codes)) (if (consp elt) @@ -276,13 +243,17 @@ The following key sequence may cause multilingual text insertion." (setq from (setq to elt))) (while (<= from to) (if (>= from 128) - (define-key encoded-kbd-mode-map + (define-key key-translation-map (vector from) 'encoded-kbd-self-insert-ccl)) - (setq from (1+ from)))))) + (setq from (1+ from)))) + 8)) (t - (error "Invalid value in encoded-kbd-coding: %s" encoded-kbd-coding)))) + nil))) +;; key-translation-map at the time Encoded-kbd mode is turned on is +;; saved here. +(defvar saved-key-translation-map nil) ;; Input mode at the time Encoded-kbd mode is turned on is saved here. (defvar saved-input-mode nil) @@ -301,60 +272,38 @@ In Encoded-kbd mode, a text sent from keyboard is accepted as a multilingual text encoded in a coding system set by \\[set-keyboard-coding-system]." :global t - ;; We must at first reset input-mode to the original. - (if saved-input-mode (apply 'set-input-mode saved-input-mode)) + (if encoded-kbd-mode - (let ((coding (keyboard-coding-system))) - (setq saved-input-mode (current-input-mode)) - (cond ((null coding) - (setq encoded-kbd-mode nil) - (error "No coding system for keyboard input is set")) + ;; We are turning on Encoded-kbd mode. + (let ((coding (keyboard-coding-system)) + result) + (or saved-key-translation-map + (if (keymapp key-translation-map) + (setq saved-key-translation-map + (copy-keymap key-translation-map)) + (setq key-translation-map (make-sparse-keymap)))) + (or saved-input-mode + (setq saved-input-mode + (current-input-mode))) + (setq result (and coding (encoded-kbd-setup-keymap coding))) + (if result + (if (eq result 8) + (set-input-mode + (nth 0 saved-input-mode) + (nth 1 saved-input-mode) + 'use-8th-bit + (nth 3 saved-input-mode))) + (setq encoded-kbd-mode nil + saved-key-translation-map nil + saved-input-mode nil) + (error "Unsupported coding system in Encoded-kbd mode: %S" + coding))) - ((= (coding-system-type coding) 1) ; SJIS - (set-input-mode - (nth 0 saved-input-mode) (nth 1 saved-input-mode) - 'use-8th-bit (nth 3 saved-input-mode)) - (setq encoded-kbd-coding 'sjis)) - - ((= (coding-system-type coding) 2) ; ISO2022 - (if (aref (coding-system-flags coding) 7) ; 7-bit only - (setq encoded-kbd-coding 'iso2022-7) - (set-input-mode - (nth 0 saved-input-mode) (nth 1 saved-input-mode) - 'use-8th-bit (nth 3 saved-input-mode)) - (setq encoded-kbd-coding 'iso2022-8)) - (setq encoded-kbd-iso2022-designations (make-vector 4 nil)) - (let ((flags (coding-system-flags coding)) - (i 0)) - (while (< i 4) - (if (charsetp (aref flags i)) - (aset encoded-kbd-iso2022-designations i - (aref flags i)) - (if (charsetp (car-safe (aref flags i))) - (aset encoded-kbd-iso2022-designations i - (car (aref flags i))))) - (setq i (1+ i)))) - (setq encoded-kbd-iso2022-invocations (make-vector 3 nil)) - (aset encoded-kbd-iso2022-invocations 0 0) - (aset encoded-kbd-iso2022-invocations 1 1)) - - ((= (coding-system-type coding) 3) ; BIG5 - (set-input-mode - (nth 0 saved-input-mode) (nth 1 saved-input-mode) - 'use-8th-bit (nth 3 saved-input-mode)) - (setq encoded-kbd-coding 'big5)) - - ((= (coding-system-type coding) 4) ; CCL based coding - (set-input-mode - (nth 0 saved-input-mode) (nth 1 saved-input-mode) - 'use-8th-bit (nth 3 saved-input-mode)) - (setq encoded-kbd-coding 'ccl)) - - (t - (setq encoded-kbd-mode nil) - (error "Coding-system `%s' is not supported in Encoded-kbd mode" - (keyboard-coding-system)))) - (encoded-kbd-setup-keymap coding)))) + ;; We are turning off Encoded-kbd mode. + (setq key-translation-map saved-key-translation-map + saved-key-translation-map nil) + (apply 'set-input-mode saved-input-mode) + (setq saved-input-mode nil))) (provide 'encoded-kb) From af1781acbf8fe9e866ee36313d137a7ffb78383b Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 4 Aug 2004 13:03:26 +0000 Subject: [PATCH 077/341] (encoded-kbd-setup-keymap): Fix previous change. --- lisp/ChangeLog | 24 ++++++++++++++++++++++++ lisp/international/encoded-kb.el | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b5134b2647f..e12449df8e4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,27 @@ +2004-08-04 Kenichi Handa + + * international/encoded-kb.el (encoded-kbd-setup-keymap): Fix + previous change. + +2004-08-03 Kenichi Handa + + * international/encoded-kb.el: The following changes are to + utilize key-translation-map instead of minor mode map. + (encoded-kbd-iso2022-non-ascii-map): Delete it. + (encoded-kbd-coding, encoded-kbd-handle-8bit): Delete them. + (encoded-kbd-last-key): New function. + (encoded-kbd-iso2022-single-shift): New function. + (encoded-kbd-iso2022-designation) + (encoded-kbd-self-insert-iso2022-7bit) + (encoded-kbd-self-insert-iso2022-8bit) + (encoded-kbd-self-insert-sjis, encoded-kbd-self-insert-big5) + (encoded-kbd-self-insert-ccl): Make them suitable for bindings in + key-translation-map. + (encoded-kbd-setup-keymap): Setup key-translation-map. + (saved-key-translation-map): New variable. + (encoded-kbd-mode): Save/restore key-translation-map. Adjusted + for the change of encoded-kbd-setup-keymap. + 2004-08-02 Kim F. Storm * avoid.el (mouse-avoidance-point-position): Use window-inside-edges diff --git a/lisp/international/encoded-kb.el b/lisp/international/encoded-kb.el index 962f741c81c..cba2f0e45b9 100644 --- a/lisp/international/encoded-kb.el +++ b/lisp/international/encoded-kb.el @@ -181,7 +181,7 @@ The following key sequence may cause multilingual text insertion." ((eq (coding-system-type coding) 1) ; SJIS (let ((i 128)) (while (< i 256) - (define-key encoded-kbd-mode-map + (define-key key-translation-map (vector i) 'encoded-kbd-self-insert-sjis) (setq i (1+ i)))) 8) @@ -189,7 +189,7 @@ The following key sequence may cause multilingual text insertion." ((eq (coding-system-type coding) 3) ; Big5 (let ((i 161)) (while (< i 255) - (define-key encoded-kbd-mode-map + (define-key key-translation-map (vector i) 'encoded-kbd-self-insert-big5) (setq i (1+ i)))) 8) From 2d8a544976354b3787e4f28f2d97b3ab96f4a052 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 5 Aug 2004 00:15:15 +0000 Subject: [PATCH 078/341] (mail-extr-disable-voodoo): New variable. (mail-extr-voodoo): Check mail-extr-disable-voodoo. --- lisp/mail/mail-extr.el | 708 +++++++++++++++++++++-------------------- 1 file changed, 361 insertions(+), 347 deletions(-) diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el index faa7ca1bb74..7f2e6fef6b6 100644 --- a/lisp/mail/mail-extr.el +++ b/lisp/mail/mail-extr.el @@ -1434,374 +1434,388 @@ consing a string.)" (if all (nreverse value-list) (car value-list)) )) +(defcustom mail-extr-disable-voodoo "\\cj" + "*If it is a regexp, names matching it will never be modified. +If it is neither nil nor a string, modifying of names will never take +place. It affects how `mail-extract-address-components' works." + :type '(choice (regexp :size 0) + (const :tag "Always enabled" nil) + (const :tag "Always disabled" t)) + :group 'mail-extr) + (defun mail-extr-voodoo (mbox-beg mbox-end canonicalization-buffer) - (let ((word-count 0) - (case-fold-search nil) - mixed-case-flag lower-case-flag ;;upper-case-flag - suffix-flag last-name-comma-flag - ;;cbeg cend - initial - begin-again-flag - drop-this-word-if-trailing-flag - drop-last-word-if-trailing-flag - word-found-flag - this-word-beg last-word-beg - name-beg name-end - name-done-flag - ) - (save-excursion - (set-syntax-table mail-extr-address-text-syntax-table) + (unless (and mail-extr-disable-voodoo + (or (not (stringp mail-extr-disable-voodoo)) + (progn + (goto-char (point-min)) + (re-search-forward mail-extr-disable-voodoo nil t)))) + (let ((word-count 0) + (case-fold-search nil) + mixed-case-flag lower-case-flag ;;upper-case-flag + suffix-flag last-name-comma-flag + ;;cbeg cend + initial + begin-again-flag + drop-this-word-if-trailing-flag + drop-last-word-if-trailing-flag + word-found-flag + this-word-beg last-word-beg + name-beg name-end + name-done-flag + ) + (save-excursion + (set-syntax-table mail-extr-address-text-syntax-table) - ;; Get rid of comments. - (goto-char (point-min)) - (while (not (eobp)) - ;; Initialize for this iteration of the loop. - (skip-chars-forward "^({[\"'`") - (let ((cbeg (point))) - (set-syntax-table mail-extr-address-text-comment-syntax-table) - (if (memq (following-char) '(?\' ?\`)) - (search-forward "'" nil 'move - (if (eq ?\' (following-char)) 2 1)) - (or (mail-extr-safe-move-sexp 1) - (goto-char (point-max)))) - (set-syntax-table mail-extr-address-text-syntax-table) - (when (eq (char-after cbeg) ?\() - ;; Delete the comment itself. - (delete-region cbeg (point)) - ;; Canonicalize whitespace where the comment was. - (skip-chars-backward " \t") - (if (looking-at "\\([ \t]+$\\|[ \t]+,\\)") - (replace-match "") - (setq cbeg (point)) - (skip-chars-forward " \t") - (if (bobp) - (delete-region (point) cbeg) - (just-one-space)))))) - - ;; This was moved above. - ;; Fix . used as space - ;; But it belongs here because it occurs not only as - ;; rypens@reks.uia.ac.be (Piet.Rypens) - ;; but also as - ;; "Piet.Rypens" - ;;(goto-char (point-min)) - ;;(while (re-search-forward mail-extr-bad-dot-pattern nil t) - ;; (replace-match "\\1 \\2" t)) - - (unless (search-forward " " nil t) + ;; Get rid of comments. (goto-char (point-min)) - (cond ((search-forward "_" nil t) - ;; Handle the *idiotic* use of underlines as spaces. - ;; Example: fml@foo.bar.dom (First_M._Last) - (goto-char (point-min)) - (while (search-forward "_" nil t) - (replace-match " " t))) - ((search-forward "." nil t) - ;; Fix . used as space - ;; Example: danj1@cb.att.com (daniel.jacobson) - (goto-char (point-min)) - (while (re-search-forward mail-extr-bad-dot-pattern nil t) - (replace-match "\\1 \\2" t))))) + (while (not (eobp)) + ;; Initialize for this iteration of the loop. + (skip-chars-forward "^({[\"'`") + (let ((cbeg (point))) + (set-syntax-table mail-extr-address-text-comment-syntax-table) + (if (memq (following-char) '(?\' ?\`)) + (search-forward "'" nil 'move + (if (eq ?\' (following-char)) 2 1)) + (or (mail-extr-safe-move-sexp 1) + (goto-char (point-max)))) + (set-syntax-table mail-extr-address-text-syntax-table) + (when (eq (char-after cbeg) ?\() + ;; Delete the comment itself. + (delete-region cbeg (point)) + ;; Canonicalize whitespace where the comment was. + (skip-chars-backward " \t") + (if (looking-at "\\([ \t]+$\\|[ \t]+,\\)") + (replace-match "") + (setq cbeg (point)) + (skip-chars-forward " \t") + (if (bobp) + (delete-region (point) cbeg) + (just-one-space)))))) - ;; Loop over the words (and other junk) in the name. - (goto-char (point-min)) - (while (not name-done-flag) + ;; This was moved above. + ;; Fix . used as space + ;; But it belongs here because it occurs not only as + ;; rypens@reks.uia.ac.be (Piet.Rypens) + ;; but also as + ;; "Piet.Rypens" + ;;(goto-char (point-min)) + ;;(while (re-search-forward mail-extr-bad-dot-pattern nil t) + ;; (replace-match "\\1 \\2" t)) - (when word-found-flag - ;; Last time through this loop we skipped over a word. - (setq last-word-beg this-word-beg) - (setq drop-last-word-if-trailing-flag - drop-this-word-if-trailing-flag) - (setq word-found-flag nil)) + (unless (search-forward " " nil t) + (goto-char (point-min)) + (cond ((search-forward "_" nil t) + ;; Handle the *idiotic* use of underlines as spaces. + ;; Example: fml@foo.bar.dom (First_M._Last) + (goto-char (point-min)) + (while (search-forward "_" nil t) + (replace-match " " t))) + ((search-forward "." nil t) + ;; Fix . used as space + ;; Example: danj1@cb.att.com (daniel.jacobson) + (goto-char (point-min)) + (while (re-search-forward mail-extr-bad-dot-pattern nil t) + (replace-match "\\1 \\2" t))))) - (when begin-again-flag - ;; Last time through the loop we found something that - ;; indicates we should pretend we are beginning again from - ;; the start. - (setq word-count 0) - (setq last-word-beg nil) - (setq drop-last-word-if-trailing-flag nil) - (setq mixed-case-flag nil) - (setq lower-case-flag nil) - ;; (setq upper-case-flag nil) - (setq begin-again-flag nil)) + ;; Loop over the words (and other junk) in the name. + (goto-char (point-min)) + (while (not name-done-flag) - ;; Initialize for this iteration of the loop. - (mail-extr-skip-whitespace-forward) - (if (eq word-count 0) (narrow-to-region (point) (point-max))) - (setq this-word-beg (point)) - (setq drop-this-word-if-trailing-flag nil) + (when word-found-flag + ;; Last time through this loop we skipped over a word. + (setq last-word-beg this-word-beg) + (setq drop-last-word-if-trailing-flag + drop-this-word-if-trailing-flag) + (setq word-found-flag nil)) - ;; Decide what to do based on what we are looking at. - (cond + (when begin-again-flag + ;; Last time through the loop we found something that + ;; indicates we should pretend we are beginning again from + ;; the start. + (setq word-count 0) + (setq last-word-beg nil) + (setq drop-last-word-if-trailing-flag nil) + (setq mixed-case-flag nil) + (setq lower-case-flag nil) + ;; (setq upper-case-flag nil) + (setq begin-again-flag nil)) - ;; Delete title - ((and (eq word-count 0) - (looking-at mail-extr-full-name-prefixes)) - (goto-char (match-end 0)) - (narrow-to-region (point) (point-max))) - - ;; Stop after name suffix - ((and (>= word-count 2) - (looking-at mail-extr-full-name-suffix-pattern)) - (mail-extr-skip-whitespace-backward) - (setq suffix-flag (point)) - (if (eq ?, (following-char)) - (forward-char 1) - (insert ?,)) - ;; Enforce at least one space after comma - (or (eq ?\ (following-char)) - (insert ?\ )) + ;; Initialize for this iteration of the loop. (mail-extr-skip-whitespace-forward) - (cond ((memq (following-char) '(?j ?J ?s ?S)) - (capitalize-word 1) - (if (eq (following-char) ?.) - (forward-char 1) - (insert ?.))) - (t - (upcase-word 1))) - (setq word-found-flag t) - (setq name-done-flag t)) + (if (eq word-count 0) (narrow-to-region (point) (point-max))) + (setq this-word-beg (point)) + (setq drop-this-word-if-trailing-flag nil) - ;; Handle SCA names - ((looking-at "MKA \\(.+\\)") ; "Mundanely Known As" - (goto-char (match-beginning 1)) - (narrow-to-region (point) (point-max)) - (setq begin-again-flag t)) - - ;; Check for initial last name followed by comma - ((and (eq ?, (following-char)) - (eq word-count 1)) - (forward-char 1) - (setq last-name-comma-flag t) - (or (eq ?\ (following-char)) - (insert ?\ ))) - - ;; Stop before trailing comma-separated comment - ;; THIS CASE MUST BE AFTER THE PRECEDING CASES. - ;; *** This case is redundant??? - ;;((eq ?, (following-char)) - ;; (setq name-done-flag t)) - - ;; Delete parenthesized/quoted comment/nickname - ((memq (following-char) '(?\( ?\{ ?\[ ?\" ?\' ?\`)) - (setq cbeg (point)) - (set-syntax-table mail-extr-address-text-comment-syntax-table) - (cond ((memq (following-char) '(?\' ?\`)) - (or (search-forward "'" nil t - (if (eq ?\' (following-char)) 2 1)) - (delete-char 1))) - (t - (or (mail-extr-safe-move-sexp 1) - (goto-char (point-max))))) - (set-syntax-table mail-extr-address-text-syntax-table) - (setq cend (point)) + ;; Decide what to do based on what we are looking at. (cond - ;; Handle case of entire name being quoted + + ;; Delete title ((and (eq word-count 0) - (looking-at " *\\'") - (>= (- cend cbeg) 2)) - (narrow-to-region (1+ cbeg) (1- cend)) - (goto-char (point-min))) + (looking-at mail-extr-full-name-prefixes)) + (goto-char (match-end 0)) + (narrow-to-region (point) (point-max))) + + ;; Stop after name suffix + ((and (>= word-count 2) + (looking-at mail-extr-full-name-suffix-pattern)) + (mail-extr-skip-whitespace-backward) + (setq suffix-flag (point)) + (if (eq ?, (following-char)) + (forward-char 1) + (insert ?,)) + ;; Enforce at least one space after comma + (or (eq ?\ (following-char)) + (insert ?\ )) + (mail-extr-skip-whitespace-forward) + (cond ((memq (following-char) '(?j ?J ?s ?S)) + (capitalize-word 1) + (if (eq (following-char) ?.) + (forward-char 1) + (insert ?.))) + (t + (upcase-word 1))) + (setq word-found-flag t) + (setq name-done-flag t)) + + ;; Handle SCA names + ((looking-at "MKA \\(.+\\)") ; "Mundanely Known As" + (goto-char (match-beginning 1)) + (narrow-to-region (point) (point-max)) + (setq begin-again-flag t)) + + ;; Check for initial last name followed by comma + ((and (eq ?, (following-char)) + (eq word-count 1)) + (forward-char 1) + (setq last-name-comma-flag t) + (or (eq ?\ (following-char)) + (insert ?\ ))) + + ;; Stop before trailing comma-separated comment + ;; THIS CASE MUST BE AFTER THE PRECEDING CASES. + ;; *** This case is redundant??? + ;;((eq ?, (following-char)) + ;; (setq name-done-flag t)) + + ;; Delete parenthesized/quoted comment/nickname + ((memq (following-char) '(?\( ?\{ ?\[ ?\" ?\' ?\`)) + (setq cbeg (point)) + (set-syntax-table mail-extr-address-text-comment-syntax-table) + (cond ((memq (following-char) '(?\' ?\`)) + (or (search-forward "'" nil t + (if (eq ?\' (following-char)) 2 1)) + (delete-char 1))) + (t + (or (mail-extr-safe-move-sexp 1) + (goto-char (point-max))))) + (set-syntax-table mail-extr-address-text-syntax-table) + (setq cend (point)) + (cond + ;; Handle case of entire name being quoted + ((and (eq word-count 0) + (looking-at " *\\'") + (>= (- cend cbeg) 2)) + (narrow-to-region (1+ cbeg) (1- cend)) + (goto-char (point-min))) + (t + ;; Handle case of quoted initial + (if (and (or (= 3 (- cend cbeg)) + (and (= 4 (- cend cbeg)) + (eq ?. (char-after (+ 2 cbeg))))) + (not (looking-at " *\\'"))) + (setq initial (char-after (1+ cbeg))) + (setq initial nil)) + (delete-region cbeg cend) + (if initial + (insert initial ". "))))) + + ;; Handle *Stupid* VMS date stamps + ((looking-at mail-extr-stupid-vms-date-stamp-pattern) + (replace-match "" t)) + + ;; Handle Chinese characters. + ((looking-at mail-extr-hz-embedded-gb-encoded-chinese-pattern) + (goto-char (match-end 0)) + (setq word-found-flag t)) + + ;; Skip initial garbage characters. + ;; THIS CASE MUST BE AFTER THE PRECEDING CASES. + ((and (eq word-count 0) + (looking-at mail-extr-leading-garbage)) + (goto-char (match-end 0)) + ;; *** Skip backward over these??? + ;; (skip-chars-backward "& \"") + (narrow-to-region (point) (point-max))) + + ;; Various stopping points + ((or + + ;; Stop before ALL CAPS acronyms, if preceded by mixed-case + ;; words. Example: XT-DEM. + (and (>= word-count 2) + mixed-case-flag + (looking-at mail-extr-weird-acronym-pattern) + (not (looking-at mail-extr-roman-numeral-pattern))) + + ;; Stop before trailing alternative address + (looking-at mail-extr-alternative-address-pattern) + + ;; Stop before trailing comment not introduced by comma + ;; THIS CASE MUST BE AFTER AN EARLIER CASE. + (looking-at mail-extr-trailing-comment-start-pattern) + + ;; Stop before telephone numbers + (and (>= word-count 1) + (looking-at mail-extr-telephone-extension-pattern))) + (setq name-done-flag t)) + + ;; Delete ham radio call signs + ((looking-at mail-extr-ham-call-sign-pattern) + (delete-region (match-beginning 0) (match-end 0))) + + ;; Fixup initials + ((looking-at mail-extr-initial-pattern) + (or (eq (following-char) (upcase (following-char))) + (setq lower-case-flag t)) + (forward-char 1) + (if (eq ?. (following-char)) + (forward-char 1) + (insert ?.)) + (or (eq ?\ (following-char)) + (insert ?\ )) + (setq word-found-flag t)) + + ;; Handle BITNET LISTSERV list names. + ((and (eq word-count 0) + (looking-at mail-extr-listserv-list-name-pattern)) + (narrow-to-region (match-beginning 1) (match-end 1)) + (setq word-found-flag t) + (setq name-done-flag t)) + + ;; Handle & substitution, when & is last and is not first. + ((and (> word-count 0) + (eq ?\ (preceding-char)) + (eq (following-char) ?&) + (eq (1+ (point)) (point-max))) + (delete-char 1) + (capitalize-region + (point) + (progn + (insert-buffer-substring canonicalization-buffer + mbox-beg mbox-end) + (point))) + (setq disable-initial-guessing-flag t) + (setq word-found-flag t)) + + ;; Handle & between names, as in "Bob & Susie". + ((and (> word-count 0) (eq (following-char) ?\&)) + (setq name-beg (point)) + (setq name-end (1+ name-beg)) + (setq word-found-flag t) + (goto-char name-end)) + + ;; Regular name words + ((looking-at mail-extr-name-pattern) + (setq name-beg (point)) + (setq name-end (match-end 0)) + + ;; Certain words will be dropped if they are at the end. + (and (>= word-count 2) + (not lower-case-flag) + (or + ;; Trailing 4-or-more letter lowercase words preceded by + ;; mixed case or uppercase words will be dropped. + (looking-at "[[:lower:]]\\{4,\\}[ \t]*\\'") + ;; Drop a trailing word which is terminated with a period. + (eq ?. (char-after (1- name-end)))) + (setq drop-this-word-if-trailing-flag t)) + + ;; Set the flags that indicate whether we have seen a lowercase + ;; word, a mixed case word, and an uppercase word. + (if (re-search-forward "[[:lower:]]" name-end t) + (if (progn + (goto-char name-beg) + (re-search-forward "[[:upper:]]" name-end t)) + (setq mixed-case-flag t) + (setq lower-case-flag t)) + ;; (setq upper-case-flag t) + ) + + (goto-char name-end) + (setq word-found-flag t)) + + ;; Allow a number as a word, if it doesn't mean anything else. + ((looking-at "[0-9]+\\>") + (setq name-beg (point)) + (setq name-end (match-end 0)) + (goto-char name-end) + (setq word-found-flag t)) + (t - ;; Handle case of quoted initial - (if (and (or (= 3 (- cend cbeg)) - (and (= 4 (- cend cbeg)) - (eq ?. (char-after (+ 2 cbeg))))) - (not (looking-at " *\\'"))) - (setq initial (char-after (1+ cbeg))) - (setq initial nil)) - (delete-region cbeg cend) - (if initial - (insert initial ". "))))) + (setq name-done-flag t) + )) - ;; Handle *Stupid* VMS date stamps - ((looking-at mail-extr-stupid-vms-date-stamp-pattern) - (replace-match "" t)) + ;; Count any word that we skipped over. + (if word-found-flag + (setq word-count (1+ word-count)))) - ;; Handle Chinese characters. - ((looking-at mail-extr-hz-embedded-gb-encoded-chinese-pattern) - (goto-char (match-end 0)) - (setq word-found-flag t)) + ;; If the last thing in the name is 2 or more periods, or one or more + ;; other sentence terminators (but not a single period) then keep them + ;; and the preceding word. This is for the benefit of whole sentences + ;; in the name field: it's better behavior than dropping the last word + ;; of the sentence... + (if (and (not suffix-flag) + (looking-at "\\(\\.+\\|[?!;:.][?!;:.]+\\|[?!;:][?!;:.]*\\)\\'")) + (goto-char (setq suffix-flag (point-max)))) - ;; Skip initial garbage characters. - ;; THIS CASE MUST BE AFTER THE PRECEDING CASES. - ((and (eq word-count 0) - (looking-at mail-extr-leading-garbage)) - (goto-char (match-end 0)) - ;; *** Skip backward over these??? - ;; (skip-chars-backward "& \"") + ;; Drop everything after point and certain trailing words. + (narrow-to-region (point-min) + (or (and drop-last-word-if-trailing-flag + last-word-beg) + (point))) + + ;; Xerox's mailers SUCK!!!!!! + ;; We simply refuse to believe that any last name is PARC or ADOC. + ;; If it looks like that is the last name, that there is no meaningful + ;; here at all. Actually I guess it would be best to map patterns + ;; like foo.hoser@xerox.com into foo@hoser.xerox.com, but I don't + ;; actually know that that is what's going on. + (unless suffix-flag + (goto-char (point-min)) + (let ((case-fold-search t)) + (if (looking-at "[-A-Za-z_]+[. ]\\(PARC\\|ADOC\\)\\'") + (erase-buffer)))) + + ;; If last name first put it at end (but before suffix) + (when last-name-comma-flag + (goto-char (point-min)) + (search-forward ",") + (setq name-end (1- (point))) + (goto-char (or suffix-flag (point-max))) + (or (eq ?\ (preceding-char)) + (insert ?\ )) + (insert-buffer-substring (current-buffer) (point-min) name-end) + (goto-char name-end) + (skip-chars-forward "\t ,") (narrow-to-region (point) (point-max))) - ;; Various stopping points - ((or + ;; Delete leading and trailing junk characters. + ;; *** This is probably completely unneeded now. + ;;(goto-char (point-max)) + ;;(skip-chars-backward mail-extr-non-end-name-chars) + ;;(if (eq ?. (following-char)) + ;; (forward-char 1)) + ;;(narrow-to-region (point) + ;; (progn + ;; (goto-char (point-min)) + ;; (skip-chars-forward mail-extr-non-begin-name-chars) + ;; (point))) - ;; Stop before ALL CAPS acronyms, if preceded by mixed-case - ;; words. Example: XT-DEM. - (and (>= word-count 2) - mixed-case-flag - (looking-at mail-extr-weird-acronym-pattern) - (not (looking-at mail-extr-roman-numeral-pattern))) - - ;; Stop before trailing alternative address - (looking-at mail-extr-alternative-address-pattern) - - ;; Stop before trailing comment not introduced by comma - ;; THIS CASE MUST BE AFTER AN EARLIER CASE. - (looking-at mail-extr-trailing-comment-start-pattern) - - ;; Stop before telephone numbers - (and (>= word-count 1) - (looking-at mail-extr-telephone-extension-pattern))) - (setq name-done-flag t)) - - ;; Delete ham radio call signs - ((looking-at mail-extr-ham-call-sign-pattern) - (delete-region (match-beginning 0) (match-end 0))) - - ;; Fixup initials - ((looking-at mail-extr-initial-pattern) - (or (eq (following-char) (upcase (following-char))) - (setq lower-case-flag t)) - (forward-char 1) - (if (eq ?. (following-char)) - (forward-char 1) - (insert ?.)) - (or (eq ?\ (following-char)) - (insert ?\ )) - (setq word-found-flag t)) - - ;; Handle BITNET LISTSERV list names. - ((and (eq word-count 0) - (looking-at mail-extr-listserv-list-name-pattern)) - (narrow-to-region (match-beginning 1) (match-end 1)) - (setq word-found-flag t) - (setq name-done-flag t)) - - ;; Handle & substitution, when & is last and is not first. - ((and (> word-count 0) - (eq ?\ (preceding-char)) - (eq (following-char) ?&) - (eq (1+ (point)) (point-max))) - (delete-char 1) - (capitalize-region - (point) - (progn - (insert-buffer-substring canonicalization-buffer - mbox-beg mbox-end) - (point))) - (setq disable-initial-guessing-flag t) - (setq word-found-flag t)) - - ;; Handle & between names, as in "Bob & Susie". - ((and (> word-count 0) (eq (following-char) ?\&)) - (setq name-beg (point)) - (setq name-end (1+ name-beg)) - (setq word-found-flag t) - (goto-char name-end)) - - ;; Regular name words - ((looking-at mail-extr-name-pattern) - (setq name-beg (point)) - (setq name-end (match-end 0)) - - ;; Certain words will be dropped if they are at the end. - (and (>= word-count 2) - (not lower-case-flag) - (or - ;; Trailing 4-or-more letter lowercase words preceded by - ;; mixed case or uppercase words will be dropped. - (looking-at "[[:lower:]]\\{4,\\}[ \t]*\\'") - ;; Drop a trailing word which is terminated with a period. - (eq ?. (char-after (1- name-end)))) - (setq drop-this-word-if-trailing-flag t)) - - ;; Set the flags that indicate whether we have seen a lowercase - ;; word, a mixed case word, and an uppercase word. - (if (re-search-forward "[[:lower:]]" name-end t) - (if (progn - (goto-char name-beg) - (re-search-forward "[[:upper:]]" name-end t)) - (setq mixed-case-flag t) - (setq lower-case-flag t)) -;; (setq upper-case-flag t) - ) - - (goto-char name-end) - (setq word-found-flag t)) - - ;; Allow a number as a word, if it doesn't mean anything else. - ((looking-at "[0-9]+\\>") - (setq name-beg (point)) - (setq name-end (match-end 0)) - (goto-char name-end) - (setq word-found-flag t)) - - (t - (setq name-done-flag t) - )) - - ;; Count any word that we skipped over. - (if word-found-flag - (setq word-count (1+ word-count)))) - - ;; If the last thing in the name is 2 or more periods, or one or more - ;; other sentence terminators (but not a single period) then keep them - ;; and the preceding word. This is for the benefit of whole sentences - ;; in the name field: it's better behavior than dropping the last word - ;; of the sentence... - (if (and (not suffix-flag) - (looking-at "\\(\\.+\\|[?!;:.][?!;:.]+\\|[?!;:][?!;:.]*\\)\\'")) - (goto-char (setq suffix-flag (point-max)))) - - ;; Drop everything after point and certain trailing words. - (narrow-to-region (point-min) - (or (and drop-last-word-if-trailing-flag - last-word-beg) - (point))) - - ;; Xerox's mailers SUCK!!!!!! - ;; We simply refuse to believe that any last name is PARC or ADOC. - ;; If it looks like that is the last name, that there is no meaningful - ;; here at all. Actually I guess it would be best to map patterns - ;; like foo.hoser@xerox.com into foo@hoser.xerox.com, but I don't - ;; actually know that that is what's going on. - (unless suffix-flag + ;; Compress whitespace (goto-char (point-min)) - (let ((case-fold-search t)) - (if (looking-at "[-A-Za-z_]+[. ]\\(PARC\\|ADOC\\)\\'") - (erase-buffer)))) - - ;; If last name first put it at end (but before suffix) - (when last-name-comma-flag - (goto-char (point-min)) - (search-forward ",") - (setq name-end (1- (point))) - (goto-char (or suffix-flag (point-max))) - (or (eq ?\ (preceding-char)) - (insert ?\ )) - (insert-buffer-substring (current-buffer) (point-min) name-end) - (goto-char name-end) - (skip-chars-forward "\t ,") - (narrow-to-region (point) (point-max))) - - ;; Delete leading and trailing junk characters. - ;; *** This is probably completely unneeded now. - ;;(goto-char (point-max)) - ;;(skip-chars-backward mail-extr-non-end-name-chars) - ;;(if (eq ?. (following-char)) - ;; (forward-char 1)) - ;;(narrow-to-region (point) - ;; (progn - ;; (goto-char (point-min)) - ;; (skip-chars-forward mail-extr-non-begin-name-chars) - ;; (point))) - - ;; Compress whitespace - (goto-char (point-min)) - (while (re-search-forward "[ \t\n]+" nil t) - (replace-match (if (eobp) "" " ") t)) - ))) + (while (re-search-forward "[ \t\n]+" nil t) + (replace-match (if (eobp) "" " ") t)) + )))) From 8dbc532e462f384899acfa1f17d687a2fdef6400 Mon Sep 17 00:00:00 2001 From: Lars Hansen Date: Thu, 5 Aug 2004 06:19:38 +0000 Subject: [PATCH 079/341] Update how to separate the editable field of an editable-field widget from other widgets. (Programming Example): Add text after field. --- man/ChangeLog | 6 ++++++ man/widget.texi | 22 ++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index a36b0c75fe4..4f2ce160de6 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,9 @@ +2004-08-05 Lars Hansen + + * widget.texi (User Interface): Update how to separate the + editable field of an editable-field widget from other widgets. + (Programming Example): Add text after field. + 2004-07-24 Richard M. Stallman * text.texi (Paragraphs): Update how paragraphs are separated diff --git a/man/widget.texi b/man/widget.texi index 457af8a07bb..7e1d920cc62 100644 --- a/man/widget.texi +++ b/man/widget.texi @@ -213,14 +213,19 @@ middle of another field is prohibited. Editable text fields are created by the @code{editable-field} widget. -An editable field must be surrounded by static text on both sides, that -is, text that does not change in the lifetime of the widget. If the -field extends to the end of the line, the terminating line-feed character -will count as the necessary static text on that end, but you will have -to provide the static text before the field yourself. The -@code{:format} keyword is useful for generating the static text; for -instance, if you give it a value of @code{"Name: %v"}, the "Name: " part -will count as the static text. +@strong{Warning:} In an @code{editable-field} widget, the editable +field must not be adjacent to another widget---that won't work. +You must put some text in between. Either make this text part of +the @code{editable-field} widget itself, or insert it with +@code{widget-insert}. + +The @code{:format} keyword is useful for generating the necessary +text; for instance, if you give it a value of @code{"Name: %v "}, +the @samp{Name: } part will provide the necessary separating text +before the field and the trailing space will provide the +separating text after the field. If you don't include the +@code{:size} keyword, the field will extend to the end of the +line, and the terminating newline will provide separation after. The editing text fields are highlighted with the @code{widget-field-face} face, making them easy to find. @@ -345,6 +350,7 @@ Interface}). (widget-insert "Here is some documentation.\n\nName: ") (widget-create 'editable-field :size 13 + :format "%v " ; Text after the field! "My Name") (widget-create 'menu-choice :tag "Choose" From 73e3e7c2c8d0d245859fd625f009edd81a7257f9 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 6 Aug 2004 19:06:49 +0000 Subject: [PATCH 080/341] (install-arch-indep, uninstall): Add flymake. --- Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 35cc2798e32..05d7b556256 100644 --- a/Makefile.in +++ b/Makefile.in @@ -475,7 +475,7 @@ install-arch-indep: mkdir info chmod a+r ${infodir}/dir); \ fi; \ cd ${srcdir}/info ; \ - for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* emacs-xtra* eshell* eudc* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* reftex* sc* ses* speedbar* tramp* vip* widget* woman* smtpmail*; do \ + for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* emacs-xtra* eshell* eudc* flymake* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* reftex* sc* ses* speedbar* tramp* vip* widget* woman* smtpmail*; do \ (cd $${thisdir}; \ ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \ chmod a+r ${infodir}/$$f); \ @@ -485,7 +485,7 @@ install-arch-indep: mkdir info thisdir=`/bin/pwd`; \ if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \ then \ - for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime emacs-xtra eshell eudc forms gnus idlwave info message mh-e pcl-cvs reftex sc ses speedbar tramp vip viper widget woman smtpmail; do \ + for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime emacs-xtra eshell eudc flymake forms gnus idlwave info message mh-e pcl-cvs reftex sc ses speedbar tramp vip viper widget woman smtpmail; do \ (cd $${thisdir}; \ ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \ done; \ @@ -551,7 +551,7 @@ uninstall: done (cd ${archlibdir} && rm -f fns-*) -rm -rf ${libexecdir}/emacs/${version} - (cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* emacs-xtra* forms* gnus* info* mh-e* sc* ses* vip* smtpmail*) + (cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* emacs-xtra* flymake* forms* gnus* info* mh-e* sc* ses* vip* smtpmail*) (cd ${man1dir} && rm -f emacs${manext} emacsclient${manext} etags${manext} ctags${manext}) (cd ${bindir} && rm -f $(EMACSFULL) $(EMACS)) From 792a05ba9d65124c38021c0b99e803ea029d24ac Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 6 Aug 2004 20:25:44 +0000 Subject: [PATCH 081/341] (install): Remove .arch-inventory files. --- leim/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/leim/Makefile.in b/leim/Makefile.in index 7f3c13dbe36..acffcc7f7b5 100644 --- a/leim/Makefile.in +++ b/leim/Makefile.in @@ -232,6 +232,7 @@ install: all fi; \ rm -rf ${INSTALLDIR}/CVS ${INSTALLDIR}/*/CVS; \ rm -f ${INSTALLDIR}/.cvsignore ${INSTALLDIR}/*/.cvsignore; \ + rm -f ${INSTALLDIR}/.arch-inventory ${INSTALLDIR}/*/.arch-inventory; \ rm -f ${INSTALLDIR}/\#* ${INSTALLDIR}/*/\#* ; \ rm -f ${INSTALLDIR}/.\#* ${INSTALLDIR}/*/.\#* ; \ rm -f ${INSTALLDIR}/*~ ${INSTALLDIR}/*/*~ ; \ From de10c1149c818f8cee4cc5af7408655945a339d3 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 6 Aug 2004 20:26:11 +0000 Subject: [PATCH 082/341] *** empty log message *** --- ChangeLog | 4 ++++ leim/ChangeLog | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 60fbc7e8723..223d75fdf07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-08-06 Andreas Schwab + + * Makefile.in (install-arch-indep, uninstall): Add flymake. + 2004-07-31 Eli Zaretskii * config.bat: Update URLs in the comments. diff --git a/leim/ChangeLog b/leim/ChangeLog index 146bc897098..c30c488c0b7 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog @@ -1,3 +1,7 @@ +2004-08-06 Andreas Schwab + + * Makefile.in (install): Remove .arch-inventory files. + 2004-07-01 David Kastrup * quail/greek.el ("((") ("))"): add quotation mark shorthands. From bdb3097a23f057be4a747831cf69aa957f4f67e1 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 7 Aug 2004 01:00:05 +0000 Subject: [PATCH 083/341] (High-Level Completion): Add anchor for definition of `read-variable'. --- lispref/minibuf.texi | 1 + 1 file changed, 1 insertion(+) diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi index c0ee5c85881..7b762a654e6 100644 --- a/lispref/minibuf.texi +++ b/lispref/minibuf.texi @@ -1118,6 +1118,7 @@ complete in the set of extant Lisp symbols, and it uses the @end defun @defun read-variable prompt &optional default +@anchor{Definition of read-variable} This function reads the name of a user variable and returns it as a symbol. From 5504e99ca65abbc04ab68a13612e51b6b5c04e7a Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 7 Aug 2004 01:12:59 +0000 Subject: [PATCH 084/341] Various changes in addition to: (Using Interactive): Clarify description of `interactive-form'. (Interactive Call): Mention default for KEYS argument to `call-interactively'. (Command Loop Info): Clarify description of `this-command-keys'. Mention KEEP-RECORD argument to `clear-this-command-keys'. Value of `last-event-frame' can be `macro'. (Repeat Events): `double-click-fuzz' is also used to distinguish clicks and drags. (Classifying Events): Clarify descriptions of `event-modifiers' `event-basic-type' and `event-convert-list'. (Accessing Events): `posn-timestamp' takes POSITION argument. (Quoted Character Input): Clarify description of `read-quoted-char' and fix example. (Quitting): Add `with-local-quit'. (Disabling Commands): Correct and clarify descriptions of `enable-command' and `disable-command'. Mention what happens if `disabled-command-hook' is nil. (Keyboard Macros): Mention LOOPFUNC arg to `execute-kbd-macro'. Describe `executing-kbd-macro' instead of obsolete `executing-macro'. --- lispref/ChangeLog | 26 +++++++ lispref/commands.texi | 169 ++++++++++++++++++++++++++++-------------- 2 files changed, 139 insertions(+), 56 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 146f2173864..adfd17b5318 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,29 @@ +2004-08-06 Luc Teirlinck + + * minibuf.texi (High-Level Completion): Add anchor for definition + of `read-variable'. + + * commands.texi: Various changes in addition to: + (Using Interactive): Clarify description of `interactive-form'. + (Interactive Call): Mention default for KEYS argument to + `call-interactively'. + (Command Loop Info): Clarify description of `this-command-keys'. + Mention KEEP-RECORD argument to `clear-this-command-keys'. + Value of `last-event-frame' can be `macro'. + (Repeat Events): `double-click-fuzz' is also used to distinguish + clicks and drags. + (Classifying Events): Clarify descriptions of `event-modifiers' + `event-basic-type' and `event-convert-list'. + (Accessing Events): `posn-timestamp' takes POSITION argument. + (Quoted Character Input): Clarify description of + `read-quoted-char' and fix example. + (Quitting): Add `with-local-quit'. + (Disabling Commands): Correct and clarify descriptions of + `enable-command' and `disable-command'. + Mention what happens if `disabled-command-hook' is nil. + (Keyboard Macros): Mention LOOPFUNC arg to `execute-kbd-macro'. + Describe `executing-kbd-macro' instead of obsolete `executing-macro'. + 2004-07-24 Luc Teirlinck * frames.texi: Various changes in addition to: diff --git a/lispref/commands.texi b/lispref/commands.texi index 7a014080e89..d568805d6be 100644 --- a/lispref/commands.texi +++ b/lispref/commands.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Emacs Lisp Reference Manual. -@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 +@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2004 @c Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. @setfilename ../info/commands @@ -119,7 +119,7 @@ controls the reading of arguments for an interactive call. This section describes how to write the @code{interactive} form that makes a Lisp function an interactively-callable command, and how to -examine a commands's @code{interactive} form. +examine a command's @code{interactive} form. @defspec interactive arg-descriptor @cindex argument descriptors @@ -235,12 +235,13 @@ string (starting with the first character that is not @samp{*} or @cindex examining the @code{interactive} form @defun interactive-form function -This function returns the @code{interactive} form of @var{function}. If -@var{function} is a command (@pxref{Interactive Call}), the value is a -list of the form @code{(interactive @var{spec})}, where @var{spec} is -the descriptor specification used by the command's @code{interactive} -form to compute the function's arguments. If @var{function} is not a -command, @code{interactive-form} returns @code{nil}. +This function returns the @code{interactive} form of @var{function}. +If @var{function} is an interactively callable function +(@pxref{Interactive Call}), the value is the command's +@code{interactive} form @code{(interactive @var{spec})}, which +specifies how to compute its arguments. Otherwise, the value is +@code{nil}. If @var{function} is a symbol, its function definition is +used. @end defun @node Interactive Codes @@ -416,8 +417,9 @@ the string.) Other characters that normally terminate a symbol (e.g., parentheses and brackets) do not do so here. Prompt. @item v -A variable declared to be a user option (i.e., satisfying the predicate -@code{user-variable-p}). @xref{High-Level Completion}. Existing, +A variable declared to be a user option (i.e., satisfying the +predicate @code{user-variable-p}). This reads the variable using +@code{read-variable}. @xref{Definition of read-variable}. Existing, Completion, Prompt. @item x @@ -528,10 +530,12 @@ realistic example of using @code{commandp}. @defun call-interactively command &optional record-flag keys This function calls the interactively callable function @var{command}, reading arguments according to its interactive calling specifications. -An error is signaled if @var{command} is not a function or if it cannot -be called interactively (i.e., is not a command). Note that keyboard -macros (strings and vectors) are not accepted, even though they are -considered commands, because they are not functions. +It returns whatever @var{command} returns. An error is signaled if +@var{command} is not a function or if it cannot be called +interactively (i.e., is not a command). Note that keyboard macros +(strings and vectors) are not accepted, even though they are +considered commands, because they are not functions. If @var{command} +is a symbol, then @code{call-interactively} uses its function definition. @cindex record command history If @var{record-flag} is non-@code{nil}, then this command and its @@ -541,6 +545,8 @@ an argument. @xref{Command History}. The argument @var{keys}, if given, specifies the sequence of events to supply if the command inquires which events were used to invoke it. +If @var{keys} is omitted or @code{nil}, the return value of +@code{this-command-keys} is used. @xref{Definition of this-command-keys}. @end defun @defun command-execute command &optional record-flag keys special @@ -551,7 +557,8 @@ callable function or a keyboard macro. A string or vector as @var{command} is executed with @code{execute-kbd-macro}. A function is passed to -@code{call-interactively}, along with the optional @var{record-flag}. +@code{call-interactively}, along with the optional @var{record-flag} +and @var{keys}. A symbol is handled by using its function definition in its place. A symbol with an @code{autoload} definition counts as a command if it was @@ -559,9 +566,6 @@ declared to stand for an interactively callable function. Such a definition is handled by loading the specified library and then rechecking the definition of the symbol. -The argument @var{keys}, if given, specifies the sequence of events to -supply if the command inquires which events were used to invoke it. - The argument @var{special}, if given, means to ignore the prefix argument and not clear it. This is used for executing special events (@pxref{Special Events}). @@ -741,10 +745,14 @@ was specified to run but remapped into another command. @end defvar @defun this-command-keys +@anchor{Definition of this-command-keys} This function returns a string or vector containing the key sequence that invoked the present command, plus any previous commands that -generated the prefix argument for this command. The value is a string -if all those events were characters. @xref{Input Events}. +generated the prefix argument for this command. However, if the +command has called @code{read-key-sequence}, it returns the last read +key sequence. @xref{Definition of read-key-sequence}. The value is a +string if all events in the sequence were characters that fit in a +string. @xref{Input Events}. @example @group @@ -762,13 +770,13 @@ input events in a string (@pxref{Strings of Events}). @end defun @tindex clear-this-command-keys -@defun clear-this-command-keys +@defun clear-this-command-keys &optional keep-record This function empties out the table of events for -@code{this-command-keys} to return, and also empties the records that -the function @code{recent-keys} (@pxref{Recording Input}) will -subsequently return. This is useful after reading a password, to -prevent the password from echoing inadvertently as part of the next -command in certain cases. +@code{this-command-keys} to return. Unless @var{keep-record} is +non-@code{nil}, it also empties the records that the function +@code{recent-keys} (@pxref{Recording Input}) will subsequently return. +This is useful after reading a password, to prevent the password from +echoing inadvertently as part of the next command in certain cases. @end defun @defvar last-nonmenu-event @@ -809,6 +817,8 @@ Usually this is the frame that was selected when the event was generated, but if that frame has redirected input focus to another frame, the value is the frame to which the event was redirected. @xref{Input Focus}. + +If the last event came from a keyboard macro, the value is @code{macro}. @end defvar @node Adjusting Point @@ -1155,7 +1165,7 @@ the marginal areas, @var{position} has this form: @example (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} - @var{object} @var{text-pos} (@var{col} . @var{row}) + @var{object} @var{text-pos} (@var{col} . @var{row}) @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height})) @end example @@ -1387,22 +1397,25 @@ the value is 3 or greater. If @var{event} is an ordinary mouse event (not a repeat event), the value is 1. @end defun -@defvar double-click-fuzz +@defopt double-click-fuzz To generate repeat events, successive mouse button presses must be at approximately the same screen position. The value of @code{double-click-fuzz} specifies the maximum number of pixels the -mouse may be moved between two successive clicks to make a -double-click. -@end defvar +mouse may be moved (horizontally or vertically) between two successive +clicks to make a double-click. -@defvar double-click-time +This variable is also the threshold for motion of the mouse to count +as a drag. +@end defopt + +@defopt double-click-time To generate repeat events, the number of milliseconds between successive button presses must be less than the value of @code{double-click-time}. Setting @code{double-click-time} to @code{nil} disables multi-click detection entirely. Setting it to @code{t} removes the time limit; Emacs then detects multi-clicks by position only. -@end defvar +@end defopt @node Motion Events @subsection Motion Events @@ -1593,16 +1606,22 @@ This function returns a list of the modifiers that @var{event} has. The modifiers are symbols; they include @code{shift}, @code{control}, @code{meta}, @code{alt}, @code{hyper} and @code{super}. In addition, the modifiers list of a mouse event symbol always contains one of -@code{click}, @code{drag}, and @code{down}. +@code{click}, @code{drag}, and @code{down}. For double or triple +events, it also contains @code{double} or @code{triple}. -The argument @var{event} may be an entire event object, or just an event -type. +The argument @var{event} may be an entire event object, or just an +event type. If @var{event} is a symbol that has never been used in an +event that has been read as input in the current Emacs session, then +@code{event-modifiers} can return @code{nil}, even when @var{event} +actually has modifiers. Here are some examples: @example (event-modifiers ?a) @result{} nil +(event-modifiers ?A) + @result{} (shift) (event-modifiers ?\C-a) @result{} (control) (event-modifiers ?\C-%) @@ -1627,7 +1646,8 @@ but the event symbol name itself does not contain @samp{click}. @defun event-basic-type event This function returns the key or mouse button that @var{event} -describes, with all modifiers removed. For example: +describes, with all modifiers removed. The @var{event} argument is as +in @code{event-modifiers}. For example: @example (event-basic-type ?a) @@ -1656,7 +1676,8 @@ event. @defun event-convert-list list This function converts a list of modifier names and a basic event type -to an event type which specifies all of them. For example, +to an event type which specifies all of them. The basic event type +must be the last element of the list. For example, @example (event-convert-list '(control ?a)) @@ -1788,7 +1809,7 @@ is a buffer position, return the size of the character at that position. @cindex mouse event, timestamp @cindex timestamp of a mouse event -@defun posn-timestamp +@defun posn-timestamp position Return the timestamp in @var{position}. This is the time at which the event occurred, in milliseconds. @end defun @@ -1998,10 +2019,13 @@ for example, @code{describe-key} uses it to read the key to describe. @defun read-key-sequence prompt @cindex key sequence +@anchor{Definition of read-key-sequence} This function reads a key sequence and returns it as a string or vector. It keeps reading events until it has accumulated a complete key sequence; that is, enough to specify a non-prefix command using the -currently active keymaps. +currently active keymaps. (Remember that a key sequence that starts +with a mouse event is read using the keymaps of the buffer in the +window that the mouse was in, not the current buffer.) If the events are all characters and all can fit in a string, then @code{read-key-sequence} returns a string (@pxref{Strings of Events}). @@ -2101,6 +2125,8 @@ from the terminal---not counting those generated by keyboard macros. The lowest level functions for command input are those that read a single event. +None of the three functions below suppresses quitting. + @defun read-event &optional prompt inherit-input-method This function reads and returns the next event of command input, waiting if necessary until an event is available. Events can come directly from @@ -2122,8 +2148,8 @@ If @code{cursor-in-echo-area} is non-@code{nil}, then @code{read-event} moves the cursor temporarily to the echo area, to the end of any message displayed there. Otherwise @code{read-event} does not move the cursor. -If @code{read-event} gets an event that is defined as a help character, in -some cases @code{read-event} processes the event directly without +If @code{read-event} gets an event that is defined as a help character, +then in some cases @code{read-event} processes the event directly without returning. @xref{Help Functions}. Certain other events, called @dfn{special events}, are also processed directly within @code{read-event} (@pxref{Special Events}). @@ -2235,7 +2261,10 @@ The command @code{quoted-insert} uses this function. This function is like @code{read-char}, except that if the first character read is an octal digit (0-7), it reads any number of octal digits (but stopping if a non-octal digit is found), and returns the -character represented by that numeric character code. +character represented by that numeric character code. If the +character that terminates the sequence of octal digits is @key{RET}, +it is discarded. Any other terminating character is used as input +after this function returns. Quitting is suppressed when the first character is read, so that the user can enter a @kbd{C-g}. @xref{Quitting}. @@ -2252,7 +2281,7 @@ is 127 in decimal). @group ---------- Echo Area ---------- -What character-@kbd{177} +What character @kbd{1 7 7}- ---------- Echo Area ---------- @result{} 127 @@ -2370,7 +2399,8 @@ during the sleep. @cindex special events Special events are handled at a very low level---as soon as they are read. The @code{read-event} function processes these events itself, and -never returns them. +never returns them. Instead, it keeps waiting for the first event +that is not special and returns that one. Events that are handled in this way do not echo, they are never grouped into key sequences, and they never appear in the value of @@ -2544,6 +2574,28 @@ is set to a value other than @code{nil}. If @code{inhibit-quit} is non-@code{nil}, then @code{quit-flag} has no special effect. @end defvar +@defmac with-local-quit forms@dots{} +This macro executes @var{forms} in sequence, but allows quitting, at +least locally, within @var{body} even if @code{inhibit-quit} was +non-@code{nil} outside this construct. It returns the value of the +last form in @var{forms}. + +If @code{inhibit-quit} is @code{nil} on entry to @code{with-local-quit}, +it only executes the @var{forms}, and setting @code{quit-flag} causes +a normal quit. However, if @code{inhibit-quit} is non-@code{nil} so +that ordinary quitting is delayed, a non-@code{nil} @code{quit-flag} +triggers a special kind of local quit. This ends the execution of +@var{forms} and exits the @code{with-local-quit} form with +@code{quit-flag} still non-@code{nil}, so that another (ordinary) quit +will happen as soon as that is allowed. If @code{quit-flag} is +already non-@code{nil} at the beginning of @var{forms}, the local quit +happens immediately and they don't execute at all. + +This macro is mainly useful in functions that can be called from +timers, @code{pre-command-hook}, @code{post-command-hook} and other +places where @code{inhibit-quit} is normally bound to @code{t}. +@end defmac + @deffn Command keyboard-quit This function signals the @code{quit} condition with @code{(signal 'quit nil)}. This is the same thing that quitting does. (See @code{signal} @@ -2844,15 +2896,14 @@ Disabling a command has no effect on calling it as a function from Lisp programs. @deffn Command enable-command command -Allow @var{command} to be executed without special confirmation from now -on, and (if the user confirms) alter the user's init file (@pxref{Init +Allow @var{command} (a symbol) to be executed without special +confirmation from now on, and alter the user's init file (@pxref{Init File}) so that this will apply to future sessions. @end deffn @deffn Command disable-command command Require special confirmation to execute @var{command} from now on, and -(if the user confirms) alter the user's init file so that this -will apply to future sessions. +alter the user's init file so that this will apply to future sessions. @end deffn @defvar disabled-command-hook @@ -2862,7 +2913,8 @@ is run instead of the disabled command. The hook functions can use command, and thus find the command itself. @xref{Hooks}. By default, @code{disabled-command-hook} contains a function that asks -the user whether to proceed. +the user whether to proceed. If the value is @code{nil}, then all +commands work normally, even disabled ones. @end defvar @node Command History @@ -2918,7 +2970,7 @@ representation of a keyboard macro is a string or vector containing the events. Don't confuse keyboard macros with Lisp macros (@pxref{Macros}). -@defun execute-kbd-macro kbdmacro &optional count +@defun execute-kbd-macro kbdmacro &optional count loopfunc This function executes @var{kbdmacro} as a sequence of events. If @var{kbdmacro} is a string or vector, then the events in it are executed exactly as if they had been input by the user. The sequence is @@ -2935,10 +2987,14 @@ many times. If @var{count} is omitted or @code{nil}, @var{kbdmacro} is executed once. If it is 0, @var{kbdmacro} is executed over and over until it encounters an error or a failing search. +If @var{loopfunc} is non-@code{nil}, it is a function that is called, +without arguments, prior to each iteration of the macro. If +@var{loopfunc} returns @code{nil}, then this stops execution of the macro. + @xref{Reading One Event}, for an example of using @code{execute-kbd-macro}. @end defun -@defvar executing-macro +@defvar executing-kbd-macro This variable contains the string or vector that defines the keyboard macro that is currently executing. It is @code{nil} if no macro is currently executing. A command can test this variable so as to behave @@ -2947,10 +3003,11 @@ yourself. @end defvar @defvar defining-kbd-macro -This variable indicates whether a keyboard macro is being defined. A -command can test this variable so as to behave differently while a macro -is being defined. The commands @code{start-kbd-macro} and -@code{end-kbd-macro} set this variable---do not set it yourself. +This variable is non-@code{nil} if and only if a keyboard macro is +being defined. A command can test this variable so as to behave +differently while a macro is being defined. The commands +@code{start-kbd-macro} and @code{end-kbd-macro} set this variable---do +not set it yourself. The variable is always local to the current terminal and cannot be buffer-local. @xref{Multiple Displays}. From 2515a13130407aaad6ff3c25ab6e013fec042ac8 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 7 Aug 2004 02:32:11 +0000 Subject: [PATCH 085/341] (syms_of_keyboard) : Doc fix. --- src/ChangeLog | 5 +++++ src/keyboard.c | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 2b0c47862d4..285f9162a75 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-08-06 Luc Teirlinck + + * keyboard.c (syms_of_keyboard) : + Doc fix. + 2004-08-03 Kenichi Handa * coding.c (decode_coding_string): Adjust coding->consumed, and diff --git a/src/keyboard.c b/src/keyboard.c index 07b91d16040..55802e7d30a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -11280,6 +11280,7 @@ The elements of the list are event types that may have menu bar bindings. */); doc: /* Per-terminal keymap that overrides all other local keymaps. If this variable is non-nil, it is used as a keymap instead of the buffer's local map, and the minor mode keymaps and text property keymaps. +It also overrides `overriding-local-map'. This variable is intended to let commands such as `universal-argument' set up a different keymap for reading the next command. */); From 8bd6323a8fc6886ed4bb5d2010391dbe0751e8f1 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 7 Aug 2004 12:03:54 +0000 Subject: [PATCH 086/341] (reb-re-syntax): Add `rx' syntax. (reb-lisp-mode): Require `rx' feature when `re-reb-syntax' is `rx'. (reb-lisp-syntax-p, reb-change-syntax): `rx' is a Lisp syntax. (reb-cook-regexp): Call `rx-to-string' when `re-reb-syntax' is `rx'. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/re-builder.el | 15 ++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e12449df8e4..eaaf7b35c3d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2004-08-07 John Paul Wallington + + * emacs-lisp/re-builder.el (reb-re-syntax): Add `rx' syntax. + (reb-lisp-mode): Require `rx' feature when `re-reb-syntax' is `rx'. + (reb-lisp-syntax-p, reb-change-syntax): `rx' is a Lisp syntax. + (reb-cook-regexp): Call `rx-to-string' when `re-reb-syntax' is `rx'. + 2004-08-04 Kenichi Handa * international/encoded-kb.el (encoded-kbd-setup-keymap): Fix diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index c6112c4a105..6eb1ffa2e54 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -135,6 +135,7 @@ Can either be `read', `string', `sregex' or `lisp-re'." (const :tag "String syntax" string) (const :tag "`sregex' syntax" sregex) (const :tag "`lisp-re' syntax" lisp-re) + (const :tag "`rx' syntax" rx) (value: string))) (defcustom reb-auto-match-limit 200 @@ -261,7 +262,9 @@ Except for Lisp syntax this is the same as `reb-regexp'.") (cond ((eq reb-re-syntax 'lisp-re) ; Pull in packages (require 'lisp-re)) ; as needed ((eq reb-re-syntax 'sregex) ; sregex is not autoloaded - (require 'sregex))) ; right now.. + (require 'sregex)) ; right now.. + ((eq reb-re-syntax 'rx) ; rx-to-string is autoloaded + (require 'rx))) ; require rx anyway (reb-mode-common)) ;; Use the same "\C-c" keymap as `reb-mode' and use font-locking from @@ -320,7 +323,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.") (defsubst reb-lisp-syntax-p () "Return non-nil if RE Builder uses a Lisp syntax." - (memq reb-re-syntax '(lisp-re sregex))) + (memq reb-re-syntax '(lisp-re sregex rx))) (defmacro reb-target-binding (symbol) "Return binding for SYMBOL in the RE Builder target buffer." @@ -466,10 +469,10 @@ Optional argument SYNTAX must be specified if called non-interactively." (list (intern (completing-read "Select syntax: " (mapcar (lambda (el) (cons (symbol-name el) 1)) - '(read string lisp-re sregex)) + '(read string lisp-re sregex rx)) nil t (symbol-name reb-re-syntax))))) - (if (memq syntax '(read string lisp-re sregex)) + (if (memq syntax '(read string lisp-re sregex rx)) (let ((buffer (get-buffer reb-buffer))) (setq reb-re-syntax syntax) (if buffer @@ -604,6 +607,8 @@ optional fourth argument FORCE is non-nil." (lre-compile-string (eval (car (read-from-string re))))) ((eq reb-re-syntax 'sregex) (apply 'sregex (eval (car (read-from-string re))))) + ((eq reb-re-syntax 'rx) + (rx-to-string (eval (car (read-from-string re))))) (t re))) (defun reb-update-regexp () @@ -670,7 +675,7 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions." (overlay-put overlay 'priority i))) (setq i (1+ i)))))) (let ((count (if subexp submatches matches))) - (message"%s %smatch%s%s" + (message "%s %smatch%s%s" (if (= 0 count) "No" (int-to-string count)) (if subexp "subexpression " "") (if (= 1 count) "" "es") From abaf2e77e7ba11af0daa8989b2b0a2eb136d649b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 7 Aug 2004 16:47:41 +0000 Subject: [PATCH 087/341] (completion-root-regexp): New defvar. (completion-setup-function): Use it instead of a literal string. --- lisp/ChangeLog | 5 +++++ lisp/simple.el | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eaaf7b35c3d..c59e0003f94 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-07 Satyaki Das (tiny change) + + * simple.el (completion-root-regexp): New defvar. + (completion-setup-function): Use it instead of a literal string. + 2004-08-07 John Paul Wallington * emacs-lisp/re-builder.el (reb-re-syntax): Add `rx' syntax. diff --git a/lisp/simple.el b/lisp/simple.el index 1e112b1be74..b52220d542b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4304,6 +4304,12 @@ make the common parts less visible than normal, so that the rest of the differing parts is, by contrast, slightly highlighted." :group 'completion) +;; This is for packages that need to bind it to a non-default regexp +;; in order to make the first-differing character highlight work +;; to their liking +(defvar completion-root-regexp "^/" + "Regexp to use in `completion-setup-function' to find the root directory.") + (defun completion-setup-function () (let ((mainbuf (current-buffer)) (mbuf-contents (minibuffer-contents))) @@ -4332,7 +4338,7 @@ of the differing parts is, by contrast, slightly highlighted." (with-current-buffer mainbuf (save-excursion (goto-char (point-max)) - (skip-chars-backward "^/") + (skip-chars-backward completion-root-regexp) (- (point) (minibuffer-prompt-end))))) ;; Otherwise, in minibuffer, the whole input is being completed. (if (minibufferp mainbuf) From 0cedd530e32404ca05c7535d373fc64acd29e784 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 7 Aug 2004 20:57:19 +0000 Subject: [PATCH 088/341] (make_temp_name): Handle multibyte prefixes. --- src/ChangeLog | 4 ++++ src/fileio.c | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 285f9162a75..1f4952b2ea1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-08-07 Stefan Monnier + + * fileio.c (make_temp_name): Handle multibyte prefixes. + 2004-08-06 Luc Teirlinck * keyboard.c (syms_of_keyboard) : diff --git a/src/fileio.c b/src/fileio.c index c417dcdf339..a05b1cb8340 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -886,7 +886,7 @@ make_temp_name (prefix, base64_p) int base64_p; { Lisp_Object val; - int len; + int len, clen; int pid; unsigned char *p, *data; char pidbuf[20]; @@ -921,8 +921,10 @@ make_temp_name (prefix, base64_p) #endif } - len = SCHARS (prefix); - val = make_uninit_string (len + 3 + pidlen); + len = SBYTES (prefix); clen = SCHARS (prefix); + val = make_uninit_multibyte_string (clen + 3 + pidlen, len + 3 + pidlen); + if (!STRING_MULTIBYTE (prefix)) + STRING_SET_UNIBYTE (val); data = SDATA (val); bcopy(SDATA (prefix), data, len); p = data + len; From 1725a7c935d4d381d0bb1216b75e3ac786fcad49 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 7 Aug 2004 21:07:57 +0000 Subject: [PATCH 089/341] (window_list_1): YAILOM. --- src/ChangeLog | 2 ++ src/window.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1f4952b2ea1..4b4246d6070 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2004-08-07 Stefan Monnier + * window.c (window_list_1): YAILOM. + * fileio.c (make_temp_name): Handle multibyte prefixes. 2004-08-06 Luc Teirlinck diff --git a/src/window.c b/src/window.c index ad22e1df107..463c8f1f1bd 100644 --- a/src/window.c +++ b/src/window.c @@ -1828,7 +1828,7 @@ window_list_1 (window, minibuf, all_frames) rest = Fmemq (window, list); if (!NILP (rest) && !EQ (rest, list)) { - for (tail = list; XCDR (tail) != rest; tail = XCDR (tail)) + for (tail = list; !EQ (XCDR (tail), rest); tail = XCDR (tail)) ; XSETCDR (tail, Qnil); list = nconc2 (rest, list); From e4e66c94cbd659c6034444c69eae1a549e21b7cd Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 8 Aug 2004 00:00:07 +0000 Subject: [PATCH 090/341] (Translating Input): Only non-prefix bindings in `key-translation-map' override actual key bindings. Warn about possible indirect effect of actual key bindings on non-prefix bindings in `key-translation-map'. --- lispref/os.texi | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lispref/os.texi b/lispref/os.texi index 3e1b93339ad..42a0613bfec 100644 --- a/lispref/os.texi +++ b/lispref/os.texi @@ -1686,12 +1686,18 @@ finished; it receives the results of translation by @code{function-key-map}. @item -@code{key-translation-map} overrides actual key bindings. For example, -if @kbd{C-x f} has a binding in @code{key-translation-map}, that -translation takes effect even though @kbd{C-x f} also has a key binding -in the global map. +Non-prefix bindings in @code{key-translation-map} override actual key +bindings. For example, if @kbd{C-x f} has a non-prefix binding in +@code{key-translation-map}, that translation takes effect even though +@kbd{C-x f} also has a key binding in the global map. @end itemize +Note however that actual key bindings can have an effect on +@code{key-translation-map}, even though they are overridden by it. +Indeed, actual key bindings override @code{function-key-map} and thus +may alter the key sequence that @code{key-translation-map} receives. +Clearly, it is better to avoid to avoid this type of situation. + The intent of @code{key-translation-map} is for users to map one character set to another, including ordinary characters normally bound to @code{self-insert-command}. From 7a093e872021135087ca04364bf1764832fc807a Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 8 Aug 2004 00:33:40 +0000 Subject: [PATCH 091/341] (Flocal_key_binding, Fglobal_key_binding) (syms_of_keymap) : Doc fixes. --- src/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/keymap.c b/src/keymap.c index 6cb7b8709d3..3d4a782b5f8 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1602,7 +1602,7 @@ is non-nil, `key-binding' returns the unmapped command. */) DEFUN ("local-key-binding", Flocal_key_binding, Slocal_key_binding, 1, 2, 0, doc: /* Return the binding for command KEYS in current local keymap only. -KEYS is a string, a sequence of keystrokes. +KEYS is a string or vector, a sequence of keystrokes. The binding is probably a symbol with a function definition. If optional argument ACCEPT-DEFAULT is non-nil, recognize default @@ -1621,7 +1621,7 @@ bindings; see the description of `lookup-key' for more details about this. */) DEFUN ("global-key-binding", Fglobal_key_binding, Sglobal_key_binding, 1, 2, 0, doc: /* Return the binding for command KEYS in current global keymap only. -KEYS is a string, a sequence of keystrokes. +KEYS is a string or vector, a sequence of keystrokes. The binding is probably a symbol with a function definition. This function's return values are the same as those of `lookup-key' \(which see). @@ -3751,7 +3751,7 @@ key, typing `ESC O P x' would return [f1 x]. */); DEFVAR_LISP ("key-translation-map", &Vkey_translation_map, doc: /* Keymap of key translations that can override keymaps. This keymap works like `function-key-map', but comes after that, -and applies even for keys that have ordinary bindings. */); +and its non-prefix bindings override ordinary bindings. */); Vkey_translation_map = Qnil; staticpro (&Vmouse_events); From 81909a1aef80ec199c646f488da81fa48d1417af Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 8 Aug 2004 00:37:38 +0000 Subject: [PATCH 092/341] *** empty log message *** --- lispref/ChangeLog | 7 +++++++ src/ChangeLog | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index adfd17b5318..b046727f2f9 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,10 @@ +2004-08-07 Luc Teirlinck + + * os.texi (Translating Input): Only non-prefix bindings in + `key-translation-map' override actual key bindings. Warn about + possible indirect effect of actual key bindings on non-prefix + bindings in `key-translation-map'. + 2004-08-06 Luc Teirlinck * minibuf.texi (High-Level Completion): Add anchor for definition diff --git a/src/ChangeLog b/src/ChangeLog index 4b4246d6070..577f3291069 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-08-07 Luc Teirlinck + + * keymap.c (Flocal_key_binding, Fglobal_key_binding) + (syms_of_keymap) : Doc fixes. + 2004-08-07 Stefan Monnier * window.c (window_list_1): YAILOM. From de700726fb364cf5b6107501b392d96cac641df2 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 8 Aug 2004 15:47:21 +0000 Subject: [PATCH 093/341] (Key Sequence Input): Remove unnecessary anchor, (Command Loop Info): Replace reference to it. (Disabling Commands): `disabled-command-hook' has been renamed to `disabled-command-function'. --- lispref/ChangeLog | 9 +++++++++ lispref/commands.texi | 26 ++++++++++++++------------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index b046727f2f9..f8abc8e2c11 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,12 @@ +2004-08-08 Luc Teirlinck + + * hooks.texi (Standard Hooks): `disabled-command-hook' has been + renamed to `disabled-command-function'. + * commands.texi (Key Sequence Input): Remove unnecessary anchor, + (Command Loop Info): Replace reference to it. + (Disabling Commands): `disabled-command-hook' has been renamed to + `disabled-command-function'. + 2004-08-07 Luc Teirlinck * os.texi (Translating Input): Only non-prefix bindings in diff --git a/lispref/commands.texi b/lispref/commands.texi index d568805d6be..796fc45f5f3 100644 --- a/lispref/commands.texi +++ b/lispref/commands.texi @@ -750,9 +750,9 @@ This function returns a string or vector containing the key sequence that invoked the present command, plus any previous commands that generated the prefix argument for this command. However, if the command has called @code{read-key-sequence}, it returns the last read -key sequence. @xref{Definition of read-key-sequence}. The value is a -string if all events in the sequence were characters that fit in a -string. @xref{Input Events}. +key sequence. @xref{Key Sequence Input}. The value is a string if +all events in the sequence were characters that fit in a string. +@xref{Input Events}. @example @group @@ -2019,7 +2019,6 @@ for example, @code{describe-key} uses it to read the key to describe. @defun read-key-sequence prompt @cindex key sequence -@anchor{Definition of read-key-sequence} This function reads a key sequence and returns it as a string or vector. It keeps reading events until it has accumulated a complete key sequence; that is, enough to specify a non-prefix command using the @@ -2906,15 +2905,18 @@ Require special confirmation to execute @var{command} from now on, and alter the user's init file so that this will apply to future sessions. @end deffn -@defvar disabled-command-hook -When the user invokes a disabled command interactively, this normal hook -is run instead of the disabled command. The hook functions can use -@code{this-command-keys} to determine what the user typed to run the -command, and thus find the command itself. @xref{Hooks}. +@defvar disabled-command-function +The value of this variable should be a function. When the user +invokes a disabled command interactively, this function is called +instead of the disabled command. It can use @code{this-command-keys} +to determine what the user typed to run the command, and thus find the +command itself. -By default, @code{disabled-command-hook} contains a function that asks -the user whether to proceed. If the value is @code{nil}, then all -commands work normally, even disabled ones. +The value may also be @code{nil}. Then all commands work normally, +even disabled ones. + +By default, the value is a function that asks the user whether to +proceed. @end defvar @node Command History From 27e8464dae1a2d7f12fd7b0bc1c98d8313175228 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 8 Aug 2004 15:49:14 +0000 Subject: [PATCH 094/341] (Standard Hooks): `disabled-command-hook' has been renamed to `disabled-command-function'. --- lispref/hooks.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lispref/hooks.texi b/lispref/hooks.texi index 5c424bd8de2..ad5d709e720 100644 --- a/lispref/hooks.texi +++ b/lispref/hooks.texi @@ -64,7 +64,7 @@ however, we have renamed all of those.) @item diary-display-hook @item diary-hook @item dired-mode-hook -@item disabled-command-hook +@item disabled-command-function @item echo-area-clear-hook @item edit-picture-hook @item electric-buffer-menu-mode-hook From 939a77610645115e16e8677aeaf35c50dd06b14f Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 8 Aug 2004 16:05:14 +0000 Subject: [PATCH 095/341] (disabled-command-function): New variable renamed from `disabled-command-hook'. (disabled-command-hook): Keep the _variable_ as alias for `disabled-command-function' and make obsolete. (disabled-command-function): Function renamed from `disabled-command-hook'. Adapt code to namechange of the variable. --- lisp/novice.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/novice.el b/lisp/novice.el index 1cb89066481..ca9a06769d5 100644 --- a/lisp/novice.el +++ b/lisp/novice.el @@ -1,6 +1,7 @@ ;;; novice.el --- handling of disabled commands ("novice mode") for Emacs -;; Copyright (C) 1985, 1986, 1987, 1994, 2002 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1987, 1994, 2002, 2004 +;; Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: internal, help @@ -36,12 +37,17 @@ ;; and the keys are returned by (this-command-keys). ;;;###autoload -(defvar disabled-command-hook 'disabled-command-hook +(defvar disabled-command-function 'disabled-command-function "Function to call to handle disabled commands. If nil, the feature is disabled, i.e., all commands work normally.") +(defvaralias 'disabled-command-hook 'disabled-command-function) +(make-obsolete-variable + 'disabled-command-hook + "use the variable `disabled-command-function' instead." "21.4") + ;;;###autoload -(defun disabled-command-hook (&rest ignore) +(defun disabled-command-function (&rest ignore) (let (char) (save-window-excursion (with-output-to-temp-buffer "*Help*" @@ -91,7 +97,7 @@ SPC to try the command just this once, but leave it disabled. (ding) (message "Please type y, n, ! or SPC (the space bar): ")))) (if (= char ?!) - (setq disabled-command-hook nil)) + (setq disabled-command-function nil)) (if (= char ?y) (if (and user-init-file (not (string= "" user-init-file)) From 971e4c987c646d7654232c72990ff5554a0023b9 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 8 Aug 2004 16:17:23 +0000 Subject: [PATCH 096/341] Declare Qdisabled_command_function instead of Qdisabled_command_hook. (Fcommand_execute): Use Qdisabled_command_function instead of Qdisabled_command_hook. (syms_of_keyboard): Ditto. --- src/keyboard.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 55802e7d30a..268d782e478 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -131,8 +131,8 @@ KBOARD the_only_kboard; #endif /* Non-nil disable property on a command means - do not execute it; call disabled-command-hook's value instead. */ -Lisp_Object Qdisabled, Qdisabled_command_hook; + do not execute it; call disabled-command-function's value instead. */ +Lisp_Object Qdisabled, Qdisabled_command_function; #define NUM_RECENT_KEYS (100) int recent_keys_index; /* Index for storing next element into recent_keys */ @@ -9665,9 +9665,9 @@ a special event, so ignore the prefix argument and don't clear it. */) tem = Fget (cmd, Qdisabled); if (!NILP (tem) && !NILP (Vrun_hooks)) { - tem = Fsymbol_value (Qdisabled_command_hook); + tem = Fsymbol_value (Qdisabled_command_function); if (!NILP (tem)) - return call1 (Vrun_hooks, Qdisabled_command_hook); + return call1 (Vrun_hooks, Qdisabled_command_function); } } @@ -10782,8 +10782,8 @@ syms_of_keyboard () Qtimer_event_handler = intern ("timer-event-handler"); staticpro (&Qtimer_event_handler); - Qdisabled_command_hook = intern ("disabled-command-hook"); - staticpro (&Qdisabled_command_hook); + Qdisabled_command_function = intern ("disabled-command-function"); + staticpro (&Qdisabled_command_function); Qself_insert_command = intern ("self-insert-command"); staticpro (&Qself_insert_command); From 572fc345a065d970fc0bc648cac384d2e54b5f0c Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 8 Aug 2004 16:49:37 +0000 Subject: [PATCH 097/341] (global-unset-key, local-unset-key): Doc fixes. --- lisp/subr.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 0572446aefc..eb1e5e5df2f 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2304,13 +2304,13 @@ which in most cases is shared with all other buffers in the same major mode." (defun global-unset-key (key) "Remove global binding of KEY. -KEY is a string representing a sequence of keystrokes." +KEY is a string or vector representing a sequence of keystrokes." (interactive "kUnset key globally: ") (global-set-key key nil)) (defun local-unset-key (key) "Remove local binding of KEY. -KEY is a string representing a sequence of keystrokes." +KEY is a string or vector representing a sequence of keystrokes." (interactive "kUnset key locally: ") (if (current-local-map) (local-set-key key nil)) From c90e7e43b102a9732ea4ef7a292f51cec881d463 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 8 Aug 2004 17:09:43 +0000 Subject: [PATCH 098/341] *** empty log message *** --- etc/NEWS | 5 +++++ src/ChangeLog | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 0693e063992..c85ec30bb03 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2187,6 +2187,11 @@ configuration files. * Lisp Changes in Emacs 21.4 ++++ +** Both the variable and the function `disabled-command-hook' have +been renamed to `disabled-command-function', The variable +`disabled-command-hook' has been kept as an obsolete alias. + ** Function `compute-motion' now calculates the usable window width if the WIDTH argument is nil. If the TOPOS argument is nil, the usable window height and width is used. diff --git a/src/ChangeLog b/src/ChangeLog index 577f3291069..7ec9ec257d8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-08-08 Luc Teirlinck + + * keyboard.c: Declare Qdisabled_command_function instead of + Qdisabled_command_command. + (Fcommand_execute): Use Qdisabled_command_function instead of + Qdisabled_command_command. + (syms_of_keyboard): Ditto. + 2004-08-07 Luc Teirlinck * keymap.c (Flocal_key_binding, Fglobal_key_binding) From 8392e13818eadb0645893eaf991d9cae429f2e78 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 8 Aug 2004 17:14:58 +0000 Subject: [PATCH 099/341] *** empty log message *** --- etc/NEWS | 2 +- lisp/ChangeLog | 11 +++++++++++ src/ChangeLog | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index c85ec30bb03..2d8b10e81ec 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2189,7 +2189,7 @@ configuration files. +++ ** Both the variable and the function `disabled-command-hook' have -been renamed to `disabled-command-function', The variable +been renamed to `disabled-command-function'. The variable `disabled-command-hook' has been kept as an obsolete alias. ** Function `compute-motion' now calculates the usable window diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c59e0003f94..afa583fd9ef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2004-08-08 Luc Teirlinck + + * subr.el (global-unset-key, local-unset-key): Doc fixes. + + * novice.el (disabled-command-function): New variable renamed from + `disabled-command-hook'. + (disabled-command-hook): Keep the _variable_ as alias for + `disabled-command-function' and make obsolete. + (disabled-command-function): Function renamed from + `disabled-command-hook'. Adapt code to name change of the variable. + 2004-08-07 Satyaki Das (tiny change) * simple.el (completion-root-regexp): New defvar. diff --git a/src/ChangeLog b/src/ChangeLog index 7ec9ec257d8..248d5daa92e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,9 +1,9 @@ 2004-08-08 Luc Teirlinck * keyboard.c: Declare Qdisabled_command_function instead of - Qdisabled_command_command. + Qdisabled_command_hook. (Fcommand_execute): Use Qdisabled_command_function instead of - Qdisabled_command_command. + Qdisabled_command_hook. (syms_of_keyboard): Ditto. 2004-08-07 Luc Teirlinck From 3bc603c41715a07b049bc26e4ec1022531b2f557 Mon Sep 17 00:00:00 2001 From: Lars Hansen Date: Sun, 8 Aug 2004 19:38:51 +0000 Subject: [PATCH 100/341] (widget-sexp-validate): Allow whitespace after expression. --- lisp/ChangeLog | 5 +++++ lisp/wid-edit.el | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index afa583fd9ef..ac91216cdca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-08 Lars Hansen + + * wid-edit.el (widget-sexp-validate): Allow whitespace after + expression. + 2004-08-08 Luc Teirlinck * subr.el (global-unset-key, local-unset-key): Doc fixes. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 8029fb3d5a6..05ef4b95658 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -3153,6 +3153,8 @@ It will read a directory name from the minibuffer when invoked." (setq err "Empty sexp -- use `nil'?") (unless (widget-apply widget :match (read (current-buffer))) (setq err (widget-get widget :type-error)))) + ;; Allow whitespace after expression. + (skip-syntax-forward "\\s-") (if (and (not (eobp)) (not err)) (setq err (format "Junk at end of expression: %s" From 7ad938e7307746dc7e88d54085543aa548c9eb8d Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sun, 8 Aug 2004 22:54:36 +0000 Subject: [PATCH 101/341] (define-ibuffer-column size): Use string-to-number instead of string-to-int. (define-ibuffer-column mode): Fix indentation. --- lisp/ChangeLog | 6 ++++++ lisp/ibuffer.el | 15 ++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ac91216cdca..31e414c2a4b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-08-08 John Paul Wallington + + * ibuffer.el (define-ibuffer-column size): Use `string-to-number' + instead of `string-to-int'. + (define-ibuffer-column mode): Fix indentation. + 2004-08-08 Lars Hansen * wid-edit.el (widget-sexp-validate): Allow whitespace after diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 140f2995292..f013f8e3c72 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1644,16 +1644,17 @@ If point is on a group name, this function operates on that group." (dolist (string column-strings) (setq total ;; like, ewww ... - (+ (float (string-to-int string)) + (+ (float (string-to-number string)) total))) (format "%.0f" total)))) (format "%s" (buffer-size))) -(define-ibuffer-column mode (:inline t - :props - ('mouse-face 'highlight - 'keymap ibuffer-mode-name-map - 'help-echo "mouse-2: filter by this mode")) +(define-ibuffer-column mode + (:inline t + :props + ('mouse-face 'highlight + 'keymap ibuffer-mode-name-map + 'help-echo "mouse-2: filter by this mode")) (format "%s" mode-name)) (define-ibuffer-column process @@ -2198,7 +2199,7 @@ Try to restore the previous window configuration iff `ibuffer-restore-window-config-on-quit' is non-nil." (interactive) (if ibuffer-restore-window-config-on-quit - (progn + (progn (bury-buffer) (unless (= (count-windows) 1) (set-window-configuration ibuffer-prev-window-config))) From 30e75a873acbcc4f4d59d0341fb49211d8c6d010 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 9 Aug 2004 02:47:17 +0000 Subject: [PATCH 102/341] (Character Type): Reposition `@anchor' to prevent double space inside sentence in Info. --- lispref/ChangeLog | 3 +++ lispref/objects.texi | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index f8abc8e2c11..5f4f8901637 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,5 +1,8 @@ 2004-08-08 Luc Teirlinck + * objects.texi (Character Type): Reposition `@anchor' to prevent + double space inside sentence in Info. + * hooks.texi (Standard Hooks): `disabled-command-hook' has been renamed to `disabled-command-function'. * commands.texi (Key Sequence Input): Remove unnecessary anchor, diff --git a/lispref/objects.texi b/lispref/objects.texi index 7c8eff06295..e945f075e65 100644 --- a/lispref/objects.texi +++ b/lispref/objects.texi @@ -411,8 +411,8 @@ represents the shifted-control-o character. @cindex hyper characters @cindex super characters @cindex alt characters - The X Window System defines three other @anchor{modifier bits} -modifier bits that can be set + The X Window System defines three other +@anchor{modifier bits}modifier bits that can be set in a character: @dfn{hyper}, @dfn{super} and @dfn{alt}. The syntaxes for these bits are @samp{\H-}, @samp{\s-} and @samp{\A-}. (Case is significant in these prefixes.) Thus, @samp{?\H-\M-\A-x} represents From 55e0a9c697612b190ec3e33c058c4d361cd11daf Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 9 Aug 2004 07:40:39 +0000 Subject: [PATCH 103/341] Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-483 Build-in-place tweak Patches applied: * lorentey@elte.hu--2004/emacs--multi-tty--0--patch-224 Added sorted-doc to backup regex in lib-src. --- lib-src/.arch-inventory | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib-src/.arch-inventory b/lib-src/.arch-inventory index 0e0621a8dc3..362f3aebf63 100644 --- a/lib-src/.arch-inventory +++ b/lib-src/.arch-inventory @@ -1,5 +1,5 @@ # Ignore binaries -backup ^(test-distrib|make-docfile|profile|digest-doc|movemail|cvtmail|fakemail|yow|emacsserver|hexl|update-game-score|etags|ctags|emacsclient|b2m|ebrowse)$ +backup ^(test-distrib|make-docfile|profile|digest-doc|movemail|cvtmail|fakemail|yow|emacsserver|hexl|update-game-score|etags|ctags|emacsclient|b2m|ebrowse|sorted-doc)$ # Building actually makes a copy/link of the source file precious ^(ctags\.c)$ From 2c0a0e38e968ecf7e394f851c4512ab6d5ecccb6 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 9 Aug 2004 18:42:04 +0000 Subject: [PATCH 104/341] (Fmake_keymap, Fmap_keymap, Fwhere_is_internal): Doc fixes. --- src/keymap.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/keymap.c b/src/keymap.c index 3d4a782b5f8..92cb6902a1e 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -130,10 +130,11 @@ static void silly_event_symbol_error P_ ((Lisp_Object)); DEFUN ("make-keymap", Fmake_keymap, Smake_keymap, 0, 1, 0, doc: /* Construct and return a new keymap, of the form (keymap CHARTABLE . ALIST). -CHARTABLE is a char-table that holds the bindings for the ASCII -characters. ALIST is an assoc-list which holds bindings for function keys, -mouse events, and any other things that appear in the input stream. -All entries in it are initially nil, meaning "command undefined". +CHARTABLE is a char-table that holds the bindings for all characters +without modifiers. All entries in it are initially nil, meaning +"command undefined". ALIST is an assoc-list which holds bindings for +function keys, mouse events, and any other things that appear in the +input stream. Initially, ALIST is nil. The optional arg STRING supplies a menu name for the keymap in case you use it as a menu with `x-popup-menu'. */) @@ -728,7 +729,10 @@ map_keymap_call (key, val, fun, dummy) DEFUN ("map-keymap", Fmap_keymap, Smap_keymap, 2, 2, 0, doc: /* Call FUNCTION for every binding in KEYMAP. -FUNCTION is called with two arguments: the event and its binding. */) +FUNCTION is called with two arguments: the event and its binding. +If KEYMAP has a parent, the parent's bindings are included as well. +This works recursively: if the parent has itself a parent, then the +grandparent's bindings are also included and so on. */) (function, keymap) Lisp_Object function, keymap; { @@ -2572,7 +2576,7 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap) DEFUN ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 5, 0, doc: /* Return list of keys that invoke DEFINITION. -If KEYMAP is non-nil, search only KEYMAP and the global keymap. +If KEYMAP is a keymap, search only KEYMAP and the global keymap. If KEYMAP is nil, search all the currently active keymaps. If KEYMAP is a list of keymaps, search only those keymaps. @@ -2580,8 +2584,8 @@ If optional 3rd arg FIRSTONLY is non-nil, return the first key sequence found, rather than a list of all possible key sequences. If FIRSTONLY is the symbol `non-ascii', return the first binding found, no matter what it is. -If FIRSTONLY has another non-nil value, prefer sequences of ASCII characters, -and entirely reject menu bindings. +If FIRSTONLY has another non-nil value, prefer sequences of ASCII characters +\(or their meta variants) and entirely reject menu bindings. If optional 4th arg NOINDIRECT is non-nil, don't follow indirections to other keymaps or slots. This makes it possible to search for an From a14b195b009cefe5591c1d630bd82a40f016ba23 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 9 Aug 2004 18:48:23 +0000 Subject: [PATCH 105/341] (kbd): Doc fix. --- lisp/subr.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/subr.el b/lisp/subr.el index eb1e5e5df2f..53aef00f899 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -566,7 +566,7 @@ The order of bindings in a keymap matters when it is used as a menu." (defmacro kbd (keys) "Convert KEYS to the internal Emacs key representation. KEYS should be a string constant in the format used for -saving keyboard macros (see `insert-kbd-macro')." +saving keyboard macros (see `edmacro-mode')." (read-kbd-macro keys)) (put 'keyboard-translate-table 'char-table-extra-slots 0) From abca4ad75ac6ca35f8578da8fa429f659a636e1a Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 9 Aug 2004 18:50:28 +0000 Subject: [PATCH 106/341] (describe-bindings): Doc fix. --- lisp/help.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/help.el b/lisp/help.el index fc43d8db03d..52a772779a5 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -428,7 +428,8 @@ We put that list in a buffer, and display the buffer. The optional argument PREFIX, if non-nil, should be a key sequence; then we display only bindings that start with that prefix. The optional argument BUFFER specifies which buffer's bindings -to display (default, the current buffer)." +to display (default, the current buffer). BUFFER can be a buffer +or a buffer name." (interactive) (or buffer (setq buffer (current-buffer))) (help-setup-xref (list #'describe-bindings prefix buffer) (interactive-p)) From 2bd773305205dbac4b72192f5e73accea18d0d1e Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 9 Aug 2004 18:52:34 +0000 Subject: [PATCH 107/341] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ src/ChangeLog | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 31e414c2a4b..bf085a50aec 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-08-09 Luc Teirlinck + + * help.el (describe-bindings): Doc fix. + + * subr.el (kbd): Doc fix. + 2004-08-08 John Paul Wallington * ibuffer.el (define-ibuffer-column size): Use `string-to-number' diff --git a/src/ChangeLog b/src/ChangeLog index 248d5daa92e..3f9b6d85e51 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-08-09 Luc Teirlinck + + * keymap.c (Fmake_keymap, Fmap_keymap, Fwhere_is_internal): Doc fixes. + 2004-08-08 Luc Teirlinck * keyboard.c: Declare Qdisabled_command_function instead of From 72f2b52554110518f03f81556c2192413700ad97 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 9 Aug 2004 21:06:37 +0000 Subject: [PATCH 108/341] (Window Frame Parameters): Correct typo. --- lispref/frames.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lispref/frames.texi b/lispref/frames.texi index 6d7b956af64..c2c488873a4 100644 --- a/lispref/frames.texi +++ b/lispref/frames.texi @@ -563,9 +563,9 @@ menu bar. @xref{Menu Bar}. (The X toolkit and GTK allow at most one menu bar line; they treat larger values as 1.) @item tool-bar-lines -The number of lines to use for the toolbar. A value of @code{nil} means -don't display a tool bar. (GTK allows at most one tool bar line; it -treats larger values as 1.) +The number of lines to use for the tool bar. A value of @code{nil} +means don't display a tool bar. (GTK allows at most one tool bar line; +it treats larger values as 1.) @item screen-gamma @cindex gamma correction From 093b77de60c1fa064b9e3b1ef31a5e03ef545645 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 10 Aug 2004 08:18:04 +0000 Subject: [PATCH 109/341] *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bf085a50aec..6a2e7118049 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -38,6 +38,11 @@ (reb-lisp-syntax-p, reb-change-syntax): `rx' is a Lisp syntax. (reb-cook-regexp): Call `rx-to-string' when `re-reb-syntax' is `rx'. +2004-08-05 Katsumi Yamaoka (tiny change) + + * mail/mail-extr.el (mail-extr-disable-voodoo): New variable. + (mail-extr-voodoo): Check mail-extr-disable-voodoo. + 2004-08-04 Kenichi Handa * international/encoded-kb.el (encoded-kbd-setup-keymap): Fix From db8af011af1d4d58b42a285e252504c860693d9a Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Tue, 10 Aug 2004 15:45:54 +0000 Subject: [PATCH 110/341] Various changes in addition to: (Keymap Terminology): `kbd' uses same syntax as Edit Macro mode. Give more varied examples for `kbd'. (Creating Keymaps): Char tables have slots for all characters without modifiers. (Active Keymaps): `overriding-local-map' and `overriding-terminal-local-map' also override text property and overlay keymaps. (Functions for Key Lookup): Mention OLP arg to `current-active-maps'. (Scanning Keymaps): `accessible-keymaps' uses `[]' instead of `""' to denote a prefix of no events. `map-keymap' includes parent's bindings _recursively_. Clarify and correct description of `where-is-internal'. Mention BUFFER-OR-NAME arg to `describe-bindings'. (Menu Example): For menus intended for use with the keyboard, the menu items should be bound to characters or real function keys. --- lispref/ChangeLog | 19 +++++++++ lispref/keymaps.texi | 96 +++++++++++++++++++++++++++----------------- 2 files changed, 78 insertions(+), 37 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 5f4f8901637..ed0c2e9d421 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,22 @@ +2004-08-10 Luc Teirlinck + + * keymaps.texi: Various changes in addition to: + (Keymap Terminology): `kbd' uses same syntax as Edit Macro mode. + Give more varied examples for `kbd'. + (Creating Keymaps): Char tables have slots for all characters + without modifiers. + (Active Keymaps): `overriding-local-map' and + `overriding-terminal-local-map' also override text property and + overlay keymaps. + (Functions for Key Lookup): Mention OLP arg to `current-active-maps'. + (Scanning Keymaps): `accessible-keymaps' uses `[]' instead of `""' + to denote a prefix of no events. + `map-keymap' includes parent's bindings _recursively_. + Clarify and correct description of `where-is-internal'. + Mention BUFFER-OR-NAME arg to `describe-bindings'. + (Menu Example): For menus intended for use with the keyboard, the + menu items should be bound to characters or real function keys. + 2004-08-08 Luc Teirlinck * objects.texi (Character Type): Reposition `@anchor' to prevent diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi index 12246f0b236..089d29fc4ee 100644 --- a/lispref/keymaps.texi +++ b/lispref/keymaps.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Emacs Lisp Reference Manual. -@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2000 +@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 1999, 2000, 2004 @c Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. @setfilename ../info/keymaps @@ -103,16 +103,19 @@ representation; it is also convenient to use @code{kbd}: This macro converts the text @var{keyseq-text} (a string constant) into a key sequence (a string or vector constant). The contents of @var{keyseq-text} should describe the key sequence using the syntax -used in this manual: +used in this manual. More precisely, it uses the same syntax that +Edit Macro mode uses for editing keyboard macros (@pxref{Edit Keyboard +Macro,,, emacs, The GNU Emacs Manual}). @example (kbd "C-x") @result{} "\C-x" (kbd "C-x C-f") @result{} "\C-x\C-f" -(kbd "C-c C-c") @result{} "\C-c\C-c" (kbd "C-x 4 C-f") @result{} "\C-x4\C-f" (kbd "X") @result{} "X" (kbd "RET") @result{} "\^M" -(kbd "C-c 3") @result{} "\C-c3" +(kbd "C-c SPC") @result{} "\C-c@ " +(kbd " SPC") @result{} [f1 32] +(kbd "C-M-") @result{} [C-M-down] @end example @end defmac @@ -144,7 +147,8 @@ This specifies a @dfn{default key binding}; any event not bound by other elements of the keymap is given @var{binding} as its binding. Default bindings allow a keymap to bind all possible event types without having to enumerate all of them. A keymap that has a default binding -completely masks any lower-precedence keymap. +completely masks any lower-precedence keymap, except for events +explicitly bound to @code{nil} (see below). @item @var{char-table} If an element of a keymap is a char-table, it counts as holding @@ -251,17 +255,15 @@ satisfies @code{keymapp}. @c ??? This should come after make-sparse-keymap @defun make-keymap &optional prompt This function creates and returns a new full keymap. That keymap -contains a char-table (@pxref{Char-Tables}) with 384 slots: the first -128 slots are for defining all the @acronym{ASCII} characters, the next 128 -slots are for 8-bit European characters, and each one of the final 128 -slots is for one character set of non-@acronym{ASCII} characters supported by -Emacs. The new keymap initially binds all these characters to -@code{nil}, and does not bind any other kind of event. +contains a char-table (@pxref{Char-Tables}) with slots for all +characters without modifiers. The new keymap initially binds all +these characters to @code{nil}, and does not bind any other kind of +event. @example @group (make-keymap) - @result{} (keymap [nil nil nil @dots{} nil nil]) + @result{} (keymap #^[t nil nil nil @dots{} nil nil keymap]) @end group @end example @@ -509,6 +511,7 @@ active keymap. @defun define-prefix-command symbol &optional mapvar prompt @cindex prefix command +@anchor{Definition of define-prefix-command} This function prepares @var{symbol} for use as a prefix key's binding: it creates a sparse keymap and stores it as @var{symbol}'s function definition. Subsequently binding a key sequence to @var{symbol} will @@ -698,15 +701,16 @@ all buffers. @defvar overriding-local-map If non-@code{nil}, this variable holds a keymap to use instead of the -buffer's local keymap and instead of all the minor mode keymaps. This -keymap, if any, overrides all other maps that would have been active, -except for the current global map. +buffer's local keymap, text property or overlay keymaps, and instead +of all the minor mode keymaps. This keymap, if any, overrides all +other maps that would have been active, except for the current global +map. @end defvar @defvar overriding-terminal-local-map If non-@code{nil}, this variable holds a keymap to use instead of -@code{overriding-local-map}, the buffer's local keymap and all the minor -mode keymaps. +@code{overriding-local-map}, the buffer's local keymap, text property +or overlay keymaps, and all the minor mode keymaps. This variable is always local to the current terminal and cannot be buffer-local. @xref{Multiple Displays}. It is used to implement @@ -977,9 +981,12 @@ An error is signaled if @var{key} is not a string or a vector. @end example @end defun -@defun current-active-maps +@defun current-active-maps &optional olp This returns the list of keymaps that would be used by the command -loop in the current circumstances to look up a key sequence. +loop in the current circumstances to look up a key sequence. Normally +it ignores @code{overriding-local-map} and +@code{overriding-terminal-local-map}, but if @var{olp} is +non-@code{nil} then it pays attention to them. @end defun @defun local-key-binding key &optional accept-defaults @@ -1191,7 +1198,7 @@ changing the bindings of both @kbd{C-p C-f} and @kbd{C-x C-f} in the default global map. The function @code{substitute-key-definition} scans a keymap for -keys that have a certain binding and rebind them with a different +keys that have a certain binding and rebinds them with a different binding. Another feature you can use for similar effects, but which is often cleaner, is to add a binding that remaps a command (@pxref{Remapping Commands}). @@ -1324,7 +1331,7 @@ this by making these two command-remapping bindings in its keymap: Whenever @code{my-mode-map} is an active keymap, if the user types @kbd{C-k}, Emacs will find the standard global binding of @code{kill-line} (assuming nobody has changed it). But -@code{my-mode-map} remaps @code{kill-line} to @code{my-mode-map}, +@code{my-mode-map} remaps @code{kill-line} to @code{my-kill-line}, so instead of running @code{kill-line}, Emacs runs @code{my-kill-line}. @@ -1337,15 +1344,16 @@ Remapping only works through a single level. In other words, @noindent does not have the effect of remapping @code{kill-line} into -@code{my-other-kill-line}. If an ordinary key binding specifies +@code{my-other-kill-line}. If an ordinary key binding specifies @code{kill-line}, this keymap will remap it to @code{my-kill-line}; if an ordinary binding specifies @code{my-kill-line}, this keymap will remap it to @code{my-other-kill-line}. @defun command-remapping command -This function returns the remapping for @var{command}, given the -current active keymaps. If @var{command} is not remapped (which is -the usual situation), the function returns @code{nil}. +This function returns the remapping for @var{command} (a symbol), +given the current active keymaps. If @var{command} is not remapped +(which is the usual situation), or not a symbol, the function returns +@code{nil}. @end defun @node Key Binding Commands @@ -1409,7 +1417,7 @@ actually bind the multibyte character with code 2294, not the unibyte Latin-1 character with code 246 (@kbd{M-v}). In order to use this binding, you need to enter the multibyte Latin-1 character as keyboard input. One way to do this is by using an appropriate input method -(@pxref{Input Methods, , Input Methods, emacs,The GNU Emacs Manual}). +(@pxref{Input Methods, , Input Methods, emacs, The GNU Emacs Manual}). If you want to use a unibyte character in the key binding, you can construct the key sequence string using @code{multibyte-char-to-unibyte} @@ -1499,7 +1507,7 @@ association list with elements of the form @code{(@var{key} .@: @var{keymap} is @var{map}. The elements of the alist are ordered so that the @var{key} increases -in length. The first element is always @code{("" .@: @var{keymap})}, +in length. The first element is always @code{([] .@: @var{keymap})}, because the specified keymap is accessible from itself with a prefix of no events. @@ -1517,7 +1525,7 @@ definition is the sparse keymap @code{(keymap (83 .@: center-paragraph) @smallexample @group (accessible-keymaps (current-local-map)) -@result{}(("" keymap +@result{}(([] keymap (27 keymap ; @r{Note this keymap for @key{ESC} is repeated below.} (83 . center-paragraph) (115 . center-line)) @@ -1541,7 +1549,7 @@ of a window. @smallexample @group (accessible-keymaps (current-global-map)) -@result{} (("" keymap [set-mark-command beginning-of-line @dots{} +@result{} (([] keymap [set-mark-command beginning-of-line @dots{} delete-backward-char]) @end group @group @@ -1572,6 +1580,8 @@ The function @code{map-keymap} calls @var{function} once for each binding in @var{keymap}. It passes two arguments, the event type and the value of the binding. If @var{keymap} has a parent, the parent's bindings are included as well. +This works recursively: if the parent has itself a parent, then the +grandparent's bindings are also included and so on. This function is the cleanest way to examine all the bindings in a keymap. @@ -1580,7 +1590,7 @@ in a keymap. @defun where-is-internal command &optional keymap firstonly noindirect no-remap This function is a subroutine used by the @code{where-is} command (@pxref{Help, , Help, emacs,The GNU Emacs Manual}). It returns a list -of key sequences (of any length) that are bound to @var{command} in a +of all key sequences (of any length) that are bound to @var{command} in a set of keymaps. The argument @var{command} can be any object; it is compared with all @@ -1588,7 +1598,7 @@ keymap entries using @code{eq}. If @var{keymap} is @code{nil}, then the maps used are the current active keymaps, disregarding @code{overriding-local-map} (that is, pretending -its value is @code{nil}). If @var{keymap} is non-@code{nil}, then the +its value is @code{nil}). If @var{keymap} is a keymap, then the maps searched are @var{keymap} and the global keymap. If @var{keymap} is a list of keymaps, only those keymaps are searched. @@ -1598,11 +1608,12 @@ keymaps that are active. To search only the global map, pass @code{(keymap)} (an empty keymap) as @var{keymap}. If @var{firstonly} is @code{non-ascii}, then the value is a single -string representing the first key sequence found, rather than a list of +vector representing the first key sequence found, rather than a list of all possible key sequences. If @var{firstonly} is @code{t}, then the value is the first key sequence, except that key sequences consisting entirely of @acronym{ASCII} characters (or meta variants of @acronym{ASCII} -characters) are preferred to all other key sequences. +characters) are preferred to all other key sequences and that the +return value can never be a menu binding. If @var{noindirect} is non-@code{nil}, @code{where-is-internal} doesn't follow indirect keymap bindings. This makes it possible to search for @@ -1623,7 +1634,7 @@ other command. However, if @var{no-remap} is non-@code{nil}. @end smallexample @end defun -@deffn Command describe-bindings &optional prefix +@deffn Command describe-bindings &optional prefix buffer-or-name This function creates a listing of all current key bindings, and displays it in a buffer named @samp{*Help*}. The text is grouped by modes---minor modes first, then the major mode, then global bindings. @@ -1643,6 +1654,10 @@ For example, in the default global map, the characters @samp{@key{SPC} @kbd{~} is @acronym{ASCII} 126, and the characters between them include all the normal printing characters, (e.g., letters, digits, punctuation, etc.@:); all these characters are bound to @code{self-insert-command}. + +If @var{buffer-or-name} is non-@code{nil}, it should be a buffer or a +buffer name. Then @code{describe-bindings} lists that buffer's bindings, +instead of the current buffer's. @end deffn @node Menu Keymaps @@ -1681,8 +1696,9 @@ prompt string. The easiest way to construct a keymap with a prompt string is to specify the string as an argument when you call @code{make-keymap}, -@code{make-sparse-keymap} or @code{define-prefix-command} -(@pxref{Creating Keymaps}). +@code{make-sparse-keymap} (@pxref{Creating Keymaps}), or +@code{define-prefix-command} (@pxref{Definition of define-prefix-command}). + @defun keymap-prompt keymap This function returns the overall prompt string of @var{keymap}, @@ -2107,6 +2123,12 @@ functioning of the menu itself, but they are ``echoed'' in the echo area when the user selects from the menu, and they appear in the output of @code{where-is} and @code{apropos}. + The menu in this example is intended for use with the mouse. If a +menu is intended for use with the keyboard, that is, if it is bound to +a key sequence ending with a keyboard event, then the menu items +should be bound to characters or ``real'' function keys, that can be +typed with the keyboard. + The binding whose definition is @code{("--")} is a separator line. Like a real menu item, the separator has a key symbol, in this case @code{separator-ps-print}. If one menu has two separators, they must @@ -2389,7 +2411,7 @@ property list elements to add to the menu item specification. This function is used for making non-global tool bar items. Use it like @code{tool-bar-add-item-from-menu} except that @var{in-map} specifies the local map to make the definition in. The argument -@var{from-map} si like the @var{map} argument of +@var{from-map} is like the @var{map} argument of @code{tool-bar-add-item-from-menu}. @end defun From 48ddd622ab1fd194602d7392487a37cb35162545 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 10 Aug 2004 21:18:38 +0000 Subject: [PATCH 111/341] Sync with Tramp 2.0.44. --- lisp/ChangeLog | 27 ++++++++++++++++++ lisp/net/tramp.el | 65 ++++++++++++++++++++++++-------------------- lisp/net/trampver.el | 2 +- man/ChangeLog | 4 +++ man/trampver.texi | 2 +- 5 files changed, 68 insertions(+), 32 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6a2e7118049..8321253666a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,30 @@ +2004-08-10 Michael Albinus + + Sync with Tramp 2.0.44. + + * net/tramp.el (tramp-post-connection): Quote $1 and $2 of shell + function "tramp_file_attributes". Otherwise, file names + containing spaces are misinterpreted. Reported by Magnus Henoch + . + (tramp-handle-file-truename): FILENAME must be expanded first. + Otherwise, parameters like "/ssh:deego@gnufans.net:~" will return + obscure results. Reported by D. Goel . + (tramp-handle-verify-visited-file-modtime): If file does not + exist, say it is not modified if and only if that agrees with the + buffer's record. Check whether a file is visiting the buffer, or + the buffer has no recorded last modification time. Return t in + case the visiting file doesn't exist. Suggested by Luc Teirlinck + . + (tramp-handle-write-region): Pass modtime explicitely to + `set-visited-file-modtime', because filename can be different + from (buffer-file-name) if `file-precious-flag' is set. + `set-visited-file-modtime' must be called always when `visit' is t + or a string. Suggested by Luc Teirlinck . + (tramp-handle-set-visited-file-modtime): If `time-list' is not + nil, don't apply the whole body. If the file doesn't exists, set + modtime to '(-1 65535). Suggested by Luc Teirlinck + . + 2004-08-09 Luc Teirlinck * help.el (describe-bindings): Doc fix. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 02b076483c1..cda0d41fd8d 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2055,7 +2055,7 @@ target of the symlink differ." (defun tramp-handle-file-truename (filename &optional counter prev-dirs) "Like `file-truename' for tramp files." - (with-parsed-tramp-file-name filename nil + (with-parsed-tramp-file-name (expand-file-name filename) nil (let* ((steps (tramp-split-string localname "/")) (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs (file-name-as-directory localname))) @@ -2299,32 +2299,33 @@ If it doesn't exist, generate a new one." (unless (buffer-file-name) (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file" (buffer-name))) - (when time-list - (tramp-run-real-handler 'set-visited-file-modtime (list time-list))) - (let ((f (buffer-file-name)) - (coding-system-used nil)) - (with-parsed-tramp-file-name f nil - (let* ((attr (file-attributes f)) - (modtime (nth 5 attr))) - ;; We use '(0 0) as a don't-know value. See also - ;; `tramp-handle-file-attributes-with-ls'. - (when (boundp 'last-coding-system-used) - (setq coding-system-used last-coding-system-used)) - (if (not (equal modtime '(0 0))) - (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) - (save-excursion - (tramp-send-command - multi-method method user host - (format "%s -ild %s" - (tramp-get-ls-command multi-method method user host) - (tramp-shell-quote-argument localname))) - (tramp-wait-for-output) - (setq attr (buffer-substring (point) - (progn (end-of-line) (point))))) - (setq tramp-buffer-file-attributes attr)) - (when (boundp 'last-coding-system-used) - (setq last-coding-system-used coding-system-used)) - nil)))) + (if time-list + (tramp-run-real-handler 'set-visited-file-modtime (list time-list)) + (let ((f (buffer-file-name)) + (coding-system-used nil)) + (with-parsed-tramp-file-name f nil + (let* ((attr (file-attributes f)) + ;; '(-1 65535) means file doesn't exists yet. + (modtime (or (nth 5 attr) '(-1 65535)))) + ;; We use '(0 0) as a don't-know value. See also + ;; `tramp-handle-file-attributes-with-ls'. + (when (boundp 'last-coding-system-used) + (setq coding-system-used last-coding-system-used)) + (if (not (equal modtime '(0 0))) + (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) + (save-excursion + (tramp-send-command + multi-method method user host + (format "%s -ild %s" + (tramp-get-ls-command multi-method method user host) + (tramp-shell-quote-argument localname))) + (tramp-wait-for-output) + (setq attr (buffer-substring (point) + (progn (end-of-line) (point))))) + (setq tramp-buffer-file-attributes attr)) + (when (boundp 'last-coding-system-used) + (setq last-coding-system-used coding-system-used)) + nil))))) ;; CCC continue here @@ -3811,8 +3812,11 @@ This will break if COMMAND prints a newline, followed by the value of (unless (equal curbuf (current-buffer)) (error "Buffer has changed from `%s' to `%s'" curbuf (current-buffer))) - (when (eq visit t) - (set-visited-file-modtime)) + (when (or (eq visit t) (stringp visit)) + (set-visited-file-modtime + ;; We must pass modtime explicitely, because filename can be different + ;; from (buffer-file-name), f.e. if `file-precious-flag' is set. + (nth 5 (file-attributes filename)))) ;; Make `last-coding-system-used' have the right value. (when (boundp 'last-coding-system-used) (setq last-coding-system-used coding-system-used)) @@ -5847,7 +5851,8 @@ locale to C and sets up the remote shell search path." multi-method method user host (concat "tramp_file_attributes () {\n" tramp-remote-perl - " -e '" tramp-perl-file-attributes "' $1 $2 2>/dev/null\n" + " -e '" tramp-perl-file-attributes "'" + " \"$1\" \"$2\" 2>/dev/null\n" "}")) (tramp-wait-for-output) (unless (tramp-method-out-of-band-p multi-method method user host) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index b3223d7a46e..46b33b2d50f 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -30,7 +30,7 @@ ;; are auto-frobbed from configure.ac, so you should edit that file and run ;; "autoconf && ./configure" to change them. -(defconst tramp-version "2.0.39" +(defconst tramp-version "2.0.44" "This version of Tramp.") (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" diff --git a/man/ChangeLog b/man/ChangeLog index 4f2ce160de6..d6e105977fc 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2004-08-10 Michael Albinus + + Sync with Tramp 2.0.44. + 2004-08-05 Lars Hansen * widget.texi (User Interface): Update how to separate the diff --git a/man/trampver.texi b/man/trampver.texi index 32ab2349241..a5cc874b3fb 100644 --- a/man/trampver.texi +++ b/man/trampver.texi @@ -4,7 +4,7 @@ @c In the Tramp CVS, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.0.43 +@set trampver 2.0.44 @c Other flags from configuration @set prefix /usr/local From 7c3225c3a606c9e81e98b2b1f414542aca21d36f Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Tue, 10 Aug 2004 21:38:02 +0000 Subject: [PATCH 112/341] Remove description of Mac OS version upgrade problems as it is no longer applicable. --- etc/ChangeLog | 5 +++++ etc/PROBLEMS | 11 ----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 5c86c060880..c26a8a7d786 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2004-08-10 Steven Tamm + + * PROBLEMS: Remove description of Mac OS version upgrade + problems as it is no longer applicable. + 2004-07-27 Werner Lemberg * NEWS: Document all new tutorials. diff --git a/etc/PROBLEMS b/etc/PROBLEMS index abc04f3dd11..a72d6f14e31 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -59,17 +59,6 @@ There appears to be a problem with the implementation of pty's on the Mac OS X that causes process output to be truncated. To avoid this, leave process-connection-type set to its default value of nil. -* Emacs crashes on Mac OS X (Carbon) after system software upgrade. - -This problem seems to be now solved by Steven Tamm's patch to -unexmacosx.c on Nov 24, 2002. - -Between Mac OS X release 10.2.1 and 10.2.2 there was an incompatible -change in the memory allocator that causes a EXC_BAD_ACCESS error near -xrealloc(). Relinking the application (by deleting src/temacs and -running make) will solve the problem. It appears to be caused by some -problems with the unexec code and its interaction with libSystem.B. - * Emacs crashes with SIGSEGV in XtInitializeWidgetClass It crashes on X, but runs fine when called with option "-nw". From 2a15eb73df90655c012a78713ae9b33278c3206e Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Wed, 11 Aug 2004 16:22:21 +0000 Subject: [PATCH 113/341] Updated CC Mode to 5.30.9. --- lisp/ChangeLog | 100 ++++++++++++ lisp/progmodes/cc-align.el | 35 +++-- lisp/progmodes/cc-cmds.el | 9 +- lisp/progmodes/cc-defs.el | 215 +++++++++++++++++++++++--- lisp/progmodes/cc-engine.el | 292 +++++++++++++++++++++++------------- lisp/progmodes/cc-fonts.el | 114 +++++++++----- lisp/progmodes/cc-langs.el | 6 + lisp/progmodes/cc-styles.el | 2 + lisp/progmodes/cc-vars.el | 146 +----------------- man/ChangeLog | 4 + man/cc-mode.texi | 129 ++++++++++++---- 11 files changed, 696 insertions(+), 356 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8321253666a..12c2b4d8a60 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,103 @@ +2004-08-11 Martin Stjernholm + + CC Mode update to 5.30.9: + + * progmodes/cc-defs.el, progmodes/cc-vars.el (c-emacs-features): + Moved from cc-vars to cc-defs for dependency reasons. Fixed the + POSIX char class test to check that it works in + `skip-chars-(forward|backward)' too. + + * progmodes/cc-align.el (c-lineup-arglist): Fixed bug when the + first argument starts with a special brace list. + + * progmodes/cc-engine.el (c-forward-type): Fixed promotion bug + when `c-opt-type-concat-key' is used (i.e. in Pike). + + * progmodes/cc-engine.el (c-looking-at-special-brace-list): Fixed + bug when the inner char pair doesn't have paren syntax, i.e. "(< + >)". + + * progmodes/cc-align.el (c-lineup-multi-inher): Made it syntactic + whitespace safe. + + * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed anchor + position for `arglist-intro', `arglist-cont-nonempty' and + `arglist-close' when there are two arglist open parens on the same + line and there's nothing in front of the first. + + * progmodes/cc-fonts.el (c-basic-matchers-before): Fixed font + locking of qualified names in Java, which previously could fontify + common indexing expressions in many cases. The standard Java + naming conventions are used to tell them apart. + + * progmodes/cc-align.el (c-lineup-whitesmith-in-block): Fixed + inconsistency wrt opening parens on the first line inside a paren + block. + + * progmodes/cc-defs.el (c-langs-are-parametric): Must be known at + compile time for the sake of `c-major-mode-is'. + + (c-mode-is-new-awk-p): Made it a macro to delay expansion of + `c-major-mode-is' in the event that this is used inside a + `c-lang-defconst'. + + * progmodes/cc-defs.el (c-major-mode-is): Fixed expansion inside + `c-lang-defconst' so that it works better with fallback languages. + + * progmodes/cc-defs.el (c-add-language): Fixed a typo that caused + it to fail to record the base mode. + + * progmodes/cc-engine.el (c-syntactic-re-search-forward): Fixed + bug so that it doesn't go past the closing paren when PAREN-LEVEL + is used. Reordered the syntax checks to get more efficient + skipping in some situations. + + * progmodes/cc-cmds.el (c-electric-brace): Don't trip up on a line + continuation which might precede the newly inserted '{'. + + * progmodes/cc-engine.el (c-syntactic-re-search-forward): Fixed + cases where it could loop indefinitely. + + * progmodes/cc-fonts.el (c-font-lock-declarators): Handle array + size specs correctly. Only fontify identifiers in front of '(' + with as functions - don't accept any paren char. Tightened up + initializer skipping to stop before function and class blocks. + + * progmodes/cc-engine.el (c-beginning-of-decl-1): Fixed bug where + the point could be left directly after an open paren when finding + the beginning of the first decl in the block. + + * progmodes/cc-engine.el (c-parse-state): Don't use the syntax + table when filtering out legitimate open parens to be recorded. + This could cause cache inconsistencies when e.g. + `c++-template-syntax-table' was temporarily in use. + + * progmodes/cc-engine.el (c-on-identifier, + c-simple-skip-symbol-backward): Small fix for handling "-" + correctly in `skip-chars-backward'. Affected the operator lfun + syntax in Pike. + + * progmodes/cc-engine.el (c-invalidate-sws-region-after): Fixed + bug that could cause an error from `after-change-functions' when + the changed region is at bob. + +2004-08-11 Alan Mackenzie + + CC Mode update to 5.30.9: + + * progmodes/cc-cmds.el, progmodes/cc-vars.el: Amend doc(-strings) + to say that doesn't insert WS into a CPP line. + (c-indent-command, c-tab-always-indent): Amend doc strings. + + * progmodes/cc-styles.el, progmodes/cc-engine.el: Add in two + checks for user errors, thus eliminating cryptic and unhelpful + Emacs error messages. (1) Check the arg to `c-set-style' is a + string. (2) Check that settings to `c-offsets-alist' are not + spuriously quoted. + + * progmodes/cc-cmds.el: (c-electric-brace): don't delete a comment + which precedes the newly inserted `{'. + 2004-08-10 Michael Albinus Sync with Tramp 2.0.44. diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index b51a304c531..c5dd091f291 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el @@ -121,7 +121,7 @@ Works with: arglist-cont-nonempty, arglist-close." ;; like "({". (when c-special-brace-lists (let ((special-list (c-looking-at-special-brace-list))) - (when special-list + (when (and special-list (< (car (car special-list)) (point))) (goto-char (+ (car (car special-list)) 2))))) (let ((savepos (point)) @@ -380,9 +380,7 @@ Works with: inher-cont, member-init-cont." (back-to-indentation) (let* ((eol (c-point 'eol)) (here (point)) - (char-after-ip (progn - (skip-chars-forward " \t") - (char-after)))) + (char-after-ip (char-after))) (if (cdr langelem) (goto-char (cdr langelem))) ;; This kludge is necessary to support both inher-cont and @@ -392,13 +390,12 @@ Works with: inher-cont, member-init-cont." (backward-char) (c-backward-syntactic-ws)) - (skip-chars-forward "^:" eol) - (if (eq char-after-ip ?,) - (skip-chars-forward " \t" eol) - (skip-chars-forward " \t:" eol)) - (if (or (eolp) - (looking-at c-comment-start-regexp)) - (c-forward-syntactic-ws here)) + (c-syntactic-re-search-forward ":" eol 'move) + (if (looking-at c-syntactic-eol) + (c-forward-syntactic-ws here) + (if (eq char-after-ip ?,) + (backward-char) + (skip-chars-forward " \t" eol))) (if (< (point) here) (vector (current-column))) ))) @@ -952,11 +949,17 @@ Works with: defun-close, defun-block-intro, block-close, brace-list-close, brace-list-intro, statement-block-intro and all in* symbols, e.g. inclass and inextern-lang." (save-excursion - (goto-char (cdr langelem)) - (back-to-indentation) - (if (eq (char-syntax (char-after)) ?\() - 0 - c-basic-offset))) + (+ (progn + (back-to-indentation) + (if (eq (char-syntax (char-after)) ?\() + c-basic-offset + 0)) + (progn + (goto-char (cdr langelem)) + (back-to-indentation) + (if (eq (char-syntax (char-after)) ?\() + 0 + c-basic-offset))))) (defun c-lineup-cpp-define (langelem) "Line up macro continuation lines according to the indentation of diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index a61369004e8..806fbade693 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -479,7 +479,11 @@ This function does various newline cleanups based on the value of ;; end up before it. (setq delete-temp-newline (cons (save-excursion - (c-backward-syntactic-ws) + (end-of-line 0) + (if (eq (char-before) ?\\) + ;; Ignore a line continuation. + (backward-char)) + (skip-chars-backward " \t") (copy-marker (point) t)) (point-marker)))) (unwind-protect @@ -1971,8 +1975,7 @@ If `c-tab-always-indent' is t, always just indent the current line. If nil, indent the current line only if point is at the left margin or in the line's indentation; otherwise insert some whitespace[*]. If other than nil or t, then some whitespace[*] is inserted only within -literals (comments and strings) and inside preprocessor directives, -but the line is always reindented. +literals (comments and strings), but the line is always reindented. If `c-syntactic-indentation' is t, indentation is done according to the syntactic context. A numeric argument, regardless of its value, diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index ad8b8a92bff..64f3a72f56f 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -48,7 +48,6 @@ ;; Silence the compiler. (cc-bytecomp-defvar c-enable-xemacs-performance-kludge-p) ; In cc-vars.el -(cc-bytecomp-defvar c-emacs-features) ; In cc-vars.el (cc-bytecomp-defun buffer-syntactic-context-depth) ; XEmacs (cc-bytecomp-defun region-active-p) ; XEmacs (cc-bytecomp-defvar zmacs-region-stays) ; XEmacs @@ -105,7 +104,7 @@ ;;; Variables also used at compile time. -(defconst c-version "5.30.8" +(defconst c-version "5.30.9" "CC Mode version number.") (defconst c-version-sym (intern c-version)) @@ -620,20 +619,36 @@ This function does not do any hidden buffer changes." (eq (char-before) ?\\))) (backward-char)))) +(eval-and-compile + (defvar c-langs-are-parametric nil)) + (defmacro c-major-mode-is (mode) "Return non-nil if the current CC Mode major mode is MODE. MODE is either a mode symbol or a list of mode symbols. This function does not do any hidden buffer changes." - (if (eq (car-safe mode) 'quote) - (let ((mode (eval mode))) - (if (listp mode) - `(memq c-buffer-is-cc-mode ',mode) - `(eq c-buffer-is-cc-mode ',mode))) - `(let ((mode ,mode)) - (if (listp mode) - (memq c-buffer-is-cc-mode mode) - (eq c-buffer-is-cc-mode mode))))) + + (if c-langs-are-parametric + ;; Inside a `c-lang-defconst'. + `(c-lang-major-mode-is ,mode) + + (if (eq (car-safe mode) 'quote) + (let ((mode (eval mode))) + (if (listp mode) + `(memq c-buffer-is-cc-mode ',mode) + `(eq c-buffer-is-cc-mode ',mode))) + + `(let ((mode ,mode)) + (if (listp mode) + (memq c-buffer-is-cc-mode mode) + (eq c-buffer-is-cc-mode mode)))))) + +(defmacro c-mode-is-new-awk-p () + ;; Is the current mode the "new" awk mode? It is important for + ;; (e.g.) the cc-engine functions do distinguish between the old and + ;; new awk-modes. + '(and (c-major-mode-is 'awk-mode) + (memq 'syntax-properties c-emacs-features))) (defmacro c-parse-sexp-lookup-properties () ;; Return the value of the variable that says whether the @@ -968,13 +983,6 @@ the value of the variable with that name. This function does not do any hidden buffer changes." (symbol-value (c-mode-symbol suffix))) -(defsubst c-mode-is-new-awk-p () - ;; Is the current mode the "new" awk mode? It is important for - ;; (e.g.) the cc-engine functions do distinguish between the old and - ;; new awk-modes. - (and (c-major-mode-is 'awk-mode) - (memq 'syntax-properties c-emacs-features))) - (defsubst c-got-face-at (pos faces) "Return non-nil if position POS in the current buffer has any of the faces in the list FACES. @@ -1056,12 +1064,156 @@ current language (taken from `c-buffer-is-cc-mode')." (put 'c-make-keywords-re 'lisp-indent-function 1) + +;; Figure out what features this Emacs has + +(cc-bytecomp-defvar open-paren-in-column-0-is-defun-start) + +(defconst c-emacs-features + (let (list) + + (if (boundp 'infodock-version) + ;; I've no idea what this actually is, but it's legacy. /mast + (setq list (cons 'infodock list))) + + ;; XEmacs 19 and beyond use 8-bit modify-syntax-entry flags. + ;; Emacs 19 uses a 1-bit flag. We will have to set up our + ;; syntax tables differently to handle this. + (let ((table (copy-syntax-table)) + entry) + (modify-syntax-entry ?a ". 12345678" table) + (cond + ;; XEmacs 19, and beyond Emacs 19.34 + ((arrayp table) + (setq entry (aref table ?a)) + ;; In Emacs, table entries are cons cells + (if (consp entry) (setq entry (car entry)))) + ;; XEmacs 20 + ((fboundp 'get-char-table) (setq entry (get-char-table ?a table))) + ;; before and including Emacs 19.34 + ((and (fboundp 'char-table-p) + (char-table-p table)) + (setq entry (car (char-table-range table [?a])))) + ;; incompatible + (t (error "CC Mode is incompatible with this version of Emacs"))) + (setq list (cons (if (= (logand (lsh entry -16) 255) 255) + '8-bit + '1-bit) + list))) + + (let ((buf (generate-new-buffer " test")) + parse-sexp-lookup-properties + parse-sexp-ignore-comments + lookup-syntax-properties) + (save-excursion + (set-buffer buf) + (set-syntax-table (make-syntax-table)) + + ;; For some reason we have to set some of these after the + ;; buffer has been made current. (Specifically, + ;; `parse-sexp-ignore-comments' in Emacs 21.) + (setq parse-sexp-lookup-properties t + parse-sexp-ignore-comments t + lookup-syntax-properties t) + + ;; Find out if the `syntax-table' text property works. + (modify-syntax-entry ?< ".") + (modify-syntax-entry ?> ".") + (insert "<()>") + (c-mark-<-as-paren 1) + (c-mark->-as-paren 4) + (goto-char 1) + (c-forward-sexp) + (if (= (point) 5) + (setq list (cons 'syntax-properties list))) + + ;; Find out if generic comment delimiters work. + (c-safe + (modify-syntax-entry ?x "!") + (if (string-match "\\s!" "x") + (setq list (cons 'gen-comment-delim list)))) + + ;; Find out if generic string delimiters work. + (c-safe + (modify-syntax-entry ?x "|") + (if (string-match "\\s|" "x") + (setq list (cons 'gen-string-delim list)))) + + ;; See if POSIX char classes work. + (when (and (string-match "[[:alpha:]]" "a") + ;; All versions of Emacs 21 so far haven't fixed + ;; char classes in `skip-chars-forward' and + ;; `skip-chars-backward'. + (progn + (delete-region (point-min) (point-max)) + (insert "foo123") + (skip-chars-backward "[:alnum:]") + (bobp)) + (= (skip-chars-forward "[:alpha:]") 3)) + (setq list (cons 'posix-char-classes list))) + + ;; See if `open-paren-in-column-0-is-defun-start' exists and + ;; isn't buggy. + (when (boundp 'open-paren-in-column-0-is-defun-start) + (let ((open-paren-in-column-0-is-defun-start nil) + (parse-sexp-ignore-comments t)) + (delete-region (point-min) (point-max)) + (set-syntax-table (make-syntax-table)) + (modify-syntax-entry ?\' "\"") + (cond + ;; XEmacs. Afaik this is currently an Emacs-only + ;; feature, but it's good to be prepared. + ((memq '8-bit list) + (modify-syntax-entry ?/ ". 1456") + (modify-syntax-entry ?* ". 23")) + ;; Emacs + ((memq '1-bit list) + (modify-syntax-entry ?/ ". 124b") + (modify-syntax-entry ?* ". 23"))) + (modify-syntax-entry ?\n "> b") + (insert "/* '\n () */") + (backward-sexp) + (if (bobp) + (setq list (cons 'col-0-paren list))))) + + (set-buffer-modified-p nil)) + (kill-buffer buf)) + + ;; See if `parse-partial-sexp' returns the eighth element. + (when (c-safe (>= (length (save-excursion (parse-partial-sexp 1 1))) 10)) + (setq list (cons 'pps-extended-state list))) + + ;;(message "c-emacs-features: %S" list) + list) + "A list of certain features in the (X)Emacs you are using. +There are many flavors of Emacs out there, each with different +features supporting those needed by CC Mode. The following values +might be present: + +'8-bit 8 bit syntax entry flags (XEmacs style). +'1-bit 1 bit syntax entry flags (Emacs style). +'syntax-properties It works to override the syntax for specific characters + in the buffer with the 'syntax-table property. +'gen-comment-delim Generic comment delimiters work + (i.e. the syntax class `!'). +'gen-string-delim Generic string delimiters work + (i.e. the syntax class `|'). +'pps-extended-state `parse-partial-sexp' returns a list with at least 10 + elements, i.e. it contains the position of the + start of the last comment or string. +'posix-char-classes The regexp engine understands POSIX character classes. +'col-0-paren It's possible to turn off the ad-hoc rule that a paren + in column zero is the start of a defun. +'infodock This is Infodock (based on XEmacs). + +'8-bit and '1-bit are mutually exclusive.") + ;;; Some helper constants. -;; If the regexp engine supports POSIX char classes (e.g. Emacs 21) -;; then we can use them to handle extended charsets correctly. -(if (string-match "[[:alpha:]]" "a") ; Can't use c-emacs-features here. +;; If the regexp engine supports POSIX char classes then we can use +;; them to handle extended charsets correctly. +(if (memq 'posix-char-classes c-emacs-features) (progn (defconst c-alpha "[:alpha:]") (defconst c-alnum "[:alnum:]") @@ -1127,8 +1279,8 @@ system." (error "The mode name symbol `%s' must end with \"-mode\"" mode)) (put mode 'c-mode-prefix (match-string 1 (symbol-name mode))) (unless (get base-mode 'c-mode-prefix) - (error "Unknown base mode `%s'" base-mode) - (put mode 'c-fallback-mode base-mode))) + (error "Unknown base mode `%s'" base-mode)) + (put mode 'c-fallback-mode base-mode)) (defvar c-lang-constants (make-vector 151 0)) ;; This obarray is a cache to keep track of the language constants @@ -1144,7 +1296,6 @@ system." ;; various other symbols, but those don't have any variable bindings. (defvar c-lang-const-expansion nil) -(defvar c-langs-are-parametric nil) (defsubst c-get-current-file () ;; Return the base name of the current file. @@ -1585,6 +1736,22 @@ This macro does not do any hidden buffer changes." c-lang-constants))) +(defun c-lang-major-mode-is (mode) + ;; `c-major-mode-is' expands to a call to this function inside + ;; `c-lang-defconst'. Here we also match the mode(s) against any + ;; fallback modes for the one in `c-buffer-is-cc-mode', so that + ;; e.g. (c-major-mode-is 'c++-mode) is true in a derived language + ;; that has c++-mode as base mode. + (unless (listp mode) + (setq mode (list mode))) + (let (match (buf-mode c-buffer-is-cc-mode)) + (while (if (memq buf-mode mode) + (progn + (setq match t) + nil) + (setq buf-mode (get buf-mode 'c-fallback-mode)))) + match)) + (cc-provide 'cc-defs) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 2e907589304..ea36064412f 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -1270,7 +1270,7 @@ This function does not do any hidden buffer changes." (when (and (= beg end) (get-text-property beg 'c-in-sws) - (not (bobp)) + (> beg (point-min)) (get-text-property (1- beg) 'c-in-sws)) ;; Ensure that an `c-in-sws' range gets broken. Note that it isn't ;; safe to keep a range that was continuous before the change. E.g: @@ -1906,7 +1906,7 @@ This function does not do any hidden buffer changes." (if last-pos ;; Prepare to loop, but record the open paren only if it's ;; outside a macro or within the same macro as point, and - ;; if it is a "real" open paren and not some character + ;; if it is a legitimate open paren and not some character ;; that got an open paren syntax-table property. (progn (setq pos last-pos) @@ -1914,7 +1914,11 @@ This function does not do any hidden buffer changes." (save-excursion (goto-char last-pos) (not (c-beginning-of-macro)))) - (= (char-syntax (char-before last-pos)) ?\()) + ;; Check for known types of parens that we want + ;; to record. The syntax table is not to be + ;; trusted here since the caller might be using + ;; e.g. `c++-template-syntax-table'. + (memq (char-before last-pos) '(?{ ?\( ?\[))) (setq c-state-cache (cons (1- last-pos) c-state-cache)))) (if (setq last-pos (c-up-list-forward pos)) @@ -2124,7 +2128,7 @@ This function does not do any hidden buffer changes." (when (c-major-mode-is 'pike-mode) ;; Handle the ` syntax in Pike. (let ((pos (point))) - (skip-chars-backward "!%&*+\\-/<=>^|~[]()") + (skip-chars-backward "-!%&*+/<=>^|~[]()") (and (if (< (skip-chars-backward "`") 0) t (goto-char pos) @@ -2144,7 +2148,7 @@ This function does not do any hidden buffer changes." (and (c-major-mode-is 'pike-mode) ;; Handle the ` syntax in Pike. (let ((pos (point))) - (if (and (< (skip-chars-backward "!%&*+\\-/<=>^|~[]()") 0) + (if (and (< (skip-chars-backward "-!%&*+/<=>^|~[]()") 0) (< (skip-chars-backward "`") 0) (looking-at c-symbol-key) (>= (match-end 0) pos)) @@ -2384,8 +2388,11 @@ outside any comment, macro or string literal, or else the content of that region is taken as syntactically significant text. If PAREN-LEVEL is non-nil, an additional restriction is added to -ignore matches in nested paren sexps, and the search will also not go -outside the current paren sexp. +ignore matches in nested paren sexps. The search will also not go +outside the current list sexp, which has the effect that if the point +should be moved to BOUND when no match is found \(i.e. NOERROR is +neither nil nor t), then it will be at the closing paren if the end of +the current list sexp is encountered first. If NOT-INSIDE-TOKEN is non-nil, matches in the middle of tokens are ignored. Things like multicharacter operators and special symbols @@ -2401,11 +2408,15 @@ subexpression is never tested before the starting position, so it might be a good idea to include \\=\\= as a match alternative in it. Optimization note: Matches might be missed if the \"look behind\" -subexpression should match the end of nonwhite syntactic whitespace, +subexpression can match the end of nonwhite syntactic whitespace, i.e. the end of comments or cpp directives. This since the function -skips over such things before resuming the search. It's also not safe -to assume that the \"look behind\" subexpression never can match -syntactic whitespace." +skips over such things before resuming the search. It's on the other +hand not safe to assume that the \"look behind\" subexpression never +matches syntactic whitespace. + +Bug: Unbalanced parens inside cpp directives are currently not handled +correctly \(i.e. they don't get ignored as they should) when +PAREN-LEVEL is set." (or bound (setq bound (point-max))) (if paren-level (setq paren-level -1)) @@ -2413,53 +2424,55 @@ syntactic whitespace." ;;(message "c-syntactic-re-search-forward %s %s %S" (point) bound regexp) (let ((start (point)) - (pos (point)) + tmp + ;; Start position for the last search. + search-pos + ;; The `parse-partial-sexp' state between the start position + ;; and the point. + state + ;; The current position after the last state update. The next + ;; `parse-partial-sexp' continues from here. + (state-pos (point)) + ;; The position at which to check the state and the state + ;; there. This is separate from `state-pos' since we might + ;; need to back up before doing the next search round. + check-pos check-state + ;; Last position known to end a token. (last-token-end-pos (point-min)) - match-pos found state check-pos check-state tmp) + ;; Set when a valid match is found. + found) (condition-case err (while (and - (re-search-forward regexp bound noerror) + (progn + (setq search-pos (point)) + (re-search-forward regexp bound noerror)) (progn - (setq match-pos (point) - state (parse-partial-sexp - pos (match-beginning 0) paren-level nil state) - pos (point)) + (setq state (parse-partial-sexp + state-pos (match-beginning 0) paren-level nil state) + state-pos (point)) (if (setq check-pos (and lookbehind-submatch + (or (not paren-level) + (>= (car state) 0)) (match-end lookbehind-submatch))) (setq check-state (parse-partial-sexp - pos check-pos paren-level nil state)) - (setq check-pos pos + state-pos check-pos paren-level nil state)) + (setq check-pos state-pos check-state state)) - ;; If we got a look behind subexpression and get an - ;; insignificant match in something that isn't + ;; NOTE: If we got a look behind subexpression and get + ;; an insignificant match in something that isn't ;; syntactic whitespace (i.e. strings or in nested ;; parentheses), then we can never skip more than a - ;; single character from the match position before - ;; continuing the search. That since the look behind - ;; subexpression might match the end of the - ;; insignificant region. + ;; single character from the match start position + ;; (i.e. `state-pos' here) before continuing the + ;; search. That since the look behind subexpression + ;; might match the end of the insignificant region in + ;; the next search. (cond - ((setq tmp (elt check-state 3)) - ;; Match inside a string. - (if (or lookbehind-submatch - (not (integerp tmp))) - (goto-char (min (1+ pos) bound)) - ;; Skip to the end of the string before continuing. - (let ((ender (make-string 1 tmp)) (continue t)) - (while (if (search-forward ender bound noerror) - (progn - (setq state (parse-partial-sexp - pos (point) nil nil state) - pos (point)) - (elt state 3)) - (setq continue nil))) - continue))) - ((elt check-state 7) ;; Match inside a line comment. Skip to eol. Use ;; `re-search-forward' instead of `skip-chars-forward' to get @@ -2472,6 +2485,7 @@ syntactic whitespace." ((and (not (elt check-state 5)) (eq (char-before check-pos) ?/) + (not (c-get-char-property (1- check-pos) 'syntax-table)) (memq (char-after check-pos) '(?/ ?*))) ;; Match in the middle of the opener of a block or line ;; comment. @@ -2479,6 +2493,67 @@ syntactic whitespace." (re-search-forward "[\n\r]" bound noerror) (search-forward "*/" bound noerror))) + ;; The last `parse-partial-sexp' above might have + ;; stopped short of the real check position if the end + ;; of the current sexp was encountered in paren-level + ;; mode. The checks above are always false in that + ;; case, and since they can do better skipping in + ;; lookbehind-submatch mode, we do them before + ;; checking the paren level. + + ((and paren-level + (/= (setq tmp (car check-state)) 0)) + ;; Check the paren level first since we're short of the + ;; syntactic checking position if the end of the + ;; current sexp was encountered by `parse-partial-sexp'. + (if (> tmp 0) + + ;; Inside a nested paren sexp. + (if lookbehind-submatch + ;; See the NOTE above. + (progn (goto-char state-pos) t) + ;; Skip out of the paren quickly. + (setq state (parse-partial-sexp state-pos bound 0 nil state) + state-pos (point))) + + ;; Have exited the current paren sexp. + (if noerror + (progn + ;; The last `parse-partial-sexp' call above + ;; has left us just after the closing paren + ;; in this case, so we can modify the bound + ;; to leave the point at the right position + ;; upon return. + (setq bound (1- (point))) + nil) + (signal 'search-failed (list regexp))))) + + ((setq tmp (elt check-state 3)) + ;; Match inside a string. + (if (or lookbehind-submatch + (not (integerp tmp))) + ;; See the NOTE above. + (progn (goto-char state-pos) t) + ;; Skip to the end of the string before continuing. + (let ((ender (make-string 1 tmp)) (continue t)) + (while (if (search-forward ender bound noerror) + (progn + (setq state (parse-partial-sexp + state-pos (point) nil nil state) + state-pos (point)) + (elt state 3)) + (setq continue nil))) + continue))) + + ((save-excursion + (save-match-data + (c-beginning-of-macro start))) + ;; Match inside a macro. Skip to the end of it. + (c-end-of-macro) + (cond ((<= (point) bound) t) + (noerror nil) + (t (signal 'search-failed (list regexp))))) + ((and not-inside-token (or (< check-pos last-token-end-pos) (< check-pos @@ -2487,62 +2562,42 @@ syntactic whitespace." (save-match-data (c-end-of-current-token last-token-end-pos)) (setq last-token-end-pos (point)))))) - ;; Match inside a token. - (cond ((<= (point) bound) - (goto-char (min (1+ pos) bound)) - t) - (noerror nil) - (t (signal 'search-failed "end of token")))) - - ((save-excursion - (save-match-data - (c-beginning-of-macro start))) - ;; Match inside a macro. Skip to the end of it. - (c-end-of-macro) - (cond ((<= (point) bound) t) - (noerror nil) - (t (signal 'search-failed "end of macro")))) - - ((and paren-level - (/= (setq tmp (car check-state)) 0)) - (if (> tmp 0) - ;; Match inside a nested paren sexp. - (if lookbehind-submatch - (goto-char (min (1+ pos) bound)) - ;; Skip out of the paren quickly. - (setq state (parse-partial-sexp pos bound 0 nil state) - pos (point))) - ;; Have exited the current paren sexp. The - ;; `parse-partial-sexp' above has left us just after the - ;; closing paren in this case. Just make - ;; `re-search-forward' above fail in the appropriate way; - ;; we'll adjust the leave off point below if necessary. - (setq bound (point)))) + ;; Inside a token. + (if lookbehind-submatch + ;; See the NOTE above. + (goto-char state-pos) + (goto-char (min last-token-end-pos bound)))) (t ;; A real match. (setq found t) - nil))))) + nil))) + + ;; Should loop to search again, but take care to avoid + ;; looping on the same spot. + (or (/= search-pos (point)) + (if (= (point) bound) + (if noerror + nil + (signal 'search-failed (list regexp))) + (forward-char) + t)))) (error (goto-char start) (signal (car err) (cdr err)))) - ;;(message "c-syntactic-re-search-forward done %s" (or match-pos (point))) + ;;(message "c-syntactic-re-search-forward done %s" (or (match-end 0) (point))) (if found (progn - (goto-char match-pos) - match-pos) + (goto-char (match-end 0)) + (match-end 0)) ;; Search failed. Set point as appropriate. - (cond ((eq noerror t) - (goto-char start)) - (paren-level - (if (eq (car (parse-partial-sexp pos bound -1 nil state)) -1) - (backward-char))) - (t - (goto-char bound))) + (if (eq noerror t) + (goto-char start) + (goto-char bound)) nil))) (defun c-syntactic-skip-backward (skip-chars &optional limit) @@ -4030,12 +4085,13 @@ This function does not do any hidden buffer changes." (defun c-forward-type () ;; Move forward over a type spec if at the beginning of one, ;; stopping at the next following token. Return t if it's a known - ;; type that can't be a name, 'known if it's an otherwise known type - ;; (according to `*-font-lock-extra-types'), 'prefix if it's a known - ;; prefix of a type, 'found if it's a type that matches one in - ;; `c-found-types', 'maybe if it's an identfier that might be a - ;; type, or nil if it can't be a type (the point isn't moved then). - ;; The point is assumed to be at the beginning of a token. + ;; type that can't be a name or other expression, 'known if it's an + ;; otherwise known type (according to `*-font-lock-extra-types'), + ;; 'prefix if it's a known prefix of a type, 'found if it's a type + ;; that matches one in `c-found-types', 'maybe if it's an identfier + ;; that might be a type, or nil if it can't be a type (the point + ;; isn't moved then). The point is assumed to be at the beginning + ;; of a token. ;; ;; Note that this function doesn't skip past the brace definition ;; that might be considered part of the type, e.g. @@ -4199,11 +4255,14 @@ This function does not do any hidden buffer changes." ;; don't let the existence of the operator itself promote two ;; uncertain types to a certain one. (cond ((eq res t)) - ((or (eq res 'known) (memq res2 '(t known))) + ((eq res2 t) (c-add-type id-start id-end) (when c-record-type-identifiers (c-record-type-id id-range)) (setq res t)) + ((eq res 'known)) + ((eq res2 'known) + (setq res 'known)) ((eq res 'found)) ((eq res2 'found) (setq res 'found)) @@ -4526,7 +4585,8 @@ brace." ;; `c-beginning-of-statement-1' stops at a block start, but we ;; want to continue if the block doesn't begin a top level - ;; construct, i.e. if it isn't preceded by ';', '}', ':', or bob. + ;; construct, i.e. if it isn't preceded by ';', '}', ':', bob, + ;; or an open paren. (let ((beg (point)) tentative-move) (while (and ;; Must check with c-opt-method-key in ObjC mode. @@ -4536,6 +4596,9 @@ brace." (progn (c-backward-syntactic-ws lim) (not (memq (char-before) '(?\; ?} ?: nil)))) + (save-excursion + (backward-char) + (not (looking-at "\\s("))) ;; Check that we don't move from the first thing in a ;; macro to its header. (not (eq (setq tentative-move @@ -4972,33 +5035,44 @@ brace." (condition-case () (save-excursion (let ((beg (point)) - end type) + inner-beg end type) (c-forward-syntactic-ws) (if (eq (char-after) ?\() (progn (forward-char 1) (c-forward-syntactic-ws) + (setq inner-beg (point)) (setq type (assq (char-after) c-special-brace-lists))) (if (setq type (assq (char-after) c-special-brace-lists)) (progn + (setq inner-beg (point)) (c-backward-syntactic-ws) (forward-char -1) (setq beg (if (eq (char-after) ?\() (point) nil))))) (if (and beg type) - (if (and (c-safe (goto-char beg) + (if (and (c-safe + (goto-char beg) + (c-forward-sexp 1) + (setq end (point)) + (= (char-before) ?\))) + (c-safe + (goto-char inner-beg) + (if (looking-at "\\s(") + ;; Check balancing of the inner paren + ;; below. + (progn (c-forward-sexp 1) - (setq end (point)) - (= (char-before) ?\))) - (c-safe (goto-char beg) - (forward-char 1) - (c-forward-sexp 1) - ;; Kludges needed to handle inner - ;; chars both with and without - ;; paren syntax. - (or (/= (char-syntax (char-before)) ?\)) - (= (char-before) (cdr type))))) + t) + ;; If the inner char isn't a paren then + ;; we can't check balancing, so just + ;; check the char before the outer + ;; closing paren. + (goto-char end) + (backward-char) + (c-backward-syntactic-ws) + (= (char-before) (cdr type))))) (if (or (/= (char-syntax (char-before)) ?\)) (= (progn (c-forward-syntactic-ws) @@ -6272,7 +6346,7 @@ This function does not do any hidden buffer changes." (goto-char containing-sexp) (setq placeholder (c-point 'boi)) (if (and (c-safe (backward-up-list 1) t) - (> (point) placeholder)) + (>= (point) placeholder)) (progn (forward-char) (skip-chars-forward " \t")) @@ -6313,7 +6387,7 @@ This function does not do any hidden buffer changes." (goto-char containing-sexp) (setq placeholder (c-point 'boi)) (when (and (c-safe (backward-up-list 1) t) - (> (point) placeholder)) + (>= (point) placeholder)) (forward-char) (skip-chars-forward " \t") (setq placeholder (point))) @@ -6354,7 +6428,7 @@ This function does not do any hidden buffer changes." (goto-char containing-sexp) (setq placeholder (c-point 'boi)) (if (and (c-safe (backward-up-list 1) t) - (> (point) placeholder)) + (>= (point) placeholder)) (progn (forward-char) (skip-chars-forward " \t")) @@ -6830,6 +6904,10 @@ This function does not do any hidden buffer changes." ((vectorp offset) offset) ((null offset) nil) ((listp offset) + (if (eq (car offset) 'quote) + (error +"Setting in c-offsets-alist element \"(%s . '%s)\" was mistakenly quoted" + symbol (cadr offset))) (let (done) (while (and (not done) offset) (setq done (c-evaluate-offset (car offset) langelem symbol) diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 27c604b3f33..c5bbfaf86dd 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -574,33 +574,65 @@ casts and declarations are fontified. Used on level 2 and higher." ;; Fontify leading identifiers in fully qualified names like ;; "foo::bar" in languages that supports such things. ,@(when (c-lang-const c-opt-identifier-concat-key) - `((,(byte-compile - ;; Must use a function here since we match longer - ;; than we want to move before doing a new search. - ;; This is not necessary for XEmacs >= 20 since it - ;; restarts the search from the end of the first - ;; highlighted submatch (something that causes - ;; problems in other places). - `(lambda (limit) - (while (re-search-forward - ,(concat "\\(\\<" ; 1 - "\\(" (c-lang-const c-symbol-key) "\\)" ; 2 - "[ \t\n\r\f\v]*" - (c-lang-const c-opt-identifier-concat-key) - "[ \t\n\r\f\v]*" - "\\)" - "\\(" - (c-lang-const c-opt-after-id-concat-key) - "\\)") - limit t) - (unless (progn - (goto-char (match-beginning 0)) - (c-skip-comments-and-strings limit)) - (or (get-text-property (match-beginning 2) 'face) - (c-put-font-lock-face (match-beginning 2) - (match-end 2) - c-reference-face-name)) - (goto-char (match-end 1))))))))) + (if (c-major-mode-is 'java-mode) + ;; Java needs special treatment since "." is used both to + ;; qualify names and in normal indexing. Here we look for + ;; capital characters at the beginning of an identifier to + ;; recognize the class. "*" is also recognized to cover + ;; wildcard import declarations. All preceding dot separated + ;; identifiers are taken as package names and therefore + ;; fontified as references. + `(,(c-make-font-lock-search-function + ;; Search for class identifiers preceded by ".". The + ;; anchored matcher takes it from there. + (concat (c-lang-const c-opt-identifier-concat-key) + "[ \t\n\r\f\v]*" + (concat "\\(" + "[" c-upper "][" (c-lang-const c-symbol-chars) "]*" + "\\|" + "\\*" + "\\)")) + `((let (id-end) + (goto-char (1+ (match-beginning 0))) + (while (and (eq (char-before) ?.) + (progn + (backward-char) + (c-backward-syntactic-ws) + (setq id-end (point)) + (< (skip-chars-backward + ,(c-lang-const c-symbol-chars)) 0)) + (not (get-text-property (point) 'face))) + (c-put-font-lock-face (point) id-end c-reference-face-name) + (c-backward-syntactic-ws))) + nil + (goto-char (match-end 0))))) + + `((,(byte-compile + ;; Must use a function here since we match longer than we + ;; want to move before doing a new search. This is not + ;; necessary for XEmacs >= 20 since it restarts the search + ;; from the end of the first highlighted submatch (something + ;; that causes problems in other places). + `(lambda (limit) + (while (re-search-forward + ,(concat "\\(\\<" ; 1 + "\\(" (c-lang-const c-symbol-key) "\\)" ; 2 + "[ \t\n\r\f\v]*" + (c-lang-const c-opt-identifier-concat-key) + "[ \t\n\r\f\v]*" + "\\)" + "\\(" + (c-lang-const c-opt-after-id-concat-key) + "\\)") + limit t) + (unless (progn + (goto-char (match-beginning 0)) + (c-skip-comments-and-strings limit)) + (or (get-text-property (match-beginning 2) 'face) + (c-put-font-lock-face (match-beginning 2) + (match-end 2) + c-reference-face-name)) + (goto-char (match-end 1)))))))))) ;; Fontify the special declarations in Objective-C. ,@(when (c-major-mode-is 'objc-mode) @@ -787,17 +819,19 @@ casts and declarations are fontified. Used on level 2 and higher." (<= (point) limit) ;; Search syntactically to the end of the declarator (";", - ;; ",", ")", ">" (for <> arglists), eob etc) or to the - ;; beginning of an initializer or function prototype ("=" - ;; or "\\s\("). + ;; ",", a closen paren, eob etc) or to the beginning of an + ;; initializer or function prototype ("=" or "\\s\("). + ;; Note that the open paren will match array specs in + ;; square brackets, and we treat them as initializers too. (c-syntactic-re-search-forward - "[\];,\{\}\[\)>]\\|\\'\\|\\(=\\|\\(\\s\(\\)\\)" limit t t)) + "[;,]\\|\\s)\\|\\'\\|\\(=\\|\\s(\\)" limit t t)) (setq next-pos (match-beginning 0) - id-face (if (match-beginning 2) + id-face (if (eq (char-after next-pos) ?\() 'font-lock-function-name-face 'font-lock-variable-name-face) - got-init (match-beginning 1)) + got-init (and (match-beginning 1) + (char-after (match-beginning 1)))) (if types ;; Register and fontify the identifer as a type. @@ -828,9 +862,17 @@ casts and declarations are fontified. Used on level 2 and higher." (goto-char limit))) (got-init - ;; Skip an initializer expression. - (if (c-syntactic-re-search-forward "[;,]" limit 'move t) - (backward-char))) + ;; Skip an initializer expression. If we're at a '=' + ;; then accept a brace list directly after it to cope + ;; with array initializers. Otherwise stop at braces + ;; to avoid going past full function and class blocks. + (and (if (and (eq got-init ?=) + (= (c-forward-token-2) 0) + (looking-at "{")) + (c-safe (c-forward-sexp) t) + t) + (c-syntactic-re-search-forward "[;,{]" limit 'move t) + (backward-char))) (t (c-forward-syntactic-ws limit))) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 19555b37527..6aeb70ba4e3 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -374,6 +374,12 @@ identifiers, or nil in languages that don't have such things. Does not contain a \\| operator at the top level." t nil c++ "::" + ;; Java has "." to concatenate identifiers but it's also used for + ;; normal indexing. There's special code in the Java font lock + ;; rules to fontify qualified identifiers based on the standard + ;; naming conventions. We still define "." here to make + ;; `c-forward-name' move over as long names as possible which is + ;; necessary to e.g. handle throws clauses correctly. java "\\." idl "::" pike "\\(::\\|\\.\\)") diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 13ffd310fce..1a26e54bf06 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -355,6 +355,8 @@ when used elsewhere." (completing-read prompt c-style-alist nil t (cons c-indentation-style 0) 'c-set-style-history)))))) + (or (stringp stylename) + (error "Argument to c-set-style was not a string")) (c-initialize-builtin-style) (let ((vars (c-get-style-variables stylename nil))) (unless dont-override diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index f21531c2f22..2ed23f8ef86 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el @@ -271,12 +271,12 @@ nil." (defcustom c-tab-always-indent t "*Controls the operation of the TAB key. -If t, hitting TAB always just indents the current line. If nil, -hitting TAB indents the current line if point is at the left margin or -in the line's indentation, otherwise it insert a `real' tab character -\(see note\). If the symbol `other', then tab is inserted only within -literals -- defined as comments and strings -- and inside preprocessor -directives, but the line is always reindented. +If t, hitting TAB always just indents the current line. If nil, hitting +TAB indents the current line if point is at the left margin or in the +line's indentation, otherwise it inserts a `real' tab character \(see +note\). If some other value (not nil or t), then tab is inserted only +within literals \(comments and strings), but the line is always +reindented. Note: The value of `indent-tabs-mode' will determine whether a real tab character will be inserted, or the equivalent number of spaces. @@ -1545,140 +1545,6 @@ Don't change this directly; call `c-set-style' instead.") Set from `c-comment-prefix-regexp' at mode initialization.") (make-variable-buffer-local 'c-current-comment-prefix) - -;; Figure out what features this Emacs has - -(cc-bytecomp-defvar open-paren-in-column-0-is-defun-start) - -(defconst c-emacs-features - (let (list) - - (if (boundp 'infodock-version) - ;; I've no idea what this actually is, but it's legacy. /mast - (setq list (cons 'infodock list))) - - ;; XEmacs 19 and beyond use 8-bit modify-syntax-entry flags. - ;; Emacs 19 uses a 1-bit flag. We will have to set up our - ;; syntax tables differently to handle this. - (let ((table (copy-syntax-table)) - entry) - (modify-syntax-entry ?a ". 12345678" table) - (cond - ;; XEmacs 19, and beyond Emacs 19.34 - ((arrayp table) - (setq entry (aref table ?a)) - ;; In Emacs, table entries are cons cells - (if (consp entry) (setq entry (car entry)))) - ;; XEmacs 20 - ((fboundp 'get-char-table) (setq entry (get-char-table ?a table))) - ;; before and including Emacs 19.34 - ((and (fboundp 'char-table-p) - (char-table-p table)) - (setq entry (car (char-table-range table [?a])))) - ;; incompatible - (t (error "CC Mode is incompatible with this version of Emacs"))) - (setq list (cons (if (= (logand (lsh entry -16) 255) 255) - '8-bit - '1-bit) - list))) - - (let ((buf (generate-new-buffer " test")) - parse-sexp-lookup-properties - parse-sexp-ignore-comments - lookup-syntax-properties) - (save-excursion - (set-buffer buf) - (set-syntax-table (make-syntax-table)) - - ;; For some reason we have to set some of these after the - ;; buffer has been made current. (Specifically, - ;; `parse-sexp-ignore-comments' in Emacs 21.) - (setq parse-sexp-lookup-properties t - parse-sexp-ignore-comments t - lookup-syntax-properties t) - - ;; Find out if the `syntax-table' text property works. - (modify-syntax-entry ?< ".") - (modify-syntax-entry ?> ".") - (insert "<()>") - (c-mark-<-as-paren 1) - (c-mark->-as-paren 4) - (goto-char 1) - (c-forward-sexp) - (if (= (point) 5) - (setq list (cons 'syntax-properties list))) - - ;; Find out if generic comment delimiters work. - (c-safe - (modify-syntax-entry ?x "!") - (if (string-match "\\s!" "x") - (setq list (cons 'gen-comment-delim list)))) - - ;; Find out if generic string delimiters work. - (c-safe - (modify-syntax-entry ?x "|") - (if (string-match "\\s|" "x") - (setq list (cons 'gen-string-delim list)))) - - ;; See if `open-paren-in-column-0-is-defun-start' exists and - ;; isn't buggy. - (when (boundp 'open-paren-in-column-0-is-defun-start) - (let ((open-paren-in-column-0-is-defun-start nil) - (parse-sexp-ignore-comments t)) - (set-syntax-table (make-syntax-table)) - (modify-syntax-entry ?\' "\"") - (cond - ;; XEmacs. Afaik this is currently an Emacs-only - ;; feature, but it's good to be prepared. - ((memq '8-bit list) - (modify-syntax-entry ?/ ". 1456") - (modify-syntax-entry ?* ". 23")) - ;; Emacs - ((memq '1-bit list) - (modify-syntax-entry ?/ ". 124b") - (modify-syntax-entry ?* ". 23"))) - (modify-syntax-entry ?\n "> b") - (insert "/* '\n () */") - (backward-sexp) - (if (bobp) - (setq list (cons 'col-0-paren list)))) - (kill-buffer buf)) - - (set-buffer-modified-p nil)) - (kill-buffer buf)) - - ;; See if `parse-partial-sexp' returns the eighth element. - (when (c-safe (>= (length (save-excursion (parse-partial-sexp 1 1))) 10)) - (setq list (cons 'pps-extended-state list))) - - ;; See if POSIX char classes work. - (when (string-match "[[:alpha:]]" "a") - (setq list (cons 'posix-char-classes list))) - - list) - "A list of certain features in the (X)Emacs you are using. -There are many flavors of Emacs out there, each with different -features supporting those needed by CC Mode. The following values -might be present: - -'8-bit 8 bit syntax entry flags (XEmacs style). -'1-bit 1 bit syntax entry flags (Emacs style). -'syntax-properties It works to override the syntax for specific characters - in the buffer with the 'syntax-table property. -'gen-comment-delim Generic comment delimiters work - (i.e. the syntax class `!'). -'gen-string-delim Generic string delimiters work - (i.e. the syntax class `|'). -'pps-extended-state `parse-partial-sexp' returns a list with at least 10 - elements, i.e. it contains the position of the - start of the last comment or string. -'posix-char-classes The regexp engine understands POSIX character classes. -'col-0-paren It's possible to turn off the ad-hoc rule that a paren - in column zero is the start of a defun. -'infodock This is Infodock (based on XEmacs). - -'8-bit and '1-bit are mutually exclusive.") - (cc-provide 'cc-vars) diff --git a/man/ChangeLog b/man/ChangeLog index d6e105977fc..ab7bea36fcf 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2004-08-11 Martin Stjernholm + + * cc-mode.texi: Various updates for CC Mode 5.30.9. + 2004-08-10 Michael Albinus Sync with Tramp 2.0.44. diff --git a/man/cc-mode.texi b/man/cc-mode.texi index c3b7dd4833f..2c0933a5335 100644 --- a/man/cc-mode.texi +++ b/man/cc-mode.texi @@ -1340,9 +1340,9 @@ block comments. @findex setup-paragraph-variables (c-) Also note that since @ccmode{} uses the value of @code{c-comment-prefix-regexp} to set up several other variables at mode -initialization, there won't have any effect if you change it inside a +initialization, there won't be any effect if you just change it inside a @ccmode{} buffer. You need to call the command -@code{c-setup-paragraph-variables} to update those other variables with +@code{c-setup-paragraph-variables} too, to update those other variables with the new value. That's also the case if you modify this variable in a mode hook, since @ccmode{} sets up all variables before calling them. @end defopt @@ -1415,8 +1415,12 @@ namely when a block comment is broken for the first time. This style variable@footnote{In versions before 5.26, this variable was called @code{c-comment-continuation-stars}. As a compatibility measure, @ccmode{} still uses the value on that variable if it's set.} is used -then as the comment prefix. It defaults to @samp{* }, which makes a -comment +then as the comment prefix. It defaults to @samp{* +}@footnote{Actually, this default setting of +@code{c-block-comment-prefix} typically gets overriden by the default +style @code{gnu}, which sets it to blank. You can see the line +splitting effect described here by setting a different style, +e.g. @code{k&r} @xref{Choosing a Style}}, which makes a comment @example /* Got O(n^2) here, which is a Bad Thing. */ @@ -2057,13 +2061,13 @@ These variables are also useful when indenting code: @vindex tab-always-indent (c-) @kindex TAB @cindex literal -This variable controls how @kbd{TAB} (@code{c-indent-command}) operates. -When it is @code{t}, @kbd{TAB} always indents the current line. When it -is @code{nil}, the line is indented only if point is at the left margin, -or on or before the first non-whitespace character on the line, -otherwise some whitespace is inserted. If this variable is the symbol -@code{other}, then some whitespace is inserted only within strings and -comments (literals), and inside preprocessor directives, but the line is +This variable controls how @kbd{TAB} (@code{c-indent-command}) +operates. When it is @code{t}, @kbd{TAB} always indents the current +line. When it is @code{nil}, the line is indented only if point is at +the left margin, or on or before the first non-whitespace character on +the line, otherwise some whitespace is inserted. If this variable is +some other value (not @code{nil} or @code{t}), then some whitespace is +inserted only within strings and comments (literals), but the line is always reindented. @end defopt @@ -2878,26 +2882,71 @@ string. @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @node Adding Styles, File Styles, Choosing a Style, Styles @comment node-name, next, previous, up -@subsection Adding Styles +@subsection Adding and Amending Styles @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! If none of the built-in styles is appropriate, you'll probably want to -add a new @dfn{style definition}. Styles are kept in the -@code{c-style-alist} variable, but you should never modify this -variable directly. Instead, @ccmode{} provides the function -@code{c-add-style} that you can use to easily add new styles or change -existing styles: +create a new @dfn{style definition}, possibly based on an existing +style. To do this, put the new style's settings into a list with the +following format - the list can then be passed as an argument to the +function @code{c-add-style}: + +@cindex style definition +@defvr {List} style definition +([@var{base-style}] [(@var{variable} . @var{value}) @dots{}]) + +Optional @var{base-style}, if present, must be a string which is the +name of the @dfn{base style} from which this style inherits. At most +one @var{base-style} is allowed in a style definition. If +@var{base-style} is not specified, the style inherits from a table of +default values@footnote{This table is stored internally in the +variable c-fallback-style. It is computed during the initialisation +of @ccmode{} from the factory defaults of the style variables and any +global values they may have been given since starting Emacs.} instead. +All styles eventually inherit from this internal table. Style loops +generate errors. The list of pre-existing styles can be seen in +@ref{Built-in Styles}. + +The dotted pairs (@var{variable} . @var{value}) each consist of a +variable and the value it is to be set to when the style is later +activated.@footnote{In certain circumstances, this value can get +overridden by another value.} The variable can be either a @ccmode{} +style variable or an arbitrary Emacs variable. In the latter case, it +is @emph{not} made buffer local by the @ccmode{} style system. +@end defvr + +Two variables are treated specially in the dotted pair list: + +@table @code +@item c-offsets-alist +The value is in turn a dotted list on the form + +(@var{syntactic-symbol} . @var{offset}) + +as described in @ref{Customizing Indentation}. These are passed to +@code{c-set-offset} so there is no need to set every syntactic symbol in +your style, only those that are different from the inherited style. + +@item c-special-indent-hook +The value is added to @code{c-special-indent-hook} using +@code{add-hook}, so any functions already on it are kept. If the value +is a list, each element of the list is added with @code{add-hook}. +@end table + +Styles are kept in the @code{c-style-alist} variable, but you +should never modify this variable directly. Instead, @ccmode{} +provides the function @code{c-add-style} for this purpose. @defun c-add-style stylename description &optional set-p @findex add-style (c-) -Add or update a style. If @var{stylename} is not already in -@code{c-style-alist} then a new style according to @var{description} -is added, otherwise the existing style is changed. If the optional -@var{set-p} is non-@code{nil} then the new style is applied to the -current buffer as well. - -@comment TBD: The next paragraph is bogus. I really need to better -@comment document adding styles, including setting up inherited styles. +Add or update a style called @var{stylename}, a string. +@var{description} is the new style definition in the form described +above. If @var{stylename} already exists in @code{c-style-alist} then +it is replaced by @var{description}. (Note, this replacement is +total. The old style is @emph{not} merged into the new one.) +Otherwise, a new style is added. If the optional @var{set-p} is +non-@code{nil} then the new style is applied to the current buffer as +well. The sample @file{.emacs} file provides a concrete example of how a new style can be added and automatically set. @xref{Sample .emacs File}. @@ -3416,9 +3465,9 @@ Analogous to @code{inclass} syntactic symbol, but used inside lambda Lines continuing the header of a lambda function, i.e., between the @code{lambda} keyword and the function body. Only used in Pike mode. @item inexpr-statement -A statement block inside an expression. The gcc C extension of this is -recognized. It's also used for the special functions that takes a -statement block as an argument in Pike. +A statement block inside an expression. The gcc C and C++ extension for +this is recognized. It's also used for the special functions that take +a statement block as an argument in Pike. @item inexpr-class A class definition inside an expression. This is used for anonymous classes in Java. It's also used for anonymous array initializers in @@ -4022,7 +4071,8 @@ indented just like a normal class, with the added indentation given to @code{inexpr-class}. There are a few occasions where a statement block may be used inside an -expression. One is in C code using the gcc extension for this, e.g: +expression. One is in C or C++ code using the gcc extension for this, +e.g: @example 1: int res = (@{ @@ -5225,7 +5275,7 @@ Controls whether a final newline is ensured when the file is saved. The value is an association list that for each language mode specifies the value to give to @code{require-final-newline} at mode initialization; see that variable for details about the value. If a language isn't -present on the association list, CC Mode won't set +present on the association list, CC Mode won't touch @code{require-final-newline} in buffers for that language. The default is to set @code{require-final-newline} to @code{t} in the @@ -5484,6 +5534,25 @@ interpreter tries to call the macro as a function, it shows this (somewhat cryptic) error message.}. If you are using the standalone @ccmode{} distribution, try recompiling it according to the instructions in the @file{README} file. + +@item +@cindex open paren in column zero +@emph{I have an open paren character at column zero inside a comment or +multiline string literal, and it causes the fontification and/or +indentation to go haywire. What gives?} + +It's due to the ad-hoc rule in (X)Emacs that such open parens always +start defuns (which translates to functions, classes, namespaces or any +other top-level block constructs in the @ccmode{} languages). +@xref{Left Margin Paren,,, emacs, The Emacs Editor}, for details +(@xref{Defuns,,, emacs, The Emacs Editor}, in the Emacs 20 manual). + +This heuristic is built into the core syntax analysis routines in +(X)Emacs, so it's not really a @ccmode{} issue. However, in Emacs 21.4 +it has become possible to turn it off@footnote{Using the variable +@code{open-paren-in-column-0-is-defun-start}.} and @ccmode{} does so +there since it got its own system to keep track of blocks. + @end itemize From 048526bd2d7c479248ae5b23225fddee312a0eba Mon Sep 17 00:00:00 2001 From: Daniel Pfeiffer Date: Wed, 11 Aug 2004 20:00:11 +0000 Subject: [PATCH 114/341] (speedbar-scan-subdirs): New option. (speedbar-file-lists): Don't ignore file-name case on Unix and use dolist. (speedbar-insert-files-at-point): Take an extra argument and use it to optionally find out if a subdir is empty. Also unreadable files don't get expand buttons. (speedbar-directory-plus): New image (bitmap already existed unused). (speedbar-expand-image-button-alist): Use it. --- lisp/ChangeLog | 11 +++++++ lisp/speedbar.el | 85 ++++++++++++++++++++++++++++-------------------- 2 files changed, 60 insertions(+), 36 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 12c2b4d8a60..2ebc52c42ef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2004-08-11 Daniel Pfeiffer + + * speedbar.el (speedbar-scan-subdirs): New option. + (speedbar-file-lists): Don't ignore file-name case on Unix and use + dolist. + (speedbar-insert-files-at-point): Take an extra argument and use + it to optionally find out if a subdir is empty. Also unreadable + files don't get expand buttons. + (speedbar-directory-plus): New image (bitmap already existed unused). + (speedbar-expand-image-button-alist): Use it. + 2004-08-11 Martin Stjernholm CC Mode update to 5.30.9: diff --git a/lisp/speedbar.el b/lisp/speedbar.el index f8e9386585d..0556af489ef 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -689,8 +689,16 @@ file." :type '(repeat (regexp :tag "Extension Regexp")) :set (lambda (sym val) (setq speedbar-supported-extension-expressions val - speedbar-file-regexp (speedbar-extension-list-to-regex val))) - ) + speedbar-file-regexp (speedbar-extension-list-to-regex val)))) + +(defcustom speedbar-scan-subdirs nil + "*Non-nil means speedbar will check if subdirs are empty. +That way you don't have to click on them to find out. But this +incurs extra I/O, hence it slows down directory display +proportionally to the number of subdirs." + :group 'speedbar + :type 'boolean + :version 21.4) (defvar speedbar-file-regexp (speedbar-extension-list-to-regex speedbar-supported-extension-expressions) @@ -2185,21 +2193,17 @@ the file-system." ;; find the directory, either in the cache, or build it. (or (cdr-safe (assoc directory speedbar-directory-contents-alist)) (let ((default-directory directory) - (dir (directory-files directory nil)) - (dirs nil) - (files nil)) - (while dir - (if (not - (or (string-match speedbar-file-unshown-regexp (car dir)) - (string-match speedbar-directory-unshown-regexp (car dir)))) - (if (file-directory-p (car dir)) - (setq dirs (cons (car dir) dirs)) - (setq files (cons (car dir) files)))) - (setq dir (cdr dir))) - (let ((nl (cons (nreverse dirs) (list (nreverse files))))) + (case-fold-search read-file-name-completion-ignore-case) + dirs files) + (dolist (file (directory-files directory nil)) + (or (string-match speedbar-file-unshown-regexp file) + (string-match speedbar-directory-unshown-regexp file) + (if (file-directory-p file) + (setq dirs (cons file dirs)) + (setq files (cons file files))))) + (let ((nl `(,(nreverse dirs) ,(nreverse files)))) (aput 'speedbar-directory-contents-alist directory nl) - nl)) - )) + nl)))) (defun speedbar-directory-buttons (directory index) "Insert a single button group at point for DIRECTORY. @@ -2343,34 +2347,40 @@ position to insert a new item, and that the new item will end with a CR." ;;; Build button lists ;; -(defun speedbar-insert-files-at-point (files level) +(defun speedbar-insert-files-at-point (files level directory) "Insert list of FILES starting at point, and indenting all files to LEVEL. Tag expandable items with a +, otherwise a ?. Don't highlight ? as we don't know how to manage them. The input parameter FILES is a cons cell of the form ( 'DIRLIST . 'FILELIST )." ;; Start inserting all the directories - (let ((dirs (car files))) - (while dirs - (speedbar-make-tag-line 'angle ?+ 'speedbar-dired (car dirs) - (car dirs) 'speedbar-dir-follow nil - 'speedbar-directory-face level) - (setq dirs (cdr dirs)))) - (let ((lst (car (cdr files))) - (case-fold-search t)) - (while lst - (let* ((known (string-match speedbar-file-regexp (car lst))) + (dolist (dir (car files)) + (if (if speedbar-scan-subdirs + (condition-case nil + (let ((l (speedbar-file-lists (concat directory dir)))) + (or (car l) (cadr l))) + (file-error)) + (file-readable-p (concat directory dir))) + (speedbar-make-tag-line 'angle ?+ 'speedbar-dired dir + dir 'speedbar-dir-follow nil + 'speedbar-directory-face level) + (speedbar-make-tag-line 'angle ? nil dir + dir 'speedbar-dir-follow nil + 'speedbar-directory-face level))) + (let ((case-fold-search read-file-name-completion-ignore-case)) + (dolist (file (cadr files)) + (let* ((known (and (file-readable-p (concat directory file)) + (string-match speedbar-file-regexp file))) (expchar (if known ?+ ??)) (fn (if known 'speedbar-tag-file nil))) (if (or speedbar-show-unknown-files (/= expchar ??)) - (speedbar-make-tag-line 'bracket expchar fn (car lst) - (car lst) 'speedbar-find-file nil - 'speedbar-file-face level))) - (setq lst (cdr lst))))) + (speedbar-make-tag-line 'bracket expchar fn file + file 'speedbar-find-file nil + 'speedbar-file-face level)))))) (defun speedbar-default-directory-list (directory index) "Insert files for DIRECTORY with level INDEX at point." (speedbar-insert-files-at-point - (speedbar-file-lists directory) index) + (speedbar-file-lists directory) index directory) (speedbar-reset-scanners) (if (= index 0) ;; If the shown files variable has extra directories, then @@ -2918,7 +2928,7 @@ updated." (newcf (if newcfd newcfd)) (lastb (current-buffer)) (sucf-recursive (boundp 'sucf-recursive)) - (case-fold-search t)) + (case-fold-search read-file-name-completion-ignore-case)) (if (and newcf ;; check here, that way we won't refresh to newcf until ;; its been written, thus saving ourselves some time @@ -4235,9 +4245,7 @@ IMAGESPEC is the image data, and DOCSTRING is documentation for the image." (speedbar-convert-emacs21-imagespec-to-xemacs (quote ,imagespec))) 'buffer) (error nil)) - ,docstring)) - -))) + ,docstring))))) (defimage-speedbar speedbar-directory-plus ((:type xpm :file "sb-dir-plus.xpm" :ascent center)) @@ -4247,6 +4255,10 @@ IMAGESPEC is the image data, and DOCSTRING is documentation for the image." ((:type xpm :file "sb-dir-minus.xpm" :ascent center)) "Image used for open directories with stuff in them.") +(defimage-speedbar speedbar-directory + ((:type xpm :file "sb-dir.xpm" :ascent center)) + "Image used for empty or unreadable directories.") + (defimage-speedbar speedbar-page-plus ((:type xpm :file "sb-pg-plus.xpm" :ascent center)) "Image used for closed files with stuff in them.") @@ -4290,6 +4302,7 @@ IMAGESPEC is the image data, and DOCSTRING is documentation for the image." (defvar speedbar-expand-image-button-alist '(("<+>" . speedbar-directory-plus) ("<->" . speedbar-directory-minus) + ("< >" . speedbar-directory) ("[+]" . speedbar-page-plus) ("[-]" . speedbar-page-minus) ("[?]" . speedbar-page) From 97db3e8acbb80eb282a9a3c873d8ad46f6922f6a Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Wed, 11 Aug 2004 20:59:27 +0000 Subject: [PATCH 115/341] (Help): Fix texinfo usage. --- man/help.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/help.texi b/man/help.texi index 050e600759b..3f7419981d2 100644 --- a/man/help.texi +++ b/man/help.texi @@ -63,7 +63,7 @@ match for @var{topic}, a regular expression. @xref{Apropos}. @item C-h i d m emacs @key{RET} i @var{topic} @key{RET} This looks up @var{topic} in the indices of the Emacs on-line manual. If there are several matches, Emacs displays the first one. You can then -press @key{,} to move to other matches, until you find what you are +press @kbd{,} to move to other matches, until you find what you are looking for. @item C-h i d m emacs @key{RET} s @var{topic} @key{RET} From d2aa2c2b5b8109e1054409f15d4ccdbb94d9255e Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Wed, 11 Aug 2004 21:08:49 +0000 Subject: [PATCH 116/341] *** empty log message *** --- man/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/man/ChangeLog b/man/ChangeLog index ab7bea36fcf..80e8da24f96 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2004-08-11 Luc Teirlinck + + * help.texi (Help): Fix Texinfo usage. + 2004-08-11 Martin Stjernholm * cc-mode.texi: Various updates for CC Mode 5.30.9. From 42e1fd33d7b28a2cd674b8b80637d42fc5aeb193 Mon Sep 17 00:00:00 2001 From: Daniel Pfeiffer Date: Thu, 12 Aug 2004 07:30:05 +0000 Subject: [PATCH 117/341] *** empty log message *** --- lisp/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2ebc52c42ef..2645cdbefa3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -6,7 +6,7 @@ (speedbar-insert-files-at-point): Take an extra argument and use it to optionally find out if a subdir is empty. Also unreadable files don't get expand buttons. - (speedbar-directory-plus): New image (bitmap already existed unused). + (speedbar-directory): New image (unused pixmap already existed). (speedbar-expand-image-button-alist): Use it. 2004-08-11 Martin Stjernholm From fa460eaf0727a31564b6236c853767945a01fc83 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 13 Aug 2004 01:27:30 +0000 Subject: [PATCH 118/341] (Spelling): Fix typo. --- man/ChangeLog | 4 ++++ man/fixit.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/man/ChangeLog b/man/ChangeLog index 80e8da24f96..326bd4b3dbf 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2004-08-12 Luc Teirlinck + + * fixit.texi (Spelling): Fix typo. + 2004-08-11 Luc Teirlinck * help.texi (Help): Fix Texinfo usage. diff --git a/man/fixit.texi b/man/fixit.texi index c7078c30b03..84121842b8c 100644 --- a/man/fixit.texi +++ b/man/fixit.texi @@ -339,7 +339,7 @@ a different standard dictionary. Ispell uses a separate dictionary for word completion. The variable @code{ispell-complete-word-dict} specifies the file name of this dictionary. The completion dictionary must be different because it -cannot use employ root and affix information. For some languages +cannot use root and affix information. For some languages there is a spell checking dictionary but no word completion dictionary. From 977d0bea229c79030c69cf510609ab070b8d86a6 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 13 Aug 2004 21:36:12 +0000 Subject: [PATCH 119/341] (Basic Keyboard Macro, Save Keyboard Macro): Fix typos. --- man/kmacro.texi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/man/kmacro.texi b/man/kmacro.texi index be2b520fc59..8965c4f2167 100644 --- a/man/kmacro.texi +++ b/man/kmacro.texi @@ -165,7 +165,7 @@ to plain @kbd{C-x (} followed by retyping the whole definition so far. As a consequence it re-executes the macro as previously defined. You can also add to the end of the definition of the last keyboard -macro without re-execuing it by typing @kbd{C-u C-u C-x (}. +macro without re-executing it by typing @kbd{C-u C-u C-x (}. The variable @code{kmacro-execute-before-append} specifies whether a single @kbd{C-u} prefix causes the existing macro to be re-executed @@ -218,7 +218,7 @@ of the macro ring. The definition of the new head macro is displayed in the echo area. You can continue to rotate the macro ring immediately by repeating just @kbd{C-n} and @kbd{C-p} until the desired macro is at the head of the ring. To execute the new macro -ring head immediately, just type @kbd{C-k}. +ring head immediately, just type @kbd{C-k}. @findex kmacro-view-macro-repeat @kindex C-x C-k C-v @@ -361,7 +361,7 @@ register as a counter, incrementing it on each repetition of the macro. @findex name-last-kbd-macro @kindex C-x C-k n If you wish to save a keyboard macro for later use, you can give it -a name using @kbd{C-x C-k n} (@code{name-last-kbd-macro}). +a name using @kbd{C-x C-k n} (@code{name-last-kbd-macro}). This reads a name as an argument using the minibuffer and defines that name to execute the macro. The macro name is a Lisp symbol, and defining it in this way makes it a valid command name for calling with @kbd{M-x} or for @@ -377,7 +377,7 @@ key using @kbd{C-x C-k b} (@code{kmacro-bind-to-key}) followed by the key sequence you want the keyboard macro to be bound to. You can bind to any key sequence in the global keymap, but since most key sequences already have other bindings, you should select the key -sequence carefylly. If you try to bind to a key sequence with an +sequence carefully. If you try to bind to a key sequence with an existing binding (in any keymap), you will be asked if you really want to replace the existing binding of that key. @@ -448,7 +448,7 @@ keyboard input that you would use to invoke the macro---@kbd{C-x e} or @findex kmacro-step-edit-macro @kindex C-x C-k SPC You can interactively and stepwise replay and edit the last keyboard -macro one command at a time by typing @kbd{C-x C-k SPC} +macro one command at a time by typing @kbd{C-x C-k SPC} (@code{kmacro-step-edit-macro}). Unless you quit the macro using @kbd{q} or @kbd{C-g}, the edited macro replaces the last macro on the macro ring. From d48102cf5fa56a2f0f29f6b576b372b4f2216a0e Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 14 Aug 2004 01:12:08 +0000 Subject: [PATCH 120/341] (RegNumbers): Mention `C-x r i' binding for `insert-register', instead of `C-x r g' binding, for consistency. --- man/ChangeLog | 5 +++++ man/regs.texi | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 326bd4b3dbf..dcaf7867125 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2004-08-13 Luc Teirlinck + + * regs.texi (RegNumbers): Mention `C-x r i' binding for + `insert-register', instead of `C-x r g' binding, for consistency. + 2004-08-12 Luc Teirlinck * fixit.texi (Spelling): Fix typo. diff --git a/man/regs.texi b/man/regs.texi index ab1ef42e2f1..7268dd72446 100644 --- a/man/regs.texi +++ b/man/regs.texi @@ -30,8 +30,8 @@ Display a description of what register @var{r} contains. * Text: RegText. Saving text in registers. * Rectangle: RegRect. Saving rectangles in registers. * Configurations: RegConfig. Saving window configurations in registers. -* Files: RegFiles. File names in registers. * Numbers: RegNumbers. Numbers in registers. +* Files: RegFiles. File names in registers. * Bookmarks:: Bookmarks are like registers, but persistent. @end menu @@ -185,11 +185,11 @@ Store @var{number} into register @var{r} (@code{number-to-register}). @findex increment-register Increment the number in register @var{r} by @var{number} (@code{increment-register}). -@item C-x r g @var{r} +@item C-x r i @var{r} Insert the number from register @var{r} into the buffer. @end table - @kbd{C-x r g} is the same command used to insert any other sort of + @kbd{C-x r i} is the same command used to insert any other sort of register contents into the buffer. @kbd{C-x r +} with no numeric argument increments the register value by 1; @kbd{C-x r n} with no numeric argument stores zero in the register. From 78642e03de5db7d943198e4f6b52e98a1704360e Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 14 Aug 2004 10:01:55 +0000 Subject: [PATCH 121/341] (forward-word): Allow 0 args. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/bytecomp.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2645cdbefa3..c0caca8e94e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-08-14 John Paul Wallington + + * emacs-lisp/bytecomp.el (forward-word): Allow 0 args. + 2004-08-11 Daniel Pfeiffer * speedbar.el (speedbar-scan-subdirs): New option. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index a4ae751cab7..0a12f6fae9f 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2900,7 +2900,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." (byte-defop-compiler char-after 0-1) (byte-defop-compiler set-buffer 1) ;;(byte-defop-compiler set-mark 1) ;; obsolete -(byte-defop-compiler19 forward-word 1) +(byte-defop-compiler19 forward-word 0-1) (byte-defop-compiler19 char-syntax 1) (byte-defop-compiler19 nreverse 1) (byte-defop-compiler19 car-safe 1) From 142941b8a65e96b63d1cad279c251d75a3533957 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Aug 2004 10:58:44 +0000 Subject: [PATCH 122/341] (../info/tramp, tramp.dvi): Depend on trampver.texi. --- man/ChangeLog | 4 ++++ man/Makefile.in | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index dcaf7867125..541ac26f3a9 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2004-08-14 Eli Zaretskii + + * Makefile.in (../info/tramp, tramp.dvi): Depend on trampver.texi. + 2004-08-13 Luc Teirlinck * regs.texi (RegNumbers): Mention `C-x r i' binding for diff --git a/man/Makefile.in b/man/Makefile.in index 468adf54844..ddf3fd320c8 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -279,9 +279,9 @@ speedbar.dvi: speedbar.texi emacs-mime.dvi: emacs-mime.texi $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-mime.texi -../info/tramp: tramp.texi +../info/tramp: tramp.texi trampver.texi cd $(srcdir); $(MAKEINFO) -D emacs tramp.texi -tramp.dvi: tramp.texi +tramp.dvi: tramp.texi trampver.texi $(ENVADD) $(TEXI2DVI) ${srcdir}/tramp.texi ../info/ses: ses.texi From 1daf07a2cca0e48aa0e4b1e8338c3b8e605e16b7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Aug 2004 11:33:02 +0000 Subject: [PATCH 123/341] Remove the lines which say "@true", to avoid running a Unixy shell and to reincarnate the "Nothing to be done for `all'" message from Make when there's nothing to be done. --- msdos/sedleim.inp | 1 + 1 file changed, 1 insertion(+) diff --git a/msdos/sedleim.inp b/msdos/sedleim.inp index f4795e749b8..bb81e7ec113 100644 --- a/msdos/sedleim.inp +++ b/msdos/sedleim.inp @@ -30,6 +30,7 @@ INSTALLDIR=. /touch stamp-subdir/s|touch|djecho "stamp-subdir" >| s|\([ ]\)echo|\1djecho|g +/^ @true *$/d /RUN-EMACS *=/,/^$/c\ export EMACSLOADPATH=${buildlisppath}\ From 3dab38a94eb11529fc680332addead4fbd8781a1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Aug 2004 12:01:01 +0000 Subject: [PATCH 124/341] Replace actual whitespace with the magic string that causes help-with-tutorial to automatically insert the correct amount. --- etc/TUTORIAL.es | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/etc/TUTORIAL.es b/etc/TUTORIAL.es index 9cd6100e84f..e4850649c7d 100644 --- a/etc/TUTORIAL.es +++ b/etc/TUTORIAL.es @@ -18,32 +18,8 @@ ocasi Nota importante: para terminar la sesión de Emacs teclee C-x C-c (dos caracteres). Los caracteres ">>" en el margen izquierdo indican instrucciones para que usted trate de usar un comando. Por ejemplo: - - - - - - - - - - - - -[Mitad de página en blanco para propósitos didácticos. El texto - continúa abajo] - - - - - - - - - - - - +<> +[Mitad de página en blanco para propósitos didácticos. El texto continúa abajo] >> Ahora teclee C-v (ver la próxima pantalla) para desplazarse a la siguiente pantalla (hágalo manteniendo la tecla control oprimida mientras teclea v). Desde ahora debería hacer esto From bed6d708744793275ccb9daf258e6c6a6a1618b0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Aug 2004 12:21:03 +0000 Subject: [PATCH 125/341] (battery-linux-proc-acpi): Look into battery directories matching the literal string "CMB", too (required for Linux kernel version 2.6.7). --- lisp/battery.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/battery.el b/lisp/battery.el index 73d78067571..3b44ff891f9 100644 --- a/lisp/battery.el +++ b/lisp/battery.el @@ -290,7 +290,7 @@ The following %-sequences are provided: nil t) (setq low (+ (or low 0) (string-to-int (match-string 1)))))))) - (directory-files "/proc/acpi/battery/" t "BAT"))) + (directory-files "/proc/acpi/battery/" t "\\(BAT\\|CMB\\)"))) (and capacity rate (setq minutes (if (zerop rate) 0 (floor (* (/ (float (if (string= charging-state From ab5a4a32caeff74defe45849579627e00fad395c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Aug 2004 12:22:40 +0000 Subject: [PATCH 126/341] *** empty log message *** --- etc/ChangeLog | 6 ++++++ lisp/ChangeLog | 6 ++++++ msdos/ChangeLog | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index c26a8a7d786..79add1e3434 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,9 @@ +2004-08-14 Eric Hanchrow + + * TUTORIAL.es: Replace actual whitespace with the magic string + that causes help-with-tutorial to automatically insert the correct + amount. + 2004-08-10 Steven Tamm * PROBLEMS: Remove description of Mac OS version upgrade diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c0caca8e94e..e096d4242be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-08-14 Kurt Hornik (tiny change) + + * battery.el (battery-linux-proc-acpi): Look into battery + directories matching the literal string "CMB", too (required for + Linux kernel version 2.6.7). + 2004-08-14 John Paul Wallington * emacs-lisp/bytecomp.el (forward-word): Allow 0 args. diff --git a/msdos/ChangeLog b/msdos/ChangeLog index 6d221726b7e..1722153dc51 100644 --- a/msdos/ChangeLog +++ b/msdos/ChangeLog @@ -1,3 +1,9 @@ +2004-08-14 Eli Zaretskii + + * sedleim.inp: Remove the lines which say "@true", to avoid + running a Unixy shell and to reincarnate the "Nothing to be done + for `all'" message from Make when there's nothing to be done. + 2004-05-11 Eli Zaretskii * sedleim.inp (distclean): Remove stamp-subdirs. From 723addaeae514f6418c135c85ec0d006c9d14d1c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Aug 2004 12:32:24 +0000 Subject: [PATCH 127/341] Mention the thumbs.el package. --- etc/NEWS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 2d8b10e81ec..c25c07ea724 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1966,9 +1966,12 @@ source files. See the Flymake's Info manual for more details. of hierarchical data as an outline. For example, the tree-widget is well suited to display a hierarchy of directories and files. -** The wdired.el package allows you to use normal editing commands on dired +** The wdired.el package allows you to use normal editing commands on Dired buffers to change filenames, permissions, etc... +** The thumbs.el package allows you to preview image files as thumbnails +and can be invoked from a Dired buffer. + ** The new python.el package is used to edit Python and Jython programs. ** The URL package (which had been part of W3) is now part of Emacs. From 750286732b38be5e14ef809b4ea5e108d7903bfe Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 14 Aug 2004 12:46:46 +0000 Subject: [PATCH 128/341] (syms_of_minibuf) : Doc fix. --- src/minibuf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/minibuf.c b/src/minibuf.c index dd7bb42263b..d50e7404ab3 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -2673,7 +2673,10 @@ property of a history variable overrides this default. */); Vcompletion_auto_help = Qt; DEFVAR_BOOL ("completion-ignore-case", &completion_ignore_case, - doc: /* Non-nil means don't consider case significant in completion. */); + doc: /* Non-nil means don't consider case significant in completion. + +See also `read-file-name-completion-ignore-case' concerning case significance +in completion when reading a file name. */); completion_ignore_case = 0; DEFVAR_BOOL ("enable-recursive-minibuffers", &enable_recursive_minibuffers, From d35c2489f7f05a1648c0293182b00088b3b2880e Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 14 Aug 2004 12:47:42 +0000 Subject: [PATCH 129/341] (Fread_file_name): Doc fix. --- src/fileio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index a05b1cb8340..5acfee7c02c 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6193,7 +6193,10 @@ DIR should be an absolute directory name. It defaults to the value of If this command was invoked with the mouse, use a file dialog box if `use-dialog-box' is non-nil, and the window system or X toolkit in use -provides a file dialog box. */) +provides a file dialog box. + +See also `read-file-name-completion-ignore-case' +and `read-file-name-function'. */) (prompt, dir, default_filename, mustmatch, initial, predicate) Lisp_Object prompt, dir, default_filename, mustmatch, initial, predicate; { From 08e3de6956fcee57077a2f8fe9e51add6b3d0aae Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Aug 2004 12:48:39 +0000 Subject: [PATCH 130/341] Remove accidental changes of March 4. Fix backing up when a regexp isearch is made more general. Use symbolic accessor functions for isearch stack frames to make usage clearer. (search-whitespace-regexp): Made groups in documentation shy (as is the group in the default value). (isearch-fallback): New function, addresses problems with regexps liberalized by `\|', adds support for liberalization by `\}' (the general repetition construct), and incorporates behavior for `*'/`?'. (isearch-}-char): New command, calls `isearch-fallback' with arguments appropriate to a typed `}'. (isearch-*-char, isearch-|-char): Now just call `isearch-fallback' appropriately. (isearch-mode-map): Bind `}' to `isearch-}-char'. (isearch-string, isearch-message,string, isearch-point, isearch-success, isearch-forward-flag, isearch-other-end, isearch-word, isearch-invalid-regexp, isearch-wrapped, isearch-barrier, isearch-within-brackets, isearch-case-fold-search): New inline functions to read fields of a stack frame. --- lisp/isearch.el | 234 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 155 insertions(+), 79 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index a5261d2530c..3ec972a39ec 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -153,9 +153,9 @@ string, and RET terminates editing and does a nonincremental search." (defcustom search-whitespace-regexp "\\(?:\\s-+\\)" "*If non-nil, regular expression to match a sequence of whitespace chars. This applies to regular expression incremental search. -You might want to use something like \"[ \\t\\r\\n]+\" instead. -In the Customization buffer, that is `[' followed by a space, -a tab, a carriage return (control-M), a newline, and `]+'." +You might want to use something like \"\\\\(?:[ \\t\\r\\n]+\\\\)\" instead. +In the Customization buffer, that is `\\(?:[' followed by a space, +a tab, a carriage return (control-M), a newline, and `]+\\)'." :type 'regexp :group 'isearch) @@ -298,11 +298,11 @@ Default value, nil, means edit the string instead." (define-key map "\M-\C-y" 'isearch-yank-char) (define-key map "\C-y" 'isearch-yank-line) - ;; Define keys for regexp chars * ? |. + ;; Define keys for regexp chars * ? } |. ;; Nothing special for + because it matches at least once. (define-key map "*" 'isearch-*-char) (define-key map "?" 'isearch-*-char) - (define-key map "{" 'isearch-{-char) + (define-key map "}" 'isearch-}-char) (define-key map "|" 'isearch-|-char) ;; Turned off because I find I expect to get the global definition--rms. @@ -372,9 +372,9 @@ Default value, nil, means edit the string instead." (defvar isearch-cmds nil "Stack of search status sets. -Each set is a list of the form: - (STRING MESSAGE POINT SUCCESS FORWARD OTHER-END WORD - INVALID-REGEXP WRAPPED BARRIER WITHIN-BRACKETS CASE-FOLD-SEARCH)") +Each set is a vector of the form: + [STRING MESSAGE POINT SUCCESS FORWARD OTHER-END WORD + INVALID-REGEXP WRAPPED BARRIER WITHIN-BRACKETS CASE-FOLD-SEARCH]") (defvar isearch-string "") ; The current search string. (defvar isearch-message "") ; text-char-description version of isearch-string @@ -773,6 +773,74 @@ REGEXP says which ring to use." ;; (isearch-clean-overlays) ;; (handle-switch-frame (car (cdr last-command-char)))) + +;; The search status structure and stack. + +(defsubst isearch-string (frame) + "Return the search string in FRAME." + (aref 0 frame)) +(defsubst isearch-message-string (frame) + "Return the search string to display to the user in FRAME." + (aref 1 frame)) +(defsubst isearch-point (frame) + "Return the point in FRAME." + (aref 2 frame)) +(defsubst isearch-success (frame) + "Return the success flag in FRAME." + (aref 3 frame)) +(defsubst isearch-forward-flag (frame) + "Return the searching-forward flag in FRAME." + (aref 4 frame)) +(defsubst isearch-other-end (frame) + "Return the other end of the match in FRAME." + (aref 5 frame)) +(defsubst isearch-word (frame) + "Return the search-by-word flag in FRAME." + (aref 6 frame)) +(defsubst isearch-invalid-regexp (frame) + "Return the regexp error message in FRAME, or nil if its regexp is valid." + (aref 7 frame)) +(defsubst isearch-wrapped (frame) + "Return the search-wrapped flag in FRAME." + (aref 8 frame)) +(defsubst isearch-barrier (frame) + "Return the barrier value in FRAME." + (aref 9 frame)) +(defsubst isearch-within-brackets (frame) + "Return the in-character-class flag in FRAME." + (aref 10 frame)) +(defsubst isearch-case-fold-search (frame) + "Return the case-folding flag in FRAME." + (aref 11 frame)) + +(defun isearch-top-state () + (let ((cmd (car isearch-cmds))) + (setq isearch-string (isearch-string cmd) + isearch-message (isearch-message-string cmd) + isearch-success (isearch-success cmd) + isearch-forward (isearch-forward-flag cmd) + isearch-other-end (isearch-other-end cmd) + isearch-word (isearch-word cmd) + isearch-invalid-regexp (isearch-invalid-regexp cmd) + isearch-wrapped (isearch-wrapped cmd) + isearch-barrier (isearch-barrier cmd) + isearch-within-brackets (isearch-within-brackets cmd) + isearch-case-fold-search (isearch-case-fold-search cmd)) + (goto-char (isearch-point cmd)))) + +(defun isearch-pop-state () + (setq isearch-cmds (cdr isearch-cmds)) + (isearch-top-state)) + +(defun isearch-push-state () + (setq isearch-cmds + (cons (vector isearch-string isearch-message (point) + isearch-success isearch-forward isearch-other-end + isearch-word + isearch-invalid-regexp isearch-wrapped isearch-barrier + isearch-within-brackets isearch-case-fold-search) + isearch-cmds))) + ;; Commands active while inside of the isearch minor mode. @@ -1249,53 +1317,93 @@ might return the position of the end of the line." (isearch-update)) -(defun isearch-{-char () - "Handle \{ specially in regexps." - (interactive) - (isearch-*-char t)) - -;; *, ?, and | chars can make a regexp more liberal. +;; *, ?, }, and | chars can make a regexp more liberal. ;; They can make a regexp match sooner or make it succeed instead of failing. ;; So go back to place last successful search started ;; or to the last ^S/^R (barrier), whichever is nearer. ;; + needs no special handling because the string must match at least once. -(defun isearch-*-char (&optional want-backslash) - "Handle * and ? specially in regexps. -When WANT-BACKSLASH is non-nil, do special handling for \{." - (interactive) - (if isearch-regexp - (let ((idx (length isearch-string))) - (while (and (> idx 0) - (eq (aref isearch-string (1- idx)) ?\\)) - (setq idx (1- idx))) - ;; * and ? are special when not preceded by \. - ;; { is special when it is preceded by \. - (when (= (mod (- (length isearch-string) idx) 2) - (if want-backslash 1 0)) - (setq isearch-adjusted t) - ;; Get the isearch-other-end from before the last search. - ;; We want to start from there, - ;; so that we don't retreat farther than that. - ;; (car isearch-cmds) is after last search; - ;; (car (cdr isearch-cmds)) is from before it. - (let ((cs (nth 5 (car (cdr isearch-cmds))))) - (setq cs (or cs isearch-barrier)) - (goto-char - (if isearch-forward - (max cs isearch-barrier) - (min cs isearch-barrier))))))) +(defun isearch-backslash (str) + "Return t if STR ends in an odd number of backslashes." + (= (mod (- (length str) (string-match "\\\\*\\'" str)) 2) 1)) + +(defun isearch-fallback (want-backslash &optional allow-invalid to-barrier) + "Return point to previous successful match to allow regexp liberalization. +\\ +Respects \\[isearch-repeat-forward] and \\[isearch-repeat-backward] by +stopping at `isearch-barrier' as needed. + +Do nothing if a backslash is escaping the liberalizing character. If +WANT-BACKSLASH is non-nil, invert this behavior (for \\} and \\|). + +Do nothing if regexp has recently been invalid unless optional ALLOW-INVALID +non-nil. + +If optional TO-BARRIER non-nil, ignore previous matches and go exactly to the +barrier." + ;; (eq (not a) (not b)) makes all non-nil values equivalent + (when (and isearch-regexp (eq (not (isearch-backslash isearch-string)) + (not want-backslash)) + ;; We have to check 2 stack frames because the last might be + ;; invalid just because of a backslash. + (or (not isearch-invalid-regexp) + (not (isearch-invalid-regexp (cadr isearch-cmds))) + allow-invalid)) + (if to-barrier + (progn (goto-char isearch-barrier) + (setq isearch-adjusted t)) + (let* ((stack isearch-cmds) + (previous (cdr stack)) ; lookbelow in the stack + (frame (car stack))) + ;; Walk down the stack looking for a valid regexp (as of course only + ;; they can be the previous successful match); this conveniently + ;; removes all bracket-sets and groups that might be in the way, as + ;; well as partial \{\} constructs that the code below leaves behind. + ;; Also skip over postfix operators -- though horrid, + ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly legal. + (while (and previous + (or (isearch-invalid-regexp frame) + (let* ((string (isearch-string frame)) + (lchar (aref string (1- (length string))))) + ;; The operators aren't always operators; check + ;; backslashes. This doesn't handle the case of + ;; operators at the beginning of the regexp not + ;; being special, but then we should fall back to + ;; the barrier anyway because it's all optional. + (if (isearch-backslash + (isearch-string (car previous))) + (eq lchar ?\}) + (memq lchar '(?* ?? ?+)))))) + (setq stack previous previous (cdr previous) frame (car stack))) + (when stack + ;; `stack' now refers the most recent valid regexp that is not at + ;; all optional in its last term. Now dig one level deeper and find + ;; what matched before that. + (let ((last-other-end (or (isearch-other-end (car previous)) + isearch-barrier))) + (goto-char (if isearch-forward + (max last-other-end isearch-barrier) + (min last-other-end isearch-barrier))) + (setq isearch-adjusted t)))))) (isearch-process-search-char last-command-char)) +;; * and ? are special when not preceded by \. +(defun isearch-*-char () + "Maybe back up to handle * and ? specially in regexps." + (interactive) + (isearch-fallback nil)) +;; } is special when it is preceded by \. +(defun isearch-}-char () + "Handle \\} specially in regexps." + (interactive) + (isearch-fallback t t)) + +;; | is special when it is preceded by \. (defun isearch-|-char () - "If in regexp search, jump to the barrier." + "If in regexp search, jump to the barrier unless in a group." (interactive) - (if isearch-regexp - (progn - (setq isearch-adjusted t) - (goto-char isearch-barrier))) - (isearch-process-search-char last-command-char)) + (isearch-fallback t nil t)) (defun isearch-unread-key-sequence (keylist) "Unread the given key-sequence KEYLIST. @@ -1774,38 +1882,6 @@ If there is no completion possible, say so and continue searching." (delete-field) (insert isearch-string)))) - -;; The search status stack (and isearch window-local variables, not used). -;; Need a structure for this. - -(defun isearch-top-state () - (let ((cmd (car isearch-cmds))) - (setq isearch-string (car cmd) - isearch-message (car (cdr cmd)) - isearch-success (nth 3 cmd) - isearch-forward (nth 4 cmd) - isearch-other-end (nth 5 cmd) - isearch-word (nth 6 cmd) - isearch-invalid-regexp (nth 7 cmd) - isearch-wrapped (nth 8 cmd) - isearch-barrier (nth 9 cmd) - isearch-within-brackets (nth 10 cmd) - isearch-case-fold-search (nth 11 cmd)) - (goto-char (car (cdr (cdr cmd)))))) - -(defun isearch-pop-state () - (setq isearch-cmds (cdr isearch-cmds)) - (isearch-top-state)) - -(defun isearch-push-state () - (setq isearch-cmds - (cons (list isearch-string isearch-message (point) - isearch-success isearch-forward isearch-other-end - isearch-word - isearch-invalid-regexp isearch-wrapped isearch-barrier - isearch-within-brackets isearch-case-fold-search) - isearch-cmds))) - ;; Message string @@ -1936,9 +2012,9 @@ Can be changed via `isearch-search-fun-function' for special needs." (if isearch-success nil ;; Ding if failed this time after succeeding last time. - (and (nth 3 (car isearch-cmds)) + (and (isearch-success (car isearch-cmds)) (ding)) - (goto-char (nth 2 (car isearch-cmds))))) + (goto-char (isearch-point (car isearch-cmds))))) ;; Called when opening an overlay, and we are still in isearch. From 42f47086223bd96ad5abbd695646526ce4742391 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 14 Aug 2004 12:49:12 +0000 Subject: [PATCH 131/341] (Frestore_buffer_modified_p): Doc fix. --- src/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer.c b/src/buffer.c index f55ae7983f4..bade501b1a7 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1077,7 +1077,7 @@ A non-nil FLAG means mark the buffer modified. */) DEFUN ("restore-buffer-modified-p", Frestore_buffer_modified_p, Srestore_buffer_modified_p, 1, 1, 0, - doc: /* Like `set-buffer-modified-p', with a differences concerning redisplay. + doc: /* Like `set-buffer-modified-p', with a difference concerning redisplay. It is not ensured that mode lines will be updated to show the modified state of the current buffer. Use with care. */) (flag) From e11d1dd9e1355bae0c909f0ca8082ee169f08021 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Aug 2004 12:50:24 +0000 Subject: [PATCH 132/341] *** empty log message *** --- etc/ChangeLog | 4 ++++ lisp/ChangeLog | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index 79add1e3434..33d187a36da 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2004-08-14 Romain Francoise + + * NEWS: Mention the thumbs.el package. + 2004-08-14 Eric Hanchrow * TUTORIAL.es: Replace actual whitespace with the magic string diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e096d4242be..8da17e4d0f6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,26 @@ +2004-08-14 Davis Herring + + * isearch.el: Remove accidental changes of March 4. Fix backing + up when a regexp isearch is made more general. Use symbolic + accessor functions for isearch stack frames to make usage clearer. + (search-whitespace-regexp): Made groups in documentation shy (as + is the group in the default value). + (isearch-fallback): New function, addresses problems with regexps + liberalized by `\|', adds support for liberalization by `\}' (the + general repetition construct), and incorporates behavior for + `*'/`?'. + (isearch-}-char): New command, calls `isearch-fallback' with + arguments appropriate to a typed `}'. + (isearch-*-char, isearch-|-char): Now just call `isearch-fallback' + appropriately. + (isearch-mode-map): Bind `}' to `isearch-}-char'. + (isearch-string, isearch-message,string, isearch-point, + isearch-success, isearch-forward-flag, isearch-other-end, + isearch-word, isearch-invalid-regexp, isearch-wrapped, + isearch-barrier, isearch-within-brackets, + isearch-case-fold-search): + New inline functions to read fields of a stack frame. + 2004-08-14 Kurt Hornik (tiny change) * battery.el (battery-linux-proc-acpi): Look into battery From 01a6fd47315d605a8f8e54dff33a38f04b078bac Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 14 Aug 2004 13:44:54 +0000 Subject: [PATCH 133/341] (read-file-name-completion-ignore-case): Add. (blink-cursor-alist): Change version to "21.4". --- lisp/cus-start.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 5e237cd0db7..c9ce8f8474c 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -121,6 +121,7 @@ (const :tag "always" t))) ;; fileio.c (insert-default-directory minibuffer boolean) + (read-file-name-completion-ignore-case minibuffer boolean "21.4") ;; fns.c (use-dialog-box menu boolean "21.1") (use-file-dialog menu boolean "21.4") @@ -264,7 +265,7 @@ :format "%v") (other :tag "Unlimited" t))) (unibyte-display-via-language-environment mule boolean) - (blink-cursor-alist cursor alist "21.5") + (blink-cursor-alist cursor alist "21.4") ;; xfaces.c (scalable-fonts-allowed display boolean) ;; xfns.c From 6dad1714dbc14c28b3ea54bd32744b6ff0ac2d76 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 14 Aug 2004 13:51:44 +0000 Subject: [PATCH 134/341] *** empty log message *** --- lisp/ChangeLog | 3 +++ src/ChangeLog | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8da17e4d0f6..c10c342abe5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -29,6 +29,9 @@ 2004-08-14 John Paul Wallington + * cus-start.el (read-file-name-completion-ignore-case): Add. + (blink-cursor-alist): Change version to "21.4". + * emacs-lisp/bytecomp.el (forward-word): Allow 0 args. 2004-08-11 Daniel Pfeiffer diff --git a/src/ChangeLog b/src/ChangeLog index 3f9b6d85e51..dc39a6d24b9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-08-14 John Paul Wallington + + * buffer.c (Frestore_buffer_modified_p): Doc fix. + + * fileio.c (Fread_file_name): Doc fix. + + * minibuf.c (syms_of_minibuf) : Doc fix. + 2004-08-09 Luc Teirlinck * keymap.c (Fmake_keymap, Fmap_keymap, Fwhere_is_internal): Doc fixes. From f0d73c14e2c9b9329a86ed8092f9329823598638 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Sun, 15 Aug 2004 22:00:06 +0000 Subject: [PATCH 135/341] Upgraded to MH-E version 7.4.80. See etc/MH-E-NEWS and lisp/mh-e/ChangeLog for details. --- etc/ChangeLog | 4 + etc/MH-E-NEWS | 368 ++++- etc/NEWS | 2 +- lisp/mh-e/ChangeLog | 2008 ++++++++++++++++++++++++++- lisp/mh-e/mh-alias.el | 207 ++- lisp/mh-e/mh-comp.el | 450 +++--- lisp/mh-e/mh-customize.el | 2770 ++++++++++++++++++++----------------- lisp/mh-e/mh-e.el | 524 +++---- lisp/mh-e/mh-funcs.el | 97 +- lisp/mh-e/mh-gnus.el | 36 +- lisp/mh-e/mh-identity.el | 296 ++-- lisp/mh-e/mh-inc.el | 8 +- lisp/mh-e/mh-index.el | 225 +-- lisp/mh-e/mh-junk.el | 450 +++--- lisp/mh-e/mh-loaddefs.el | 513 +++---- lisp/mh-e/mh-mime.el | 288 +++- lisp/mh-e/mh-pick.el | 39 +- lisp/mh-e/mh-seq.el | 214 ++- lisp/mh-e/mh-speed.el | 33 +- lisp/mh-e/mh-utils.el | 741 +++++----- 20 files changed, 6154 insertions(+), 3119 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 33d187a36da..3c6ac1e165b 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2004-08-15 Bill Wohler + + * NEWS, MH-E-NEWS: Upgraded to MH-E version 7.4.80. + 2004-08-14 Romain Francoise * NEWS: Mention the thumbs.el package. diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS index 5bea16d91ba..264acf8ead1 100644 --- a/etc/MH-E-NEWS +++ b/etc/MH-E-NEWS @@ -6,6 +6,372 @@ Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +* Changes in MH-E 7.4.80 + +Version 7.4.80 now supports GNU mailutils, S/MIME, picons, +which-func-mode, has an improved interface for hiding header fields, +improves upon the MH variant detection, and contains many bug fixes. +Those of you familiar with the GNU version numbering schemes will +recognize this as an alpha release. This does not reflect on the +quality of this release which is as high as it has always been. +Although we are not ready to release 8.0, we want you to have access +to the work that has been hiding in CVS. At the same time we want to +make it clear that there are incompatible changes with previous +versions. + +We are planning to release the long-awaited manual update synchronized +with version 8.0. We are using documentation from the manual in the +docstrings which is hoped to make "C-h f (describe-function)" really +useful and create a seamless experience when switching back and forth +between the manual and the docstrings. This has been done in about +half of the variables and functions in this version. + +The writing of the manual has revealed a few inconsistencies in the +software whose fixes have resulted in incompatible changes, and there +may well be more. So, unlike version 7 which was chock full of new +features, version 8's strengths will include complete documentation +and higher quality. + +** New Features in MH-E 7.4.80 + +*** GNU mailutils Support + +MH-E now supports GNU mailutils 0.4 and higher versions. + +*** S/MIME Support + +MH-E now supports S/MIME using Gnus 5.10.6 or higher. + +*** Picon Support + +In addition to the other methods of displaying an icon for the sender +of a message, MH-E can now display images from a picon directory. The +directory search path is found in the `mh-picon-directory-list' +variable. More documentation is found in the "facedb" sections in the +xfaces man page. [NOTE: need to make mh-picon-directory-list an option +and add xfaces facedb documentation to it.] + +*** X-Image-URL Updates + +Now support the use of `curl' and `fetch' as alternatives to `wget' to +obtain the image. The display of images are controlled with the +`mh-show-use-xface-flag' option while the `mh-fetch-x-image-url' +option controls how the images are fetched. + +WARNING: There are security concerns with this feature. Please read +the documentation for these options carefully before changing the +default. + +*** Updates to mh-identity-list + +Note that the field names found in `mh-identity-list' that refer to +the fields in `mh-identity-handlers' have changed in an incompatible +way from 7.4.4. In general, the symbolic names now have a ":" prefix +to avoid collisions with header fields. Before starting Emacs, edit +your .emacs and insert ":" before "signature" if you have defined it. + +You can change your attribution in replies with the new "Attribution +Verb" field, and you can set your default GPG user ID with the "GPG +key ID" field. + +Signatures can now be read from the `mh-signature-file-name' variable, +or come from a function, in addition to a named file. If you write +your own function, variables that you can use include +`mh-signature-separator-regexp', `mh-signature-separator', +and `mh-signature-separator-p'. + +The handling of these fields has been moved into a new +`mh-identity-handlers' option, an alist of fields (strings) and +handlers (functions). Strings are lowercase. Use ":signature" for +Signature and ":pgg-default-user-id" for GPG Key ID. The function +associated with the string "default" is used if no other functions are +appropriate. For this reason, don't name a header field "Default". + +If you point your signature at a vCard file with a vcf suffix, then it +will be incorporated as a vCard body part (closes SF #802723). + +*** Catchup Command + +There is a new "F c (mh-catchup)" command that marks all unread +messages in the current folder as read. + +*** Change Content-Type Renderer on the Fly in MH-Show Buffer + +This has been implemented by adding the key binding "K e +(mh-display-with-external-viewer)". For inline text/html parts, +buttons aren't displayed by default. In that case use "K t +(mh-toggle-mime-buttons)" to display the button before viewing it with +an external browser (closes SF #839318). + +*** Use which-func-mode to Display Folder in Index Mode + +Turning on `which-func-mode' displays the folder name of the message +under the cursor in index folders (closes SF #855520). + +*** Render Signature and vCard in Italics + +This has been implemented. Use `mh-show-signature-face' to customize +the face used (closes SF #802722). + +*** New Print Map + +There is now a keymap for the printing functions whose prefix is "P". +The command "l (mh-print-msg)" has been replaced with "P l". Other new +functions in this keymap include: + + P A mh-ps-print-toggle-mime + P C mh-ps-print-toggle-color + P F mh-ps-print-toggle-faces + P M mh-ps-print-toggle-mime + P f mh-ps-print-msg-file + P l mh-print-msg + P p mh-ps-print-msg + P s mh-ps-print-msg-show + +*** Draft Buffer Keymap Changes + +The keymap in the draft buffer has been modified slightly. The old +anonymous ftp and tar composition commands have been reinstated and +letter signing and encrypting keymaps have been added. + +The type of signing or encryption has been generalized so the method +is now an option rather than a part of the function's name. The option +is `mh-mml-method-default' and choices include PGP (MIME), PGP, +S/MIME, or none. + +Key 7.4.4 7.4.80 + +C-c RET C-e mh-mml-secure-message-encrypt-pgpmime + mh-mml-secure-message-encrypt +C-c RET C-s mh-mml-secure-message-sign-pgpmime + - +C-c RET C-g - mh-mhn-compose-anon-ftp +C-c RET C-n - mh-mml-unsecure-message +C-c RET C-s - mh-mml-secure-message-sign +C-c RET C-t - mh-mhn-compose-external-compressed-tar +C-c RET C-s mh-mml-secure-message-sign-pgpmime + mh-mml-secure-message-sign +C-c RET C-x - mh-mhn-compose-external-type +C-c RET e mh-mml-secure-message-encrypt-pgpmime + Prefix Command +C-c RET e e - mh-mml-secure-message-encrypt +C-c RET e s - mh-mml-secure-message-signencrypt +C-c RET g - mh-mhn-compose-anon-ftp +C-c RET n - mh-mml-unsecure-message +C-c RET s mh-mml-secure-message-sign-pgpmime + Prefix Command +C-c RET s e - mh-mml-secure-message-signencrypt +C-c RET s s - mh-mml-secure-message-sign +C-c RET t - mh-mhn-compose-external-compressed-tar +C-c RET x - mh-mhn-compose-external-type + +*** Speedbar: Highlight Folders With Unseen + +The speedbar now renders the folders with unseen messages in boldface +which makes them easier to identify (closes SF #623369). + +*** Quick Key Help + +The "? (mh-help)" function now displays the help in its own buffer +called *MH-E Help* (closes SF #493740 and SF #656631). + +*** New Startup File mh-e-autoloads.el + +If you are installing MH-E yourself, then you can replace any +autoloads you may have with "(require 'mh-e-autoloads.el)". See the +README for details. + +*** Glimpse Support Removed + +Since glimpse isn't free, we cannot mention it. Glimpse has been +removed from the option `mh-indexer-choices' (closes SF #831276). + +*** mh-msg-is-in-seq Update + +Can now specify an alternate message number to "S s +(mh-msg-is-in-seq)" with a prefix argument. + +** New Variables in MH-E 7.4.80 + +Variables that have been added to MH-E that have not been discussed +elsewhere are listed here. + +*** mail-citation-hook + +Hook for modifying a citation just inserted in the mail buffer. + +*** mh-alias-reloaded-hook + +Invoked by `mh-alias-reload' after reloading aliases. + +*** mh-auto-fields-prompt-flag + +Non-nil means to prompt before sending if fields in +`mh-auto-fields-list' are inserted. + +*** mh-default-folder-for-message-function + +Function to select a default folder for refiling or `Fcc'. + +*** mh-forward-hook + +Invoked on the forwarded letter by "f (mh-forward)". + +*** mh-invisible-header-fields-default + +List of hidden header fields. The header fields listed in this option +are hidden, although you can check off any field that you would like +to see. Header fields that you would like to hide that aren't listed +can be added to the `mh-invisible-header-fields' option (closes SF +#752045). + +The option `mh-visible-header-fields' has been deleted. + +*** mh-junk-background + +If on, spam programs are run in background. This used to be the +default behavior but this could overwhelm a system if many messages +were black- or whitelisted at once. The spam programs are now run in +the foreground, but this option can be used to put them back in the +background. + +*** mh-signature-separator-flag + +Non-nil means a signature separator should be inserted. It is not +recommended that you change this option since various mail user +agents, including MH-E, use the separator to present the signature +differently, and to suppress the signature when replying or yanking a +letter into a draft. + +*** mh-variant + +Specifies the variant used by MH-E. The default setting of this option +is `Auto-detect' which means that MH-E will automatically choose the +first of nmh, MH, or GNU mailutils that it finds in the directories +listed in `mh-path', `mh-sys-path', and `exec-path'. If, for example, +you have both nmh and mailutils installed and `mh-variant-in-use' was +initialized to nmh but you want to use mailutils, then you can set +this option to `mailutils'. + +When this variable is changed, MH-E resets `mh-progs', `mh-lib', +`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use' +accordingly. + +If you've set these variables in your .emacs, it is strongly suggested +that you comment them out. The MH detection code has been completely +rewritten and it is very likely that you no longer to set them and +their setting may confuse other MH-E settings. + +** Variables Deleted in MH-E + +Variables that have been removed from MH-E that have not been +discussed elsewhere are listed here. + +*** mh-alias-system-aliases + +System definitions should not be a user option. + +*** mh-junk-mail-folder + +Since this variable can accept values other than folder names, it was +renamed to `mh-junk-disposition' to more accurately reflect the content. + +** Bug Fixes in MH-E 7.4.80 + +Many bugs were fixed in this version that aren't listed below. + +*** mh-extract-rejected-mail Can't Do MIME (and Other Formats) + +Now handles qmail and exim bounces (addresses SF #404965). + +*** mh-rmail Hangs in XEmacs + +We've determined that MH-E is incompatible with some versions of +XEmacs (21.5.9-21.5.16). More recent versions work fine. If you think +our list is too broad, please let us know which version of XEmacs you +are using (closes SF #644321). + +*** Inconsistent Prompts + +Prompt formats are now consistent throughout the application (closes +SF #730470). + +*** Empty Shell Comments Confuse mh-mhn-directive-present-p + +If you had a string that matched the regexp "^# $" in your draft, it +would cause an error. This has been fixed (closes SF #762458). + +*** Quote Hashes When mhbuild Directives Used + +A related bug, if you had empty shell comments but inserted your own +directives, you'd get another error from mhbuild. This has been fixed +by quoting the hash ("^# $") like this "##" before submitting to +mhbuild (closes SF #762464). + +*** Inconsistent Usage in Scan Formatting Variables + +The variables: + + mh-note-cur + mh-note-deleted + mh-note-dist + mh-note-forw + mh-note-refiled + mh-note-repl + mh-note-seq + +used to contain strings. Although only the first character was read, +the entire string would be inserted which may have caused problems. +These variables have been converted to character constants so that +only a single character can be inserted into the scan line (closes SF +#770772). + +*** Bad Handling of Aliases That Conflict With Local User Names + +If a user name existed both locally and in the aliases file, the local +user would be flashed, but the alias would be used when sending. This +has been fixed so that the user name that is flashed is the same as +the name that is sent (closes SF #772595). + +*** Args out of range + +In rare and non-reproducible circumstances, compilation sometimes +threw an "Args out of range" error. Nonetheless, this has been fixed +(closes SF #806577). + +*** mh-forward hard-codes '-mime' Switch on nmh + +Added new option `mh-compose-forward-as-mime-flag' that controls whether +messages are forwarded as MIME attachments (closes SF #827203). + +*** Not Re-prompted to Sign After Pass Phrase Typo + +If there were errors when sending a signed message (like getting the +pass phrase wrong), the MML markup remained in the draft buffer. The +draft buffer is now restored if there is an error (closes SF #839303). + +*** Font-lock Gets Confused in MH-Letter Buffer + +If a user manually moved the cursor to the end of the header field +separator line (by mouse click or keyboard navigation) and hit Enter +to start typing their message, any line in the body with a colon would +be fontified with a gray background. This has been fixed (closes SF +#855479). + +*** mh-refile-msg Fails to Suggest Folder for Empty Message + +If you received a message with an empty body from someone who is +listed in your aliases file, "o (mh-refile-msg)" failed to suggest the +correct folder. This has been fixed (closes SF #917096). + +*** Error Visiting Folder With no Unseen Messages + +If you visited a folder without unseen messages and the option "flist: +-noshowzero" is present in your ~/.mh_profile, you'd get an error. This +has been fixed (closes SF #933954). + + + * Changes in MH-E 7.4.4 Version 7.4.4 addresses programmatic issues from the FSF and prepares @@ -18,7 +384,7 @@ code moved here from desktop.el. * Changes in MH-E 7.4.3 -Version 7.4.3 fixes the problem where mh-identity-list was not getting +Version 7.4.3 fixes the problem where `mh-identity-list' was not getting set from .emacs. * Changes in MH-E 7.4.2 diff --git a/etc/NEWS b/etc/NEWS index c25c07ea724..43af2c90549 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -658,7 +658,7 @@ You can now put the init files .emacs and .emacs_SHELL under ** MH-E changes. -Upgraded to MH-E version 7.4.4. There have been major changes since +Upgraded to MH-E version 7.4.80. There have been major changes since version 5.0.2; see MH-E-NEWS for details. +++ diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 3d19028b099..645e9a1bd6d 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,239 @@ +2004-08-15 Bill Wohler + + * Released MH-E version 7.4.80. + + * MH-E-NEWS, README: Updated for release 7.4.80. + + * mh-e.el (Version, mh-version): Updated for release 7.4.80. + +2004-08-15 Bill Wohler + + * mh-funcs.el, mh-gnus.el, mh-inc.el, mh-init.el, mh-junk.el, + mh-pick.el, mh-print.el, mh-xemacs.el: Added 2004 to Copyright. + + * mh-acros.el, mh-alias.el: Checkdoc fixes. + +2004-08-12 Satyaki Das + + * mh-acros.el (cl): Load cl in this file. That is all right, since + this file is only used at compile time, and so cl doesn't get + loaded at run time. This avoids problems with stale *.elc files + present in the Emacs source tree during compilation. + (mh-defstruct): Modify it to make it more CL like and in the + process simplify it a bit. This makes the argument list of the + constructor compatible with the previous version, thereby avoiding + a compilation error when an old version of mh-seq.elc is present. + + * mh-seq.el (mh-thread-id-container, mh-thread-get-message) + (mh-thread-get-message-container): Revert back to the CL style + of using keyword arguments, since the mh-defstruct now produces + code compatible to such usage. + +2004-08-11 Satyaki Das + + * mh-acros.el (mh-defstruct, mh-require-cl): Checkdoc fixes. + + * mh-utils.el (message-tokenize-header, message-fetch-field): Add + autoloads. + (mh-folder-completing-read): Make the folder completion look + better with CVS Emacs. + + * mh-init.el (mh-variant-set): Remove dead code. + +2004-08-11 Bill Wohler + + * *.el: Use the following at the top of each file which seems to + do a good job of suppressing compilation warnings in 21.3 and CVS + Emacs (21.4). This replaces (require 'cl) or (require + 'utils) (mh-require-cl) calls: + + (eval-when-compile (require 'mh-acros)) + (mh-require-cl) + +2004-08-10 Bill Wohler + + * release-utils (DESCRIPTION): Added one. + (FILES, SEE ALSO, VERSION): Deleted empty and incorrect sections. + + * mh-e.el (mh-colors-available-p): Call x-display-color-cells with + mh-funcall-if-exists since it no longer seems to be defined in + GNU Emacs 21.4. + +2004-08-10 Satyaki Das + + * mh-speed.el (mh-process-kill-without-query, mh-speed-flists): + Avoid a compiler warning in versions of Emacs where + process-kill-without-query is a deprecated function. + + * mh-seq.el (mh-thread-message, mh-thread-container): Use + mh-defstruct instead of defstruct. + (mh-thread-id-container, mh-thread-get-message-container) + (mh-thread-get-message): Use the slightly different structure + constructor function. + + * mh-acros.el (mh-defstruct): New macro which is a partial + replacement of the defstruct in CL. + (no-byte-compile): Don't compile the file since it isn't loaded at + run time, so efficiency isn't an issue. + + * mh-utils.el (mh-buffer-data): Use mh-defstruct instead of + defstruct. + +2004-08-09 Satyaki Das + + * mh-funcs.el, mh-junk.el, mh-print.el: Use mh-require-cl to avoid + compilation warnings in Emacs-21.3. + + * mh-acros.el (mh-require-cl): Add autoloads of CL functions used. + +2004-08-09 Bill Wohler + + * mh-customize.el (mh-show-use-xface-flag): Mention that `fetch' and + `curl' are supported as well. + +2004-08-08 Bill Wohler + + * mh-xemacs.el (mh-xemacs-has-toolbar-flag): Checkdoc fixes. + + * mh-mime.el (mh-display-with-external-viewer): Checkdoc fixes. + + * mh-identity.el: (mh-identity-attribution-verb-end): Stripped + trailing space; checkdoc fixes. + + * mh-e.el (mh-restore-desktop-buffer): Checkdoc fixes. + + * mh-customize.el: (mh-inc-spool-list, + mh-compose-forward-as-mime-flag, defcustom): Stripped trailing + space; checkdoc fixes. + + * mh-comp.el (mh-reply): Stripped trailing space. + + * mh-unit.el (mh-unit-files): Added mh-acros.el and mh-gnus.el. + (mh-unit): Don't lm-verify pre-21.4. Save buffers before killing + since we might have done some editing. + + * import-emacs: Deleted. Functionality subsumed by release-utils. + + * release-utils: New script. Performs import-emacs functionality + and displays new and deleted options. + + * Makefile (import-emacs): Call release-utils instead of + import-emacs. + + * mh-funcs.el (mh-undo-folder): Removed deprecated `ignore' + argument. + + * mh-e.el (mh-scan-date-regexp): Deleted as Peter claims it is + obsolete. + (mh-folder-font-lock-keywords): Removed reference to deleted + variable `mh-scan-date-regexp'. + + * mh-customize.el (mh-auto-fields-prompt-flag): Made reference to + `mh-auto-fileds-lists'. + (mh-forward-hook): Fixed docstring typo. + +2004-08-07 Bill Wohler + + * mh-acros.el: New file. Currently holds macros needed by + mh-customize.el but is planned to hold all macros to avoid + dependency problems when compiling. + + * mh-utils.el (mh-xemacs-flag): Defined in mh-customize.el now. + (mh-require-cl, mh-do-in-gnu-emacs, mh-do-in-xemacs) + (mh-funcall-if-exists, mh-make-local-hook, mh-mark-active-p): + Moved to new file mh-acros.el. + + * mh-customize.el: Require mh-acros and cl only when compiling and + mh-loaddefs at runtime instead of mh-utils. + (mh-xemacs-flag): Define it here instead of mh-utils.el. + + * Makefile (MH-E-SRC): Added mh-acros.el. + + * mh-gnus.el (default-enable-multibyte-characters): Don't define + any more. It doesn't seem to be needed. + + * mh-customize.el (mh-junk-background): New variable. If on, spam + programs are run in background. Running in foreground can be slow. + Defaults to nil to spare machines with little memory. + + * mh-junk.el (mh-spamassassin-blacklist, mh-bogofilter-blacklist) + (mh-bogofilter-whitelist, mh-spamprobe-blacklist) + (mh-spamprobe-whitelist): Use new option mh-junk-background. + +2004-07-25 Satyaki Das + + * mh-utils.el (mh-folder-completing-read): In recent CVS Emacs, + the first letter of the possible choices in the completion buffer + is highlighted. The change is needed for this feature to work + during folder name completion. This is not entirely sufficient, + since the leading "+" in folder names is still mishandled. A patch + is required in Emacs itself to address that. + +2004-07-22 Mark D. Baushke + + * mh-e.el (recursive-load-depth-limit): Move + recursive-load-depth-limit code to ... + * mh-utils.el (recursive-load-depth-limit): ... here to avoid + problems compiling mh-utils.el and mh-alias.el with gnus-5.10.6 + under emacs-21.1. Use eval-and-compile instead of eval-when. + +2004-07-20 Bill Wohler + + * mh-customize.el (mh-invisible-header-fields-internal): Added + header fields emitted by T-Mobile picture phones (X-Mms-*, and + commented out X-Operator field saying it's like X-Mailer). + +2004-07-12 Bill Wohler + + * mh-gnus.el: Set local variables indent-tabs-mode and + sentence-end-double-space to nil. + + * mh-customize.el: Checkpoint from option docstring updates and + manual synchronization from last summer. For the options listed + below, docstring was usually completely rewritten. Use "on" + instead of "t" in docstring to match what is seen in customization + buffer. Use headline capitalization. Standardize on "Auto-detect" + text when option has that capibility. + (mh): Since we work on more than one type of Emacs, use Emacs + instead of GNU Emacs. Prefer GNU mailutils over GNU Mailutils. + (mh-variant): s/Autodetect at startup/Auto-detect/. + (mh-alias-insertion-location): s/Sorted + alphabetically/Alphabetical/. s/At the top of file/Top/. s/At the + bottom of file/Bottom/. + (mh-alias-local-users-prefix): s/Use login instead of real + name/Use Login/. + (mh-identity-list): Sorted values by fields, attribution, + signature, GPG key. + (mh-auto-fields-list): Missing quote. + (mh-compose-insertion): s/Use Gnus/Gnus/. s/Use mhn/mhn/. + (mh-compose-space-does-completion-flag): s/SPACE//. + (mh-extract-from-attribution-verb): Since we have French, added + German too ;-). + (mh-letter-complete-function): Mention default in docstring. + (mh-invisible-header-fields-internal): Added X-ELNK-Trace from + Earthlink. + (mh-alias-flash-on-comma, mh-alias-insert-file) + (mh-alias-passwd-gecos-comma-separator-flag) + (mh-recenter-summary-flag, mh-default-folder-for-message-function) + (mh-default-folder-must-exist-flag, mh-index-program) + (mh-index-ticked-messages-folders, mh-ins-buf-prefix) + (mh-delete-yanked-msg-window-flag, mh-identity-default): See + summary above. + + * mh-init.el (mh-variant-set, mh-sys-path, mh-variant-mu-mh-info): + Prefer GNU mailutils over GNU Mailutils MH. + + * mh-comp.el (sc-cite-original, mh-smail, mh-smail-batch) + (mh-edit-again, mh-extract-rejected-mail, mh-forward) + (mh-smail-other-window, mh-reply, mh-send, mh-send-other-window): + Use `mh-send' instead of \\[mh-send]] since links in the docstring + are more useful than a key sequence in these cases. Use "See also" + instead of "See also documentation for". + + * Merged in 7.4.4 changes, described below. + + * mh-e.el (Version, mh-version): Set to 7.4.4+cvs. + 2004-07-10 Bill Wohler * Released MH-E version 7.4.4. @@ -66,7 +302,7 @@ require that the cl package not be required at runtime. However, the cl package in versions of Emacs prior to 21.4 left cl routines in their macro expansions. Use mh-require-cl to provide the cl - routines in the best way possible. + routines in the best way possible (closes SF #930012). (require 'mouse): To shush compiler. * Use new function mh-require-cl throughout. @@ -87,6 +323,128 @@ 4. Run xbmtopbm < file.xbm > file.pbm. Thanks to jan.h.d@swipnet.se for the help. +2004-07-07 Stephen Gildea + + * mh-customize.el (mh-invisible-header-fields-internal): + Add X-Greylist, X-Source*, and X-WebTV-Signature. + Replace specific X-Spam-* headers with general pattern. + +2004-06-15 Bill Wohler + + * README: Vladimir Ivanovic reports that mh-rmail works with + XEmacs 21.5.17, so updated requirements text accordingly (closes + SF #644321). + +2004-05-12 Satyaki Das + + * mh-utils.el (mh-mail-header-end): Replace call to + rfc822-goto-eoh with something that allows From_ lines in the mail + header. + +2004-04-14 Bill Wohler + + * mh-utils.el (mh-show-mouse): s/EVENT/event/. Thanks to John Paul + Wallington for pointing this out. + +2004-04-12 Satyaki Das + + * mh-e.el (mh-folder-size-flist): Add -showzero option so that the + parsing code doesn't get confused by the presence of -noshowzero + in the user's .mh_profile (closes SF #933954). + +2004-04-07 Satyaki Das + + * mh-mime.el (mh-insert-mime-button) + (mh-insert-mime-security-button): Add evaporate property to + overlays used in MIME part buttons. This avoids problems with + CVS Emacs. + +2004-03-16 Satyaki Das + + * mh-e.el (mh-folder-from-address): Go to the end of buffer if the + re-search-forward fails (closes SF #917096). + +2004-02-02 Satyaki Das + + * mh-customize.el (mh-compose-forward-as-mime-flag): New user + customizable variable that controls whether messages are forwarded + as MIME attachments (closes SF #827203). + + * mh-comp.el (mh-forward): Call forw with -mime option only if + mh-compose-forward-as-mime-flag is non-nil. + +2003-12-26 Jeffrey C Honig + + * mh-junk.el (mh-junk-blacklist, mh-junk-whitelist) + (mh-spamassassin-blacklist, mh-spamassassin-blacklist) + (mh-spamassassin-blacklist, mh-spamassassin-whitelist) + (mh-spamassassin-whitelist, mh-bogofilter-blacklist) + (mh-spamprobe-blacklist): Add progress messages. Change "Couldn't" + to "Unable" in error messages. Run bogofilter and spamprobe in + the foreground to prevent a large number of processes from + swamping the system. + +2003-12-25 Satyaki Das + + * mh-e.el (mh-prompt-for-refile-folder): Marking the whole folder + and then refiling all messages throws an error, since this + function expects point to be on a valid scan line. The change + relaxes this requirement, thereby avoiding the above problem. + +2003-12-14 Satyaki Das + + * mh-comp.el (mh-ascii-buffer-p): New function that checks if a + buffer is entirely composed of ASCII. + (mh-send-letter): Encode the draft if it contains non-ASCII + characters. + +2003-12-12 Satyaki Das + + * mh-customize.el (mh-invisible-headers): Keep only unique fields + in list of header fields to hide. This avoids problems in XEmacs. + +2003-12-10 Satyaki Das + + * mh-seq.el (mh-thread-print-scan-lines): The imenu index was not + getting created for threaded index buffers. The change fixes this. + + * mh-index.el (mh-index-insert-folder-headers): Always create the + imenu index. + (mh-index-create-imenu-index): Set which-func-mode to t. If + which-function-mode is turned on after the folder buffer has been + prepared, display of the folder info was being inhibited. The + change fixes that. + +2003-12-09 Satyaki Das + + * mh-comp.el (mh-letter-mode): Setup mh-mail-header-separator + based on draft contents. + (mh-letter-mode, mh-letter-mail-header-end-marker) + (mh-letter-header-end): Remove use of the variable + mh-letter-mail-header-end-marker. Instead use + mh-mail-header-separator. This avoids problems in font locking + draft buffers (closes SF #855479). + +2003-12-09 Satyaki Das + + * mh-index.el (mh-index-insert-folder-headers): Modified so that + imenu--index-alist is updated. + (mh-index-create-imenu-index): New function that generates an + index usable by imenu. This adds which-func-mode support to index + folders (closes SF #855520). + + * mh-e.el (which-func, which-func-modes): Tell which-func that + mh-folder-mode supports it. + (mh-folder-mode): Add support for imenu. + +2003-11-22 Peter S Galbraith + + * Makefile: renamed mh-startup.el to mh-e-autoloads.el + + * README: renamed mh-startup.el to mh-e-autoloads.el + + * .cvsignore: Added mh-e-autoloads.el + 2003-11-18 Bill Wohler * Released MH-E version 7.4.3. @@ -95,6 +453,8 @@ * mh-e.el (Version, mh-version): Updated for release 7.4.3. + * This patch release contains the following two patches: + * mh-identity.el (mh-identity-make-menu): Removed condition on mh-auto-fields-list. Use it to enable or disable menu item instead. @@ -103,6 +463,810 @@ defcustom before mh-auto-fields-list so that defvar wouldn't clobber user's customization settings. +2003-11-17 Jeffrey C Honig + + * mh-print.el (mh-print-msg): Do not print a message on deprecated + usage, the bindings have been removed. + + * mh-e.el (mh-folder-mode-map): Remove "l" binding for + mh-print-msg. + + * mh-utils.el (mh-show-mode-map): Remove "l" binding for + mh-print-msg. + +2003-11-16 Satyaki Das + + * mh-comp.el (mh-beginning-of-word): Use the function + mh-mail-abbrev-make-syntax-table instead of the function + mail-abbrev-make-syntax-table. + + * mh-gnus.el (mh-mail-abbrev-make-syntax-table): Add a wrapper + function that calls mail-abbrev-make-syntax-table if available. + This is needed so that MH-E built with CVS Emacs will work with + released versions of Emacs21 and vice versa. + +2003-11-14 Peter S Galbraith + + * mh-customize.el (mh-invisible-header-fields-internal): Add + "X-NAI-Spam-" and "X-Spam-Report:". + +2003-11-14 Mark D. Baushke + + * mh-customize.el (mh-invisible-header-fields-internal): + Add X-AntiAbuse and X-MailScanner. + (Patch from Stephen Gildea.) + +2003-11-13 Peter S Galbraith + + * mh-identity.el (mh-identity-handler-attribution-verb): New + function. A new Identity handler for the attribution verb (e.g. + "wrote:") to allow for different identities to use different + languages. + (mh-identity-insert-attribution-verb): New function. Insert the + attribution verb, placing special markers so it can be deleted and + replaced later. + (mh-identity-attribution-verb-start): New variable. Holds the + marker for the start of the attribution verb. + (mh-identity-attribution-verb-end): New variable. Holds the + marker for the end of the attribution verb. + + * mh-customize.el (mh-identity-handlers): Add new + ":attribution-verb" tag for the attribution-verb handler. + (mh-identity-list): Idem. + + * mh-comp.el (mh-yank-cur-msg): Insert attribution verb using + mh-identity-insert-attribution-verb. + (mh-extract-from-attribution): Extract only the name from the From + line, without appending `mh-extract-from-attribution-verb' since + markers need to be inserted around that now. + +2003-11-12 Bill Wohler + + * mh-e.el (mh-rmail, mh-nmail): Well, actually, we run in both GNU + Emacs and XEmacs, so removed the "GNU" in the docstrings unless + one is strictly talking about GNU Emacs. + + * mh-comp.el (mh-smail, mh-smail-batch, mh-smail-other-window): + Ditto. + +2003-11-11 Bill Wohler + + * mh-customize.el (mh-customize): Minor docstring change. + (mh, mh-e): The short description for MH-E is: The GNU Emacs + Interface to the MH Mail System. Therefore, updated docstrings + accordingly. + + * mh-comp.el (mh-smail, mh-smail-batch, mh-smail-other-window): + Ditto. + + * mh-e.el (mh-rmail, mh-nmail): Ditto. + +2003-11-10 Satyaki Das + + * mh-mime.el (mh-mml-to-mime): In case errors happen in + mml-to-mime, restore contents of the draft buffer (closes SF + #839303). + +2003-11-07 Bill Wohler + + * mh-customize.el (mh-letter-mode-hook): Moved to mh-sending-mail + group (where it is now documented in the manual). + (mh-pick-mode-hook): Moved to mh-index group (where it is now + documented in the manual). + + * mh-loaddefs.el: Deleted per our discussion on mh-e-devel. No + more conflicts! No more check-ins! Anyone pulling CVS MH-E is + expected to compile. This file shall be added to the tarball so + that users of the distribution are not. + +2003-11-07 Mark D. Baushke + + * mh-loaddefs.el: Regenerated. + + * mh-customize.el (mh-forward-hook): Define new hook. + * mh-comp.el (mh-forward): Use it. + +2003-11-07 Satyaki Das + + * mh-loaddefs.el: Regenerated. + + * mh-utils.el (mh-show-toggle-mime-buttons) + (mh-show-display-with-external-viewer): New interactive functions + callable from the show buffer. + (mh-show-mime-map): Add bindings for "K t" and "K e". + (mh-show-msg): Propagate change to + mh-display-buttons-for-inline-parts-flag to the show buffer. + + * mh-mime.el (mh-display-with-external-viewer): New interactive + function to display MIME parts with external viewer (closes SF + #839318). + + * mh-e.el (mh-folder-mode): Make the variable + mh-display-buttons-for-inline-parts-flag buffer-local so that + display of MIME buttons can be toggled. + (mh-toggle-mime-buttons): New interactive function to toggle + display of MIME buttons. + (mh-mime-map): Modified to add bindings for "K t" and "K e". + +2003-11-04 Steve Youngs + + * Makefile (XEMACS_LOADDEFS_FILE): New. Used to generate mh-loaddefs.el + in XEmacs. + (XEMACS_LOADDEFS_COOKIE): Ditto. + (XEMACS_LOADDEFS_PKG_NAME): Ditto. + (xemacs): Add target to build mh-loaddefs.el in XEmacs + (clean-xemacs): Remove `mh-loaddefs.el*' + (loaddefs-xemacs): New rule to build mh-loaddefs.el in XEmacs. + +2003-11-02 Peter S Galbraith + + * mh-init.el (mh-variant-set-variant): Reset `mh-x-mailer-string' + when we select an MH variant. + +2003-11-02 Jeffrey C Honig + + * mh-loaddefs.el: Regenerated. + + * mh-funcs.el (mh-print-msg): Move to mh-print.el. + + * mh-e.el (mh-folder-mode-map): Add mh-print-msg ("l") back, it + will print a message that this usage is deprecated. + + * mh-print.el (require, mh-ps-print-msg, mh-ps-print-msg-file): + Require mh-funcs for mh-note-printed. PS print functions were not + setting the printed notation. Move mh-print-msg here for + consistency. Print message if mh-print-msg invoked via deprecated + key binding. + +2003-11-01 Peter S Galbraith + + * Makefile: Add target to make `mh-startup.el', a file containg + usual entry commands into MH-E to be used for users installing + MH-E separately from Emacs. + + * README: Document the above for users. + +2003-10-29 Jeffrey C Honig + + * mh-utils.el (mh-show-ps-print-map): Add "?" and "l" to + mh-show-ps-print-map. + + * mh-e.el (mh-ps-print-map, mh-help-messages): Add "?" and "l" to + mh-ps-print-map. Add "l" to help message. + +2003-10-27 Bill Wohler + + * Makefile (MH-E-SRC): Moved mh-xemacs.el to new variable + MH-E-XEMACS-SRC. + (MH-E-XEMACS-SRC): New variable to hold XEmacs source files. + (MH-E-XEMACS-OBJ): New variable to hold XEmacs object files. + (clean): Moved XEmacs-specific code to clean-xemacs. + (xemacs): Added clean-xemacs prerequisite. Moved down to + XEmacs section of file. + (clean-xemacs): New target to remove XEmacs-specific files. + (compile-xemacs): Added $(MH-E-XEMACS-SRC) prerequisite. + (dist): Added $(MH-E-XEMACS-SRC) to tarball. + +2003-10-27 Satyaki Das + + * mh-loaddefs.el: Regenerated. + + * mh-index.el (mh-indexer-choices): Remove option for the non-free + glimpse indexer (closes SF #831276). + (mh-glimpse-binary, mh-glimpse-directory) + (mh-glimpse-execute-search, mh-glimpse-next-result): Functions + and variables to implement glimpse support are removed. + + * mh-customize.el (mh-index-program): Remove option for glimpse. + +2003-10-24 Satyaki Das + + * mh-customize.el: Remove top-level test for toolbar enabled + XEmacs since it is not needed. + (mh-tool-bar-define): Add test for XEmacs toolbar in the functions + mh-toolbar-init, mh-tool-bar-letter-buttons-set and + mh-tool-bar-folder-buttons-set. This enables proper compilation + irrespective of whether the XEmacs was built with toolbar support + or not. + + * mh-comp.el (mh-letter-mode): Remove conditional since it is not + needed. + + * mh-e.el (mh-folder-mode): Same as above. + + * mh-utils.el (mh-show-mode): Same as above. + + * mh-xemacs.el (mh-xemacs-icon-map): Remove condition on toolbar + presence since we want the build to work if XEmacs without + toolbars is used during compilation. + +2003-10-23 Bill Wohler + + * mh-customize.el: The Great Reorganization. Sorted groups + alphabetically. Aligned variables in customization groups with + manual sections. Group docstrings changed to match manual chapter + titles. + +2003-10-22 Satyaki Das + + * mh-speed.el (timer): Avoid compiler warning in XEmacs. + +2003-10-22 Steve Youngs + + * Makefile (XEMACS_OPTIONS): Add '-no-autoloads' to give a cleaner + build environment. + (AUTO_PRELOADS): Removed, in favour of 'AUTOLOAD_PACKAGE_NAME' and + 'AUTOLOAD_FILE'. + (AUTOLOAD_PACKAGE_NAME): New. + (AUTOLOAD_FILE): New. + (all): Don't set $EMACS_HOME if building with XEmacs. + (xemacs): Use 'compile-xemacs' instead of 'compile'. + (auto-autoloads.elc): Use new $AUTOLOAD_* vars and allow for + '-no-autoloads'. + (custom-load.elc): Allow for '-no-autoloads'. + (compile-xemacs): New. It allows for the '-no-autoloads' option + and byte-compiles all the source files with a single instance of + XEmacs. + + * mh-e.el (mh-folder-mode): Only load the toolbar in XEmacs if + toolbar support is available. + + * mh-comp.el (mh-letter-mode): Only load the toolbar in XEmacs if + toolbar support is available. + + * mh-customize.el: Require 'mh-xemacs' at toplevel when + 'mh-xemacs-flag' is non-nil. + Wrap all the toolbar code in a test that is true if using + GNU/Emacs or a toolbar-enabled XEmacs. + + * mh-print.el (mh-ps-spool-a-msg): Comment out + `clean-message-header-flag' because it isn't used anywhere. + + * mh-utils.el (mh-show-mode): Only load the toolbar in XEmacs if + toolbar support is available. + + * mh-xemacs.el: Autoload `regexp-opt', `customize-group', + `view-mode', `with-electric-help', `pp', `sort-numeric-fields', + `reverse-region', and `goto-address' at compile time. + (mh-xemacs-has-toolbar-flag): New. This is non-nil when XEmacs + has toolbar support. + (mh-xemacs-toolbar-*-icon): Use it. + +2003-10-21 Mark D. Baushke + + * mh-identity.el (mh-identity-field-handler): Fields that begin + with ":" must have an mh-identity-handler defined or the user + gets an error. + +2003-10-17 Peter S Galbraith + + * mh-customize.el (mh-identity-list): This change affects users! + The keyword "signature" becomes ":signature". The recently added + keyword "pgg-default-user-id" becomes ":pgg-default-user-id". + (mh-auto-fields-list): The keyword "Identity" becomes ":identity". + (mh-identity-handlers): Idem for signature and pgg-default-user-id. + + * mh-comp.el (mh-insert-auto-fields): Idem for Identity. + +2003-10-17 Peter S Galbraith + + * mh-xemacs.el: Add eval-and-compile call to (load "toolbar" t t) to + make sure `toolbar-make-button-list' is defined. We can't use + require because Emacs doesn't have this library. + +2003-10-16 Bill Wohler + + * mh-customize.el (mh-signature-file-name) + (mh-letter-insert-signature-hook): Merge docstring with manual. + + * mh-comp.el (mh-file-is-vcard-p): Checkdoc fix. + (mh-insert-signature): Merge docstring with manual. + + * mh-customize.el (mh-junk): Changed manual link in defgroup from + Customizing mh-e to Junk. + (mh-junk-function-alist): Moved SpamAssassin to first in list on + the hunch that it is the most popular and should be chosen if + other anti-spam programs exist. + (mh-junk-mail-folder): Since the variable can accept values other + than folder names, renamed to mh-junk-disposition to more + accurately reflect the content. Merge docstring with manual. + (mh-junk-program): Moved SpamAssassin to the top of the menu for + the same reason presented in mh-junk-function-alist. Also, fixed + case of spam programs to match official usage. Merge docstring + with manual. + + * mh-junk.el (mh-junk-blacklist): + s/mh-junk-mail-folder/mh-junk-disposition/. Merge docstring with + manual. + (mh-junk-whitelist): Merge docstring with manual. + (mh-bogofilter-blacklist): No longer suggest using automatic + classification so use -s instead of -Ns. + (mh-bogofilter-whitelist): No longer suggest using automatic + classification so use -n instead of -Sn. + (mh-spamassassin-blacklist, mh-spamassassin-whitelist): Merge + docstring with manual. Moved spamassassin functions to top of file + so functions appear in same order that they are presented in menu. + +2003-10-09 Peter S Galbraith + + * mh-customize.el (mail-citation-hook): Moved from mh-comp.el and + made into a defcustom. + +2003-10-09 Satyaki Das + + * mh-loaddefs.el: Regenerated. + + * mh-comp.el (mh-get-header-field): Add autoload cookie. + + * mh-utils.el (mh-show-ps-print-toggle-mime) + (mh-show-ps-print-toggle-color, mh-show-ps-print-toggle-faces) + (mh-show-ps-print-msg-file, mh-show-ps-print-msg) + (mh-show-ps-print-msg-show): New interactive functions callable + from the show buffer. + (mh-show-ps-print-map): New key map for printing. + + * mh-e.el (mh-folder-mode-map): Remove key binding for + mh-print-msg. + (mh-ps-print-map): Add new key map for printing. + + * Makefile (MH-E-SRC): Add mh-print.el. + +2003-10-07 Satyaki Das + + * mh-utils.el (mh-x-image-url-fetch-image): In XEmacs, + make-temp-file is not present. So to avoid security problems, use + a temporary file in the user's home directory. This avoids issues + in creating files in a world-writable directory. + + * mh-mime.el (mh-signature-highlight): In Emacs, arrange for the + overlay to be freed when it is no longer needed. Also, implement + signature highlighting in XEmacs. + +2003-10-05 Satyaki Das + + * mh-mime.el (mh-mime-display, mh-mm-inline-message): Respect the + value of `mm-verify-option' and `mm-decrypt-option'. + (mh-mime-display-security): Rearrange code a bit to avoid too many + new lines being inserted when message verification/decryption is + carried out while the message is being read. Also use the + point-m{in|ax}-marker functions to make the function easier to read. + (mh-mime-security-press-button): Extend the function so that the + user can verify/decrypt messages while reading them. + + * mh-gnus.el (mm-possibly-verify-or-decrypt): Added to avoid + compiler warning with old Gnus. + + * mh-utils.el (mh-x-image-url-sane-p): New function which checks + if the URL in X-Image-URL is something we can handle. + (mh-x-image-url-display): Don't display image if the URL looks + malformed. + +2003-10-04 Mark D Baushke + + * mh-comp.el (mh-letter-menu): Simplify menu heading. + +2003-10-03 Mark D Baushke + + * mh-mime.el (mh-mml-query-cryptographic-method): Avoid + revisionist history and still provide a good default. + + * mh-comp.el (mh-letter-menu): Remove the Disable Security + parenthetical comment. + + * mh-loaddefs.el: Regenerated. + + * mh-customize.el (mh-mml-method-default): What method should be + used in secure directives. + + * mh-mime.el (mh-secure-message): New function used to generate + the mml security tags. + (mh-mml-unsecure-message): New wrapper function around + mml-unsecure-messages. + (mh-mml-secure-message-sign-pgpmime): Remove function. + (mh-mml-secure-message-encrypt-pgpmime): Ditto. + (mh-mml-cryptographic-method-history): New variable. + (mh-mml-query-cryptographic-method): New function. + (mh-mml-secure-message-encrypt): Ditto. + (mh-mml-secure-message-signencrypt): Ditto. + (mh-mml-secure-message-sign): Ditto. + + * mh-comp.el (mh-letter-menu, mh-letter-mode-help-messages, + (mh-letter-mode-map): Update to use new functions. + +2003-09-26 Satyaki Das + + * mh-seq.el (mh-interactive-range): The function has been + extended so that it now takes a default result to return if no + interactive prefix arg is given and no region is active. + + * mh-e.el (mh-add-sequence-notation): If transient-mark-mode is + on, then the active region is deactivated based on whether a user + sequence or a internal sequence is being notated. The change + removes this inconsistency. + (mh-catchup, mh-folder-map): A new interactive function to mark + messages as read has been added and bound to "F c" in the folder + mode. + + * mh-utils.el (mh-show-catchup, mh-show-folder-map): New + interactive function callable from show mode buffers has been + bound to "F c". + +2003-09-24 Bill Wohler + + * mh-customize.el (mh-clean-message-header-flag) + (mh-invisible-header-fields-default, mh-invisible-header-fields): + Merge docstring with manual. + +2003-09-24 Mark D. Baushke + + * mh-junk.el (mh-junk-blacklist): Junked messages should be put + into the mh-seen-list to avoid propagating the unseen sequence + into the spam folder. + + * mh-loaddefs.el: Regenerated. + + * mh-mime.el (mh-mml-secure-message-sign-pgpmime): Add an optional + dontsign argument to remove an existing secure message directive. + Update the docstring -- this fuction does not allow for + encrypt/sign, just sign directives. + + * mh-mime.el (mh-mml-secure-message-sign-pgpmime): Use + mml-insert-tag directly to provide a sender if + mh-identity-pgg-default-user-id is set. + (mh-mml-secure-message-encrypt-pgpmime): Use mml-insert-tag + directly to provide a sender if this message is to be both signed + and encrypted and mh-identity-pgg-default-user-id is set. + +2003-09-23 Bill Wohler + + * mh-alias.el (Commentary): Removed as it is now in the manual. + (mh-alias-system-aliases): Moved here from mh-customize.el. By + definition, "system" definitions are not user-visible, and user + filenames are in the the Aliasfile: profile component, so this + variable really shouldn't be a defcustom + (mh-alias-tstamp, mh-alias-filenames, mh-alias-reload) + (mh-alias-add-alias, mh-alias-grab-from-field) + (mh-alias-add-address-under-point, mh-alias-apropos): Merge + docstring with manual. + (mh-alias-reload-maybe): Minor comment update. + (mh-alias-insert-file): Merge docstring with manual. Removed + "[press TAB]" from prompt since users should know about completion + and space can be used as well. + (mh-alias-for-from-p): No longer returns a surprising result (t if + there was **not** an alias for the From field) if the From header + field is missing. This function now returns what you would expect + a function of this name to return. Renamed from + mh-alias-from-has-no-alias-p since negatives in the function name + make logic harder to follow. + (mh-alias-add-alias-to-file): Merge docstring with manual. + Improved verbiage of prompt. Aliases are now inserted "[b]efore" + or "[a]fter" the existing alias instead of "[i]nsert" or + "[a]ppend." Note how the new usage flows better. + + * mh-customize.el (mh-alias): Changed manual link in defgroup from + Customizing mh-e to Aliases. + (mh-alias-grab-from-field button): mh-alias-from-has-no-alias-p + renamed to mh-alias-for-from-p and no longer returns surprising + value if there isn't a From field. Therefore, enable button if + there is a From header field and mh-alias-for-from-p returns nil. + (mh-letter-complete-function) + (mh-alias-completion-ignore-case-flag, mh-alias-flash-on-comma) + (mh-alias-insert-file, mh-alias-insertion-location) + (mh-alias-local-users, mh-alias-local-users-prefix) + (mh-alias-passwd-gecos-comma-separator-flag): Merge docstring with + manual. + (mh-alias-system-aliases): Moved to mh-alias.el. + + * mh-comp.el (mh-letter-complete-function-alist): Removed comment + about making this customizable since I didn't think it seemed + appropriate in the manual. + (mh-letter-complete): Merge docstring with manual. + +2003-09-23 Satyaki Das + + * mh-speed.el (mh-speed-flists): When exiting emacs, don't ask if + the flists process should be killed. + + * mh-e.el (mh-folder-message-menu): Enable undo menu entry only + if something can be undone. + + * mh-customize.el (undo): Enable undo button only if something + can be undone. + +2003-09-22 Peter S Galbraith + + * mh-customize.el (mh-identity-handlers): New defcustom. Alist of + Handler functions for mh-identity (downcased) fields. + (mh-identity-list): Add support for pgg-default-user-id. + + * mh-identity.el (mh-insert-identity): Modified to use + `mh-identity-handlers', adding hacking flexibility for those who + might need it. + (mh-identity-field-handler): New function. Return the handler for + a FIELD or nil if none set. The field name is downcased. + (mh-identity-handler-gpg-identity): New function; handler for pgg + pgp identities. It sets a buffer-local value for + `mh-pgg-default-user-id' which must be handled by mh-send-letter. + (mh-identity-pgg-default-user-id): New buffer-local variable to + hold the requested key ID. + (mh-identity-handler-signature): New function; handler t insert + and remove signature files. + (mh-identity-handler-default): New function; the default handler + to insert or remove generic field. + (mh-identity-handler-top): Insert a field at the top of the + header. + (mh-identity-handler-bottom): Insert a field at the bottom of the + header. + (mh-header-field-delete): Make more robust wrt the field having a + trailing colon or not. + (mh-identity-make-menu): Add a "Customize Identities" menu entry. + + * mh-loaddefs.el: Regenerated. + +2003-09-21 Peter S Galbraith + + * mh-init.el (mh-variant-set): Bug fix for mh-variant long names + with version numbers. + + * mh-e.el (mh-scan-format): patch from Sergey Poznyakoff. + GNU mailutils now supports the %(decode) format + +2003-09-20 Satyaki Das + + * mh-gnus.el (mh-mm-text-html-renderer): New function to query + which HTML renderer is being used by Gnus. + + * mh-mime.el (mh-signature-highlight): Renderers used to display + HTML parts garble the signature separator in various ways. The + function has been modified to take that into account. + (mh-mime-display-single, mh-mm-display-part): Pass the new + optional argument to `mh-signature-highlight'. + +2003-09-19 Mark D. Baushke + + * mh-mime.el (mh-have-file-command, mh-file-mime-type): Made an + mh-autoload as they are used in mh-comp.el. + + * mh-loaddefs.el: Regenerated. + +2003-09-18 Peter S Galbraith + + * mh-comp.el (mh-insert-fields): Make sure field has a colon. + +2003-09-18 Satyaki Das + + * mh-seq.el (mh-toggle-tick): Don't hardcode the name of the tick + sequencence in the function. This would have caused improper + highlighting of the tick sequence if the user had changed its + name. + +2003-09-15 Satyaki Das + + * mh-e.el (mh-folder-message-menu): Fix a little bug which shows + up as a problem during compilation (closes SF #806577). + +2003-09-15 Mark D. Baushke + + * mh-customize.el (mh-invisible-header-fields-internal): Added + a new field for GNU mailutils per Sergey Poznyakoff. + +2003-09-09 Satyaki Das + + * mh-utils.el (vcard): Unconditionally load vcard.el, if + available, so that vcards are always inlined. + +2003-09-09 Peter S Galbraith + + * mh-mime.el (mh-file-mime-type-substitutions): Add entry to + convert text/plain .vcf files to text/x-vcard. + (mh-mime-content-types): Add text/x-vcard. + +2003-09-09 Bill Wohler + + * mh-comp.el (mh-rejected-letter-start): Added strings for qmail + and exim (addresses SF #404965). + +2003-09-09 Satyaki Das + + * mh-gnus.el (mm-inline-text-vcard): Make vcard display work with + Gnus-5.9. The extra file vcard.el is still needed. + + * mh-mime.el (mh-signature-highlight): New function that + highlights message signatures. + (mh-mm-display-part, mh-mime-display-single): Highlight signatures + using `mh-signature-highlight' (closes SF #802722). More work is + needed for XEmacs. + (mh-mime-display): Highlight signature in non-MIME email too. + + * mh-customize.el (mh-show-signature-face): New face used to + display message signature. + +2003-09-08 Peter S Galbraith + + * mh-e.el (mh-version): Do something sensible when + mh-variant-in-use is undefined. + * mh-junk.el (mh-spamassassin-blacklist) + (mh-spamassassin-whitelist): Change options to be compatoble with + old version of spamassassin (V2.20). + +2003-09-07 Mark D. Baushke + + * mh-mime.el (mh-access-types): Per RFC 2049, the "afs" + access-type for message/external-body has been removed. + Update the comments to reference the current MIME RFCs + 2045, 2046 and 2049 rather than the obsolete RFC 1521. + +2003-09-05 Peter S Galbraith + + * mh-e.el (mh-version): Bumped version number to 7.4.2+cvs. + +2003-09-04 Satyaki Das + + * mh-utils.el (mh-picon-directory-list, mh-picon-directory): The + mh-picon-directory-list variable supersedes mh-picon-directory. + (mh-picon-existing-directory-list): New variable that contains + the list of picon directories that actually exist. + (mh-picon-set-directory-list): New function to update + mh-picon-existing-directory-list from mh-picon-directory-list. + (mh-picon-get-image): The function has been modified to search a + list of possible picon source directories. The regexp to extract + the username from the email address has been made smarter so that + it can recognize email addresses of the form user+random@foo.net + and extract "user" from there. + (mh-picon-file-contents): The file type recognition code has been + moved from mh-picon-get-image into this function. + (mh-picon-generate-path): The function has been generalized so + that searching multiple paths is now feasible. + + * mh-pick.el, mh-e.el: Checkdoc fixes. + +2003-09-02 Satyaki Das + + * mh-identity.el (eval-when): It seems that the mh-comp-loaded + code isn't required any more. + +2003-08-30 Satyaki Das + + * mh-init.el (mh-variant-set): Replace `error' with `message' so + that Emacs CVS will compile without errors if no MH variant is + present. + +2003-08-29 Satyaki Das + + * mh-init.el (mh-variant-set): Add interactive spec to the + function. + + * mh-mime.el (mh-mhn-compose-external-type): Optional arguments + are prompted for only if prefix arg is given. + +2003-08-29 Mark D. Baushke + + * mh-mime.el (mh-mhn-compose-external-type): Modified to be + interactive and prompts for many of the fields. Made an + mh-autoload. + (mh-access-types): New table derived from RFC2017, RFC1521 and + RFC1738, used in a completing-read in + mh-mhn-compose-external-type. + + * mh-loaddefs.el: Regenerated. + +2003-08-26 Satyaki Das + + * mh-utils.el (mh-picon-image-types, mh-picon-get-image): Avoid + compiler warnings. + (mh-sub-folders-actual): Parsing of the output from folders has + been modified, so that it also works for MH (closes SF #792300). + + * mh-junk.el (mh-spamassassin-whitelist): Avoid calling + ietf-drums-parse-address if it isn't present. + (mh-spamassassin-identify-spammers): Avoid use of puthash so that + Emacs20 doesn't complain. + + * mh-e.el (mh-colors-available-p): Wrap call to + display-color-cells in a mh-funcall-if-exists to avoid compiler + warning in Emacs20. + +2003-08-25 Satyaki Das + + * mh-e.el (mh-colors-available-flag, mh-folder-mode): New + variable to track if colors are available and it is set + appropriately in mh-folder-mode. + (mh-colors-available-p, mh-colors-in-use-p): Two functions to + check whether colors are available and if they are actually being + used. + (mh-add-sequence-notation): Just changing a scan line doesn't + make font-lock refontify the line in Emacs20. So explicitly + refontify the scan line in such a situation. + (mh-internal-seq): If colors aren't being used then treat the + tick sequence like a normal user sequence. + + * mh-seq.el (mh-put-msg-in-seq): Do font-lock highlighting after + the messages have been added to the sequence. + (mh-toggle-tick): Modified so that highlighting of the ticked + messages will be properly done. If font-lock isn't being used or + if colors aren't supported by the Emacs where MH-E is running, + then the `%' character is used to annotate ticked messages. + + * mh-utils.el (mh-picon-image-types): Since Emacs20 doesn't have + image-type-available-p, wrap calls to that function in + ignore-errors. + (mh-add-msgs-to-seq): Do the font-lock highlighting after the + messages have been added. + +2003-08-24 Bill Wohler + + * Makefile (MH-E-SRC): Replaced mh-xemacs-compat.el and + mh-xemacs-icons.el with mh-xemacs.el. + + * mh-e.el: Don't require mh-xemacs-compat which no longer exists. + The XEmacs stuff gets required by mh-customize.el which is + required by mh-utils.el which is required by mh-e.el. This all + happens before mh-xemacs-compat was required, so all should be + well. + + * mh-unit.el (mh-unit-files): Replaced mh-xemacs-compat.el and + mh-xemacs-icons.el with mh-xemacs.el. + + * mh-xemacs.el: New file from concatenation of mh-xemacs-compat.el + and mh-xemacs-icons.el which were removed since their names + exceeded DOS 8+3 limits. + + * mh-customize.el (mh-compose-skipped-header-fields): Use + uppercase for field names. + +2003-08-21 Bill Wohler + + * mh-customize.el (mh-sequences): Introduced new customization + group for sequences. + (mh-refile-preserves-sequences-flag, mh-tick-seq) + (mh-update-sequences-after-mh-show-flag): Moved option from + mh-folder to mh-sequences group. Synced docstring with manual. + (mh-index-ticked-messages-folders): Since mh-tick-seq is + customizable, use it instead of tick in the docstring. + + * mh-index.el (mh-index-ticked-messages): Since mh-tick-seq is + customizable, use it instead of tick in the docstring. + + * mh-seq.el (mh-msg-is-in-seq): Can now specify an alternate + message number with a prefix argument. + (mh-narrow-to-tick): Since mh-tick-seq is customizable, use it + instead of tick in the docstring. Also, use mh-tick-seq instead of + tick in warning message. + +2003-08-20 Peter S Galbraith + + * mh-customize.el: setq mh-variant to 'none when byte-compiling, + since we don't care what MH variant (if any) is on the system at + that point. + + * mh-init.el (mh-variant-set): Don't probe for MH variant when + mh-variant is set to'none (during byte-compilation). + +2003-08-19 Peter S Galbraith + + * mh-pick.el (mh-pick-single-dash): New defconst. Search + components that are supported by single-dash option in + pick. + (mh-pick-regexp-builder): Use `mh-pick-single-dash' and adapt + patch from Sergey Poznyakoff. + + * mh-comp.el (mh-reply): mu-mh supports `repl -group', thanks to + Sergey Poznyakof. + + * mh-init.el: checkdoc fixes. + +2003-08-19 Bill Wohler + + * mh-seq.el: (mh-edit-pick-expr): Renamed from mh-read-pick-regexp + since the new name is more indicative of what the function does. + Prompt now says "Pick expression" instead of "Pick regexp". + (mh-narrow-to-subject): Rewrote function to behave like other + similar functions. + (mh-narrow-to-header-field, mh-narrow-to-range) + (mh-narrow-to-tick): s/regexp/pick-expr/. + (mh-widen, mh-narrow-to-from, mh-narrow-to-cc, mh-narrow-to-to): + Synced docstrings with manual + 2003-08-19 Bill Wohler * Released MH-E version 7.4.2. @@ -131,6 +1295,848 @@ (patches from 1.307 and 1.309 and branched for 7.4.2, closes SF #791021). +2003-08-18 Bill Wohler + + * mh-index.el (mh-index-sequenced-messages) + (mh-index-new-messages, mh-index-ticked-messages): Updated + docstrings from manual (closes SF #718833). + + * mh-customize.el (mh-variant): Checkdoc fix. + (mh-index-new-messages-folders): Don't mention defvar in + docstring, use `+inbox' instead. + (mh-index-ticked-messages-folders): Don't mention defvar in + docstring, use `tick' instead. + + * mh-comp.el (mh-repl-group-formfile): Checkdoc fix. + +2003-08-18 Peter S Galbraith + + * mh-init.el (mh-variant-set, mh-sys-path, mh-variant-info): Add + support for GNU mailutils. + (mh-variant-mu-mh-info): New function to detect mu-mh and return + info about it for `mh-variants'. + + * mh-e.el (mh-regenerate-headers): mu-mh has different error + message for a invalid mesage list. + +2003-08-18 Peter S Galbraith + + * mh-customize.el (mh-e): New defgroup. Sort of an alias for the + 'mh group that a user might be more likely to find. + +2003-08-18 Bill Wohler + + * mh-comp.el (mh-insert-auto-fields-done-local): Docstring tweak. + (mh-compose-and-send-mail): Do not call mh-insert-auto-fields. + This should be done only once in mh-send-letter. + +2003-08-18 Peter S Galbraith + + * mh-comp.el (mh-letter-mode): Call `mh-find-path unconditionally, + like elsewehere in MH-E. + + * mh-utils.el (mh-find-path): Run setup code only if + `mh-find-path-run' is nil such that this is only done once. + Also remove the `setq' for `read-mail-command' and `mail-user-agent'. + +2003-08-18 Peter S Galbraith + + * mh-e.el: require 'mh-utils first + + * mh-customize.el (mh-variant): defcustom moved here. + + * mh-init.el (mh-variants): Made an mh-autoload. + +2003-08-18 Peter S Galbraith + + * Makefile (MH-E-SRC): Added mh-init.el to MH-E-SRC. + + * mh-utils.el (mh-find-progs): Deleted. Make obsolete by mh-init.el. + (mh-find-path): Call `mh-variants' instead of now obsolete + `mh-find-progs'. + (mh-path-search): Deleted. Was only used by `mh-find-progs'. + + * mh-e.el: require mh-init.el. + (mh-version): Use simpler `mh-variant-in-use'. + (mh-scan-format): Use (mh-variant-p 'nmh) instead of mh-nmh-flag. + + * mh-comp.el (mh-insert-x-mailer): Use simpler `mh-variant-in-use'. + + * mh-utils.el (mh-progs, mh-lib, mh-lib-progs) + (mh-flists-present-flag): Moved to mh-init.el. + (mh-nmh-flag): Deleted. Use (mh-variant-p 'nmh) instead. + + * mh-comp.el (mh-repl-group-formfile, mh-forward, mh-reply) + (mh-send-letter): Use (mh-variant-p 'nmh) instead of mh-nmh-flag. + + * mh-mime.el (mh-edit-mhn, mh-mime-save-parts): Use (mh-variant-p + 'nmh) instead of mh-nmh-flag. + +2003-08-16 Bill Wohler + + * mh-customize.el (mh-folder-selection): New group to hold + variables described in Folder Selection section in manual. + (mh-default-folder-list, mh-default-folder-must-exist-flag, + mh-default-folder-prefix): Moved to mh-folder-selection group. + Updated docstrings per manual update. + (mh-default-folder-for-message-function): New defcustom. Was a + defvar in mh-utils.el. Updated docstring per manual update. + + * mh-utils.el (mh-default-folder-for-message-function): Moved to + mh-customize.el. + + * mh-e.el (mh-folder-from-address, mh-prompt-for-refile-folder): + Updated docstrings per manual update. + + * mh-unit.el (mh-unit-files): Added mh-init.el. + +2003-08-16 Peter S Galbraith + + * mh-init.el: New file. Code to initialize the MH-E back-end. + Highlights: + (mh-variant): New defcustom. Users may customize `mh-variant' to + switch between available variants. + (mh-variants): Available MH variants are described in this variable. + (mh-variant-in-use, mh-variant-p): Developers may check which + variant is currently in use with the variable `mh-variant-in-use' + or the function `mh-variant-p'. + +2003-08-15 Bill Wohler + + * mh-customize.el (mh-auto-fields-list): The manual uses Fcc + instead of fcc, so I've changed the user-visible text + accordingly. I've left the const alone for backwards + compatibility. + +2003-08-14 Bill Wohler + + * mh-identity.el (mh-insert-identity): Changed signature deletion + test to test for both markers, rather than testing to see if the + start marker is bound. Since the start marker is defined in this + file, it should always be bound. Suggestion by Satyaki. + + * mh-comp.el (mh-send-letter): Go to the top of the draft so that + the user can see which header fields have been inserted. I think + this is more important than leaving point alone or going to the + end to see the signature since Mail-Followup-To or Bcc or cc could + have some deleterious effects. + + * mh-customize.el (mh-auto-fields-prompt-flag): New variable. + Non-nil means to prompt before sending if fields inserted. + + * mh-comp.el (mh-insert-auto-fields): Now return t if fields + inserted; otherwise nil. + (mh-send-letter): Deleted obsolete documentation about adding + X-Mailer and X-Face. Prompt before sending if auto fields added + and mh-auto-fields-prompt-flag is t. + + * mh-customize.el (mh-identity-list): Allow signature to come from + mh-signature-file-name. In this case, the "signature" value is set + to nil. This might not be the best implementation. Suggestions + welcome. + + * mh-identity.el (mh-insert-identity): Now that the signature can + be a nil value, moved test higher up in cond so that the test for + a nil value would not be executed first prevening signature + handling. Handle nil signature value by calling + mh-insert-signature with no arguments which means to use + mh-signature-file-name. + + * mh-comp.el (mh-insert-signature): Changed text of message if no + signature inserted. + + * mh-customize.el (mh-identity-list): Changed "Signature" constant + back to "signature" so it *won't* be backwards-incompatible any + more. I discovered one could use the :tag keyword to get headline + captalization in the menu. + + * mh-identity.el (mh-insert-identity): Ditto. + + * mh-identity.el (mh-identity-make-menu): Always build menu. + Always create Insert Auto Fields menu item. Just don't enable it + if mh-auto-fields-list is nil. Enable radio buttons always. Make + None a radio button choice with the other identities. + + * mh-comp.el (mh-letter-menu): Removed cond on fboundp + 'easy-menu-define. We don't do this elsewhere. + +2003-08-13 Bill Wohler + + * mh-identity.el (mh-identity-make-menu, mh-insert-identity): Use + headline capitalization in menu items. Even the internal names are + exposed in the customize interface, so they need to be uppercase + too. + (mh-insert-identity): Rather than goto-char to + mh-identity-signature-start before deleting, simply pass it to + delete-region. When setting markers, use point-min-marker and + point-max-marker instead of moving point. Set marker type of + mh-identity-signature-start to t to fix a bug where changing + identity deleted user's text. + + * mh-customize.el (mh-identity-list, mh-auto-fields-list): + Reworked docstring. Use headline capitalization. Commented out + implementation details for later deletion or resurrection upon + popular demand. N.B. If your mh-identity-list contains "signature" + then you will need to either edit your .emacs file manually, or + delete your existing "signature" which will become a regular field + with this change and create a new signature. I figured I could get + away with this since 8.0 is a major release, and coinciding with + the manual update will be a MAJOR release. I apologize profusely + that I didn't catch this before it was released. + (mh-identity-default): Use headline capitalization in example. + +2003-08-12 Jeffrey C Honig + + * mh-customize.el (mh-alias-reloaded-hook): Define + `mh-alias-reloaded-hook'. + + * mh-alias.el (mh-alias-reload): Run `mh-alias-reloaded-hook' + after reloading the aliases. + +2003-08-12 Mark D. Baushke + + * mh-comp.el (mh-insert-signature): Use functionp to avoid + the possibility of doing a funcall on a void function. + +2003-08-12 Bill Wohler + + * mh-customize.el (mh-identity): Point group manual link to new + Identities section. + (mh-signature-separator-flag): New variable which can be used to + suppress the output of the signature separator. + + * mh-comp.el (mh-insert-signature): Use + mh-signature-separator-flag. + + * mh-identity.el (mh-insert-identity): If the identity's signature + file didn't exist, an fboundp error was thrown. This was fixed by + removing signature tests that were redundant and out of date with + the tests in mh-insert-signature. Removed second signature + condition as it is now handled in the first signature condition. + +2003-08-12 Peter S Galbraith + + * mh-identity.el (mh-insert-identity): Don't insert new lines on + signatures anymore. + + * mh-comp.el (mh-insert-signature): Make sure signature file is + readable before trying to insert it. + +2003-08-11 Bill Wohler + + * mh-comp.el (mh-insert-signature): Unconditionally insert a + newline so that signatures are inserted consistently, and so that + there isn't any text after the cursor so that the user can start + typing his message immediately. Use new variable and function + mh-signature-separator and mh-signature-separator-p. + + * mh-customize.el (mh-delete-yanked-msg-window-flag): Checkdoc + fix. + (mh-signature-file-name): Updated docstring now that this variable + can be a function. Added cross-references to + mh-signature-separator, mh-signature-separator-regexp, and + mh-signature-separator-p which might be used in such functions. + + * mh-identity.el (mh-insert-identity): Don't include signature if + signature separator already present. Useful when running + mh-edit-again. + + * mh-mime.el (mh-inline-vcard-p): Use mh-signature-separator-p. + + * mh-utils.el (mh-signature-separator-regexp): New variable + containing "^-- $" which should be used when looking for the + signature separator. + (mh-signature-separator): New variable containing "-- \n" which + should be used when inserting the signature separator. + (mh-signature-separator-p): New function that returns non-nil if + mh-signature-separator-regexp is found in the buffer. + +2003-08-09 Satyaki Das + + * mh-utils.el (mh-x-image-scaling-function): Variable that + contains function used to scale images. Possible choices are + mh-x-image-scale-with-convert and mh-x-image-scale-with-pnm. + (mh-convert-executable): Removed. + (mh-x-image-scale-with-pnm, mh-x-image-scale-with-convert): New + functions that scale images using pnm tools or ImageMagick. + (mh-x-image-scale-and-display, mh-x-image-url-display): Use + mh-x-image-scaling-function instead of mh-convert-executable. + +2003-08-08 Peter S Galbraith + + * mh-comp.el (mh-insert-signature): Bug fix. Handle case of nil + `mh-signature-file-name' and hooks correctly. + + * mh-identity.el (mh-insert-identity): Refactor to use + mh-insert-signature + + * mh-comp.el (mh-signature-separator-p): Removed. + + * mh-comp.el (mh-insert-signature): Merge MIME awareness from + mh-insert-identity into this command. Allow + `mh-signature-file-name' to be a function to call. See if "-- " + needs to be inserted only after hooks have run. + +2003-08-07 Bill Wohler + + * mh-customize.el (mh-compose-skipped-header-fields): Added + X-Image-URL. + (mh-autoload): Removed cookies. They aren't necessary in + mh-e.el, mh-utils.el, or mh-customize.el. + + * mh-e.el (mh-autoload): Removed cookies. They aren't necessary in + mh-e.el, mh-utils.el, or mh-customize.el. + + * mh-identity.el (mh-insert-identity): Made regexp for signature + separator more explicit. Hmmm, maybe we should create + mh-signature-separator-regexp... + + * mh-index.el (mh-replace-string): Moved to mh-utils.el. + + * mh-utils.el (mh-replace-string): Moved here from mh-index.el. + (mh-autoload): Removed cookies. They aren't necessary in mh-e.el, + mh-utils.el, or mh-customize.el. + + * mh-comp.el (mh-insert-signature): Added file argument to insert + a file other than mh-signature-file-name. Insert signature + separator, unless file already contains one. + +2003-08-06 Satyaki Das + + * mh-e.el (mh-folder-size, mh-folder-size-folder) + (mh-folder-size-flist): If flist is not present use folder to + find the number of messages in the folder. Also the .mh_sequences + file is read to find the number of unseen messages. + + * mh-utils.el (mh-flists-present-flag, mh-find-progs): Introduce + a new variable to test for the presence of the flists program and + set it in mh-find-progs. + +2003-08-06 Peter S Galbraith + + * mh-customize.el: Change the order of `mh-identity-list' and + `mh-auto-fields-list' and remove byte-compilation defvar for + `mh-identity-list'. This fixes a customization bug for + `mh-identity-list', where it wasn't set correctly. + + * mh-identity.el (mh-identity-make-menu): mh-auto-fields-list may + not be bound yet when initially loaded. + +2003-08-06 Bill Wohler + + * mh-alias.el (mh-alias-add-address-under-point): Removed trailing + period from messages. The conventions say that errors should not + end with a period and that "Foo...done" messages should not end in + a period, but they aren't explicit about messages in general. + Given what the conventions *do* say, and because most of our + messages don't end with a period, let's just say that messages in + general don't end in a period, just like error messages. + + * mh-comp.el (mh-extract-rejected-mail, mh-letter-mode-message): + Ditto. + + * mh-e.el (mh-refile-a-msg): Ditto. + + * mh-funcs.el (mh-undo-folder): Ditto. + + * mh-mime.el (mh-mime-save-parts): Ditto. + + * mh-seq.el (mh-subject-to-sequence-unthreaded) + (mh-narrow-to-subject, mh-delete-subject): Ditto. + + * mh-index.el (mh-index-sequenced-messages) + (mh-index-new-messages, mh-index-ticked-messages): Discovered that + in general we should only use question marks in yes-or-no-p or + y-or-n-p prompts, but not in other prompts that use + completing-read and offer defaults. In these cases, use colons + instead (closes SF #730470). + + * mh-mime.el (mh-mime-save-parts): Ditto. + + * mh-utils.el (mh-prompt-for-folder): Ditto. + + * mh-alias.el (mh-alias-apropos): Multiple messages are usually + shown one at a time rather than appended. Send output to + mh-aliases-buffer instead of *Help*. + (mh-alias-local-users): Checkdoc fix. + + * mh-funcs.el (mh-undo-folder): Removed commented-out code since + its deadline had expired. + + * mh-utils.el (mh-aliases-buffer): New buffer name, used in + mh-aliases.el. + +2003-08-06 Satyaki Das + + * mh-utils.el (mh-x-image-url-cache-canonicalize): Make this + function work for XEmacs too. + (mh-collect-folder-names): Use folders instead of flists. One + advantage is that folders is available on MH while flists is not. + Another is that if an explicit -sequence argument isn't given and + Unseen-Sequence profile is not present then flists croaks while + folders doesn't. + (mh-collect-folder-names-filter): Don't consider folder names that + start with a `.' character. This is needed since the folders + command doesn't filter them out like flists does. + + * mh-index.el (mh-replace-string): Add autoload for it. + +2003-08-05 Satyaki Das + + * mh-mime.el (mh-compose-forward, mh-mhn-compose-forw) + (mh-mml-forward-message): The variable mh-sent-from-msg can be a + list. So check that the value is really a number before using it + like one. + + * mh-comp.el (mh-insert-letter): Same as above. + + * mh-utils.el (mh-picon-get-image): Make the code that finds the + address of the sender more robust. + (mh-face-display-function): Make it work with XEmacs. + (mh-picon-image-types): A new variable that stores what image + types can be used. + +2003-08-05 Satyaki Das + + * mh-customize.el (mh-tool-bar-define): Make the save button such + that is activated only if the buffer needs to saved. + + * mh-utils.el (mh-face-display-function, mh-picon-get-image): Some + domains, for instance cs.cmu.edu, don't have xpm files. So we need + to search for all three files. The change does that. + (mh-picon-file-contents): A utility function to return the + contents of a file as a string. + (mh-picon-get-image): Write it as a loop to make it simpler. + (mh-x-image-set-download-state): Make the link simpler. + +2003-08-04 Satyaki Das + + * mh-utils.el (mh-x-image-url-display): Don't bother to try to + download image if we don't have the necessary tools to display + it. + (mh-face-display-function): Add preliminary support for "domain" + picons. + (mh-picon-get-image, mh-picon-generate-path): Functions to find + best match for domain in the From header field. + + * mh-e.el (mh-previous-unread-msg): If some of the messages in the + unseen sequence are not present in the folder buffer then calling + this function gets stuck and can't skip over them. The change + fixes this. + (mh-next-unread-msg): Same as above. + +2003-08-04 Bill Wohler + + * mh-utils.el (mh-show-mode): Added cross reference to + mh-folder-mode in docstring (closes SF #728638). Added + \\{mh-show-mode-map} to show keymap. + + * mh-e.el (mh-folder-mode): Added information about ranges to + docstring (closes SF #728638). + + * mh-speed.el (mh-speed-refresh): New function that calls + mh-speed-flists and mh-invalidate-map. + (mh-folder-speedbar-key-map): Replaced keybindings for + mh-speed-invalidate-map and mh-speed-flists with a single binding + for mh-speed-refresh. + (mh-folder-speedbar-menu-items): Replaced menu items for Run + Flists and Invalidate Cached Folders with the single menu item + Refresh Speedbar in order to simplify the UI. + + * mh-customize.el (mh-fetch-x-image-url): Added DOS as another + reason not to set this to t. + +2003-08-04 Satyaki Das + + * mh-e.el (mh-scan-folder): Handle ranges from user input properly. + +2003-08-03 Satyaki Das + + * mh-utils.el (mh-find-msg-get-num): Removed. If threading isn't + present, the messages are sorted by index. So `mh-goto-msg' was + implemented as a binary search and this function was used in that + implementation. So this isn't needed any more. + (mh-msg-search-pat): Removed. Before the advent of message + threading, this function was used to generate a regexp used to + search for a particular message. It isn't used anymore. The + variable `mh-scan-msg-number-regexp' should be updated and used in + `mh-goto-msg' instead of hardcoding the regexp in the code. Then + we might be able to better support other scan line formats in the + future. + + * mh-seq.el (mh-map-to-seq-msgs, mh-notate-seq): Removed. These + functions were used to notate user sequences. But calling + `mh-goto-msg' inside of a loop is inefficient. So the sequence + notation code was rewritten thereby making these functions + redundant. + (mh-copy-line-to-point): Removed. This function was used in the + implementation the now removed function `mh-copy-seq-to-point'. + That function was problematic and was replaced by the less general + `mh-copy-seq-to-eob'. This makes `mh-copy-line-to-point' + redundant. + (mh-region-to-msg-list): Removed since this is a special case of + the more general `mh-range-to-msg-list'. + + * mh-loaddefs.el: Regenerated. + +2003-08-03 Jeffrey C Honig + + * mh-customize.el (mh-invisible-header-fields-default): Added + several new fields to hide. Sorted the list with sort-lines. + +2003-08-03 Peter S Galbraith + + * mh-customize.el (mh-invisible-headers): Variable renamed to + `mh-invisible-header-fields-compiled'. + (mh-invisible-headers): Implement above change. + + * mh-utils.el (mh-display-msg): Idem. + + * mh-mime.el (mh-mm-inline-message): Idem. + + * mh-comp.el (mh-insert-letter): Idem. + +2003-08-03 Bill Wohler + + * mh-speed.el (mh-folder-speedbar-menu-items): Added separator + between standard and MH-E menu items. Use headline capitalization + in menu items. + + * mh-utils.el (mh-temp-fetch-buffer): New constant to hold + buffer name for wget output. + (mh-x-image-url-fetch-image): Use mh-temp-fetch-buffer instead + of hard-coded buffer name. Use make-temp-file to avoid race + conditions and subsequent security issues raised in make-temp-name + docstring. + +2003-08-03 Satyaki Das + + * mh-utils.el (mh-wget-executable, mh-wget-choice, mh-wget-option) + (mh-x-image-url-fetch-image): Support the use of `curl' and + `fetch' as alternatives to `wget'. + (mh-wget-choice): Change order of search. + (mh-x-image-url-fetch-image): Rename buffer. + +2003-08-03 Satyaki Das + + * mh-utils.el (mh-x-image-set-download-state) + (mh-x-image-get-download-state): Specially named symbolic links + are used to keep track of whether a X-Image-URL header field needs + to downloaded the next time it is seen. These functions get and + set the symlinks appropriately. + (mh-x-image-url-fetch-image): Simplified since the query has been + moved to `mh-x-image-url-display'. Also if wget isn't present then + try again next time since the user might install wget before + trying once more. + (mh-x-image-scale-and-display): Handle absence of the `convert' + program better. If it isn't present then we will try to display + the image the next time it is encountered. Also use the -geometry + option to convert since the -resize option isn't present in older + versions. + (mh-x-image-url-display): Move all the code that decides whether + an X-Image-URL header field will be fetched in this function. Also + remember the user's decision so that if the image couldn't be + fetched the first time, we will try to fetch it later on without + asking again. + +2003-08-02 Peter S Galbraith + + * mh-alias.el (mh-alias-local-users): Exclude all aliases already + in mh-alias-alist from `ali' (closes SF #772595). + +2003-08-01 Satyaki Das + + * mh-utils.el (mh-x-image-display, mh-x-image-url-display): Avoid + a race. The X-Image-URL is displayed asynchronously. Suppose a + message with a image is shown with `mh-show'. If a different + message is displayed before the image can be fetched, then the new + message will have the image displayed. With this change the race + is less likely to happen. + +2003-08-01 Peter S Galbraith + + * mh-inc.el (mh-inc-spool-map): Fix what `mh-inc-spool-map-help' + must look like as a fake `mh-help-messages' in order to work + correctly in mh-help. + +2003-07-31 Bill Wohler + + * mh-inc.el (mh-inc-spool-map): Use mh-help instead of + mh-ephem-message in order to display help in its own buffer + instead of minibuffer. + + * mh-utils.el (mh-help-buffer): New variable to hold the name of + the MH-E help buffer name. + + * mh-funcs.el (mh-help, mh-prefix-help): Use with-electric-help to + display help messages. I observed a friend with a vision + disability and the 5 seconds the help appeared on the screen was + not long enough for him to lock on it. I've therefore changed the + help function to display the help in its own buffer called *MH-E + Help* (closes SF #493740 and SF #656631). + + * mh-customize.el (mh-fetch-x-image-url): Changed default from nil + to 'ask. Updated docstring from manual. + (mh-invisible-header-fields-internal): Added X-Image-URL. + (mh-show-use-xface-flag): Updated docstring from manual. + (mh-x-face-file): Ditto. + + * mh-mime.el (mh-mhn-compose-external-type): Don't insert the + directory parameter if it's nil. The mhbuild man page indicates + that this parameter is optional, so this should be fine. + + * mh-comp.el (mh-letter-mode-map): Added keybindings for + mh-mhn-compose-anon-ftp and + mh-mhn-compose-external-compressed-tar. + (mh-letter-menu): Uncommented menu items for same. + +2003-07-30 Satyaki Das + + * mh-loaddefs.el: Regenerated. + + * mh-pick.el (mh-do-pick-search): Removed since the function + `mh-pick-do-search' performs the same action as this function. + + * mh-index.el (mh-index-update-unseen): Removed since the + generalized sequence synchronization code that keeps sequences in + index folders in sync with the sequences in the source folders + makes this function redundant. + + * mh-e.el (mh-folder-unseen-seq-name, mh-folder-unseen-seq-list): + Removed. These two functions were used in the unseen sequence + highlighting before the sequence highlighting code was + generalized. In any event calls to the function + `mh-folder-unseen-seq-name' can be replaced by the variable + `mh-unseen-seq' and calls to `mh-folder-unseen-seq-list' can be + replaced with (cdr (assoc mh-unseen-seq mh-seq-list)). + (mh-unmark-all-headers): Removed since this function has been + superseded by mh-remove-all-notation. + (mh-map-over-seqs): Removed since we now have the generalized + iteration over message ranges (the `mh-iterate-on-range' macro) + that can be used instead. + (mh-notate-if-in-one-seq): Removed. This function was used for + changing the `%' notation for user sequences. It can't be used for + that purpose any more, since we have a different scheme now. + + * mh-unit.el (mh-unit-tests): Removed since it isn't needed any + more. + (mh-unit): Run all function that start with the string + "mh-unit-test-". + +2003-07-30 Bill Wohler + + * mh-customize.el (mh-invisible-header-fields): Checkdoc fix. + + * mh-utils.el (mh-x-image-url-cache-canonicalize): Shortened using + example in files.el:make-backup-file-name-1. + (mh-face-display-function): Added X-Image-URL to docstring. + + * mh-unit.el (mh-unit-x-image-url-cache-canonicalize): New + function to test mh-x-image-url-cache-canonicalize since it lent + itself well to unit testing. Had to start somewhere! + (mh-unit-equal): New function that throws an error if RESULT + doesn't equal EXPECTED. + (mh-unit): Call mh-unit-x-image-url-cache-canonicalize. + +2003-07-29 Satyaki Das + + * mh-unit.el (mh-unit-update-call-graph): Make the function work + better with dotted lists, that is lists of the form (a b c . d) + where `d' isn't nil. With this we are able to avoid marking some + functions as unused even though they are actually used in alists. + +2003-07-28 Peter S Galbraith + + * mh-comp.el (mh-insert-letter): Remove `mh-visible-headers' + operation. + + * mh-mime.el (mh-mm-inline-message): Same. + + * mh-utils.el (mh-display-msg): Same. + (mh-clean-msg-header): Make a note of above change. + + * mh-customize.el (mh-invisible-header-fields-internal): Renamed + from prior `mh-invisible-header-fields-default'. + (mh-invisible-header-fields-default): Renamed from prior + `mh-invisible-header-fields-default-override'. + (mh-invisible-header-fields): Renamed from prior + `mh-invisible-header-fields-user'. + (mh-visible-headers): Removed! We use invisible fields only now. + (mh-visible-header-fields): Removed! + +2003-07-28 Peter S Galbraith + + * mh-customize.el (mh-invisible-header-fields-default): Added 3 + new fields to hide. + +2003-07-28 Satyaki Das + + * mh-utils.el (mh-show): Add an extra argument to the function so + that interactive use will always force redisplay of the message. + + * mh-mime.el (mh-mime-display, mh-mm-inline-message): Bind the + variables `mm-verify-option' and `mm-decrypt-option' so that + verification and decryption of mail can happen without any + additional tinkering. + +2003-07-25 Peter S Galbraith + + * mh-customize.el (mh-invisible-header-fields-default): New defvar + holding default fields to hide. This replaces the old + `mh-invisible-header-fields' defcustom. + (mh-invisible-header-fields-user): New defcustom. Users add + fields to suppress that we didn't include in + `mh-invisible-header-fields-default'. This could be named simply + `mh-invisible-header-fields' and it wouldn't really break anything + for users who have customized it to a long list now redundant with + `mh-invisible-header-fields-default'. + (mh-invisible-header-fields-default-override): New defcustom. + Users check off the fields they want displyed from what we + included in `mh-invisible-header-fields-default'. + (mh-invisible-headers): Function adapted to new variables. + +2003-07-25 Satyaki Das + + * mh-e.el (mh-inc-folder): If the user is in a different folder + displaying a message and runs mh-inc-folder, then the folder + changes to +inbox but the show window continues to display the + message in the old folder. The change fixes this. + (mh-visit-folder): Make the handling of the show window similar to + that of mh-inc-folder. + +2003-07-24 Satyaki Das + + * mh-e.el (mh-folder-message-menu, mh-folder-folder-menu): Use the + predicate mh-outstanding-commands-p instead of its exapansion. + Also use the same label in both menus. + (mh-outstanding-commands-p): Generalized so that it will work in + mh-show-mode buffers as well. + + * mh-customize.el (mh-tool-bar-define): Enable tool-bar button for + mh-execute-commands only if there are pending deletes or refiles. + +2003-07-19 Satyaki Das + + * mh-utils.el (mh-show-msg): If a unseen message is first marked + for deletion/refiling and then displayed, the bold highlighting + does not go away. This change fixes that. + + * mh-seq.el (mh-msg-is-in-seq): Fix a bug in the function. If any + message was marked for refiling, then the function would have you + believe that every message in the folder is being refiled. + +2003-07-17 Bill Wohler + + * mh-e.el: Removed email address for Stephen Gildea's in Change + Log at his request (damn spammers). Removed other email addresses + while I was at it since the SourceForge URL should be sufficient + contact information. + + (mh-scan-format-*mh): Fixed typo in comment above these variables. + These variables are used if mh-scan-format-file is t, not nil. + Also mh-scan-format-file is no longer "above" (courtesy Stephen + Gildea). + +2003-07-17 Satyaki Das + + * mh-mime.el (mh-mhn-quote-unescaped-sharp): New function that + quotes `#' characters in the first column that aren't part of a + MHN directive. + (mh-mhn-directive-present-p): Generalized to allow the function + to search for MHN directives in a part of the buffer. + (mh-edit-mhn): Quote unescaped `#' characters in the draft (closes + SF #762464). + +2003-07-16 Satyaki Das + + * mh-alias.el (mh-alias-read-address-map): If + mh-alias-flash-on-comma is nil when mh-alias is loaded, then + setting mh-alias-flash-on-comma to t later on doesn't turn on + address completion display till Emacs is restarted. The change + fixes this. + +2003-07-15 Bill Wohler + + * mh-utils.el (mh-cmd-note): Cleaned up docstring (changed phrase + to sentences). Moved to Scan Line Formats section. + (mh-scan-msg-number-regexp) + (mh-scan-msg-overflow-regexp, mh-scan-msg-format-regexp) + (mh-scan-msg-format-string, mh-scan-msg-search-regexp): Cleaned up + docstrings (changed phrases to sentences). + (mh-note-seq): Cleaned up docstring (changed phrase to sentences). + Also, this variable is now a character and not a string. Moved to + Scan Line Formats section. + + * mh-funcs.el (mh-note-copied, mh-note-printed): Cleaned up + docstrings (changed phrases to sentences). Also, these variables + are now characters and not strings. + + * mh-e.el (mh-scan-format-mh, mh-scan-format-nmh): Filled. I was + hoping to quote the hint `t' but checkdoc wouldn't let me. + (mh-note-deleted, mh-note-refiled, mh-note-cur): Moved to Scan + Line Formats section. + (mh-scan-good-msg-regexp, mh-scan-deleted-msg-regexp) + (mh-scan-refiled-msg-regexp, mh-scan-valid-regexp) + (mh-scan-cur-msg-number-regexp, mh-scan-date-regexp) + (mh-scan-rcpt-regexp, mh-scan-body-regexp) + (mh-scan-subject-regexp, mh-scan-format-regexp): Cleaned + up docstrings (changed phrases to sentences). + (mh-scan-cur-msg-regexp): Marked this variable as obsolete; it + should be removed for 8.0. + + * mh-comp.el (mh-note-repl, mh-note-forw, mh-note-dist): Cleaned + up docstrings (changed phrases to sentences). Also, these + variables are now characters and not strings. + +2003-07-15 Satyaki Das + + * mh-index.el (mh-index-update-single-msg) + (mh-index-create-sequences): Handle the situation where there are + copies of the exact same message correctly. + +2003-07-15 Satyaki Das + + * mh-seq.el (mh-thread-update-scan-line-map): Modified since + notation is already a character. + + * mh-utils.el (mh-note-seq): Convert from string to character. + (mh-notate): Modified since characters are used to notate instead + of strings of length one. + + * mh-comp.el (mh-note-repl, mh-note-forw, mh-note-dist): Convert + from string to characters. + + * mh-e.el (mh-note-deleted, mh-note-refiled, mh-note-cur): Same as + above (closes SF #770772). + (mh-unmark-all-headers): Modified since mh-note-* variables are + now characters. + (mh-remove-sequence-notation): The mh-notate function remembers + the previous notation. Before the change to the mh-note-* + variables, mh-notate would only remember the change if a string + was used to notate the message. Now mh-notate is always called + with a character notation. So the deletion has to take place + explicitly. + +2003-06-28 Bill Wohler + + * mh-mime.el (mh-mhn-directive-present-p): If shell comments are + present that have a space after the # but no content, then this + function would throw an error. This has been fixed (closes SF + #762458). + +2003-06-27 Satyaki Das + + * mh-index.el (mh-index-search): Use the new and improved + mh-index-new-folder. + (mh-index-new-folder): Improved so that redoing the same search + will reuse the old index folder. + (mh-index-folder-search-regexp): New function which that extracts + out the search expression that produced the index folder. + +2003-06-24 Bill Wohler + + * mh-e.el (Version, mh-version): Set to 7.4.1+cvs. + 2003-06-25 Bill Wohler * Released MH-E version 7.4.1. diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el index bd20b9118b0..1356e2c8b95 100644 --- a/lisp/mh-e/mh-alias.el +++ b/lisp/mh-e/mh-alias.el @@ -27,75 +27,12 @@ ;;; Commentary: -;; [To be deleted when documented in MH-E manual.] -;; -;; This module provides mail alias completion when entering addresses. -;; -;; Use the TAB key to complete aliases (and optionally local usernames) when -;; initially composing a message in the To: and Cc: minibuffer prompts. You -;; may enter multiple addressees separated with a comma (but do *not* add any -;; space after the comma). -;; -;; In the header of a message draft, use "M-TAB (mh-letter-complete)" to -;; complete aliases. This is useful when you want to add an addressee as an -;; afterthought when creating a message, or when adding an additional -;; addressee to a reply. -;; -;; By default, completion is case-insensitive. This can be changed by -;; customizing the variable `mh-alias-completion-ignore-case-flag'. This is -;; useful, for example, to differentiate between people aliases in lowercase -;; such as: -;; -;; p.galbraith: Peter Galbraith -;; -;; and lists in uppercase such as: -;; -;; MH-E: MH-E mailing list -;; -;; Note that this variable affects minibuffer completion only. If you have an -;; alias for P.Galbraith and type in p.galbraith at the prompt, it will still -;; be expanded in the letter buffer because MH is case-insensitive. -;; -;; When you press ", (mh-alias-minibuffer-confirm-address)" after an alias in -;; the minibuffer, the expansion for the previous mail alias appears briefly. -;; To inhibit this, customize the variable `mh-alias-flash-on-comma'. -;; -;; The addresses and aliases entered in the minibuffer are added to the -;; message draft. To expand the aliases before they are added to the draft, -;; customize the variable `mh-alias-expand-aliases-flag'. -;; -;; Completion is also performed on usernames extracted from the /etc/passwd -;; file. This can be a handy tool on a machine where you and co-workers -;; exchange messages, but should probably be disabled on a system with -;; thousands of users you don't know. This is done by customizing the -;; variable `mh-alias-local-users'. This variable also takes a string which -;; is executed to generate the password file. For example, you'd use "ypcat -;; passwd" for NIS. -;; -;; Aliases are loaded the first time you send mail and get the "To:" prompt -;; and whenever a source of aliases changes. Sources of system aliases are -;; defined in the customization variable `mh-alias-system-aliases' and -;; include: -;; -;; /etc/nmh/MailAliases -;; /usr/lib/mh/MailAliases -;; /etc/passwd -;; -;; Sources of personal aliases are read from the files listed in your MH -;; profile component Aliasfile. Multiple files are separated by white space -;; and are relative to your mail directory. -;; -;; Alias Insertions -;; ~~~~~~~~~~~~~~~~ -;; There are commands to insert new aliases into your alias file(s) (defined -;; by the `Aliasfile' component in the .mh_profile file or by the variable -;; `mh-alias-insert-file'). In particular, there is a tool-bar icon to grab -;; an alias from the From line of the current message. - ;;; Change Log: ;;; Code: +(eval-when-compile (require 'mh-acros)) +(mh-require-cl) (require 'mh-e) (load "cmr" t t) ; Non-fatal dependency for ; completing-read-multiple. @@ -116,15 +53,23 @@ (defvar mh-alias-tstamp nil "Time aliases were last loaded.") (defvar mh-alias-read-address-map nil) -(if mh-alias-read-address-map - () +(unless mh-alias-read-address-map (setq mh-alias-read-address-map (copy-keymap minibuffer-local-completion-map)) - (if mh-alias-flash-on-comma - (define-key mh-alias-read-address-map - "," 'mh-alias-minibuffer-confirm-address)) + (define-key mh-alias-read-address-map + "," 'mh-alias-minibuffer-confirm-address) (define-key mh-alias-read-address-map " " 'self-insert-command)) +(defvar mh-alias-system-aliases + '("/etc/nmh/MailAliases" "/etc/mh/MailAliases" + "/usr/lib/mh/MailAliases" "/usr/share/mailutils/mh/MailAliases" + "/etc/passwd") + "*A list of system files which are a source of aliases. +If these files are modified, they are automatically reread. This list need +include only system aliases and the passwd file, since personal alias files +listed in your `Aliasfile:' MH profile component are automatically included. +You can update the alias list manually using \\[mh-alias-reload].") + ;;; Alias Loading @@ -138,7 +83,7 @@ This is a wrapper around `assoc-string' or `assoc-ignore-case'. Avoid (defun mh-alias-tstamp (arg) "Check whether alias files have been modified. -Return t if any file listed in the MH profile component Aliasfile has been +Return t if any file listed in the Aliasfile MH profile component has been modified since the timestamp. If ARG is non-nil, set timestamp with the current time." (if arg @@ -157,7 +102,7 @@ If ARG is non-nil, set timestamp with the current time." (defun mh-alias-filenames (arg) "Return list of filenames that contain aliases. -The filenames come from the MH profile component Aliasfile and are expanded. +The filenames come from the Aliasfile profile component and are expanded. If ARG is non-nil, filenames listed in `mh-alias-system-aliases' are appended." (or mh-progs (mh-find-path)) (save-excursion @@ -201,7 +146,8 @@ non-nil." res)) (defun mh-alias-local-users () - "Return an alist of local users from /etc/passwd." + "Return an alist of local users from /etc/passwd. +Exclude all aliases already in `mh-alias-alist' from `ali'" (let (passwd-alist) (save-excursion (set-buffer (get-buffer-create mh-temp-buffer)) @@ -222,23 +168,33 @@ non-nil." (gecos-name (match-string 3)) (realname (mh-alias-gecos-name gecos-name username - mh-alias-passwd-gecos-comma-separator-flag))) - (setq passwd-alist - (cons - (list (if mh-alias-local-users-prefix - (concat mh-alias-local-users-prefix - (mh-alias-suggest-alias realname t)) - username) - (if (string-equal username realname) - (concat "<" username ">") - (concat realname " <" username ">"))) - passwd-alist)))))) + mh-alias-passwd-gecos-comma-separator-flag)) + (alias-name (if mh-alias-local-users-prefix + (concat mh-alias-local-users-prefix + (mh-alias-suggest-alias realname t)) + username)) + (alias-translation + (if (string-equal username realname) + (concat "<" username ">") + (concat realname " <" username ">")))) + (when (not (mh-assoc-ignore-case alias-name mh-alias-alist)) + (setq passwd-alist (cons (list alias-name alias-translation) + passwd-alist))))))) (forward-line 1))) passwd-alist)) ;;;###mh-autoload (defun mh-alias-reload () - "Load MH aliases into `mh-alias-alist'." + "Reload MH aliases. + +Since aliases are updated frequently, MH-E will reload aliases automatically +whenever an alias lookup occurs if an alias source (a file listed in your +`Aliasfile:' profile component and your password file if variable +`mh-alias-local-users' is non-nil) has changed. However, you can reload your +aliases manually by calling this command directly. + +The value of `mh-alias-reloaded-hook' is a list of functions to be called, +with no arguments, after the aliases have been loaded." (interactive) (save-excursion (message "Loading MH aliases...") @@ -269,13 +225,14 @@ non-nil." (if (not (mh-assoc-ignore-case (car user) mh-alias-alist)) (setq mh-alias-alist (append mh-alias-alist (list user)))) (setq local-users (cdr local-users))))) + (run-hooks 'mh-alias-reloaded-hook) (message "Loading MH aliases...done")) ;;;###mh-autoload (defun mh-alias-reload-maybe () "Load new MH aliases." - (if (or (eq mh-alias-alist 'not-read) ; Doesn't exist, so create it. - (mh-alias-tstamp nil)) ; Out of date, so recreate it. + (if (or (eq mh-alias-alist 'not-read) ; Doesn't exist? + (mh-alias-tstamp nil)) ; Out of date? (mh-alias-reload))) @@ -461,21 +418,21 @@ is converted to lower case." found))) (defun mh-alias-insert-file (&optional alias) - "Return the alias file to write a new entry for ALIAS in. -Use variable `mh-alias-insert-file' if non-nil, else use AliasFile component -value. -If ALIAS is specified and it already exists, try to return the file that -contains it." + "Return filename which should be used to add ALIAS. +The value of the option `mh-alias-insert-file' is used if non-nil\; otherwise +the value of the `Aliasfile:' profile component is used. +If the alias already exists, try to return the name of the file that contains +it." (cond ((and mh-alias-insert-file (listp mh-alias-insert-file)) (if (not (elt mh-alias-insert-file 1)) ; Only one entry, use it (car mh-alias-insert-file) (if (or (not alias) (string-equal alias (mh-alias-ali alias))) ;alias doesn't exist - (completing-read "Alias file [press Tab]: " + (completing-read "Alias file: " (mapcar 'list mh-alias-insert-file) nil t) (or (mh-alias-which-file-has-alias alias mh-alias-insert-file) - (completing-read "Alias file [press Tab]: " + (completing-read "Alias file: " (mapcar 'list mh-alias-insert-file) nil t))))) ((and mh-alias-insert-file (stringp mh-alias-insert-file)) mh-alias-insert-file) @@ -490,16 +447,15 @@ contains it." (cond ((not autolist) (error "No writable alias file. -Set `mh-alias-insert-file' or set AliasFile in your .mh_profile file")) +Set `mh-alias-insert-file' or the Aliasfile profile component")) ((not (elt autolist 1)) ; Only one entry, use it (car autolist)) ((or (not alias) (string-equal alias (mh-alias-ali alias))) ;alias doesn't exist - (completing-read "Alias file [press Tab]: " - (mapcar 'list autolist) nil t)) + (completing-read "Alias file: " (mapcar 'list autolist) nil t)) (t (or (mh-alias-which-file-has-alias alias autolist) - (completing-read "Alias file [press Tab]: " + (completing-read "Alias file: " (mapcar 'list autolist) nil t)))))))) ;;;###mh-autoload @@ -520,10 +476,8 @@ Set `mh-alias-insert-file' or set AliasFile in your .mh_profile file")) (split-string aliases ", +"))))))) ;;;###mh-autoload -(defun mh-alias-from-has-no-alias-p () - "Return t is From has no current alias set. -In the exceptional situation where there isn't a From header in the message the -function returns nil." +(defun mh-alias-for-from-p () + "Return t if sender's address has a corresponding alias." (mh-alias-reload-maybe) (save-excursion (if (not (mh-folder-line-matches-show-buffer-p)) @@ -532,13 +486,16 @@ function returns nil." (set-buffer mh-show-buffer)) (let ((from-header (mh-extract-from-header-value))) (and from-header - (not (mh-alias-address-to-alias from-header))))))) + (mh-alias-address-to-alias from-header)))))) (defun mh-alias-add-alias-to-file (alias address &optional file) "Add ALIAS for ADDRESS in alias FILE without alias check or prompts. Prompt for alias file if not provided and there is more than one candidate. -If ALIAS matches exactly, prompt to [i]nsert before old value or [a]ppend -after it." + +If the alias exists already, you will have the choice of inserting the new +alias before or after the old alias. In the former case, this alias will be +used when sending mail to this alias. In the latter case, the alias serves as +an additional folder name hint when filing messages." (if (not file) (setq file (mh-alias-insert-file alias))) (save-excursion @@ -552,14 +509,15 @@ after it." ((re-search-forward (concat "^" (regexp-quote alias-search) " *\\(.*\\)") nil t) (let ((answer (read-string - (format "Exists for %s; [i]nsert, [a]ppend: " + (format (concat "Alias %s exists; insert new address " + "[b]efore or [a]fter: ") (match-string 1)))) (case-fold-search t)) - (cond ((string-match "^i" answer)) + (cond ((string-match "^b" answer)) ((string-match "^a" answer) (forward-line 1)) (t - (error "Quitting"))))) + (error "Unrecognized response"))))) ;; No, so sort-in at the right place ;; search for "^alias", then "^alia", etc. ((eq mh-alias-insertion-location 'sorted) @@ -587,8 +545,11 @@ after it." ;;;###mh-autoload (defun mh-alias-add-alias (alias address) "*Add ALIAS for ADDRESS in personal alias file. -Prompts for confirmation if the address already has an alias. -If the alias is already is use, `mh-alias-add-alias-to-file' will prompt." +This function prompts you for an alias and address. If the alias exists +already, you will have the choice of inserting the new alias before or after +the old alias. In the former case, this alias will be used when sending mail +to this alias. In the latter case, the alias serves as an additional folder +name hint when filing messages." (interactive "P\nP") (mh-alias-reload-maybe) (setq alias (completing-read "Alias: " mh-alias-alist nil nil alias)) @@ -614,9 +575,7 @@ If the alias is already is use, `mh-alias-add-alias-to-file' will prompt." ;;;###mh-autoload (defun mh-alias-grab-from-field () - "*Add ALIAS for ADDRESS in personal alias file. -Prompts for confirmation if the alias is already in use or if the address -already has an alias." + "*Add alias for the sender of the current message." (interactive) (mh-alias-reload-maybe) (save-excursion @@ -636,24 +595,26 @@ already has an alias." ;;;###mh-autoload (defun mh-alias-add-address-under-point () - "Insert an alias for email address under point." + "Insert an alias for address under point." (interactive) (let ((address (mh-goto-address-find-address-at-point))) (if address (mh-alias-add-alias nil address) - (message "No email address found under point.")))) + (message "No email address found under point")))) ;;;###mh-autoload (defun mh-alias-apropos (regexp) - "Show all aliases that match REGEXP either in name or content." + "Show all aliases or addresses that match REGEXP." (interactive "sAlias regexp: ") (if mh-alias-local-users (mh-alias-reload-maybe)) - (let ((matches "")(group-matches "")(passwd-matches)) + (let ((matches "") + (group-matches "") + (passwd-matches)) (save-excursion (message "Reading MH aliases...") (mh-exec-cmd-quiet t "ali" "-nolist" "-nouser") - (message "Reading MH aliases...done. Parsing...") + (message "Parsing MH aliases...") (while (re-search-forward regexp nil t) (beginning-of-line) (cond @@ -673,10 +634,9 @@ already has an alias." (concat matches (buffer-substring (point)(progn (end-of-line)(point))) "\n"))))) - (message "Reading MH aliases...done. Parsing...done.") + (message "Parsing MH aliases...done") (when mh-alias-local-users - (message - "Reading MH aliases...done. Parsing...done. Passwd aliases...") + (message "Making passwd aliases...") (setq passwd-matches (mapconcat '(lambda (elem) @@ -684,13 +644,12 @@ already has an alias." (string-match regexp (cadr elem))) (format "%s: %s\n" (car elem) (cadr elem)))) mh-alias-passwd-alist "")) - (message - "Reading MH aliases...done. Parsing...done. Passwd aliases...done."))) + (message "Making passwd aliases...done"))) (if (and (string-equal "" matches) (string-equal "" group-matches) (string-equal "" passwd-matches)) (message "No matches") - (with-output-to-temp-buffer "*Help*" + (with-output-to-temp-buffer mh-aliases-buffer (if (not (string-equal "" matches)) (princ matches)) (when (not (string-equal group-matches "")) diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index 489b6690bc7..cde52c65043 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -33,11 +33,12 @@ ;;; Code: +(eval-when-compile (require 'mh-acros)) +(mh-require-cl) (require 'mh-e) (require 'gnus-util) (require 'easymenu) -(require 'mh-utils) -(mh-require-cl) +(require 'mh-gnus) (eval-when (compile load eval) (ignore-errors (require 'mailabbrev))) @@ -48,6 +49,7 @@ (defvar sendmail-coding-system) (defvar mh-identity-list) (defvar mh-identity-default) +(defvar mh-mml-mode-default) (defvar mh-identity-menu) ;;; Autoloads @@ -58,7 +60,7 @@ (autoload 'sc-cite-original "sc" "Workhorse citing function which performs the initial citation. This is callable from the various mail and news readers' reply -function according to the agreed upon standard. See `\\[sc-describe]' +function according to the agreed upon standard. See `sc-describe' for more details. `sc-cite-original' does not do any yanking of the original message but it does require a few things: @@ -95,14 +97,16 @@ If MH will not allow you to redist a previously redist'd msg, set to nil.") This allows transaction log to be visible if -watch, -verbose or -snoop are used.") -(defvar mh-note-repl "-" - "String whose first character is used to notate replied to messages.") +;;; Scan Line Formats -(defvar mh-note-forw "F" - "String whose first character is used to notate forwarded messages.") +(defvar mh-note-repl ?- + "Messages that have been replied to are marked by this character.") -(defvar mh-note-dist "R" - "String whose first character is used to notate redistributed messages.") +(defvar mh-note-forw ?F + "Messages that have been forwarded are marked by this character.") + +(defvar mh-note-dist ?R + "Messages that have been redistributed are marked by this character.") (defvar mh-yank-hooks nil "Obsolete hook for modifying a citation just inserted in the mail buffer. @@ -113,23 +117,6 @@ text as modified. This is a normal hook, misnamed for historical reasons. It is semi-obsolete and is only used if `mail-citation-hook' is nil.") -(defvar mail-citation-hook nil - "*Hook for modifying a citation just inserted in the mail buffer. -Each hook function can find the citation between point and mark. -And each hook function should leave point and mark around the citation -text as modified. - -If this hook is entirely empty (nil), the text of the message is inserted -with `mh-ins-buf-prefix' prefixed to each line. - -See also the variable `mh-yank-from-start-of-msg', which controls how -much of the message passed to the hook. - -This hook was historically provided to set up supercite. You may now leave -this nil and set up supercite by setting the variable -`mh-yank-from-start-of-msg' to 'supercite or, for more automatic insertion, -to 'autosupercite.") - (defvar mh-comp-formfile "components" "Name of file to be used as a skeleton for composing messages. Default is \"components\". If not an absolute file name, the file @@ -145,7 +132,8 @@ system MH lib directory.") (defvar mh-repl-group-formfile "replgroupcomps" "Name of file to be used as a skeleton for replying to messages. This file is used to form replies to the sender and all recipients of a -message. Only used if `mh-nmh-flag' is non-nil. Default is \"replgroupcomps\". +message. Only used if `(mh-variant-p 'nmh)' is non-nil. +Default is \"replgroupcomps\". If not an absolute file name, the file is searched for first in the user's MH directory, then in the system MH lib directory.") @@ -153,6 +141,8 @@ directory, then in the system MH lib directory.") (format "^%s$" (regexp-opt '("Content-Type: message/rfc822" ;MIME MDN + "------ This is a copy of the message, including all the headers. ------";from exim + "--- Below this line is a copy of the message."; from qmail " ----- Unsent message follows -----" ;from sendmail V5 " --------Unsent Message below:" ; from sendmail at BU " ----- Original message follows -----" ;from sendmail V8 @@ -201,16 +191,16 @@ Used by the \\`\\[mh-edit-again]' and `\\[mh-extract-rejecte "Field name for message annotation.") (defvar mh-insert-auto-fields-done-local nil - "Buffer-local variable set when `mh-insert-auto-fields' successfully called.") + "Buffer-local variable set when `mh-insert-auto-fields' called successfully.") (make-variable-buffer-local 'mh-insert-auto-fields-done-local) ;;;###autoload (defun mh-smail () "Compose and send mail with the MH mail system. -This function is an entry point to MH-E, the Emacs front end -to the MH mail system. +This function is an entry point to MH-E, the Emacs interface to the MH mail +system. -See documentation of `\\[mh-send]' for more details on composing mail." +See `mh-send' for more details on composing mail." (interactive) (mh-find-path) (call-interactively 'mh-send)) @@ -220,11 +210,11 @@ See documentation of `\\[mh-send]' for more details on composing mail." ;;;###autoload (defun mh-smail-batch (&optional to subject other-headers &rest ignored) "Set up a mail composition draft with the MH mail system. -This function is an entry point to MH-E, the Emacs front end -to the MH mail system. This function does not prompt the user -for any header fields, and thus is suitable for use by programs -that want to create a mail buffer. -Users should use `\\[mh-smail]' to compose mail. +This function is an entry point to MH-E, the Emacs interface to the MH mail +system. This function does not prompt the user for any header fields, and thus +is suitable for use by programs that want to create a mail buffer. Users +should use `mh-smail' to compose mail. + Optional arguments for setting certain fields include TO, SUBJECT, and OTHER-HEADERS. Additional arguments are IGNORED." (mh-find-path) @@ -260,7 +250,8 @@ CONTINUE, SWITCH-FUNCTION, YANK-ACTION and SEND-ACTIONS are ignored." "Clean up a draft or a message MSG previously sent and make it resendable. Default is the current message. The variable `mh-new-draft-cleaned-headers' specifies the headers to remove. -See also documentation for `\\[mh-send]' function." + +See also `mh-send'." (interactive (list (mh-get-msg-num t))) (let* ((from-folder mh-current-folder) (config (current-window-configuration)) @@ -292,7 +283,8 @@ See also documentation for `\\[mh-send]' function." "Extract message MSG returned by the mail system and make it resendable. Default is the current message. The variable `mh-new-draft-cleaned-headers' gives the headers to clean out of the original message. -See also documentation for `\\[mh-send]' function." + +See also `mh-send'." (interactive (list (mh-get-msg-num t))) (let ((from-folder mh-current-folder) (config (current-window-configuration)) @@ -303,7 +295,7 @@ See also documentation for `\\[mh-send]' function." (delete-region (point-min) (point)) (mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil)) (t - (message "Does not appear to be a rejected letter."))) + (message "Does not appear to be a rejected letter"))) (mh-insert-header-separator) (goto-char (point-min)) (save-buffer) @@ -323,7 +315,7 @@ Default is the displayed message. Check the documentation of `mh-interactive-range' to see how RANGE is read in interactive use. -See also documentation for `\\[mh-send]' function." +See also `mh-send'." (interactive (list (mh-interactive-read-address "To: ") (mh-interactive-read-address "Cc: ") (mh-interactive-range "Forward"))) @@ -335,7 +327,10 @@ See also documentation for `\\[mh-send]' function." (draft-name (expand-file-name "draft" mh-user-path)) (draft (cond ((or (not (file-exists-p draft-name)) (y-or-n-p "The file 'draft' exists. Discard it? ")) - (mh-exec-cmd "forw" "-build" (if mh-nmh-flag "-mime") + (mh-exec-cmd "forw" "-build" + (if (and (mh-variant-p 'nmh) + mh-compose-forward-as-mime-flag) + "-mime") mh-current-folder (mh-coalesce-msg-list msgs)) (prog1 @@ -388,7 +383,8 @@ See also documentation for `\\[mh-send]' function." mh-note-forw "Forwarded:" config) (mh-letter-mode-message) - (mh-letter-adjust-point))))) + (mh-letter-adjust-point) + (run-hooks 'mh-forward-hook))))) (defun mh-forwarded-letter-subject (from subject) "Return a Subject suitable for a forwarded message. @@ -406,10 +402,10 @@ Original message has headers FROM and SUBJECT." ;;;###autoload (defun mh-smail-other-window () "Compose and send mail in other window with the MH mail system. -This function is an entry point to MH-E, the Emacs front end -to the MH mail system. +This function is an entry point to MH-E, the Emacs interface to the MH mail +system. -See documentation of `\\[mh-send]' for more details on composing mail." +See `mh-send' for more details on composing mail." (interactive) (mh-find-path) (call-interactively 'mh-send-other-window)) @@ -496,13 +492,15 @@ to reply to: If optional prefix argument INCLUDEP provided, then include the message in the reply using filter `mhl.reply' in your MH directory. If the file named by `mh-repl-formfile' exists, it is used as a skeleton -for the reply. See also documentation for `\\[mh-send]' function." +for the reply. + +See also `mh-send'." (interactive (list (mh-get-msg-num t) (let ((minibuffer-help-form "from => Sender only\nto => Sender and primary recipients\ncc or all => Sender and all recipients")) (or mh-reply-default-reply-to - (completing-read "Reply to whom? (from, to, all) [from]: " + (completing-read "Reply to whom: [from] " '(("from") ("to") ("cc") ("all")) nil t))) @@ -511,7 +509,7 @@ for the reply. See also documentation for `\\[mh-send]' function." (show-buffer mh-show-buffer) (config (current-window-configuration)) (group-reply (or (equal reply-to "cc") (equal reply-to "all"))) - (form-file (cond ((and mh-nmh-flag group-reply + (form-file (cond ((and (mh-variant-p 'nmh 'mu-mh) group-reply (stringp mh-repl-group-formfile)) mh-repl-group-formfile) ((stringp mh-repl-formfile) mh-repl-formfile) @@ -525,7 +523,7 @@ for the reply. See also documentation for `\\[mh-send]' function." '("-nocc" "all")) ((equal reply-to "to") '("-cc" "to")) - (group-reply (if mh-nmh-flag + (group-reply (if (mh-variant-p 'nmh 'mu-mh) '("-group" "-nocc" "me") '("-cc" "all" "-nocc" "me")))) (cond ((or (eq mh-yank-from-start-of-msg 'autosupercite) @@ -562,7 +560,6 @@ for the reply. See also documentation for `\\[mh-send]' function." ;;;###mh-autoload (defun mh-send (to cc subject) "Compose and send a letter. - Do not call this function from outside MH-E; use \\[mh-smail] instead. The file named by `mh-comp-formfile' will be used as the form. @@ -581,7 +578,6 @@ passed three arguments: TO, CC, and SUBJECT." ;;;###mh-autoload (defun mh-send-other-window (to cc subject) "Compose and send a letter in another window. - Do not call this function from outside MH-E; use \\[mh-smail-other-window] instead. @@ -711,6 +707,8 @@ Do not insert any pairs whose value is the empty string." (while name-values (let ((field-name (car name-values)) (value (car (cdr name-values)))) + (if (not (string-match "^.*:$" field-name)) + (setq field-name (concat field-name ":"))) (cond ((equal value "") nil) ((mh-position-on-field field-name) @@ -730,6 +728,7 @@ The optional second arg is for pre-version 4 compatibility and is IGNORED." ((mh-goto-header-end 0) nil))) +;;;###mh-autoload (defun mh-get-header-field (field) "Find and return the body of FIELD in the mail header. Returns the empty string if the field is not in the header of the @@ -777,35 +776,53 @@ Returns t if found, nil if not." ;;; Menu extracted from mh-menubar.el V1.1 (31 July 2001) (eval-when-compile (defvar mh-letter-menu nil)) -(cond - ((fboundp 'easy-menu-define) - (easy-menu-define - mh-letter-menu mh-letter-mode-map "Menu for MH-E letter mode." - '("Letter" - ["Send This Draft" mh-send-letter t] - ["Split Current Line" mh-open-line t] - ["Check Recipient" mh-check-whom t] - ["Yank Current Message" mh-yank-cur-msg t] - ["Insert a Message..." mh-insert-letter t] - ["Insert Signature" mh-insert-signature t] - ["GPG Sign message" - mh-mml-secure-message-sign-pgpmime mh-gnus-pgp-support-flag] - ["GPG Encrypt message" - mh-mml-secure-message-encrypt-pgpmime mh-gnus-pgp-support-flag] - ["Compose Insertion (MIME)..." mh-compose-insertion t] - ;; ["Compose Compressed tar (MIME)..." - ;;mh-mhn-compose-external-compressed-tar t] - ;; ["Compose Anon FTP (MIME)..." mh-mhn-compose-anon-ftp t] - ["Compose Forward (MIME)..." mh-compose-forward t] - ;; The next two will have to be merged. But I also need to make sure the - ;; user can't mix directives of both types. - ["Pull in All Compositions (mhn)" - mh-edit-mhn (mh-mhn-directive-present-p)] - ["Pull in All Compositions (gnus)" - mh-mml-to-mime (mh-mml-directive-present-p)] - ["Revert to Non-MIME Edit (mhn)" - mh-revert-mhn-edit (equal mh-compose-insertion 'mhn)] - ["Kill This Draft" mh-fully-kill-draft t])))) +(easy-menu-define + mh-letter-menu mh-letter-mode-map "Menu for MH-E letter mode." + '("Letter" + ["Send This Draft" mh-send-letter t] + ["Split Current Line" mh-open-line t] + ["Check Recipient" mh-check-whom t] + ["Yank Current Message" mh-yank-cur-msg t] + ["Insert a Message..." mh-insert-letter t] + ["Insert Signature" mh-insert-signature t] + ("Encrypt/Sign Message" + ["Sign Message" + mh-mml-secure-message-sign mh-gnus-pgp-support-flag] + ["Encrypt Message" + mh-mml-secure-message-encrypt mh-gnus-pgp-support-flag] + ["Sign+Encrypt Message" + mh-mml-secure-message-signencrypt mh-gnus-pgp-support-flag] + ["Disable Security" + mh-mml-unsecure-message mh-gnus-pgp-support-flag] + "--" + "Security Method" + ["PGP (MIME)" (setq mh-mml-method-default "pgpmime") + :style radio + :selected (equal mh-mml-method-default "pgpmime")] + ["PGP" (setq mh-mml-method-default "pgp") + :style radio + :selected (equal mh-mml-method-default "pgp")] + ["S/MIME" (setq mh-mml-method-default "smime") + :style radio + :selected (equal mh-mml-method-default "smime")] + "--" + ["Save Method as Default" + (customize-save-variable 'mh-mml-method-default mh-mml-method-default) t] + ) + ["Compose Insertion (MIME)..." mh-compose-insertion t] + ["Compose Compressed tar (MIME)..." + mh-mhn-compose-external-compressed-tar t] + ["Compose Get File (MIME)..." mh-mhn-compose-anon-ftp t] + ["Compose Forward (MIME)..." mh-compose-forward t] + ;; The next two will have to be merged. But I also need to make sure the + ;; user can't mix directives of both types. + ["Pull in All Compositions (mhn)" + mh-edit-mhn (mh-mhn-directive-present-p)] + ["Pull in All Compositions (gnus)" + mh-mml-to-mime (mh-mml-directive-present-p)] + ["Revert to Non-MIME Edit (mhn)" + mh-revert-mhn-edit (equal mh-compose-insertion 'mhn)] + ["Kill This Draft" mh-fully-kill-draft t])) ;;; Help Messages ;;; Group messages logically, more or less. @@ -817,12 +834,15 @@ Returns t if found, nil if not." "\t\tInsert:\n" "Check recipients: \\[mh-check-whom]" "\t\t Current message: \\[mh-yank-cur-msg]\n" - "Encrypt message: \\[mh-mml-secure-message-encrypt-pgpmime]" - "\t\t Attachment: \\[mh-compose-insertion]\n" - "Sign message: \\[mh-mml-secure-message-sign-pgpmime]" - "\t\t Message to forward: \\[mh-compose-forward]\n" + "\t\t Attachment: \\[mh-compose-insertion]\n" + "\t\t Message to forward: \\[mh-compose-forward]\n" " " - "\t\t Signature: \\[mh-insert-signature]")) + "Security:" + "\t\t Encrypt message: \\[mh-mml-secure-message-encrypt]" + "\t\t Sign+Encrypt message: \\[mh-mml-secure-message-signencrypt]" + "\t\t Sign message: \\[mh-mml-secure-message-sign]\n" + " " + "\t\t Signature: \\[mh-insert-signature]")) "Key binding cheat sheet. This is an associative array which is used to show the most common commands. @@ -872,13 +892,19 @@ When a message is composed, the hooks `text-mode-hook' and `mh-letter-mode-hook' are run. \\{mh-letter-mode-map}" - (or mh-user-path (mh-find-path)) + (mh-find-path) (make-local-variable 'mh-send-args) (make-local-variable 'mh-annotate-char) (make-local-variable 'mh-annotate-field) (make-local-variable 'mh-previous-window-config) (make-local-variable 'mh-sent-from-folder) (make-local-variable 'mh-sent-from-msg) + ;; Set the local value of mh-mail-header-separator according to what is + ;; present in the buffer... + (set (make-local-variable 'mh-mail-header-separator) + (save-excursion + (goto-char (mh-mail-header-end)) + (buffer-substring-no-properties (point) (line-end-position)))) (make-local-variable 'mail-header-separator) (setq mail-header-separator mh-mail-header-separator) ;override sendmail.el (make-local-variable 'mh-help-messages) @@ -886,12 +912,6 @@ When a message is composed, the hooks `text-mode-hook' and (setq buffer-invisibility-spec '((vanish . t) t)) (set (make-local-variable 'line-move-ignore-invisible) t) - ;; Set mh-mail-header-end-marker to remember end of message header. - (set (make-local-variable 'mh-letter-mail-header-end-marker) - (set-marker (make-marker) (save-excursion - (goto-char (mh-mail-header-end)) - (line-beginning-position 2)))) - ;; From sendmail.el for proper paragraph fill ;; sendmail.el also sets a normal-auto-fill-function (not done here) (make-local-variable 'paragraph-separate) @@ -965,11 +985,15 @@ When a message is composed, the hooks `text-mode-hook' and t))) (defun mh-letter-header-end () - "Find the end of header from `mh-letter-mail-header-end-marker'." + "Find the end of the message header. +This function is to be used only for font locking. It works by searching for +`mh-mail-header-separator' in the buffer." (save-excursion - (goto-char (marker-position mh-letter-mail-header-end-marker)) - (forward-line -1) - (point))) + (goto-char (point-min)) + (cond ((equal mh-mail-header-separator "") (point-min)) + ((search-forward (format "\n%s\n" mh-mail-header-separator) nil t) + (line-beginning-position 0)) + (t (point-min))))) (defun mh-auto-fill-for-letter () "Perform auto-fill for message. @@ -1041,16 +1065,69 @@ Prompt for the field name with a completion list of the current folders." (substring folder 1) folder))))) +(defun mh-file-is-vcard-p (file) + "Return t if FILE is a .vcf vcard." + (let ((case-fold-search t)) + (and (stringp file) + (file-exists-p file) + (or (and (not (mh-have-file-command)) + (not (null (string-match "\.vcf$" file)))) + (and (mh-have-file-command) + (string-equal "text/x-vcard" (mh-file-mime-type file))))))) + ;;;###mh-autoload -(defun mh-insert-signature () - "Insert the file named by `mh-signature-file-name' at point. +(defun mh-insert-signature (&optional file) + "Insert the signature specified by `mh-signature-file-name' or FILE at point. +A signature separator (`-- ') will be added if the signature block does not +contain one and `mh-signature-separator-flag' is on. The value of `mh-letter-insert-signature-hook' is a list of functions to be -called, with no arguments, before the signature is actually inserted." - (interactive) - (let ((mh-signature-file-name mh-signature-file-name)) - (run-hooks 'mh-letter-insert-signature-hook) - (if mh-signature-file-name - (insert-file-contents mh-signature-file-name))) +called, with no arguments, after the signature is inserted. +The signature can also be inserted with `mh-identity-list'." +(interactive) + (save-excursion + (insert "\n") + (let ((mh-signature-file-name (or file mh-signature-file-name)) + (mh-mhn-p (mh-mhn-directive-present-p)) + (mh-mml-p (mh-mml-directive-present-p))) + (save-restriction + (narrow-to-region (point) (point)) + (cond + ((mh-file-is-vcard-p mh-signature-file-name) + (if (equal mh-compose-insertion 'gnus) + (insert "<#part type=\"text/x-vcard\" filename=\"" + mh-signature-file-name + "\" disposition=inline description=VCard>\n<#/part>") + (insert "#text/x-vcard; name=\"" + (file-name-nondirectory mh-signature-file-name) + "\" [VCard] " (expand-file-name mh-signature-file-name)))) + (t + (cond + (mh-mhn-p + (insert "#\n" "Content-Description: Signature\n")) + (mh-mml-p + (mml-insert-tag 'part 'type "text/plain" 'disposition "inline" + 'description "Signature"))) + (cond ((null mh-signature-file-name)) + ((and (stringp mh-signature-file-name) + (file-readable-p mh-signature-file-name)) + (insert-file-contents mh-signature-file-name)) + ((functionp mh-signature-file-name) + (funcall mh-signature-file-name))))) + (save-restriction + (widen) + (run-hooks 'mh-letter-insert-signature-hook)) + (goto-char (point-min)) + (when (and (not (mh-file-is-vcard-p mh-signature-file-name)) + mh-signature-separator-flag + (> (point-max) (point-min)) + (not (mh-signature-separator-p))) + (cond (mh-mhn-p + (forward-line 2)) + (mh-mml-p + (forward-line 1))) + (insert mh-signature-separator)) + (if (not (> (point-max) (point-min))) + (message "No signature found"))))) (force-mode-line-update)) ;;;###mh-autoload @@ -1100,33 +1177,18 @@ MH the first time a message is composed.") (defun mh-insert-x-mailer () "Append an X-Mailer field to the header. The versions of MH-E, Emacs, and MH are shown." - ;; Lazily initialize mh-x-mailer-string. (when (and mh-insert-x-mailer-flag (null mh-x-mailer-string)) - (save-window-excursion - ;; User would be confused if version info buffer disappeared magically, - ;; so don't delete buffer if it already existed. - (let ((info-buffer-exists-p (get-buffer mh-info-buffer))) - (mh-version) - (set-buffer mh-info-buffer) - (if mh-nmh-flag - (search-forward-regexp "^nmh-\\(\\S +\\)") - (search-forward-regexp "^MH \\(\\S +\\)" nil t)) - (let ((x-mailer-mh (buffer-substring (match-beginning 1) - (match-end 1)))) - (setq mh-x-mailer-string - (format "MH-E %s; %s %s; %sEmacs %s" - mh-version (if mh-nmh-flag "nmh" "MH") x-mailer-mh - (if mh-xemacs-flag "X" "GNU ") - (cond ((not mh-xemacs-flag) emacs-version) - ((string-match "[0-9.]*\\( +\([ a-z]+[0-9]+\)\\)?" - emacs-version) - (match-string 0 emacs-version)) - (t (format "%s.%s" - emacs-major-version - emacs-minor-version)))))) - (if (not info-buffer-exists-p) - (kill-buffer mh-info-buffer))))) + (setq mh-x-mailer-string + (format "MH-E %s; %s; %sEmacs %s" + mh-version mh-variant-in-use + (if mh-xemacs-flag "X" "GNU ") + (cond ((not mh-xemacs-flag) emacs-version) + ((string-match "[0-9.]*\\( +\([ a-z]+[0-9]+\)\\)?" + emacs-version) + (match-string 0 emacs-version)) + (t (format "%s.%s" emacs-major-version + emacs-minor-version)))))) ;; Insert X-Mailer, but only if it doesn't already exist. (save-excursion (when (and mh-insert-x-mailer-flag @@ -1155,25 +1217,31 @@ Sets buffer-local `mh-insert-auto-fields-done-local' when done and inserted something. If NON-INTERACTIVE is non-nil, do not be verbose and only attempt matches if `mh-insert-auto-fields-done-local' is nil. -An `identity' entry is skipped if one was already entered manually." +An `identity' entry is skipped if one was already entered manually. + +Return t if fields added; otherwise return nil." (interactive) - (when (or (not non-interactive) (not mh-insert-auto-fields-done-local)) + (when (or (not non-interactive) + (not mh-insert-auto-fields-done-local)) (save-excursion - (when (and (or (mh-goto-header-field "To:")(mh-goto-header-field "cc:"))) - (let ((list mh-auto-fields-list)) + (when (and (or (mh-goto-header-field "To:") + (mh-goto-header-field "cc:"))) + (let ((list mh-auto-fields-list) + (fields-inserted nil)) (while list (let ((regexp (nth 0 (car list))) (entries (nth 1 (car list)))) (when (mh-regexp-in-field-p regexp "To:" "cc:") (setq mh-insert-auto-fields-done-local t) + (setq fields-inserted t) (if (not non-interactive) - (message "Matched for regexp %s" regexp)) + (message "Fields for %s added" regexp)) (let ((entry-list entries)) (while entry-list (let ((field (caar entry-list)) (value (cdar entry-list))) (cond - ((equal "identity" field) + ((equal ":identity" field) (when (and (not mh-identity-local) (assoc value mh-identity-list)) (mh-insert-identity value))) @@ -1181,7 +1249,8 @@ An `identity' entry is skipped if one was already entered manually." (mh-modify-header-field field value (equal field "From"))))) (setq entry-list (cdr entry-list)))))) - (setq list (cdr list)))))))) + (setq list (cdr list))) + fields-inserted))))) (defun mh-modify-header-field (field value &optional overwrite-flag) "To header FIELD add VALUE. @@ -1201,8 +1270,6 @@ If OVERWRITE-FLAG is non-nil then the old value, if present, is discarded." (mh-goto-header-end 0) (insert field ": " value "\n")))) -(defvar mh-letter-mail-header-end-marker nil) - (defun mh-compose-and-send-mail (draft send-args sent-from-folder sent-from-msg to subject cc @@ -1221,22 +1288,19 @@ for `mh-annotate-msg'. CONFIG is the window configuration to restore after sending the letter." (pop-to-buffer draft) (mh-letter-mode) - (mh-insert-auto-fields t) - ;; mh-identity support + ;; Insert identity. (if (and (boundp 'mh-identity-default) mh-identity-default (not mh-identity-local)) (mh-insert-identity mh-identity-default)) - (when (and (boundp 'mh-identity-list) - mh-identity-list) - (mh-identity-make-menu) - (easy-menu-add mh-identity-menu)) + (mh-identity-make-menu) + (easy-menu-add mh-identity-menu) - ;; Extra fields + ;; Insert extra fields. (mh-insert-x-mailer) (mh-insert-x-face) - ;; Hide skipped fields + (mh-letter-hide-all-skipped-fields) (setq mh-sent-from-folder sent-from-folder) @@ -1264,7 +1328,16 @@ CONFIG is the window configuration to restore after sending the letter." This should be the last function called when composing the draft." (message "%s" (substitute-command-keys (concat "Type \\[mh-send-letter] to send message, " - "\\[mh-help] for help.")))) + "\\[mh-help] for help")))) + +(defun mh-ascii-buffer-p () + "Check if current buffer is entirely composed of ASCII. +The function doesn't work for XEmacs since `find-charset-region' doesn't exist +there." + (loop for charset in (mh-funcall-if-exists + find-charset-region (point-min) (point-max)) + unless (eq charset 'ascii) return nil + finally return t)) ;;;###mh-autoload (defun mh-send-letter (&optional arg) @@ -1273,15 +1346,17 @@ If optional prefix argument ARG is provided, monitor delivery. The value of `mh-before-send-letter-hook' is a list of functions to be called, with no arguments, before doing anything. Run `\\[mh-edit-mhn]' if mhn directives are present; otherwise -run `\\[mh-mml-to-mime]' if mml directives are present. -Insert X-Mailer field if variable `mh-insert-x-mailer-flag' is set. -Insert X-Face field if the file specified by `mh-x-face-file' exists." +run `\\[mh-mml-to-mime]' if mml directives are present." (interactive "P") (run-hooks 'mh-before-send-letter-hook) - (mh-insert-auto-fields t) + (if (and (mh-insert-auto-fields t) + mh-auto-fields-prompt-flag + (goto-char (point-min))) + (if (not (y-or-n-p "Auto fields inserted, send? ")) + (error "Send aborted"))) (cond ((mh-mhn-directive-present-p) (mh-edit-mhn)) - ((mh-mml-directive-present-p) + ((or (mh-mml-directive-present-p) (not (mh-ascii-buffer-p))) (mh-mml-to-mime))) (save-buffer) (message "Sending...") @@ -1302,7 +1377,7 @@ Insert X-Face field if the file specified by `mh-x-face-file' exists." 'iso-latin-1)))) ;; The default BCC encapsulation will make a MIME message unreadable. ;; With nmh use the -mime arg to prevent this. - (if (and mh-nmh-flag + (if (and (mh-variant-p 'nmh) (mh-goto-header-field "Bcc:") (mh-goto-header-field "Content-Type:")) (setq mh-send-args (format "-mime %s" mh-send-args))) @@ -1338,7 +1413,8 @@ Insert X-Face field if the file specified by `mh-x-face-file' exists." ;;;###mh-autoload (defun mh-insert-letter (folder message verbatim) "Insert a message into the current letter. -Removes the header fields according to the variable `mh-invisible-headers'. +Removes the header fields according to the variable +`mh-invisible-header-fields-compiled'. Prefixes each non-blank line with `mh-ins-buf-prefix', unless `mh-yank-from-start-of-msg' is set for supercite in which case supercite is used to format the message. @@ -1355,11 +1431,12 @@ and point after it." (save-restriction (narrow-to-region (point) (point)) (let ((start (point-min))) - (if (equal message "") (setq message (int-to-string mh-sent-from-msg))) + (if (and (equal message "") (numberp mh-sent-from-msg)) + (setq message (int-to-string mh-sent-from-msg))) (insert-file-contents (expand-file-name message (mh-expand-file-name folder))) (when (not verbatim) - (mh-clean-msg-header start mh-invisible-headers mh-visible-headers) + (mh-clean-msg-header start mh-invisible-header-fields-compiled nil) (goto-char (point-max)) ;Needed for sc-cite-original (push-mark) ;Needed for sc-cite-original (goto-char (point-min)) ;Needed for sc-cite-original @@ -1373,15 +1450,13 @@ and point after it." (skip-chars-forward " ") (cond ((looking-at "\"\\([^\"\n]+\\)\" \\(<.+>\\)") - (format "%s %s %s" (match-string 1)(match-string 2) - mh-extract-from-attribution-verb)) + (format "%s %s " (match-string 1)(match-string 2))) ((looking-at "\\([^<\n]+<.+>\\)$") - (format "%s %s" (match-string 1) mh-extract-from-attribution-verb)) + (format "%s " (match-string 1))) ((looking-at "\\([^ ]+@[^ ]+\\) +(\\(.+\\))$") - (format "%s <%s> %s" (match-string 2)(match-string 1) - mh-extract-from-attribution-verb)) + (format "%s <%s> " (match-string 2)(match-string 1))) ((looking-at " *\\(.+\\)$") - (format "%s %s" (match-string 1) mh-extract-from-attribution-verb)))))) + (format "%s " (match-string 1))))))) ;;;###mh-autoload (defun mh-yank-cur-msg () @@ -1444,9 +1519,11 @@ yanked message will be deleted." (push-mark) ;Needed for sc-cite-original (goto-char (point-min)) ;Needed for sc-cite-original (mh-insert-prefix-string mh-ins-buf-prefix) - (if (or (eq 'attribution mh-yank-from-start-of-msg) - (eq 'autoattrib mh-yank-from-start-of-msg)) - (insert from-attr "\n\n")) + (when (or (eq 'attribution mh-yank-from-start-of-msg) + (eq 'autoattrib mh-yank-from-start-of-msg)) + (insert from-attr) + (mh-identity-insert-attribution-verb nil) + (insert "\n\n")) ;; If the user has selected a region, he has already "edited" the ;; text, so leave the cursor at the end of the yanked text. In ;; either case, leave a mark at the opposite end of the included @@ -1572,7 +1649,7 @@ Any match found replaces the text from BEGIN to END." (let ((syntax-table (syntax-table))) (unwind-protect (save-excursion - (mh-funcall-if-exists mail-abbrev-make-syntax-table) + (mh-mail-abbrev-make-syntax-table) (set-syntax-table mail-abbrev-syntax-table) (backward-word n) (point)) @@ -1593,7 +1670,6 @@ Any match found replaces the text from BEGIN to END." (mh-folder-completion-function folder nil t)))) (mh-complete-word folder choices beg end))) -;; XXX: This should probably be customizable (defvar mh-letter-complete-function-alist '((cc . mh-alias-letter-expand-alias) (bcc . mh-alias-letter-expand-alias) @@ -1607,10 +1683,10 @@ Any match found replaces the text from BEGIN to END." (defun mh-letter-complete (arg) "Perform completion on header field or word preceding point. -Alias completion is done within the mail header on selected fields based on -the matches in `mh-letter-complete-function-alist'. Elsewhere the function -designated by `mh-letter-complete-function' is used and given the prefix ARG, -if present." +If the field contains addresses (for example, `To:' or `Cc:') or folders (for +example, `Fcc:') then this function will provide alias completion. Elsewhere, +this function runs `mh-letter-complete-function' instead and passes the prefix +ARG, if present." (interactive "P") (let ((func nil)) (cond ((not (mh-in-header-p)) @@ -1832,10 +1908,13 @@ Otherwise return the empty string." ;;; Build the letter-mode keymap: ;;; If this changes, modify mh-letter-mode-help-messages accordingly, above. (gnus-define-keys mh-letter-mode-map + " " mh-letter-complete-or-space + "," mh-letter-confirm-address "\C-c?" mh-help + "\C-c\C-\\" mh-fully-kill-draft ;if no C-q + "\C-c\C-^" mh-insert-signature ;if no C-s "\C-c\C-c" mh-send-letter "\C-c\C-d" mh-insert-identity - "\C-c\M-d" mh-insert-auto-fields "\C-c\C-e" mh-edit-mhn "\C-c\C-f\C-b" mh-to-field "\C-c\C-f\C-c" mh-to-field @@ -1852,31 +1931,38 @@ Otherwise return the empty string." "\C-c\C-fs" mh-to-field "\C-c\C-ft" mh-to-field "\C-c\C-i" mh-insert-letter - "\C-c\C-m\C-e" mh-mml-secure-message-encrypt-pgpmime + "\C-c\C-m\C-e" mh-mml-secure-message-encrypt "\C-c\C-m\C-f" mh-compose-forward + "\C-c\C-m\C-g" mh-mhn-compose-anon-ftp "\C-c\C-m\C-i" mh-compose-insertion "\C-c\C-m\C-m" mh-mml-to-mime - "\C-c\C-m\C-s" mh-mml-secure-message-sign-pgpmime + "\C-c\C-m\C-n" mh-mml-unsecure-message + "\C-c\C-m\C-s" mh-mml-secure-message-sign + "\C-c\C-m\C-t" mh-mhn-compose-external-compressed-tar "\C-c\C-m\C-u" mh-revert-mhn-edit - "\C-c\C-me" mh-mml-secure-message-encrypt-pgpmime + "\C-c\C-m\C-x" mh-mhn-compose-external-type + "\C-c\C-mee" mh-mml-secure-message-encrypt + "\C-c\C-mes" mh-mml-secure-message-signencrypt "\C-c\C-mf" mh-compose-forward + "\C-c\C-mg" mh-mhn-compose-anon-ftp "\C-c\C-mi" mh-compose-insertion "\C-c\C-mm" mh-mml-to-mime - "\C-c\C-ms" mh-mml-secure-message-sign-pgpmime + "\C-c\C-mn" mh-mml-unsecure-message + "\C-c\C-mse" mh-mml-secure-message-signencrypt + "\C-c\C-mss" mh-mml-secure-message-sign + "\C-c\C-mt" mh-mhn-compose-external-compressed-tar "\C-c\C-mu" mh-revert-mhn-edit + "\C-c\C-mx" mh-mhn-compose-external-type "\C-c\C-o" mh-open-line "\C-c\C-q" mh-fully-kill-draft - "\C-c\C-\\" mh-fully-kill-draft ;if no C-q "\C-c\C-s" mh-insert-signature - "\C-c\C-^" mh-insert-signature ;if no C-s + "\C-c\C-t" mh-letter-toggle-header-field-display "\C-c\C-w" mh-check-whom "\C-c\C-y" mh-yank-cur-msg - "\C-c\C-t" mh-letter-toggle-header-field-display - " " mh-letter-complete-or-space + "\C-c\M-d" mh-insert-auto-fields "\M-\t" mh-letter-complete "\t" mh-letter-next-header-field-or-indent - [backtab] mh-letter-previous-header-field - "," mh-letter-confirm-address) + [backtab] mh-letter-previous-header-field) ;; "C-c /" prefix is used in mh-letter-mode by pgp.el and mailcrypt.el. diff --git a/lisp/mh-e/mh-customize.el b/lisp/mh-e/mh-customize.el index 2ce36c88726..0cf35b3c0d9 100644 --- a/lisp/mh-e/mh-customize.el +++ b/lisp/mh-e/mh-customize.el @@ -34,159 +34,1469 @@ ;; ;; 1. MH-E Customization Groups ;; -;; These are the customization group definitions. These are organized in a -;; logical order. High-level, windows and toolbar, folder, message, -;; composing and hooks. +;; These are the customization group definitions. Every group has a +;; associated manual node. The ordering is alphabetical, except for the +;; groups mh-faces and mh-hooks which are last . ;; ;; 2. MH-E Customization ;; -;; Here are the actual customization variables. There is a sub-section for -;; each group in the MH-E Customization Groups section. Within each -;; section, variables are sorted alphabetically. The manual section -;; dictates which group a variable should be placed. New variables should -;; be placed in the section where they would most likely be defined. +;; These are the actual customization variables. There is a sub-section for +;; each group in the MH-E Customization Groups section, in the same order, +;; separated by page breaks. Within each section, variables are sorted +;; alphabetically. ;; -;; All hooks should be placed in the 'mh-hook group; in addition, add the -;; group in which the hook is defined in the manual (or, if it is new, -;; where it would be defined). These two actions insures that the hooks -;; appear last in each group. +;; 3. Hooks +;; +;; All hooks must be placed in the mh-hook group; in addition, add the +;; group associated with the manual node in which the hook is described. +;; Since the mh-hook group appears near the end of this file, the hooks +;; will appear at the end of these other groups. +;; +;; 4. Faces +;; +;; Create a new face group if necessary; in this case, add the group +;; associated with the manual node in which the faces are described to the +;; faces' group definition. Since the face groups appear last, the face +;; groups will appear at the end of these other groups. ;; -;; 3. Faces - ;;; Change Log: ;;; Code: + (provide 'mh-customize) -(require 'mh-utils) + +(eval-when-compile (require 'mh-acros)) +(mh-require-cl) +(require 'mh-loaddefs) + +(autoload 'Info-goto-node "info") + +(eval-and-compile + (defvar mh-xemacs-flag (featurep 'xemacs) + "Non-nil means the current Emacs is XEmacs.")) (when mh-xemacs-flag (require 'mh-xemacs)) -;;;###mh-autoload (defun mh-customize (&optional delete-other-windows-flag) "Customize MH-E variables. -With optional argument DELETE-OTHER-WINDOWS-FLAG, other windows in the frame -are removed." +If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in +the frame are removed." (interactive "P") (customize-group 'mh) (when delete-other-windows-flag (delete-other-windows))) + + +;;; For compiler warnings... +(defvar mh-show-buffer) +(defvar mh-show-folder-buffer) + ;;; MH-E Customization Groups (defgroup mh nil - "GNU Emacs interface to the MH mail system." + "Emacs interface to the MH mail system. +MH is the Rand Mail Handler. Other implementations include nmh and GNU +mailutils." :link '(custom-manual "(mh-e)Top") :group 'mail) -(defgroup mh-toolbar nil - "Toolbar configuration." - :prefix "mh-" - :group 'mh) +(defgroup mh-e '((mh custom-group)) ; Sort of an alias for 'mh group + "Emacs interface to the MH mail system. +MH is the Rand Mail Handler. Other implementations include nmh and GNU +mailutils." + :link '(custom-manual "(mh-e)Top")) -(defgroup mh-speed nil - "Speedbar and folder configuration." - :prefix "mh-" - :link '(custom-manual "(mh-e)Customizing Moving Mail") +(defgroup mh-alias nil + "Aliases." + :link '(custom-manual "(mh-e)Aliases") + :prefix "mh-alias-" :group 'mh) (defgroup mh-folder nil - "Options for controlling scan listing." + "Organizing your mail with folders." :prefix "mh-" - :link '(custom-manual "(mh-e)Customizing Moving Mail") + :link '(custom-manual "(mh-e)Organizing") + :group 'mh) + +(defgroup mh-folder-selection nil + "Folder selection." + :prefix "mh-" + :link '(custom-manual "(mh-e)Folder Selection") + :group 'mh) + +(defgroup mh-identity nil + "Identities." + :link '(custom-manual "(mh-e)Identities") + :prefix "mh-identity-" + :group 'mh) + +(defgroup mh-inc nil + "Incorporating your mail." + :prefix "mh-inc-" + :link '(custom-manual "(mh-e)Incorporating Mail") :group 'mh) (defgroup mh-index nil - "Indexed searching." - :link '(custom-manual "(mh-e)Customizing mh-e") - :prefix "mh-" + "Searching." + :link '(custom-manual "(mh-e)Searching") + :prefix "mh-index-" :group 'mh) (defgroup mh-junk nil - "Spam handling." - :link '(custom-manual "(mh-e)Customizing mh-e") + "Dealing with junk mail." + :link '(custom-manual "(mh-e)Junk") :prefix "mh-junk-" :group 'mh) -(defgroup mh-show nil - "Message display." +(defgroup mh-letter nil + "Editing a draft." + :prefix "mh-" + :link '(custom-manual "(mh-e)Editing Drafts") + :group 'mh) + +(defgroup mh-ranges nil + "Ranges." + :prefix "mh-" + :link '(custom-manual "(mh-e)Ranges") + :group 'mh) + +(defgroup mh-scan-line-formats nil + "Scan line formats." + :link '(custom-manual "(mh-e)Scan Line Formats") + :prefix "mh-" + :group 'mh) + +(defgroup mh-sending-mail nil + "Sending mail." + :prefix "mh-" + :link '(custom-manual "(mh-e)Sending Mail") + :group 'mh) + +(defgroup mh-sequences nil + "Sequences." + :prefix "mh-" + :link '(custom-manual "(mh-e)Sequences") + :group 'mh) + +(defgroup mh-show nil + "Reading your mail." + :prefix "mh-" + :link '(custom-manual "(mh-e)Reading Mail") + :group 'mh) + +(defgroup mh-speed nil + "The speedbar." + :prefix "mh-speed-" + :link '(custom-manual "(mh-e)Speedbar") + :group 'mh) + +(defgroup mh-toolbar nil + "The toolbar" + :link '(custom-manual "(mh-e)Toolbar") :prefix "mh-" - :link '(custom-manual "(mh-e)Customizing Reading") :group 'mh) (defgroup mh-faces nil "Faces used in MH-E." - :link '(custom-manual "(mh-e)Customizing mh-e") + :link '(custom-manual "(mh-e)Top") :prefix "mh-" :group 'faces :group 'mh) -(defgroup mh-letter nil - "Composing messages." - :prefix "mh-" - :link '(custom-manual "(mh-e)Customizing Sending") - :group 'mh) - -(defgroup mh-alias nil - "Alias handling." - :link '(custom-manual "(mh-e)Customizing mh-e") - :prefix "mh-alias-" - :group 'mh) - -(defgroup mh-identity nil - "Multiple personalities." - :link '(custom-manual "(mh-e)Customizing mh-e") - :prefix "mh-" - :group 'mh) - (defgroup mh-hooks nil "MH-E hooks." - :link '(custom-manual "(mh-e)Customizing mh-e") + :link '(custom-manual "(mh-e)Top") :prefix "mh-" :group 'mh) ;;; Faces -(defgroup mh-speed-faces nil - "Faces used in speedbar." - :link '(custom-manual "(mh-e)Customizing mh-e") - :prefix "mh-" - :group 'mh-faces - :group 'mh-speed) - (defgroup mh-folder-faces nil "Faces used in scan listing." - :link '(custom-manual "(mh-e)Customizing mh-e") - :prefix "mh-" - :group 'mh-faces - :group 'mh-folder) - -(defgroup mh-index-faces nil - "Faces used in indexed searches." - :link '(custom-manual "(mh-e)Customizing mh-e") - :prefix "mh-" - :group 'mh-faces - :group 'mh-index) - -(defgroup mh-show-faces nil - "Faces used in message display." - :link '(custom-manual "(mh-e)Customizing mh-e") + :link '(custom-manual "(mh-e)Organizing") :prefix "mh-" :group 'mh-faces :group 'mh-show) +(defgroup mh-index-faces nil + "Faces used in searching." + :link '(custom-manual "(mh-e)Searching") + :prefix "mh-" + :group 'mh-faces + :group 'mh-index) + (defgroup mh-letter-faces nil - "Faces used when composing messages." - :link '(custom-manual "(mh-e)Customizing mh-e") + "Faces used in message drafts." + :link '(custom-manual "(mh-e)Sending Mail") :prefix "mh-" :group 'mh-faces :group 'mh-letter) +(defgroup mh-show-faces nil + "Faces used in message display." + :link '(custom-manual "(mh-e)Reading Mail") + :prefix "mh-" + :group 'mh-faces + :group 'mh-show) + +(defgroup mh-speed-faces nil + "Faces used in speedbar." + :link '(custom-manual "(mh-e)Speedbar") + :prefix "mh-" + :group 'mh-faces + :group 'mh-speed) + -;;; MH-E Customization (:group mh) +;;; Emacs interface to the MH mail system (:group mh) +(eval-when (compile) + (setq mh-variant 'none)) -;;; Toolbar configuration (:group 'mh-toolbar) +(defcustom mh-variant 'autodetect + "*Specifies the variant used by MH-E. + +The default setting of this option is `Auto-detect' which means that MH-E will +automatically choose the first of nmh, MH, or GNU mailutils that it finds in +the directories listed in `mh-path', `mh-sys-path', and `exec-path'. If, for +example, you have both nmh and mailutils installed and `mh-variant-in-use' was +initialized to nmh but you want to use mailutils, then you can set this option +to `mailutils'. + +When this variable is changed, MH-E resets `mh-progs', `mh-lib', +`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use' +accordingly." + :type `(radio + (const :tag "Auto-detect" autodetect) + ,@(mapcar (lambda (x) `(const ,(car x))) (mh-variants))) + :set (lambda (symbol value) + (set-default symbol value) ;Done in mh-variant-set-variant! + (mh-variant-set value)) + :group 'mh) + + + +;;; Aliases (:group 'mh-alias) + +(defcustom mh-alias-completion-ignore-case-flag t + "*Non-nil means don't consider case significant in MH alias completion. +As MH ignores case in the aliases, so too does MH-E. However, you may turn +this option off to make case significant which can be used to segregate +completion of your aliases. You might use lowercase for mailing lists and +uppercase for people." + :type 'boolean + :group 'mh-alias) + +(defcustom mh-alias-expand-aliases-flag nil + "*Non-nil means to expand aliases entered in the minibuffer. +In other words, aliases entered in the minibuffer will be expanded to the full +address in the message draft. By default, this expansion is not performed." + :type 'boolean + :group 'mh-alias) + +(defcustom mh-alias-flash-on-comma t + "*Specify whether to flash address or warn on translation. +This option controls the behavior when a [comma] is pressed while entering +aliases or addresses. The default setting flashes the address associated with +an address in the minibuffer briefly, but does not display a warning if the +alias is not found." + :type '(choice (const :tag "Flash but Don't Warn If No Alias" t) + (const :tag "Flash and Warn If No Alias" 1) + (const :tag "Don't Flash Nor Warn If No Alias" nil)) + :group 'mh-alias) + +(defcustom mh-alias-insert-file nil + "*Filename used to store a new MH-E alias. +The default setting of this option is `Use Aliasfile Profile Component'. This +option can also hold the name of a file or a list a file names. If this option +is set to a list of file names, or the `Aliasfile:' profile component contains +more than one file name, MH-E will prompt for one of them when MH-E adds an +alias." + :type '(choice (const :tag "Use Aliasfile Profile Component" nil) + (file :tag "Alias File") + (repeat :tag "List of Alias Files" file)) + :group 'mh-alias) + +(defcustom mh-alias-insertion-location 'sorted + "Specifies where new aliases are entered in alias files. +This option is set to `Alphabetical' by default. If you organize your alias +file in other ways, then adding aliases to the `Top' or `Bottom' of your alias +file might be more appropriate." + :type '(choice (const :tag "Alphabetical" sorted) + (const :tag "Top" top) + (const :tag "Bottom" bottom)) + :group 'mh-alias) + +(defcustom mh-alias-local-users t + "*If on, local users are added to alias completion. + +Aliases are created from `/etc/passwd' entries with a user ID larger than +a magical number, typically 200. This can be a handy tool on a machine where +you and co-workers exchange messages. These aliases have the form +`local.first.last' if a real name is present in the password file. +Otherwise, the alias will have the form `local.login'. + +If you're on a system with thousands of users you don't know, and the loading +of local aliases slows MH-E down noticeably, then turn this option off. + +This option also takes a string which is executed to generate the password +file. For example, use \"ypcat passwd\" to obtain the NIS password file." + :type '(choice (boolean) (string)) + :group 'mh-alias) + +(defcustom mh-alias-local-users-prefix "local." + "*String prepended to the real names of users from the password file. +This option can also be set to `Use Login'. + +For example, consider the following password file entry: + + psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh + +The following settings of this option will produce the associated aliases: + + \"local.\" local.peter.galbraith + \"\" peter.galbraith + Use Login psg + +This option has no effect if variable `mh-alias-local-users' is turned off." + :type '(choice (const :tag "Use Login" nil) + (string)) + :group 'mh-alias) + +(defcustom mh-alias-passwd-gecos-comma-separator-flag t + "*Non-nil means the gecos field in the password file uses a comma separator. +In the example in `mh-alias-local-users-prefix', commas are used to separate +different values within the so-called gecos field. This is a fairly common +usage. However, in the rare case that the gecos field in your password file is +not separated by commas and whose contents may contain commas, you can turn +this option off." + :type 'boolean + :group 'mh-alias) + + + +;;; Organizing Your Mail with Folders (:group 'mh-folder) + +(defcustom mh-recenter-summary-flag nil + "*Non-nil means to recenter the summary window. +If this option is turned on, recenter the summary window when the show window +is toggled off." + :type 'boolean + :group 'mh-folder) + + + +;;; Folder Selection (:group 'mh-folder-selection) + +(defcustom mh-default-folder-for-message-function nil + "Function to select a default folder for refiling or `Fcc'. +The current buffer is set to the message being refiled with point at the start +of the message. This function should return the default folder as a string +with a leading `+' sign. It can also return nil so that the last folder name +is used as the default, or an empty string to suppress the default entirely." + :type 'function + :group 'mh-folder-selection) + +(defcustom mh-default-folder-list nil + "*List of addresses and folders. +The folder name associated with the first address found in this list is used +as the default for `mh-refile-msg' and similar functions. Each element in this +list contains a `Check Recipient' item. If this item is turned on, then the +address is checked against the recipient instead of the sender. This is useful +for mailing lists. + +See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more +information." + :type '(repeat (list (regexp :tag "Address") + (string :tag "Folder") + (boolean :tag "Check Recipient"))) + :group 'mh-folder-selection) + +(defcustom mh-default-folder-must-exist-flag t + "*Non-nil means guessed folder name must exist to be used. +If the derived folder does not exist, and this option is on, then the last +folder name used is suggested. This is useful if you get mail from various +people for whom you have an alias, but file them all in the same project +folder. + +See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more +information." + :type 'boolean + :group 'mh-folder-selection) + +(defcustom mh-default-folder-prefix "" + "*Prefix used for folder names generated from aliases. +The prefix is used to prevent clutter in your mail directory. + +See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more +information." + :type 'string + :group 'mh-folder-selection) + + + +;;; Identities (:group 'mh-identity) + +(defcustom mh-identity-list nil + "*List of identities. + +Each element consists of an identity label, and a collection of header fields +and a signature to insert if the identity is selected (see +`mh-identity-default', `mh-insert-identity' and the `Identity' menu in a +MH-Letter buffer). The `Value Menu' contains the common header fields `From' +and `Organization'. Other header fields may be added using the `Other Field' +menu item. The `Signature' menu item is used to insert a signature with +`mh-insert-signature'. The `GPG Key ID' menu item is used to specify a +different key to sign or encrypt messages." + :type '(repeat (list :tag "" + (string :tag "Label") + (repeat :tag "Add at least one item below" + (choice + (cons :tag "From Field" + (const "From") + (string :tag "Value")) + (cons :tag "Organization Field" + (const "Organization") + (string :tag "Value")) + (cons :tag "Other Field" + (string :tag "Field") + (string :tag "Value")) + (cons :tag "Attribution Verb" + (const ":attribution-verb") + (string :tag "Value")) + (cons :tag "Signature" + (const :tag "Signature" + ":signature") + (choice + (const :tag "mh-signature-file-name" + nil) + (file) + (function))) + (cons :tag "GPG Key ID" + (const :tag "GPG Key ID" + ":pgg-default-user-id") + (string :tag "Value")))))) + :set 'mh-identity-list-set + :group 'mh-identity) + +(defcustom mh-auto-fields-list nil + "List of recipients for which header lines are automatically inserted. +Each element consists of the recipient, which is a regular expression, and a +collection of header fields and identities to insert if the message is sent to +this recipient. The `Value Menu' contains the common header fields `Fcc' and +`Mail-Followup-To'. Other header fields may be added using the `Other Field' +menu item. The `Identity' menu item is used to insert entire identities with +`mh-insert-identity'." + :type `(repeat + (list :tag "" + (string :tag "Recipient") + (repeat :tag "Add at least one item below" + (choice + (cons :tag "Identity" + (const ":identity") + ,(append + '(radio) + (mapcar + (function (lambda (arg) `(const ,arg))) + (mapcar 'car mh-identity-list)))) + (cons :tag "Fcc Field" + (const "fcc") + (string :tag "Value")) + (cons :tag "Mail-Followup-To Field" + (const "Mail-Followup-To") + (string :tag "Value")) + (cons :tag "Other Field" + (string :tag "Field") + (string :tag "Value")))))) + :group 'mh-identity) + +(defcustom mh-auto-fields-prompt-flag t + "*Non-nil means to prompt before sending if fields inserted. +See `mh-auto-fields-list'." + :type 'boolean + :group 'mh-identity) + +(defcustom mh-identity-default nil + "Default identity to use when `mh-letter-mode' is called." + :type (append + '(radio) + (cons '(const :tag "None" nil) + (mapcar (function (lambda (arg) `(const ,arg))) + (mapcar 'car mh-identity-list)))) + :group 'mh-identity) + +(defcustom mh-identity-handlers + '(("default" . mh-identity-handler-bottom) + ("from" . mh-identity-handler-top) + (":attribution-verb" . mh-identity-handler-attribution-verb) + (":signature" . mh-identity-handler-signature) + (":pgg-default-user-id" . mh-identity-handler-gpg-identity)) + "Handler functions for fields in `mh-identity-list'. +This is an alist of fields (strings) and handlers (functions). Strings are +lowercase. Use \":signature\" for Signature and \":pgg-default-user-id\" for +GPG Key ID. The function associated with the string \"default\" is used if no +other functions are appropriate. For this reason, don't name a header field +\"Default\"." + :type '(repeat (cons (string :tag "Field") function)) + :group 'mh-identity) + + + +;;; Incorporating Your Mail (:group 'mh-inc) + +(defcustom mh-inc-prog "inc" + "*Program to run to incorporate new mail into a folder. +Normally \"inc\". This program is relative to the `mh-progs' directory unless +it is an absolute pathname." + :type 'string + :group 'mh-inc) + +(defcustom mh-inc-spool-list nil + "*Alist of alternate spool files, corresponding folders and keybindings. +This option will be described by example. + +Suppose you have subscribed to the mh-e-devel mailing list and you use +procmail to filter its mail into `~/mail/mh-e' with the following +`.procmailrc' recipe: + + MAILDIR=$HOME/mail + :0: + * ^From mh-e-devel-admin@lists.sourceforge.net + mh-e + +If you wanted to incorporate that spool file into an MH folder called mh-e +with the \"I m\" or \\[mh-inc-spool-mh-e] commands, you would use the +following: + + Spool File: ~/mail/mh-e + Folder: mh-e + Key Binding: m + +Then, you could also install `xbuffy' and configure an extra mailbox using the +gnuserv package to run the `mh-inc-spool-mh-e' command in Emacs: + + box ~/mail/mh-e + title mh-e + origMode + polltime 10 + headertime 0 + command gnudoit -q '(mh-inc-spool-mh-e)' + +To incorporate the spool file, click the xbuffy box with the middle mouse +button." + :type '(repeat (list (file :tag "Spool File") + (string :tag "Folder") + (character :tag "Key Binding"))) + :set 'mh-inc-spool-list-set + :group 'mh-inc) + + + +;;; Searching (:group 'mh-index) + +(defcustom mh-index-new-messages-folders t + "Folders searched for the `unseen' sequence. +This option can be set to `Inbox' to search the `+inbox' folder or `All' to +search all of the top level folders. Otherwise, list the folders that should +be searched with the `Choose Folders' menu item. + +See also `mh-recursive-folders-flag'." + :group 'mh-index + :type '(choice (const :tag "Inbox" t) + (const :tag "All" nil) + (repeat :tag "Choose Folders" (string :tag "Folder")))) + +(defcustom mh-index-program nil + "Indexing program that MH-E shall use. +The default setting of this option is `Auto-detect' which means that MH-E will +automatically choose one of swish++, swish-e, mairix, namazu, pick and grep in +that order. If, for example, you have both swish++ and mairix installed and +you want to use mairix, then you can set this option to `mairix'. + +More information about setting up an indexing program to use with MH-E can be +found in the documentation of `mh-index-search'." + :type '(choice (const :tag "Auto-detect" nil) + (const :tag "swish++" swish++) + (const :tag "swish-e" swish) + (const :tag "mairix" mairix) + (const :tag "namazu" namazu) + (const :tag "pick" pick) + (const :tag "grep" grep)) + :group 'mh-index) + +(defcustom mh-index-ticked-messages-folders t + "Folders searched for `mh-tick-seq'. +This option can be set to `Inbox' to search the `+inbox' folder or `All' to +search all of the top level folders. Otherwise, list the folders that should +be searched with the `Choose Folders' menu item. + +See also `mh-recursive-folders-flag'." + :group 'mh-index + :type '(choice (const :tag "Inbox" t) + (const :tag "All" nil) + (repeat :tag "Choose Folders" (string :tag "Folder")))) + + + +;;; Dealing with Junk Mail (:group 'mh-junk) + +;; Spam fighting program chosen +(defvar mh-junk-choice nil) + +;; Available spam filter interfaces +(defvar mh-junk-function-alist + '((spamassassin mh-spamassassin-blacklist mh-spamassassin-whitelist) + (bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist) + (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist)) + "Available choices of spam programs to use. +This is an alist. For each element there are functions that blacklist a message +as spam and whitelist a message incorrectly classified as spam.") + +(defun mh-junk-choose (symbol value) + "Choose spam program to use. +The function is always called with SYMBOL bound to `mh-junk-program' and VALUE +bound to the new value of `mh-junk-program'. The function sets the variable +`mh-junk-choice' in addition to `mh-junk-program'." + (set symbol value) + (setq mh-junk-choice + (or value + (loop for element in mh-junk-function-alist + until (executable-find (symbol-name (car element))) + finally return (car element))))) + +;; User customizable variables +(defcustom mh-junk-disposition nil + "Disposition of junk mail." + :type '(choice (const :tag "Delete Spam" nil) + (string :tag "Spam Folder")) + :group 'mh-junk) + +(defcustom mh-junk-program nil + "Spam program that MH-E should use. +The default setting of this option is `Auto-detect' which means that MH-E will +automatically choose one of SpamAssassin, Bogofilter, or SpamProbe in that +order. If, for example, you have both SpamAssassin and Bogofilter installed +and you want to use BogoFilter, then you can set this option to `Bogofilter'." + :type '(choice (const :tag "Auto-detect" nil) + (const :tag "SpamAssassin" spamassassin) + (const :tag "Bogofilter" bogofilter) + (const :tag "SpamProbe" spamprobe)) + :set 'mh-junk-choose + :group 'mh-junk) + +(defcustom mh-junk-background nil + "If on, spam programs are run in background. +By default, the programs are run in the foreground, but this can be slow when +junking large numbers of messages. If you have enough memory or don't junk +that many messages at the same time, you might try turning on this option." + :type '(choice (const :tag "Off" nil) + (const :tag "On" 0)) + :group 'mh-junk) + + + +;;; Editing a Draft (:group 'mh-letter) + +(defcustom mh-mml-method-default (if mh-gnus-pgp-support-flag "pgpmime" "none") + "Default method to use in security directives." + :type '(choice (const :tag "PGP (MIME)" "pgpmime") + (const :tag "PGP" "pgp") + (const :tag "S/MIME" "smime") + (const :tag "None" "none")) + :group 'mh-letter) + +(defcustom mh-compose-forward-as-mime-flag t + "Non-nil means that messages are forwarded as a MIME part." + :type 'boolean + :group 'mh-letter) + +(defcustom mh-compose-insertion (if (locate-library "mml") 'gnus 'mhn) + "Type of MIME message directives in messages. + +By default, this option is set to `Gnus' if it is supported. This option can +also be set manually to `mhn' if mhn directives are preferred." + :type '(choice (const :tag "Gnus" gnus) + (const :tag "mhn" mhn)) + :group 'mh-letter) + +(defcustom mh-compose-skipped-header-fields + '("From" "Organization" "References" "In-Reply-To" + "X-Face" "Face" "X-Image-URL" "X-Mailer") + "List of header fields to skip over when navigating in draft." + :type '(repeat (string :tag "Field")) + :group 'mh-letter) + +(defcustom mh-compose-space-does-completion-flag nil + "*Non-nil means that does completion in message header." + :type 'boolean + :group 'mh-letter) + +(defcustom mh-delete-yanked-msg-window-flag nil + "*Non-nil means delete any window displaying the message. +If this option is on, yanking the current message into a draft letter with +\\\\[mh-yank-cur-msg] deletes any windows displaying the +message." + :type 'boolean + :group 'mh-letter) + +(defcustom mh-extract-from-attribution-verb "wrote:" + "*Verb to use for attribution when a message is yanked by \\\\[mh-yank-cur-msg]." + :type '(choice (const "wrote:") + (const "a écrit:") + (const "schrieb:") + (string :tag "Custom String")) + :group 'mh-letter) + +(defcustom mh-ins-buf-prefix "> " + "*String to put before each non-blank line of a yanked or inserted message. +Used when the message is inserted into an outgoing letter +by \\\\[mh-insert-letter] or \\[mh-yank-cur-msg]." + :type 'string + :group 'mh-letter) + +(defcustom mh-insert-x-mailer-flag t + "*Non-nil means append an X-Mailer field to the header." + :type 'boolean + :group 'mh-letter) + +(defcustom mh-letter-complete-function 'ispell-complete-word + "*Function to call when completing outside of address or folder fields. +By default, this is set to `ispell-complete-word'." + :type '(choice function (const nil)) + :group 'mh-letter) + +(defcustom mh-letter-fill-column 72 + "*Fill column to use in `mh-letter-mode'. +This is usually less than in other text modes because email messages get +quoted by some prefix (sometimes many times) when they are replied to, +and it's best to avoid quoted lines that span more than 80 columns." + :type 'integer + :group 'mh-letter) + +(defcustom mh-reply-show-message-flag t + "*Non-nil means the show buffer is displayed using \\\\[mh-reply]. + +The setting of this variable determines whether the MH `show-buffer' is +displayed with the current message when using `mh-reply' without a prefix +argument. Set it to nil if you already include the message automatically +in your draft using + repl: -filter repl.filter +in your ~/.mh_profile file." + :type 'boolean + :group 'mh-letter) + +(defcustom mh-signature-file-name "~/.signature" + "*Source of user's signature. + +By default, the text of your signature is taken from the file `~/.signature'. +You can read from other files by changing this option. This file may contain a +vCard in which case an attachment is added with the vCard. + +This option may also be a symbol, in which case that function is called. You +may not want a signature separator to be added for you; instead you may want +to insert one yourself. Variables that you may find useful to do this include +`mh-signature-separator' (when inserting a signature separator) and +`mh-signature-separator-regexp' (for finding said separator). The function +`mh-signature-separator-p', which reports t if the buffer contains a +separator, may be useful as well. + +The signature is inserted into your message with the command +\\\\[mh-insert-signature] or with the `mh-identity-list' +option." + :type 'file + :group 'mh-letter) + +(defcustom mh-signature-separator-flag t + "*Non-nil means a signature separator should be inserted. +It is not recommended that you change this option since various mail user +agents, including MH-E, use the separator to present the signature +differently, and to suppress the signature when replying or yanking a letter +into a draft." + :type 'boolean + :group 'mh-letter) + +(defcustom mh-x-face-file "~/.face" + "*File containing face header field to insert in outgoing mail. + +If the file starts with either of the strings `X-Face:', `Face:' or +`X-Image-URL:' then the contents are added to the message header verbatim. +Otherwise it is assumed that the file contains the value of the `X-Face:' +header field. + +The `X-Face:' header field, which is a low-resolution, black and white image, +can be generated using the `compface' command, which can be obtained from +ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. The \"Online +X-Face Convertor\" at http://www.dairiki.org/xface/ is a useful resource for +quick conversion of images into `X-Face:' header fields. + +Use the `make-face' script (http://quimby.gnus.org/circus/face/make-face) to +convert a JPEG image to the higher resolution, color, `Face:' header field. + +The URL of any image can be used for the `X-Image-URL:' field and no +processing of the image is required. + +To prevent the setting of any of these header fields, either set +`mh-x-face-file' to nil, or simply ensure that the file defined by this option +doesn't exist." + :type 'file + :group 'mh-letter) + +(defcustom mh-yank-from-start-of-msg 'attribution + "*Controls which part of a message is yanked by \\\\[mh-yank-cur-msg]. +If t, include the entire message, with full headers. This is historically +here for use with supercite, but is now deprecated in favor of the setting +`supercite' below. + +If the symbol `body', then yank the message minus the header. + +If the symbol `supercite', include the entire message, with full headers. +This also causes the invocation of `sc-cite-original' without the setting +of `mail-citation-hook', now deprecated practice. + +If the symbol `autosupercite', do as for `supercite' automatically when +show buffer matches the message being replied-to. When this option is used, +the -noformat switch is passed to the repl program to override a -filter or +-format switch. + +If the symbol `attribution', then yank the message minus the header and add +a simple attribution line at the top. + +If the symbol `autoattrib', do as for `attribution' automatically when show +buffer matches the message being replied-to. You can make sure this is +always the case by setting `mh-reply-show-message-flag' to t (which is the +default) and optionally `mh-delete-yanked-msg-window-flag' to t as well such +that the show window is never displayed. When the `autoattrib' option is +used, the -noformat switch is passed to the repl program to override a +-filter or -format switch. + +If nil, yank only the portion of the message following the point. + +If the show buffer has a region, this variable is ignored unless its value is +one of `attribution' or `autoattrib' in which case the attribution is added +to the yanked region." + :type '(choice (const :tag "Below point" nil) + (const :tag "Without header" body) + (const :tag "Invoke supercite" supercite) + (const :tag "Invoke supercite, automatically" autosupercite) + (const :tag "Without header, with attribution" attribution) + (const :tag "Without header, with attribution, automatically" + autoattrib) + (const :tag "Entire message with headers" t)) + :group 'mh-letter) + + + +;;; Ranges (:group 'mh-ranges) + +(defcustom mh-interpret-number-as-range-flag t + "Non-nil means interpret a number as a range. +If the variable is non-nil, and you use an integer, N, when asked for a +range to scan, then MH-E uses the range \"last:N\"." + :type 'boolean + :group 'mh-ranges) + + + +;;; Scan Line Formats (:group 'mh-scan-line-formats) + +(defcustom mh-adaptive-cmd-note-flag t + "*Non-nil means that the message number width is determined dynamically. +This is done once when a folder is first opened by running scan on the last +message of the folder. The message number for the last message is extracted +and its width calculated. This width is used when calling `mh-set-cmd-note'. + +If you prefer fixed-width message numbers, set this variable to nil and call +`mh-set-cmd-note' with the width specified by the scan format in +`mh-scan-format-file'. For example, the default width is 4, so you would use +\"(mh-set-cmd-note 4)\" if `mh-scan-format-file' were nil." + :type 'boolean + :group 'mh-scan-line-formats) + +(defcustom mh-scan-format-file t + "Specifies the format file to pass to the scan program. +If t, the format string will be taken from the either `mh-scan-format-mh' +or `mh-scan-format-nmh' depending on whether MH or nmh is in use. +If nil, the default scan output will be used. + +If you customize the scan format, you may need to modify a few variables +containing regexps that MH-E uses to identify specific portions of the output. +Use `M-x apropos RET mh-scan.*regexp' to obtain a list of these variables. You +may also have to call `mh-set-cmd-note' with the width of your message +numbers. See also `mh-adaptive-cmd-note-flag'." + :type '(choice (const :tag "Use MH-E scan Format" t) + (const :tag "Use Default scan Format" nil) + (file :tag "Specify a scan Format File")) + :group 'mh-scan-line-formats) + +(defcustom mh-scan-prog "scan" + "*Program to run to generate one-line-per-message listing of a folder. +Normally \"scan\" or a file name linked to scan. This file is searched +for relative to the `mh-progs' directory unless it is an absolute pathname." + :type 'string + :group 'mh-scan-line-formats) +(make-variable-buffer-local 'mh-scan-prog) + + + +;;; Sending Mail (:group 'mh-sending-mail) + +(defcustom mh-compose-letter-function nil + "Invoked when setting up a letter draft. +It is passed three arguments: TO recipients, SUBJECT, and CC recipients." + :type '(choice (const nil) function) + :group 'mh-sending-mail) + +(defcustom mh-compose-prompt-flag nil + "*Non-nil means prompt for header fields when composing a new draft." + :type 'boolean + :group 'mh-sending-mail) + +(defcustom mh-forward-subject-format "%s: %s" + "*Format to generate the Subject: line contents for a forwarded message. +The two string arguments to the format are the sender of the original +message and the original subject line." + :type 'string + :group 'mh-sending-mail) + +(defcustom mh-reply-default-reply-to nil + "*Sets the person or persons to whom a reply will be sent. +If nil, prompt for recipient. If non-nil, then \\`\\[mh-reply]' will use this +value and it should be one of \"from\", \"to\", \"cc\", or \"all\". +The values \"cc\" and \"all\" do the same thing." + :type '(choice (const :tag "Prompt" nil) + (const "from") (const "to") + (const "cc") (const "all")) + :group 'mh-sending-mail) + + + +;;; Sequences (:group 'mh-sequences) + +;;; If `mh-unpropagated-sequences' becomes a defcustom, add the following to +;;; the docstring: "Additional sequences that should not to be preserved can be +;;; specified by setting `mh-unpropagated-sequences' appropriately." XXX + +(defcustom mh-refile-preserves-sequences-flag t + "*Non-nil means that sequences are preserved when messages are refiled. +If this variable is non-nil and a message belonging to a sequence other than +cur or Previous-Sequence (see mh-profile 5) is refiled then it is put in the +same sequence in the destination folder." + :type 'boolean + :group 'mh-sequences) + +(defcustom mh-tick-seq 'tick + "The name of the MH sequence for ticked messages. +You would change this option if you already use the `tick' sequence for your +own use. You can also disable all of the ticking functions by choosing the +`Disable Ticking' item but there isn't much advantage to that." + :type '(choice (const :tag "Disable Ticking" nil) + symbol) + :group 'mh-sequences) + +(defcustom mh-update-sequences-after-mh-show-flag t + "*Non-nil means flush MH sequences to disk after message is shown. +Three sequences are maintained internally by MH-E and pushed out to MH when a +message is shown. They include the sequence specified by your +`Unseen-Sequence:' profile entry, `cur', and the sequence listed by +the `mh-tick-seq' option which is `tick' by default. +If you do not like this behavior, set this option to nil. You can then update +the state manually with the \\`\\[mh-execute-commands]', `\\[mh-quit]', or `\\[mh-update-sequences]' commands." + :type 'boolean + :group 'mh-sequences) + + + +;;; Reading Your Mail (:group 'mh-show) + +(defcustom mh-bury-show-buffer-flag t + "*Non-nil means that the displayed show buffer for a folder is buried." + :type 'boolean + :group 'mh-show) + +(defcustom mh-clean-message-header-flag t + "*Non-nil means remove extraneous header fields. +The header fields listed in the `mh-invisible-header-fields-default' option +are hidden, although you can check off any field that you would like to see. +Header fields that you would like to hide that aren't listed can be added to +the `mh-invisible-header-fields' option." + :type 'boolean + :group 'mh-show) + +(defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode"))) + "*Non-nil means that Gnus is used to show MIME attachments with Gnus." + :type 'boolean + :group 'mh-show) + +(defcustom mh-display-buttons-for-alternatives-flag nil + "*Non-nil means display buttons for all MIME alternatives. +Default behavior is to display only the preferred alternative. If this +variable is non-nil, then the preferred part is shown inline and buttons +are shown for each of the other alternatives." + :type 'boolean + :group 'mh-show) + +(defcustom mh-display-buttons-for-inline-parts-flag nil + "*Non-nil means display buttons for all inline MIME parts. +If non-nil, buttons are displayed for all MIME parts. Inline parts start off +in displayed state but they can be hidden by clicking the button. If nil no +buttons are shown for inline parts." + :type 'boolean + :group 'mh-show) + +(defcustom mh-do-not-confirm-flag nil + "*Non-nil means do not prompt for confirmation. +Commands such as `mh-pack-folder' prompt to confirm whether to process +outstanding moves and deletes or not before continuing. A non-nil setting will +perform the action--which is usually desired but cannot be retracted--without +question." + :type 'boolean + :group 'mh-show) + +(defcustom mh-fetch-x-image-url 'ask + "*Control fetching of `X-Image-URL:' header field image. +If set to \"Always fetch\" (t), the image is always fetched. You probably want +to avoid this setting for privacy and DOS (denial of service) reasons. For +example, fetching a URL can tip off a spammer that you've read his email. +Someone may also flood your network and fill your disk drive by sending a +torrent of messages, each specifying a unique URL to a very large file. + +If set to \"Ask before fetching\" ('ask), you are prompted before the image is +fetched. MH-E will remember your reply and will either use the already fetched +image the next time the same URL is encountered or silently skip it if you +didn't fetch it the first time. This is the default. + +If set to \"Never fetch\" (nil), images are never fetched and only displayed +if they are already present in the cache. + +The cache of images is found in the directory `.mhe-x-image-cache' within your +MH directory. To see how you can add your own face to the `From:' field, see +`mh-x-face-file'. + +This setting only has effect if `mh-show-use-xface-flag' is non-nil." + + :type '(choice (const :tag "Always fetch" t) + (const :tag "Ask before fetching" ask) + (const :tag "Never fetch" nil)) + :group 'mh-show) + +(defcustom mh-graphical-smileys-flag t + "*Non-nil means graphical smileys are displayed. +Non-nil means that small graphics will be used in the show buffer instead of +patterns like :-), ;-) etc. The setting only has effect if +`mh-decode-mime-flag' is non-nil." + :type 'boolean + :group 'mh-show) + +(defcustom mh-graphical-emphasis-flag t + "*Non-nil means graphical emphasis is displayed. +Non-nil means that _underline_ will be underlined, *bold* will appear in bold, +/italic/ will appear in italic etc. See `gnus-emphasis-alist' for the whole +list. The setting only has effect if `mh-decode-mime-flag' is non-nil." + :type 'boolean + :group 'mh-show) + +(defcustom mh-highlight-citation-p 'gnus + "How to highlight citations in show buffers. +The gnus method uses a different color for each indentation." + :type '(choice (const :tag "Use Gnus" gnus) + (const :tag "Use font-lock" font-lock) + (const :tag "Don't fontify" nil)) + :group 'mh-show) + +;; Keep fields alphabetized. Mention source, if known. +(defvar mh-invisible-header-fields-internal + '("Approved:" + "Autoforwarded:" + "Bestservhost:" + "Cancel-Lock:" ; NNTP posts + "Content-" ; RFC 2045 + "Delivered-To:" ; Egroups/yahoogroups mailing list manager + "Delivery-Date:" ; MH + "Delivery:" + "Encoding:" + "Envelope-to:" + "Errors-To:" + "Face:" ; Gnus Face header + "Forwarded:" ; MH + "From " ; sendmail + "Importance:" ; MS Outlook + "In-Reply-To:" ; MH + "Lines:" + "List-" ; Mailman mailing list manager + "List-" ; Unknown mailing list managers + "List-Subscribe:" ; Unknown mailing list managers + "List-Unsubscribe:" ; Unknown mailing list managers + "Mail-from:" ; MH + "Mailing-List:" ; Egroups/yahoogroups mailing list manager + "Message-Id:" ; RFC 822 + "Mime-Version" ; RFC 2045 + "NNTP-" ; News + "Old-Return-Path:" + "Original-Encoded-Information-Types:" ; X400 + "Original-Lines:" ; mail to news + "Original-NNTP-" ; mail to news + "Original-Newsgroups:" ; mail to news + "Original-Path:" ; mail to news + "Original-Received:" ; mail to news + "Original-To:" ; mail to news + "Original-X-" ; mail to news + "Originator:" + "P1-Content-Type:" ; X400 + "P1-Message-Id:" ; X400 + "P1-Recipient:" ; X400 + "Path:" + "Precedence:" + "Prev-Resent" ; MH + "Priority:" + "Received:" ; RFC 822 + "References:" + "Remailed-" ; MH + "Replied:" ; MH + "Resent" ; MH + "Return-Path:" ; RFC 822 + "Sensitivity:" ; MS Outlook + "Status:" ; sendmail + "Thread-" + "Ua-Content-Id:" ; X400 +;; "User-Agent:" ; Similar to X-Mailer, so display it. + "Via:" ; MH + "X-Abuse-Info:" + "X-Abuse-and-DMCA-" + "X-Accept-Language:" + "X-Accept-Language:" ; Netscape/Mozilla + "X-Ack:" + "X-Administrivia-To:" + "X-AntiAbuse:" ; cPanel + "X-Apparently-From:" ; MS Outlook + "X-Apparently-To:" ; Egroups/yahoogroups mailing list manager + "X-Authentication-Warning:" ; sendmail + "X-Beenthere:" ; Mailman mailing list manager + "X-Bogosity:" ; bogofilter + "X-Complaints-To:" + "X-Cron-Env:" + "X-DMCA" + "X-Delivered" + "X-ELNK-Trace:" ; Earthlink mailer + "X-Envelope-Date:" ; GNU mailutils + "X-Envelope-From:" + "X-Envelope-Sender:" + "X-Envelope-To:" + "X-Face:" + "X-Folder:" ; Spam + "X-From-Line" + "X-Gnus-Mail-Source:" ; gnus + "X-Greylist:" ; milter-greylist-1.2.1 + "X-Habeas-SWE-1:" ; Spam + "X-Habeas-SWE-2:" ; Spam + "X-Habeas-SWE-3:" ; Spam + "X-Habeas-SWE-4:" ; Spam + "X-Habeas-SWE-5:" ; Spam + "X-Habeas-SWE-6:" ; Spam + "X-Habeas-SWE-7:" ; Spam + "X-Habeas-SWE-8:" ; Spam + "X-Habeas-SWE-9:" ; Spam + "X-Image-URL:" ; URL equivalent of X-Face and Face + "X-Info:" ; NTMail + "X-Juno-" ; Juno + "X-List-Host:" ; Unknown mailing list managers + "X-List-Subscribe:" ; Unknown mailing list managers + "X-List-Unsubscribe:" ; Unknown mailing list managers + "X-Listprocessor-" ; ListProc(tm) by CREN + "X-Listserver:" ; Unknown mailing list managers + "X-Loop:" ; Unknown mailing list managers + "X-MHE-Checksum" ; Checksum added during index search + "X-MIME-Autoconverted:" ; sendmail + "X-MIMETrack:" + "X-Mms-" ; T-Mobile pictures + "X-MS-" ; MS Outlook + "X-MailScanner" ; ListProc(tm) by CREN + "X-Mailing-List:" ; Unknown mailing list managers + "X-Mailman-Version:" ; Mailman mailing list manager + "X-Majordomo:" ; Majordomo mailing list manager + "X-Message-Id" + "X-MessageWall-Score:" ; Unknown mailing list manager, AUC TeX + "X-MimeOLE:" ; MS Outlook + "X-Mozilla-Status:" ; Netscape/Mozilla + "X-Msmail-" ; MS Outlook + "X-NAI-Spam-" ; Network Associates Inc. SpamKiller + "X-News:" ; News + "X-No-Archive:" + "X-Notes-Item:" ; Lotus Notes Domino structured header + "X-OperatingSystem:" + ;;"X-Operator:" ; Similar to X-Mailer, so display it + "X-Orcl-Content-Type:" + "X-Original-Complaints-To:" + "X-Original-Date:" ; SourceForge mailing list manager + "X-Original-To:" + "X-Original-Trace:" + "X-OriginalArrivalTime:" ; Hotmail + "X-Originating-IP:" ; Hotmail + "X-Postfilter:" + "X-Priority:" ; MS Outlook + "X-Qotd-" ; User added + "X-RM" + "X-Received-Date:" + "X-Received:" + "X-Request-" + "X-SBClass:" ; Spam + "X-SBNote:" ; Spam + "X-SBPass:" ; Spam + "X-SBRule:" ; Spam + "X-SMTP-" + "X-Scanned-By" + "X-Sender:" + "X-Server-Date:" + "X-Server-Uuid:" + "X-Sieve:" ; Sieve filtering + "X-Source" + "X-Spam-" ; Spamassassin + "X-SpamBouncer:" ; Spam + "X-Status" + "X-Submissions-To:" + "X-Telecom-Digest" + "X-Trace:" + "X-UID" + "X-UIDL:" + "X-UserInfo1:" + "X-VSMLoop:" ; NTMail + "X-Vms-To:" + "X-WebTV-Signature:" + "X-Wss-Id:" ; Worldtalk gateways + "X-Yahoo" + "X-eGroups-" ; Egroups/yahoogroups mailing list manager + "X-pgp:" + "X-submission-address:" + "X400-" ; X400 + "Xref:") + "List of default header fields that are not to be shown. +Do not alter this variable directly. Instead, add entries from here that you +would like to be displayed in `mh-invisible-header-fields-default' +and add entries to hide in `mh-invisible-header-fields'.") + +(defvar mh-invisible-header-fields-compiled nil + "*Regexp matching lines in a message header that are not to be shown. +Do not alter this variable directly. Instead, customize +`mh-invisible-header-fields-default' checking for fields normally +hidden that you wish to display, and add extra entries to hide in +`mh-invisible-header-fields'.") + +(defun mh-invisible-headers () + "Make or remake the variable `mh-invisible-header-fields-compiled'. +Done using `mh-invisible-header-fields-internal' as input, from which entries +from `mh-invisible-header-fields-default' are removed and entries +from `mh-invisible-header-fields' are added." + (let ((fields mh-invisible-header-fields-internal)) + (when mh-invisible-header-fields-default + ;; Remove entries from `mh-invisible-header-fields-default' + (setq fields + (loop for x in fields + unless (member x mh-invisible-header-fields-default) + collect x))) + (when (and (boundp 'mh-invisible-header-fields) + mh-invisible-header-fields) + (dolist (x mh-invisible-header-fields) + (unless (member x fields) (setq fields (cons x fields))))) + (if fields + (setq mh-invisible-header-fields-compiled + (concat + "^" + ;; workaround for insufficient default + (let ((max-specpdl-size 1000)) + (regexp-opt fields t)))) + (setq mh-invisible-header-fields-compiled nil)))) + +(defcustom mh-invisible-header-fields-default nil + "*List of hidden header fields. +The header fields listed in this option are hidden, although you can check off +any field that you would like to see. Header fields that you would like to +hide that aren't listed can be added to the `mh-invisible-header-fields' +option. + +See also `mh-clean-message-header-flag'." + :type `(set ,@(mapcar (lambda (x) `(const ,x)) + mh-invisible-header-fields-internal)) + :set (lambda (symbol value) + (set-default symbol value) + (mh-invisible-headers)) + :group 'mh-show) + +(defcustom mh-invisible-header-fields nil + "*Additional header fields to hide. +Header fields that you would like to hide that aren't listed in +`mh-invisible-header-fields-default' can be added to this option with a couple +of caveats. Regular expressions are not allowed. Unique fields should have a +`:' suffix; otherwise, the element can be used to render invisible an entire +class of fields that start with the same prefix. + +See also `mh-clean-message-header-flag'." + + :type '(repeat (string :tag "Header field")) + :set (lambda (symbol value) + (set-default symbol value) + (mh-invisible-headers)) + :group 'mh-show) + +(defcustom mh-lpr-command-format "lpr -J '%s'" + "*Format for Unix command that prints a message. +The string should be a Unix command line, with the string '%s' where +the job's name (folder and message number) should appear. The formatted +message text is piped to this command when you type \\`\\[mh-print-msg]'." + :type 'string + :group 'mh-show) + +(defcustom mh-max-inline-image-height nil + "*Maximum inline image height if Content-Disposition is not present. +If nil, image will be displayed if its height is smaller than the height of +the window." + :type '(choice (const nil) integer) + :group 'mh-show) + +(defcustom mh-max-inline-image-width nil + "*Maximum inline image width if Content-Disposition is not present. +If nil, image will be displayed if its width is smaller than the width of the +window." + :type '(choice (const nil) integer) + :group 'mh-show) + +(defcustom mh-mime-save-parts-default-directory t + "Default directory to use for `mh-mime-save-parts'. +If nil, prompt and set for next time the command is used during same session. +If t, prompt always" + :type '(choice (const :tag "Prompt the first time" nil) + (const :tag "Prompt always" t) + directory) + :group 'mh-show) + +(defcustom mh-print-background-flag nil + "*Non-nil means messages should be printed in the background. +WARNING: do not delete the messages until printing is finished; +otherwise, your output may be truncated." + :type 'boolean + :group 'mh-show) + +(defcustom mh-recursive-folders-flag nil + "*Non-nil means that commands which operate on folders do so recursively." + :type 'boolean + :group 'mh-show) + +(defcustom mh-show-maximum-size 0 + "*Maximum size of message (in bytes) to display automatically. +Provides an opportunity to skip over large messages which may be slow to load. +Use a value of 0 to display all messages automatically regardless of size." + :type 'integer + :group 'mh-show) + +(defcustom mh-show-threads-flag nil + "Non-nil means new folders start in threaded mode. +Threading large number of messages can be time consuming. So if the flag is +non-nil then threading will be done only if the number of messages being +threaded is less than `mh-large-folder'." + :type 'boolean + :group 'mh-show) + +;; Use goto-addr if it was already loaded (which probably sets this +;; variable to t), or if this variable is otherwise set to t. +(defcustom mh-show-use-goto-addr-flag (and (boundp 'goto-address-highlight-p) + goto-address-highlight-p) + "*Non-nil means highlight URLs and email addresses. +The `goto-addr' module is used." + :type 'boolean + :group 'mh-show) + +(defcustom mh-show-use-xface-flag (>= emacs-major-version 21) + "*Non-nil means display face images in `mh-show-mode'. + +MH-E can display the content of `Face:', `X-Face:', and `X-Image-URL:' header +fields. If any of these fields occur in the header of your message, the +sender's face will appear in the `From:' header field. If more than one of +these fields appear, then the first field found in the order `Face:', +`X-Face:', and `X-Image-URL:' will be used. Note that versions of GNU Emacs +prior to 21.1 don't support the display of inline images, so face images are +not displayed in these versions. + +The option `mh-show-use-xface-flag' is used to turn this feature on and off. +This feature will be turned on by default if your system supports it. + +The first header field used, if present, is the Gnus-specific `Face:' field. +The `Face:' field appeared in GNU Emacs 21 and XEmacs. For more information, +see http://quimby.gnus.org/circus/face/. Next is the traditional `X-Face:' +header field. The display of this field requires the `uncompface' program +which can be obtained from +ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. Recent versions of +XEmacs have internal support for `X-Face:' images. If your version of XEmacs +does not, then you'll need both `uncompface' and the x-face package which is +available at ftp://ftp.jpl.org/pub/elisp/. + +Finally, MH-E will display images referenced by the `X-Image-URL:' header +field if neither the `Face:' nor the `X-Face:' fields are present. The display +of the images requires `wget' (available from +http://www.gnu.org/software/wget/wget.html), `fetch', or `curl' to fetch the +image and the `convert' program from the ImageMagick suite, available from +http://www.imagemagick.org/. Of the three header fields this is the most +efficient in terms of network usage since the image doesn't need to be +transmitted with every single mail. + +The option `mh-fetch-x-image-url' controls the fetching of the `X-Image-URL:' +header field image." + :type 'boolean + :group 'mh-show) + +(defcustom mh-store-default-directory nil + "*Last directory used by \\[mh-store-msg]; default for next store. +A directory name string, or nil to use current directory." + :type '(choice (const :tag "Current" nil) + directory) + :group 'mh-show) + +(defcustom mh-summary-height nil + "*Number of lines in MH-Folder window (including the mode line)." + :type '(choice (const :tag "Automatic" nil) + (integer :tag "Fixed sized")) + :group 'mh-show) + +(defcustom mhl-formfile nil + "*Name of format file to be used by mhl to show and print messages. +A value of t means use the default format file. +nil means don't use mhl to format messages when showing; mhl is still used, +with the default format file, to format messages when printing them. +The format used should specify a non-zero value for overflowoffset so +the message continues to conform to RFC 822 and MH-E can parse the headers." + :type '(choice (const nil) (const t) string) + :group 'mh-show) +(put 'mhl-formfile 'info-file "mh-e") + + + +;;; The Speedbar (:group 'mh-speed) + +(defcustom mh-large-folder 200 + "The number of messages that indicates a large folder. +If a folder is deemed to be large, that is the number of messages in it exceed +this value, then confirmation is needed when it is visited. Even when +`mh-show-threads-flag' is non-nil, the folder is not automatically threaded, if +it is large. If set to nil all folders are treated as if they are small." + :type '(choice (const :tag "No limit") integer) + :group 'mh-speed) + +(defcustom mh-speed-flists-interval 60 + "Time between calls to flists in seconds. +If 0, flists is not called repeatedly." + :type 'integer + :group 'mh-speed) + +(defcustom mh-speed-run-flists-flag t + "Non-nil means flists is used. +If non-nil, flists is executed every `mh-speed-flists-interval' seconds to +update the display of the number of unseen and total messages in each folder. +If resources are limited, this can be set to nil and the speedbar display can +be updated manually with the \\[mh-speed-flists] command." + :type 'boolean + :group 'mh-speed) + + + +;;; The Toolbar (:group 'mh-toolbar) (defcustom mh-tool-bar-search-function 'mh-search-folder "*Function called by the tool-bar search button. @@ -326,10 +1636,10 @@ where, ;; The following variable names have been carefully chosen to make code ;; generation easier. Modifying the names should be done carefully. (let (folder-buttons folder-docs folder-button-setter sequence-button-setter - show-buttons show-button-setter show-seq-button-setter - letter-buttons letter-docs letter-button-setter - folder-defaults letter-defaults - folder-vectors show-vectors letter-vectors) + show-buttons show-button-setter show-seq-button-setter + letter-buttons letter-docs letter-button-setter + folder-defaults letter-defaults + folder-vectors show-vectors letter-vectors) (dolist (x defaults) (cond ((eq (car x) :folder) (setq folder-defaults (cdr x))) ((eq (car x) :letter) (setq letter-defaults (cdr x))))) @@ -341,7 +1651,7 @@ where, (name-str (symbol-name name)) (icon (nth 2 button)) (xemacs-icon (mh-do-in-xemacs - (cdr (assoc (intern icon) mh-xemacs-icon-map)))) + (cdr (assoc (intern icon) mh-xemacs-icon-map)))) (full-doc (nth 3 button)) (doc (if (string-match "\\(.*\\)\n" full-doc) (match-string 1 full-doc) @@ -386,7 +1696,7 @@ where, setter `(when (member ',name ,list) (mh-funcall-if-exists tool-bar-add-item ,icon ',function ',key - :help ,doc :enable ',enable-expr))) + :help ,doc :enable ',enable-expr))) (add-to-list mbuttons name) (if docs (add-to-list docs doc)))))) (setq folder-buttons (nreverse folder-buttons) @@ -458,17 +1768,19 @@ where, ;; Custom setter functions (defun mh-tool-bar-letter-buttons-set (symbol value) (set-default symbol value) - (setq mh-toolbar-letter-buttons - (loop for b in value - collect (cdr (assoc b mh-toolbar-letter-vector-map))))) + (when mh-xemacs-has-toolbar-flag + (setq mh-toolbar-letter-buttons + (loop for b in value + collect (cdr (assoc b mh-toolbar-letter-vector-map)))))) (defun mh-tool-bar-folder-buttons-set (symbol value) (set-default symbol value) - (setq mh-toolbar-folder-buttons - (loop for b in value - collect (cdr (assoc b mh-toolbar-folder-vector-map)))) - (setq mh-toolbar-show-buttons - (loop for b in value - collect (cdr (assoc b mh-toolbar-show-vector-map))))) + (when mh-xemacs-has-toolbar-flag + (setq mh-toolbar-folder-buttons + (loop for b in value + collect (cdr (assoc b mh-toolbar-folder-vector-map)))) + (setq mh-toolbar-show-buttons + (loop for b in value + collect (cdr (assoc b mh-toolbar-show-vector-map)))))) ;; Initialize toolbar (defun mh-toolbar-init (mode) "Install toolbar in MODE." @@ -478,7 +1790,8 @@ where, (height 37) (width 40) (buffer (current-buffer))) - (when (and mh-xemacs-toolbar-position mh-xemacs-use-toolbar-flag) + (when (and mh-xemacs-toolbar-position mh-xemacs-use-toolbar-flag + mh-xemacs-has-toolbar-flag) (cond ((eq mh-xemacs-toolbar-position 'top) (set-specifier top-toolbar toolbar buffer) @@ -545,9 +1858,11 @@ This button runs `mh-previous-undeleted-msg'") "Mark this message for deletion\nThis button runs `mh-delete-msg'") (mh-refile-msg (folder) "refile" "Refile this message\nThis button runs `mh-refile-msg'") - (mh-undo (folder) "undo" "Undo last operation\nThis button runs `undo'") + (mh-undo (folder) "undo" "Undo last operation\nThis button runs `undo'" + (mh-outstanding-commands-p)) (mh-execute-commands (folder) "execute" - "Perform moves and deletes\nThis button runs `mh-execute-commands'") + "Perform moves and deletes\nThis button runs `mh-execute-commands'" + (mh-outstanding-commands-p)) (mh-toggle-tick (folder) "highlight" "Toggle tick mark\nThis button runs `mh-toggle-tick'") (mh-toggle-showing (folder) "show" @@ -559,7 +1874,7 @@ This button runs `mh-previous-undeleted-msg'") "Reply to this message\nThis button runs `mh-reply'") (mh-alias-grab-from-field (folder) "alias" "Grab From alias\nThis button runs `mh-alias-grab-from-field'" - (mh-alias-from-has-no-alias-p)) + (and (mh-extract-from-header-value) (not (mh-alias-for-from-p)))) (mh-send (folder) "mail_compose" "Compose new message\nThis button runs `mh-send'") (mh-rescan-folder (folder) "rescan" @@ -574,7 +1889,8 @@ This button runs `mh-previous-undeleted-msg'") (mh-send-letter (letter) "mail_send" "Send this letter") (mh-compose-insertion (letter) "attach" "Insert attachment") (ispell-message (letter) "spell" "Check spelling") - (save-buffer (letter) "save" "Save current buffer to its file") + (save-buffer (letter) "save" "Save current buffer to its file" + (buffer-modified-p)) (undo (letter) "undo" "Undo last operation") (kill-region (letter) "cut" "Cut (kill) text in region between mark and current position") @@ -594,1085 +1910,47 @@ This button runs `mh-previous-undeleted-msg'") -;;; Speedbar and folder configuration (:group 'mh-speed) - -(defcustom mh-large-folder 200 - "The number of messages that indicates a large folder. -If a folder is deemed to be large, that is the number of messages in it exceed -this value, then confirmation is needed when it is visited. Even when -`mh-show-threads-flag' is non-nil, the folder is not automatically threaded, if -it is large. If set to nil all folders are treated as if they are small." - :type '(choice (const :tag "No limit") integer) - :group 'mh-speed) - -(defcustom mh-speed-flists-interval 60 - "Time between calls to flists in seconds. -If 0, flists is not called repeatedly." - :type 'integer - :group 'mh-speed) - -(defcustom mh-speed-run-flists-flag t - "Non-nil means flists is used. -If non-nil, flists is executed every `mh-speed-flists-interval' seconds to -update the display of the number of unseen and total messages in each folder. -If resources are limited, this can be set to nil and the speedbar display can -be updated manually with the \\[mh-speed-flists] command." - :type 'boolean - :group 'mh-speed) - - - -;;; Options for controlling scan listing (:group 'mh-folder) - -(defcustom mh-adaptive-cmd-note-flag t - "*Non-nil means that the message number width is determined dynamically. -This is done once when a folder is first opened by running scan on the last -message of the folder. The message number for the last message is extracted -and its width calculated. This width is used when calling `mh-set-cmd-note'. - -If you prefer fixed-width message numbers, set this variable to nil and call -`mh-set-cmd-note' with the width specified by the scan format in -`mh-scan-format-file'. For example, the default width is 4, so you would use -\"(mh-set-cmd-note 4)\" if `mh-scan-format-file' were nil." - :type 'boolean - :group 'mh-folder) - -(defcustom mh-default-folder-list nil - "*Alist of addresses and folders. -When refiling messages, these folders are the default that is provided if the -sender (or recipient if the Check Recipient checkbox has been selected) has -the associated address, a regexp. The first entry to match will be used, so -order them according to the wanted priority. You do not need to list your -aliases here as that lookup is already performed. - -See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more -information." - :type '(repeat (list (regexp :tag "Address") - (string :tag "Folder") - (boolean :tag "Check Recipient"))) - :group 'mh-folder) - -(defcustom mh-default-folder-must-exist-flag t - "*Non-nil means guessed folder name must exist to be used. -If this variable is t, then the guessed name is only used if the folder -already exists\; if the folder doesn't exist, then the last folder name used -is suggested. This is useful if you get mail from various people for whom you -have an alias, but file them all in the same project folder. -See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more -information." - :type 'boolean - :group 'mh-folder) - -(defcustom mh-default-folder-prefix "" - "*Prefix used for guessed folder names. -This can be used to put folders associated with your aliases in a sub-folder -so as to not clutter your mail directory. -See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more -information." - :type 'string - :group 'mh-folder) - -(defcustom mh-inc-prog "inc" - "*Program to run to incorporate new mail into a folder. -Normally \"inc\". This file is searched for relative to -the `mh-progs' directory unless it is an absolute pathname." - :type 'string - :group 'mh-folder) - -(defcustom mh-inc-spool-list nil - "*Alist of alternate spool files, corresponding folders and keybindings. -Here's an example. Suppose you have subscribed to the MH-E devel mailing -list. You could filter its mail into a separate spool file named -~/mail/mh-e using Procmail and a .procmailrc entry like: - -MAILDIR=$HOME/mail #you'd better make sure it exists -:0: -* ^From mh-e-devel-admin@lists.sourceforge.net -mh-e - -If you wanted to incorporate that spool file into an MH folder called -mh-e by pressing \"I m\" in folder-mode or by `M-x mh-inc-spool-mh-e', -you would setup `mh-inc-spool-list' with an entry: - - Spool file: ~/mail/mh-e - Folder: mh-e - Key binding: m - -Then, you could also install `xbuffy' and configure an extra mailbox like so: - -box ~/mail/mh-e - title mh-e - origMode - polltime 10 - headertime 0 - command gnudoit -q '(mh-inc-spool-mh-e)' - -Note that the entry above uses the gnuserv package to communicate the -command `mh-inc-spool-mh-e' to Emacs. It will incorporate the spool file -when clicking the xbuffy box with the middle mouse button." - :type '(repeat (list (file :tag "Spool file") - (string :tag "Folder") - (character :tag "Key binding"))) - :set 'mh-inc-spool-list-set - :group 'mh-folder) - -(defcustom mh-interpret-number-as-range-flag t - "Non-nil means interpret a number as a range. -If the variable is non-nil, and you use an integer, N, when asked for a -range to scan, then MH-E uses the range \"last:N\"." - :type 'boolean - :group 'mh-folder) - -(defcustom mh-lpr-command-format "lpr -J '%s'" - "*Format for Unix command that prints a message. -The string should be a Unix command line, with the string '%s' where -the job's name (folder and message number) should appear. The formatted -message text is piped to this command when you type \\`\\[mh-print-msg]'." - :type 'string - :group 'mh-folder) - -(defcustom mh-mime-save-parts-default-directory t - "Default directory to use for `mh-mime-save-parts'. -If nil, prompt and set for next time the command is used during same session. -If t, prompt always" - :type '(choice (const :tag "Prompt the first time" nil) - (const :tag "Prompt always" t) - directory) - :group 'mh-folder) - -(defcustom mh-print-background-flag nil - "*Non-nil means messages should be printed in the background. -WARNING: do not delete the messages until printing is finished; -otherwise, your output may be truncated." - :type 'boolean - :group 'mh-folder) - -(defcustom mh-recenter-summary-flag nil - "*Non-nil means to recenter the summary window. -Recenter the summary window when the show window is toggled off if non-nil." - :type 'boolean - :group 'mh-folder) - -(defcustom mh-recursive-folders-flag nil - "*Non-nil means that commands which operate on folders do so recursively." - :type 'boolean - :group 'mh-folder) - -;;; If `mh-unpropagated-sequences' becomes a defcustom, add the following tot -;;; he docstring: "Additional sequences that should not to be preserved can be -;;; specified by setting `mh-unpropagated-sequences' appropriately." XXX - -(defcustom mh-refile-preserves-sequences-flag t - "*Non-nil means that sequences are preserved when messages are refiled. -If this variable is non-nil and a message belonging to a sequence other than -cur or Previous-Sequence (see mh-profile 5) is refiled then it is put in the -same sequence in the destination folder." - :type 'boolean - :group 'mh-folder) - -(defcustom mh-scan-format-file t - "Specifies the format file to pass to the scan program. -If t, the format string will be taken from the either `mh-scan-format-mh' -or `mh-scan-format-nmh' depending on whether MH or nmh is in use. -If nil, the default scan output will be used. - -If you customize the scan format, you may need to modify a few variables -containing regexps that MH-E uses to identify specific portions of the output. -Use `M-x apropos RET mh-scan.*regexp' to obtain a list of these variables. You -may also have to call `mh-set-cmd-note' with the width of your message -numbers. See also `mh-adaptive-cmd-note-flag'." - :type '(choice (const :tag "Use MH-E scan format" t) - (const :tag "Use default scan format" nil) - (file :tag "Specify a scan format file")) - :group 'mh-folder) - -(defcustom mh-scan-prog "scan" - "*Program to run to generate one-line-per-message listing of a folder. -Normally \"scan\" or a file name linked to scan. This file is searched -for relative to the `mh-progs' directory unless it is an absolute pathname." - :type 'string - :group 'mh-folder) -(make-variable-buffer-local 'mh-scan-prog) - -(defcustom mh-show-threads-flag nil - "Non-nil means new folders start in threaded mode. -Threading large number of messages can be time consuming. So if the flag is -non-nil then threading will be done only if the number of messages being -threaded is less than `mh-large-folder'." - :type 'boolean - :group 'mh-folder) - -(defcustom mh-store-default-directory nil - "*Last directory used by \\[mh-store-msg]; default for next store. -A directory name string, or nil to use current directory." - :type '(choice (const :tag "Current" nil) - directory) - :group 'mh-folder) - -(defcustom mh-tick-seq 'tick - "The name of the MH tick sequence." - :type '(choice (const :tag "Disable ticking" nil) - symbol) - :group 'mh-folder) - -(defcustom mh-update-sequences-after-mh-show-flag t - "*Non-nil means `mh-update-sequence' is called from `mh-show-mode'. -If set, `mh-update-sequence' is run every time a message is shown, telling -MH or nmh that this is your current message. It's useful, for example, to -display MIME content using \"M-! mhshow RET\"" - :type 'boolean - :group 'mh-folder) - - - -;;; Indexed searching (:group 'mh-index) - -(defcustom mh-index-new-messages-folders t - "Folders searched for `mh-unseen-seq'. -If t, then `mh-inbox' is searched. If nil, all the top level folders are -searched. Otherwise the list of folders specified as strings are searched. -See also `mh-recursive-folders-flag'." - :group 'mh-index - :type '(choice (const :tag "Inbox" t) - (const :tag "All" nil) - (repeat :tag "Choose folders" (string :tag "Folder")))) - -(defcustom mh-index-program nil - "Indexing program that MH-E shall use. -The possible choices are swish++, swish-e, mairix, namazu, glimpse, pick and -grep. By default this variable is nil which means that the programs are tried -in order and the first one found is used. - -More information about setting up an indexing program to use with MH-E can be -found in the documentation of `mh-index-search'." - :type '(choice (const :tag "Auto-detect" nil) - (const :tag "swish++" swish++) - (const :tag "swish-e" swish) - (const :tag "mairix" mairix) - (const :tag "namazu" namazu) - (const :tag "glimpse" glimpse) - (const :tag "pick" pick) - (const :tag "grep" grep)) - :group 'mh-index) - -(defcustom mh-index-ticked-messages-folders t - "Folders searched for `mh-tick-seq'. -If t, then `mh-inbox' is searched. If nil, all the top level folders are -searched. Otherwise the list of folders specified as strings are searched. -See also `mh-recursive-folders-flag'." - :group 'mh-index - :type '(choice (const :tag "Inbox" t) - (const :tag "All" nil) - (repeat :tag "Choose folders" (string :tag "Folder")))) - - - -;;; Spam Handling (:group 'mh-junk) - -;; Spam fighting program chosen -(defvar mh-junk-choice nil) - -;; Available spam filter interfaces -(defvar mh-junk-function-alist - '((bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist) - (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist) - (spamassassin mh-spamassassin-blacklist mh-spamassassin-whitelist)) - "Available choices of spam programs to use. -This is an alist. For each element there are functions that blacklist a message -as spam and whitelist a message incorrectly classified as spam.") - -(defun mh-junk-choose (symbol value) - "Choose spam program to use. -The function is always called with SYMBOL bound to `mh-junk-program' and VALUE -bound to the new value of `mh-junk-program'. The function sets the variable -`mh-junk-choice' in addition to `mh-junk-program'." - (set symbol value) - (setq mh-junk-choice - (or value - (loop for element in mh-junk-function-alist - until (executable-find (symbol-name (car element))) - finally return (car element))))) - -;; User customizable variables -(defcustom mh-junk-mail-folder nil - "Folder to put spam mail in. -If nil then the spam is deleted." - :type '(choice (const :tag "Delete spam" nil) - (string :tag "Spam folder")) - :group 'mh-junk) - -(defcustom mh-junk-program nil - "Spam program that MH-E shall use. -The possible choices are bogofilter, spamprobe, and spamassassin. By default -this variable is nil which means that the programs are tried in order and the -first one found is used." - :type '(choice (const :tag "auto-detect" nil) - (const :tag "bogofilter" bogofilter) - (const :tag "spamprobe" spamprobe) - (const :tag "spamassassin" spamassassin)) - :set 'mh-junk-choose - :group 'mh-junk) - - - -;;; Message display (:group 'mh-show) - -(defcustom mh-bury-show-buffer-flag t - "*Non-nil means that the displayed show buffer for a folder is buried." - :type 'boolean - :group 'mh-show) - -(defcustom mh-clean-message-header-flag t - "*Non-nil means clean headers of messages that are displayed or inserted. -The variable `mh-invisible-headers' if set determines the header fields that -are displayed. If it isn't set, then the variable `mh-invisible-headers' -determines the header fields that are removed." - :type 'boolean - :group 'mh-show) - -(defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode"))) - "*Non-nil means that Gnus is used to show MIME attachments with Gnus." - :type 'boolean - :group 'mh-show) - -(defcustom mh-display-buttons-for-alternatives-flag nil - "*Non-nil means display buttons for all MIME alternatives. -Default behavior is to display only the preferred alternative. If this -variable is non-nil, then the preferred part is shown inline and buttons -are shown for each of the other alternatives." - :type 'boolean - :group 'mh-show) - -(defcustom mh-display-buttons-for-inline-parts-flag nil - "*Non-nil means display buttons for all inline MIME parts. -If non-nil, buttons are displayed for all MIME parts. Inline parts start off -in displayed state but they can be hidden by clicking the button. If nil no -buttons are shown for inline parts." - :type 'boolean - :group 'mh-show) - -(defcustom mh-do-not-confirm-flag nil - "*Non-nil means do not prompt for confirmation. -Commands such as `mh-pack-folder' prompt to confirm whether to process -outstanding moves and deletes or not before continuing. A non-nil setting will -perform the action--which is usually desired but cannot be retracted--without -question." - :type 'boolean - :group 'mh-show) - -(defcustom mh-fetch-x-image-url nil - "Control fetching of X-Image-URL header field image. -This setting only has effect if `mh-show-use-xface-flag' is non-nil. - -If set to t, the image is fetched. - -If set to 'ask, the user is prompted before the image is fetched. MH-E will -remember your reply and will either use the already fetched image the next time -the same URL is encountered or silently skip it if you didn't fetch it the -first time. - -If set to nil, the default, images are not fetched and only displayed if they -are already present in the cache." - :type '(choice (const :tag "Always fetch" t) - (const :tag "Ask before fetching" ask) - (const :tag "Never fetch" nil)) - :group 'mh-show) - -(defcustom mh-graphical-smileys-flag t - "*Non-nil means graphical smileys are displayed. -Non-nil means that small graphics will be used in the show buffer instead of -patterns like :-), ;-) etc. The setting only has effect if -`mh-decode-mime-flag' is non-nil." - :type 'boolean - :group 'mh-show) - -(defcustom mh-graphical-emphasis-flag t - "*Non-nil means graphical emphasis is displayed. -Non-nil means that _underline_ will be underlined, *bold* will appear in bold, -/italic/ will appear in italic etc. See `gnus-emphasis-alist' for the whole -list. The setting only has effect if `mh-decode-mime-flag' is non-nil." - :type 'boolean - :group 'mh-show) - -(defcustom mh-highlight-citation-p 'gnus - "How to highlight citations in show buffers. -The gnus method uses a different color for each indentation." - :type '(choice (const :tag "Use Gnus" gnus) - (const :tag "Use font-lock" font-lock) - (const :tag "Don't fontify" nil)) - :group 'mh-show) - -(defvar mh-invisible-headers nil - "*Regexp matching lines in a message header that are not to be shown. -Customize the variable `mh-invisible-header-fields' to generate this variable; -It will in turn automatically use the function `mh-invisible-headers' to -generate this variable. -If the variable `mh-visible-headers' is non-nil, it is used instead to specify -what to keep.") - -(defun mh-invisible-headers () - "Make or remake the variable `mh-invisible-headers'. -Done using `mh-invisible-header-fields' as input." - (if mh-invisible-header-fields - (setq mh-invisible-headers - (concat - "^" - (let ((max-specpdl-size 1000) ;workaround for insufficient default - (fields mh-invisible-header-fields)) - (regexp-opt fields t)))) - (setq mh-invisible-headers nil))) - -;; Keep fields alphabetized. Mention source, if known. -(defcustom mh-invisible-header-fields - '("Approved:" - "Autoforwarded:" - "Bestservhost:" - "Cancel-Lock:" ; NNTP posts - "Content-" ; RFC 2045 - "Delivered-To:" ; Egroups/yahoogroups mailing list manager - "Delivery-Date:" ; MH - "Delivery:" - "Encoding:" - "Envelope-to:" - "Errors-To:" - "Face:" ; Gnus Face header - "Forwarded:" ; MH - "From " ; sendmail - "Importance:" ; MS Outlook - "In-Reply-To:" ; MH - "Lines:" - "List-" ; Mailman mailing list manager - "List-" ; Unknown mailing list managers - "List-Subscribe:" ; Unknown mailing list managers - "List-Unsubscribe:" ; Unknown mailing list managers - "Mail-from:" ; MH - "Mailing-List:" ; Egroups/yahoogroups mailing list manager - "Message-Id:" ; RFC 822 - "Mime-Version" ; RFC 2045 - "NNTP-" ; News - "Old-Return-Path:" - "Original-Encoded-Information-Types:" ; X400 - "Original-Lines:" ; mail to news - "Original-Newsgroups:" ; mail to news - "Original-NNTP-" ; mail to news - "Original-Path:" ; mail to news - "Original-Received:" ; mail to news - "Original-To:" ; mail to news - "Original-X-" ; mail to news - "P1-Content-Type:" ; X400 - "P1-Message-Id:" ; X400 - "P1-Recipient:" ; X400 - "Path:" - "Precedence:" - "Prev-Resent" ; MH - "Priority:" - "Received:" ; RFC 822 - "References:" - "Remailed-" ; MH - "Replied:" ; MH - "Resent" ; MH - "Return-Path:" ; RFC 822 - "Sensitivity:" ; MS Outlook - "Status:" ; sendmail - "Ua-Content-Id:" ; X400 -;; "User-Agent:" ; Similar to X-Mailer, so display it. - "Via:" ; MH - "X-Abuse-Info:" - "X-Accept-Language:" - "X-Accept-Language:" ; Netscape/Mozilla - "X-Ack:" - "X-Apparently-From:" ; MS Outlook - "X-Apparently-To:" ; Egroups/yahoogroups mailing list manager - "X-Authentication-Warning:" ; sendmail - "X-Beenthere:" ; Mailman mailing list manager - "X-Bogosity:" ; bogofilter - "X-Complaints-To:" - "X-Cron-Env:" - "X-Delivered" - "X-Envelope-Sender:" - "X-Envelope-To:" - "X-Face:" - "X-Folder:" ; Spam - "X-From-Line" - "X-Gnus-Mail-Source:" ; gnus - "X-Habeas-SWE-1:" ; Spam - "X-Habeas-SWE-2:" ; Spam - "X-Habeas-SWE-3:" ; Spam - "X-Habeas-SWE-4:" ; Spam - "X-Habeas-SWE-5:" ; Spam - "X-Habeas-SWE-6:" ; Spam - "X-Habeas-SWE-7:" ; Spam - "X-Habeas-SWE-8:" ; Spam - "X-Habeas-SWE-9:" ; Spam - "X-Info:" ; NTMail - "X-Juno-" ; Juno - "X-List-Host:" ; Unknown mailing list managers - "X-List-Subscribe:" ; Unknown mailing list managers - "X-List-Unsubscribe:" ; Unknown mailing list managers - "X-Listserver:" ; Unknown mailing list managers - "X-Loop:" ; Unknown mailing list managers - "X-MIME-Autoconverted:" ; sendmail - "X-MIMETrack:" - "X-MS-TNEF-Correlator:" ; MS Outlook - "X-Mailing-List:" ; Unknown mailing list managers - "X-Mailman-Version:" ; Mailman mailing list manager - "X-Majordomo:" ; Majordomo mailing list manager - "X-Message-Id" - "X-MHE-Checksum" ; Checksum added during index search - "X-MimeOLE:" ; MS Outlook - "X-Mozilla-Status:" ; Netscape/Mozilla - "X-Msmail-" ; MS Outlook - "X-News:" ; News - "X-No-Archive:" - "X-Notes-Item:" ; Lotus Notes Domino structured header - "X-Orcl-Content-Type:" - "X-Original-Complaints-To:" - "X-Original-Date:" ; SourceForge mailing list manager - "X-Original-To:" - "X-Original-Trace:" - "X-OriginalArrivalTime:" ; Hotmail - "X-Originating-IP:" ; Hotmail - "X-Priority:" ; MS Outlook - "X-Qotd-" ; User added - "X-Received-Date:" - "X-Received:" - "X-Request-" - "X-SBClass:" ; Spam - "X-SBNote:" ; Spam - "X-SBPass:" ; Spam - "X-SBRule:" ; Spam - "X-Scanned-By" - "X-Sender:" - "X-Server-Date:" - "X-Server-Uuid:" - "X-Sieve:" ; Sieve filtering - "X-Spam-Checker-Version:" ; Spamassassin - "X-Spam-Level:" ; Spamassassin - "X-Spam-Score:" ; Spamassassin - "X-Spam-Status:" ; Spamassassin - "X-SpamBouncer:" ; Spam - "X-Trace:" - "X-UIDL:" - "X-UserInfo1:" - "X-VSMLoop:" ; NTMail - "X-Vms-To:" - "X-Wss-Id:" ; Worldtalk gateways - "X-eGroups-" ; Egroups/yahoogroups mailing list manager - "X-pgp:" - "X-submission-address:" - "X400-" ; X400 - "Xref:") -"*List of header fields that are not to be shown. -Regexps are not allowed. Unique fields should have a \":\" suffix; otherwise, -the element can be used to render invisible an entire class of fields that -start with the same prefix. -This variable is ignored if the variable `mh-visible-headers' is set." - :type '(repeat (string :tag "Header field")) - :set (lambda (symbol value) - (set-default symbol value) - (mh-invisible-headers)) - :group 'mh-show) - -(defcustom mh-max-inline-image-height nil - "*Maximum inline image height if Content-Disposition is not present. -If nil, image will be displayed if its height is smaller than the height of -the window." - :type '(choice (const nil) integer) - :group 'mh-show) - -(defcustom mh-max-inline-image-width nil - "*Maximum inline image width if Content-Disposition is not present. -If nil, image will be displayed if its width is smaller than the width of the -window." - :type '(choice (const nil) integer) - :group 'mh-show) - -(defcustom mh-show-maximum-size 0 - "*Maximum size of message (in bytes) to display automatically. -Provides an opportunity to skip over large messages which may be slow to load. -Use a value of 0 to display all messages automatically regardless of size." - :type 'integer - :group 'mh-show) - -;; Use goto-addr if it was already loaded (which probably sets this -;; variable to t), or if this variable is otherwise set to t. -(defcustom mh-show-use-goto-addr-flag (and (boundp 'goto-address-highlight-p) - goto-address-highlight-p) - "*Non-nil means highlight URLs and email addresses. -The `goto-addr' module is used." - :type 'boolean - :group 'mh-show) - -(defcustom mh-show-use-xface-flag (>= emacs-major-version 21) - "*Non-nil means display face images in `mh-show-mode'. -This flag controls the display of three kinds of faces. - -The first is the traditional X-Face header field. For GNU Emacs 21 -and above, the `uncompface' binary is required to be in the execute -PATH for the display of X-Face images. It can be obtained from -ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. - -If the XEmacs you are using has internal support for X-Face images, then MH-E -will display X-Face images in XEmacs \"out of the box\". Even if you don't have -X-Face support compiled into your XEmacs, you can still see the X-Face images -in MH-E with the aid of an external x-face package and `uncompface'. It is -available from ftp://ftp.jpl.org/pub/elisp/. Download it, put its files in the -`load-path' and MH-E will invoke it automatically. - -Second, MH-E supports the display of the Gnus-specific Face -header field in GNU Emacs >= 21 and XEmacs. No external packages -are required. More information about the Face header can be found -at: http://quimby.gnus.org/circus/face/. - -Finally, MH-E can also display images from the X-Image-URL header field. The -display of the images requires the `wget' program, available from -http://www.gnu.org/software/wget/wget.html, to fetch the image and the -`convert' program from the ImageMagick suite, available from -http://www.imagemagick.org/. Of the three header fields this is the most -efficient in terms of network usage since the image doesn't need to be -transmitted with every single mail. However its display needs the recipient to -fetch a URL and this can be misused. So it is disabled by default. It can be -enabled by customizing `mh-fetch-x-image-url'. Setting that to ask for -confirmation before fetching seems like a good choice. - -Versions of GNU Emacs prior to 21.1 don't support the display of -inline images. So face images are not displayed in these versions." - :type 'boolean - :group 'mh-show) - -(defcustom mh-summary-height nil - "*Number of lines in MH-Folder window (including the mode line)." - :type '(choice (const :tag "Automatic" nil) - (integer :tag "Fixed sized")) - :group 'mh-show) - -(defvar mh-visible-headers nil - "*Regexp matching lines in a message header that are to be shown. -Customize the variable `mh-visible-header-fields' to generate this variable; -It will in turn automatically use the function `mh-visible-headers' to -generate this variable. -Only used if `mh-clean-message-header-flag' is non-nil. Setting it overrides -the variable `mh-invisible-headers'.") - -(defun mh-visible-headers () - "Make or remake the variable `mh-visible-headers'. -Done using `mh-visible-header-fields' as input." - (if mh-visible-header-fields - (setq mh-visible-headers - (concat - "^" - (let ((max-specpdl-size 1000) ;workaround for insufficient default - (fields mh-visible-header-fields)) - (regexp-opt fields t)))) - (setq mh-visible-headers nil))) - -(defcustom mh-visible-header-fields nil -"*List of header fields that are to be shown. -Regexps are not allowed. Unique fields should have a \":\" suffix; otherwise, -the element can be used to render visible an entire class of fields that -start with the same prefix. -Only used if `mh-clean-message-header-flag' is non-nil. -Setting it overrides the variable `mh-invisible-headers'." - :type '(repeat (string :tag "Header field")) - :set (lambda (symbol value) - (set-default symbol value) - (mh-visible-headers)) - :group 'mh-show) - -(defcustom mhl-formfile nil - "*Name of format file to be used by mhl to show and print messages. -A value of t means use the default format file. -nil means don't use mhl to format messages when showing; mhl is still used, -with the default format file, to format messages when printing them. -The format used should specify a non-zero value for overflowoffset so -the message continues to conform to RFC 822 and MH-E can parse the headers." - :type '(choice (const nil) (const t) string) - :group 'mh-show) -(put 'mhl-formfile 'info-file "mh-e") - - - -;;; Composing messages (:group 'mh-letter) - -(defcustom mh-compose-insertion (if (locate-library "mml") 'gnus 'mhn) - "Use either 'gnus or 'mhn to insert MIME message directives in messages." - :type '(choice (const :tag "Use Gnus" gnus) - (const :tag "Use mhn" mhn)) +;;; Hooks (:group 'mh-hooks + group where hook described) + +(defcustom mail-citation-hook nil + "*Hook for modifying a citation just inserted in the mail buffer. +Each hook function can find the citation between point and mark. +And each hook function should leave point and mark around the citation +text as modified. + +If this hook is entirely empty (nil), the text of the message is inserted +with `mh-ins-buf-prefix' prefixed to each line. + +See also the variable `mh-yank-from-start-of-msg', which controls how +much of the message passed to the hook. + +This hook was historically provided to set up supercite. You may now leave +this nil and set up supercite by setting the variable +`mh-yank-from-start-of-msg' to 'supercite or, for more automatic insertion, +to 'autosupercite. + +The hook 'trivial-cite is NOT part of Emacs. It is provided from tc.el, +available here: + http://shasta.cs.uiuc.edu/~lrclause/tc.html +If you use it, customize `mh-yank-from-start-of-msg' to + \"Entire message with headers\"." + :type 'hook + :options '(trivial-cite) + :group 'mh-hooks :group 'mh-letter) -(defcustom mh-compose-letter-function nil - "Invoked when setting up a letter draft. -It is passed three arguments: TO recipients, SUBJECT, and CC recipients." - :type '(choice (const nil) function) - :group 'mh-letter) - -(defcustom mh-compose-prompt-flag nil - "*Non-nil means prompt for header fields when composing a new draft." - :type 'boolean - :group 'mh-letter) - -(defcustom mh-compose-skipped-header-fields - '("from" "organization" "references" "in-reply-to" "x-face" "face" - "x-mailer") - "List of header fields to skip over when navigating in draft." - :type '(repeat (string :tag "Field")) - :group 'mh-letter) - -(defcustom mh-compose-space-does-completion-flag nil - "*Non-nil means that SPACE does completion in message header." - :type 'boolean - :group 'mh-letter) - -(defcustom mh-delete-yanked-msg-window-flag nil - "*Non-nil means delete any window displaying the message. -Controls window display when a message is yanked by \\\\[mh-yank-cur-msg]. -If non-nil, yanking the current message into a draft letter deletes any -windows displaying the message." - :type 'boolean - :group 'mh-letter) - -(defcustom mh-extract-from-attribution-verb "wrote:" - "*Verb to use for attribution when a message is yanked by \\\\[mh-yank-cur-msg]." - :type '(choice (const "wrote:") - (const "a écrit :") - (string :tag "Custom string")) - :group 'mh-letter) - -(defcustom mh-forward-subject-format "%s: %s" - "*Format to generate the Subject: line contents for a forwarded message. -The two string arguments to the format are the sender of the original -message and the original subject line." - :type 'string - :group 'mh-letter) - -(defcustom mh-ins-buf-prefix "> " - "*String to put before each non-blank line of a yanked or inserted message. -\\Used when the message is inserted into an outgoing letter -by \\[mh-insert-letter] or \\[mh-yank-cur-msg]." - :type 'string - :group 'mh-letter) - -(defcustom mh-insert-x-mailer-flag t - "*Non-nil means append an X-Mailer field to the header." - :type 'boolean - :group 'mh-letter) - -(defcustom mh-letter-complete-function 'ispell-complete-word - "*Function to call when completing outside of fields specific to aliases." - :type '(choice function (const nil)) - :group 'mh-letter) - -(defcustom mh-letter-fill-column 72 - "*Fill column to use in `mh-letter-mode'. -This is usually less than in other text modes because email messages get -quoted by some prefix (sometimes many times) when they are replied to, -and it's best to avoid quoted lines that span more than 80 columns." - :type 'integer - :group 'mh-letter) - -(defcustom mh-reply-default-reply-to nil - "*Sets the person or persons to whom a reply will be sent. -If nil, prompt for recipient. If non-nil, then \\`\\[mh-reply]' will use this -value and it should be one of \"from\", \"to\", \"cc\", or \"all\". -The values \"cc\" and \"all\" do the same thing." - :type '(choice (const :tag "Prompt" nil) - (const "from") (const "to") - (const "cc") (const "all")) - :group 'mh-letter) - -(defcustom mh-reply-show-message-flag t - "*Non-nil means the show buffer is displayed using \\\\[mh-reply]. - -The setting of this variable determines whether the MH `show-buffer' is -displayed with the current message when using `mh-reply' without a prefix -argument. Set it to nil if you already include the message automatically -in your draft using - repl: -filter repl.filter -in your ~/.mh_profile file." - :type 'boolean - :group 'mh-letter) - -(defcustom mh-signature-file-name "~/.signature" - "*Name of file containing the user's signature. -Inserted into message by \\\\[mh-insert-signature]." - :type 'file - :group 'mh-letter) - -(defcustom mh-x-face-file "~/.face" - "*File containing X-Face or Face header field to insert in outgoing mail. - -If the file starts with either of the strings \"X-Face: \", \"Face: \" or -\"X-Image-URL: \" then it is assumed to contain the whole field and is added to -the message header verbatim. Otherwise it is assumed that the file contains the -value of the X-Face header field. - -X-Face header fields can be generated using `compface', which can be obtained -from ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. The \"Online -X-Face Convertor\" at http://www.dairiki.org/xface/ is a useful resource for -quick conversion of images into X-Face header fields. - -There is a `make-face' script that converts a jpeg image to a Face header -field at http://quimby.gnus.org/circus/face/make-face. - -The URL of any image can be used for the X-Image-URL field and no processing -of the image is required. - -If nil, or the file does not exist, nothing is added to the message header." - :type 'file - :group 'mh-letter) - -(defcustom mh-yank-from-start-of-msg 'attribution - "*Controls which part of a message is yanked by \\\\[mh-yank-cur-msg]. -If t, include the entire message, with full headers. This is historically -here for use with supercite, but is now deprecated in favor of the setting -`supercite' below. - -If the symbol `body', then yank the message minus the header. - -If the symbol `supercite', include the entire message, with full headers. -This also causes the invocation of `sc-cite-original' without the setting -of `mail-citation-hook', now deprecated practice. - -If the symbol `autosupercite', do as for `supercite' automatically when -show buffer matches the message being replied-to. When this option is used, -the -noformat switch is passed to the repl program to override a -filter or --format switch. - -If the symbol `attribution', then yank the message minus the header and add -a simple attribution line at the top. - -If the symbol `autoattrib', do as for `attribution' automatically when show -buffer matches the message being replied-to. You can make sure this is -always the case by setting `mh-reply-show-message-flag' to t (which is the -default) and optionally `mh-delete-yanked-msg-window-flag' to t as well such -that the show window is never displayed. When the `autoattrib' option is -used, the -noformat switch is passed to the repl program to override a --filter or -format switch. - -If nil, yank only the portion of the message following the point. - -If the show buffer has a region, this variable is ignored unless its value is -one of `attribution' or `autoattrib' in which case the attribution is added -to the yanked region." - :type '(choice (const :tag "Below point" nil) - (const :tag "Without header" body) - (const :tag "Invoke supercite" supercite) - (const :tag "Invoke supercite, automatically" autosupercite) - (const :tag "Without header, with attribution" attribution) - (const :tag "Without header, with attribution, automatically" - autoattrib) - (const :tag "Entire message with headers" t)) - :group 'mh-letter) - - - -;;; Alias handling (:group 'mh-alias) - -(defcustom mh-alias-completion-ignore-case-flag t - "*Non-nil means don't consider case significant in MH alias completion. -This is the default in plain MH, so it is the default here as well. It -can be useful to set this to t if, for example, you use lowercase -aliases for people and uppercase for mailing lists." - :type 'boolean +(defcustom mh-alias-reloaded-hook nil + "Invoked by `mh-alias-reload' after reloading aliases." + :type 'hook + :group 'mh-hooks :group 'mh-alias) -(defcustom mh-alias-expand-aliases-flag nil - "*Non-nil means to expand aliases entered in the minibuffer. -In other words, aliases entered in the minibuffer will be expanded to the full -address in the message draft. By default, this expansion is not performed." - :type 'boolean - :group 'mh-alias) - -(defcustom mh-alias-flash-on-comma t - "*Specify whether to flash or warn on translation. -When a [comma] is pressed while entering aliases or addresses, setting this -variable to the following values has the listed effects: -t Flash alias translation but don't warn if there is no translation. -1 Flash alias translation and warn if there is no translation. -nil Do not flash alias translation nor warn if there is no translation." - :type '(choice (const :tag "Flash but don't warn if no translation" t) - (const :tag "Flash and warn if no translation" 1) - (const :tag "Don't flash nor warn if no translation" nil)) - :group 'mh-alias) - -(defcustom mh-alias-insert-file nil - "*Filename to use to store new MH-E aliases. -This variable can also be a list of filenames, in which case MH-E will prompt -for one of them. If nil, the default, then MH-E will use the first file found -in the \"AliasFile\" component of the MH profile." - :type '(choice (const :tag "Use AliasFile MH profile component" nil) - (file :tag "Alias file") - (repeat :tag "List of alias files" file)) - :group 'mh-alias) - -(defcustom mh-alias-insertion-location 'sorted - "Specifies where new aliases are entered in alias files. -Options are sorted alphabetically, at the top of the file or at the bottom." - :type '(choice (const :tag "Sorted alphabetically" sorted) - (const :tag "At the top of file" top) - (const :tag "At the bottom of file" bottom)) - :group 'mh-alias) - -(defcustom mh-alias-local-users t - "*If t, local users are completed in MH-E To: and Cc: prompts. - -Users with a userid greater than some magic number (usually 200) are available -for completion. - -If you set this variable to a string, it will be executed to generate a -password file. A value of \"ypcat passwd\" is helpful if NIS is in use." - :type '(choice (boolean) (string)) - :group 'mh-alias) - -(defcustom mh-alias-local-users-prefix "local." - "*String prepended to the real names of users from the passwd file. -If nil, use the username string unmodified instead of the real name from -the gecos field of the passwd file. - -For example, given the following passwd file line: - - psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh - -here are the derived aliases for different values of this variable: - - \"local.\" -> local.peter.galbraith - \"\" -> peter.galbraith - nii -> psg - -This variable is only meaningful if the variable `mh-alias-local-users' is -non-nil." - :type '(choice (const :tag "Use username instead of real name" nil) - (string)) - :group 'mh-alias) - -(defcustom mh-alias-passwd-gecos-comma-separator-flag t - "*Non-nil means the gecos field in the passwd file uses comma as a separator. -Used to construct aliases for users in the passwd file." - :type 'boolean - :group 'mh-alias) - -(defcustom mh-alias-system-aliases - '("/etc/nmh/MailAliases" "/usr/lib/mh/MailAliases" "/etc/passwd") - "*A list of system files from which to cull aliases. -If these files are modified, they are automatically reread. This list need -include only system aliases and the passwd file, since personal alias files -listed in your \"AliasFile\" MH profile component are automatically included. -You can update the alias list manually using \\[mh-alias-reload]." - :type '(choice (file) (repeat file)) - :group 'mh-alias) - - - -;;; Multiple personalities (:group 'mh-identity) - -(defcustom mh-identity-list nil - "*List holding MH-E identity. -Omit the colon and trailing space from the field names. -The keyword name \"none\" is reserved for internal use. -Use the keyname name \"signature\" to specify either a signature file or a -function to call to insert a signature at point. - -Providing an empty Value (\"\") will cause the field to be deleted. - -Example entries using the customize interface: - Keyword name: work - From - Value: John Doe - Organization - Value: Acme Inc. - Keyword name: home - From - Value: John Doe - Organization - Value: - -This would produce the equivalent of: - (setq mh-identity-list - '((\"work\" - ((\"From\" . \"John Doe \") - (\"Organization\" . \"Acme Inc.\"))) - (\"home\" - ((\"From\" . \"John Doe \") - (\"Organization\" . \"\")))))" - :type '(repeat (list :tag "" - (string :tag "Keyword name") - (repeat :tag "At least one pair from below" - (choice (cons :tag "From field" - (const "From") - (string :tag "Value")) - (cons :tag "Organization field" - (const "Organization") - (string :tag "Value")) - (cons :tag "Signature" - (const "signature") - (choice (file) (function))) - (cons :tag "Other field & value pair" - (string :tag "Field") - (string :tag "Value")))))) - :set 'mh-identity-list-set - :group 'mh-identity) - -(defcustom mh-auto-fields-list nil - "Alist of addresses for which header lines are automatically inserted. -Each element has the form (REGEXP ((KEYWORD VALUE) (KEYWORD VALUE)). -When the REGEXP appears in the To or cc fields of a message, the corresponding -KEYWORD header field is insert with its VALUE in the message header. - -There is one special case for KEYWORD, that of \"identity\", which means to -insert that identity using `mh-insert-identity'. - -The common KEYWORD cases of \"Mail-Followup-To\" and \"fcc\" are also -prompted for in the customization interface." - :type `(repeat - (list :tag "" - (string :tag "Regular expression to match") - (repeat :tag "At least one pair from below" - (choice - (cons :tag "Identity entry" - (const "identity") - ,(append - '(radio) - (mapcar (function (lambda (arg) `(const ,arg))) - (mapcar 'car mh-identity-list)))) - (cons :tag "fcc field" - (const "fcc") - (string :tag "Value")) - (cons :tag "Mail-Followup-To field" - (const "Mail-Followup-To") - (string :tag "Value")) - (cons :tag "Other field and value pair" - (string :tag "Field") - (string :tag "Value")))))) - :group 'mh-identity) - -(defcustom mh-identity-default nil - "Default identity to use when `mh-letter-mode' is called." - ;; Dynamically render :type corresponding to `mh-identity-list' entries, - ;; e.g.: - ;; :type '(radio (const :tag "none" nil) - ;; (const "home") - ;; (const "work")) - :type (append - '(radio) - (cons '(const :tag "None" nil) - (mapcar (function (lambda (arg) `(const ,arg))) - (mapcar 'car mh-identity-list)))) - :group 'mh-identity) - - - -;;; Hooks (:group 'mh-hooks + group where hook defined) - -;;; These are alphabetized. All hooks should be placed in the 'mh-hook group; -;;; in addition, add the group in which the hook is defined in the manual (or, -;;; if it is new, where it would be defined). - (defcustom mh-before-quit-hook nil "Invoked by \\`\\[mh-quit]' before quitting MH-E. See also `mh-quit-hook'." :type 'hook :group 'mh-hooks - :group 'mh-folder) + :group 'mh-show) (defcustom mh-before-send-letter-hook nil "Invoked at the beginning of the \\\\[mh-send-letter] command." @@ -1684,7 +1962,7 @@ See also `mh-quit-hook'." "Invoked after marking each message for deletion." :type 'hook :group 'mh-hooks - :group 'mh-folder) + :group 'mh-show) (defcustom mh-edit-mhn-hook nil "Invoked on the formatted letter by \\\\[mh-edit-mhn]." @@ -1696,13 +1974,13 @@ See also `mh-quit-hook'." "Invoked by `mh-find-path' after reading the user's MH profile." :type 'hook :group 'mh-hooks - :group 'mh-folder) + :group 'mh-show) (defcustom mh-folder-mode-hook nil "Invoked in `mh-folder-mode' on a new folder." :type 'hook :group 'mh-hooks - :group 'mh-folder) + :group 'mh-show) (defcustom mh-folder-updated-hook nil "Invoked when the folder actions (such as moves and deletes) are performed. @@ -1712,11 +1990,17 @@ current folder, `mh-current-folder'." :type 'hook :group 'mh-hooks) +(defcustom mh-forward-hook nil + "Invoked on the forwarded letter by \\\\[mh-forward]." + :type 'hook + :group 'mh-hooks + :group 'mh-folder) + (defcustom mh-inc-folder-hook nil "Invoked by \\`\\[mh-inc-folder]' after incorporating mail into a folder." :type 'hook :group 'mh-hooks - :group 'mh-folder) + :group 'mh-inc) (defcustom mh-kill-folder-suppress-prompt-hook '(mh-index-p) "Invoked at the beginning of the \\`\\[mh-kill-folder]' command. @@ -1733,13 +2017,12 @@ t on +inbox and you hit \\`\\[mh-kill-folder]' by accident in the +inbox buffer, you will not be happy." :type 'hook :group 'mh-hooks - :group 'mh-folder) + :group 'mh-show) (defcustom mh-letter-insert-signature-hook nil - "Invoked at the beginning of the \\\\[mh-insert-signature] command. -Can be used to determine which signature file to use based on message content. -On return, if `mh-signature-file-name' is non-nil that file will be inserted at -the current point in the buffer." + "Invoked after signature has been inserted. +This hook may access the actual name of the file or the function used to +insert the signature with `mh-signature-file-name'." :type 'hook :group 'mh-hooks :group 'mh-letter) @@ -1748,26 +2031,26 @@ the current point in the buffer." "Invoked in `mh-letter-mode' on a new letter." :type 'hook :group 'mh-hooks - :group 'mh-letter) + :group 'mh-sending-mail) (defcustom mh-pick-mode-hook nil "Invoked upon entry to `mh-pick-mode'." :type 'hook :group 'mh-hooks - :group 'mh-folder) + :group 'mh-index) (defcustom mh-quit-hook nil "Invoked after \\`\\[mh-quit]' quits MH-E. See also `mh-before-quit-hook'." :type 'hook :group 'mh-hooks - :group 'mh-folder) + :group 'mh-show) (defcustom mh-refile-msg-hook nil "Invoked after marking each message for refiling." :type 'hook :group 'mh-hooks - :group 'mh-folder) + :group 'mh-show) (defcustom mh-show-hook nil "Invoked after \\`\\[mh-show]' shows a message." @@ -1787,44 +2070,13 @@ The variable `mh-seen-list' can be used to obtain the list of messages which will be removed from the unseen sequence." :type 'hook :group 'mh-hooks - :group 'mh-folder) + :group 'mh-show) -;;; Faces +;;; Faces (:group 'mh-*-faces + group where faces described) -;;; Faces used in speedbar (:group mh-speed-faces) - -(defface mh-speedbar-folder-face - '((((class color) (background light)) - (:foreground "blue4")) - (((class color) (background dark)) - (:foreground "light blue"))) - "Face used for folders in the speedbar buffer." - :group 'mh-speed-faces) - -(defface mh-speedbar-selected-folder-face - '((((class color) (background light)) - (:foreground "red" :underline t)) - (((class color) (background dark)) - (:foreground "red" :underline t)) - (t (:underline t))) - "Face used for the current folder." - :group 'mh-speed-faces) - -(defface mh-speedbar-folder-with-unseen-messages-face - '((t (:inherit mh-speedbar-folder-face :bold t))) - "Face used for folders in the speedbar buffer which have unread messages." - :group 'mh-speed-faces) - -(defface mh-speedbar-selected-folder-with-unseen-messages-face - '((t (:inherit mh-speedbar-selected-folder-face :bold t))) - "Face used for the current folder when it has unread messages." - :group 'mh-speed-faces) - - - -;;; Faces used in scan listing (:group mh-folder-faces) +;;; Faces Used in Scan Listing (:group 'mh-folder-faces) (defvar mh-folder-body-face 'mh-folder-body-face "Face for highlighting body text in MH-Folder buffers.") @@ -1962,7 +2214,36 @@ will be removed from the unseen sequence." -;;; Faces used in message display (:group mh-show-faces) +;;; Faces Used in Searching (:group 'mh-index-faces) + +(defvar mh-index-folder-face 'mh-index-folder-face + "Face for highlighting folders in MH-Index buffers.") +(defface mh-index-folder-face + '((((class color) (background light)) + (:foreground "dark green" :bold t)) + (((class color) (background dark)) + (:foreground "indian red" :bold t)) + (t + (:bold t))) + "Face for highlighting folders in MH-Index buffers." + :group 'mh-index-faces) + + + +;;; Faces Used in Message Drafts (:group 'mh-letter-faces) + +(defface mh-letter-header-field-face + '((((class color) (background light)) + (:background "gray90")) + (((class color) (background dark)) + (:background "gray10")) + (t (:bold t))) + "Face for displaying header fields in draft buffers." + :group 'mh-letter-faces) + + + +;;; Faces Used in Message Display (:group 'mh-show-faces) (defvar mh-show-cc-face 'mh-show-cc-face "Face for highlighting cc header fields.") @@ -2002,6 +2283,11 @@ will be removed from the unseen sequence." "Face used to deemphasize unspecified header fields." :group 'mh-show-faces) +(defface mh-show-signature-face + '((t (:italic t))) + "Face for highlighting message signature." + :group 'mh-show-faces) + (defvar mh-show-to-face 'mh-show-to-face "Face for highlighting the To: header field.") (if (boundp 'facemenu-unlisted-faces) @@ -2041,32 +2327,34 @@ The background and foreground is used in the image." -;;; Faces used in indexed searches (:group mh-index-faces) +;;; Faces Used in Speedbar (:group 'mh-speed-faces) -(defvar mh-index-folder-face 'mh-index-folder-face - "Face for highlighting folders in MH-Index buffers.") -(defface mh-index-folder-face +(defface mh-speedbar-folder-face '((((class color) (background light)) - (:foreground "dark green" :bold t)) + (:foreground "blue4")) (((class color) (background dark)) - (:foreground "indian red" :bold t)) - (t - (:bold t))) - "Face for highlighting folders in MH-Index buffers." - :group 'mh-index-faces) + (:foreground "light blue"))) + "Face used for folders in the speedbar buffer." + :group 'mh-speed-faces) - - -;;; Faces used when composing messages. - -(defface mh-letter-header-field-face +(defface mh-speedbar-selected-folder-face '((((class color) (background light)) - (:background "gray90")) + (:foreground "red" :underline t)) (((class color) (background dark)) - (:background "gray10")) - (t (:bold t))) - "Face for displaying header fields in draft buffers." - :group 'mh-letter-faces) + (:foreground "red" :underline t)) + (t (:underline t))) + "Face used for the current folder." + :group 'mh-speed-faces) + +(defface mh-speedbar-folder-with-unseen-messages-face + '((t (:inherit mh-speedbar-folder-face :bold t))) + "Face used for folders in the speedbar buffer which have unread messages." + :group 'mh-speed-faces) + +(defface mh-speedbar-selected-folder-with-unseen-messages-face + '((t (:inherit mh-speedbar-selected-folder-face :bold t))) + "Face used for the current folder when it has unread messages." + :group 'mh-speed-faces) ;;; Local Variables: ;;; indent-tabs-mode: nil diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index e72304c4412..5cb7f90f1e3 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -5,7 +5,7 @@ ;; Author: Bill Wohler ;; Maintainer: Bill Wohler -;; Version: 7.4.4 +;; Version: 7.4.80 ;; Keywords: mail ;; This file is part of GNU Emacs. @@ -75,24 +75,19 @@ ;; Original version for Gosling emacs by Brian Reid, Stanford, 1982. ;; Modified by James Larus, BBN, July 1984 and UCB, 1984 & 1985. -;; Rewritten for GNU Emacs, James Larus 1985. larus@ginger.berkeley.edu -;; Modified by Stephen Gildea 1988. gildea@lcs.mit.edu -;; Maintenance picked up by Bill Wohler and the -;; SourceForge Crew . 2001. +;; Rewritten for GNU Emacs, James Larus, 1985. +;; Modified by Stephen Gildea, 1988. +;; Maintenance picked up by Bill Wohler and the +;; SourceForge Crew , 2001. ;;; Code: (provide 'mh-e) -(require 'mh-utils) + +(eval-when-compile (require 'mh-acros)) (mh-require-cl) - -(defvar recursive-load-depth-limit) -(eval-when (compile load eval) - (if (and (boundp 'recursive-load-depth-limit) - (integerp recursive-load-depth-limit) - (> 50 recursive-load-depth-limit)) - (setq recursive-load-depth-limit 50))) - +(require 'mh-utils) +(require 'mh-init) (require 'mh-inc) (require 'gnus-util) (require 'easymenu) @@ -101,35 +96,27 @@ (defvar font-lock-auto-fontify) (defvar font-lock-defaults) -(defconst mh-version "7.4.4" "Version number of MH-E.") +(defconst mh-version "7.4.80" "Version number of MH-E.") ;;; Autoloads (autoload 'Info-goto-node "info") - - -(defvar mh-note-deleted "D" - "String whose first character is used to notate deleted messages.") - -(defvar mh-note-refiled "^" - "String whose first character is used to notate refiled messages.") - -(defvar mh-note-cur "+" - "String whose first character is used to notate the current message.") - (defvar mh-partial-folder-mode-line-annotation "select" "Annotation when displaying part of a folder. The string is displayed after the folder's name. nil for no annotation.") + +;;; Scan Line Formats + ;;; Parameterize MH-E to work with different scan formats. The defaults work ;;; with the standard MH scan listings, in which the first 4 characters on ;;; the line are the message number, followed by two places for notations. -;; The following scan formats are passed to the scan program if the -;; setting of `mh-scan-format-file' above is nil. They are identical -;; except the later one makes use of the nmh `decode' function to -;; decode RFC 2047 encodings. If you just want to change the width of -;; the msg number, use the `mh-set-cmd-note' function. +;; The following scan formats are passed to the scan program if the setting of +;; `mh-scan-format-file' is t. They are identical except the later one makes +;; use of the nmh `decode' function to decode RFC 2047 encodings. If you just +;; want to change the width of the msg number, use the `mh-set-cmd-note' +;; function. (defvar mh-scan-format-mh (concat @@ -150,11 +137,10 @@ This format is identical to the default except that additional hints for fontification have been added to the fifth column (remember that in Emacs, the first column is 0). -The values of the fifth column, in priority order, are: `-' if the -message has been replied to, t if an address on the To: line matches -one of the mailboxes of the current user, `c' if the Cc: line matches, -`b' if the Bcc: line matches, and `n' if a non-empty Newsgroups: header -is present.") +The values of the fifth column, in priority order, are: `-' if the message has +been replied to, t if an address on the To: line matches one of the +mailboxes of the current user, `c' if the Cc: line matches, `b' if the Bcc: +line matches, and `n' if a non-empty Newsgroups: header is present.") (defvar mh-scan-format-nmh (concat @@ -176,78 +162,94 @@ This format is identical to the default except that additional hints for fontification have been added to the fifth column (remember that in Emacs, the first column is 0). -The values of the fifth column, in priority order, are: `-' if the -message has been replied to, t if an address on the To: line matches -one of the mailboxes of the current user, `c' if the Cc: line matches, -`b' if the Bcc: line matches, and `n' if a non-empty Newsgroups: header -is present.") +The values of the fifth column, in priority order, are: `-' if the message has +been replied to, t if an address on the To: field matches one of the +mailboxes of the current user, `c' if the Cc: field matches, `b' if the Bcc: +field matches, and `n' if a non-empty Newsgroups: field is present.") + +(defvar mh-note-deleted ?D + "Deleted messages are marked by this character. +See also `mh-scan-deleted-msg-regexp'.") + +(defvar mh-note-refiled ?^ + "Refiled messages are marked by this character. +See also `mh-scan-refiled-msg-regexp'.") + +(defvar mh-note-cur ?+ + "The current message (in MH) is marked by this character. +See also `mh-scan-cur-msg-number-regexp'.") (defvar mh-scan-good-msg-regexp "^\\( *[0-9]+\\)[^D^0-9]" - "Regexp specifying the scan lines that are 'good' messages. -The default `mh-folder-font-lock-keywords' expects this expression to contain -at least one parenthesized expression which matches the message number.") + "This regexp specifies the scan lines that are 'good' messages. +Note that the default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least one parenthesized expression which matches the +message number as in the default of \"^\\\\( *[0-9]+\\\\)[^D^0-9]\".") (defvar mh-scan-deleted-msg-regexp "^\\( *[0-9]+\\)D" - "Regexp matching scan lines of deleted messages. -The default `mh-folder-font-lock-keywords' expects this expression to contain -at least one parenthesized expression which matches the message number.") + "This regexp matches deleted messages. +Note that the default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least one parenthesized expression which matches the +message number as in the default of \"^\\\\( *[0-9]+\\\\)D\". +See also `mh-note-deleted'.") (defvar mh-scan-refiled-msg-regexp "^\\( *[0-9]+\\)\\^" - "Regexp matching scan lines of refiled messages. -The default `mh-folder-font-lock-keywords' expects this expression to contain -at least one parenthesized expression which matches the message number.") + "This regexp matches refiled messages. +Note that the default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least one parenthesized expression which matches the +message number as in the default of \"^\\\\( *[0-9]+\\\\)\\\\^\". +See also `mh-note-refiled'.") (defvar mh-scan-valid-regexp "^ *[0-9]" - "Regexp matching scan lines for messages (not error messages).") + "This regexp matches scan lines for messages (not error messages).") (defvar mh-scan-cur-msg-number-regexp "^\\( *[0-9]+\\+\\).*" - "Regexp matching scan line for the current message. -The default `mh-folder-font-lock-keywords' expects this expression to contain -at least one parenthesized expression which matches the message number. -Don't disable this regexp as it's needed by non fontifying functions.") - -(defvar mh-scan-cur-msg-regexp "^\\( *[0-9]+\\+DISABLED.*\\)" - "Regexp matching scan line for the current message. -The default `mh-folder-font-lock-keywords' expects this expression to contain -at least one parenthesized expression which matches the whole line. -To enable this feature, remove the string DISABLED from the regexp.") + "This regexp matches the current message. +Note that the default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least one parenthesized expression which matches the +message number as in the default of \"^\\\\( *[0-9]+\\\\+\\\\).*\". Don't +disable this regexp as it's needed by non-fontifying functions. +See also `mh-note-cur'.") (defvar mh-scan-date-regexp "\\([0-9][0-9]/[0-9][0-9]\\)" - "Regexp matching a valid date in scan lines. -The default `mh-folder-font-lock-keywords' expects this expression to contain -only one parenthesized expression which matches the date field -\(see `mh-scan-format-regexp').") + "This regexp matches a valid date. +Note that the default setting of `mh-folder-font-lock-keywords' expects this +expression to contain only one parenthesized expression which matches the date +field as in the default of \"\\\\([0-9][0-9]/[0-9][0-9]\\\\)\"}. +See also `mh-scan-format-regexp'.") (defvar mh-scan-rcpt-regexp "\\(To:\\)\\(..............\\)" - "Regexp specifying the recipient in scan lines for messages we sent. -The default `mh-folder-font-lock-keywords' expects this expression to contain -two parenthesized expressions. The first is expected to match the To: -that the default scan format file generates. The second is expected to match -the recipient's name.") + "This regexp specifies the recipient in messages you sent. +Note that the default setting of `mh-folder-font-lock-keywords' +expects this expression to contain two parenthesized expressions. The +first is expected to match the `To:' that the default scan format +file generates. The second is expected to match the recipient's name +as in the default of \"\\\\(To:\\\\)\\\\(..............\\\\)\".") (defvar mh-scan-body-regexp "\\(<<\\([^\n]+\\)?\\)" - "Regexp matching the message body beginning displayed in scan lines. -The default `mh-folder-font-lock-keywords' expects this expression to contain -at least one parenthesized expression which matches the body text.") + "This regexp matches the message body fragment displayed in scan lines. +Note that the default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least one parenthesized expression which matches the +body text as in the default of \"\\\\(<<\\\\([^\\n]+\\\\)?\\\\)\".") (defvar mh-scan-subject-regexp - ;;"^ *[0-9]+........[ ]*...................\\([Rr][Ee]:\\s-*\\)*\\([^<\n]*\\)" "^ *[0-9]+........[ ]*...................\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)" - "*Regexp matching the subject string in MH folder mode. -The default `mh-folder-font-lock-keywords' expects this expression to contain -at least tree parenthesized expressions. The first is expected to match the Re: -string, if any. The second matches an optional bracketed number after Re, -such as in Re[2]: and the third is expected to match the subject line itself.") + "This regexp matches the subject. +Note that the default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least three parenthesized expressions. The first is +expected to match the `Re:' string, if any. The second matches an optional +bracketed number after `Re:', such as in `Re[2]:' (and is thus a +sub-expression of the first expression) and the third is expected to match +the subject line itself as in the default of \"^ *[0-9]+........[ ]*...................\\\\([Rr][Ee]\\\\(\\\\\\=[[0-9]+\\\\]\\\\)?:\\\\s-*\\\\)*\\\\([^<\\n]*\\\\)\".") (defvar mh-scan-format-regexp (concat "\\([bct]\\)" mh-scan-date-regexp " *\\(..................\\)") - "Regexp matching the output of scan. -The default value is based upon the default values of either -`mh-scan-format-mh' or `mh-scan-format-nmh'. -The default `mh-folder-font-lock-keywords' expects this expression to contain -at least three parenthesized expressions. The first should match the -fontification hint, the second is found in `mh-scan-date-regexp', and the -third should match the user name.") + "This regexp matches the output of scan. +Note that the default setting of `mh-folder-font-lock-keywords' expects this +expression to contain at least three parenthesized expressions. The first +should match the fontification hint, the second is found in +`mh-scan-date-regexp', and the third should match the user name as in the +default of \"(concat \"\\\\([bct]\\\\)\" mh-scan-date-regexp + \"*\\\\(..................\\\\)\")\".") @@ -279,10 +281,7 @@ third should match the user name.") ;; scan font-lock name (list mh-scan-format-regexp '(1 mh-folder-date-face) - '(3 mh-folder-scan-format-face)) - ;; Current message line - (list mh-scan-cur-msg-regexp - '(1 mh-folder-cur-msg-face prepend t))) + '(3 mh-folder-scan-format-face))) "Regexp keywords used to fontify the MH-Folder buffer.") (defvar mh-scan-cmd-note-width 1 @@ -356,46 +355,6 @@ This column will only ever have spaces in it.") ;; Fontifify unseen mesages in bold. -(defvar mh-folder-unseen-seq-name nil - "Name of unseen sequence. -The default for this is provided by the function `mh-folder-unseen-seq-name' -On nmh systems.") - -(defun mh-folder-unseen-seq-name () - "Provide name of unseen sequence from mhparam." - (or mh-progs (mh-find-path)) - (save-excursion - (let ((unseen-seq-name "unseen")) - (with-temp-buffer - (unwind-protect - (progn - (call-process (expand-file-name "mhparam" mh-progs) - nil '(t t) nil "-component" "Unseen-Sequence") - (goto-char (point-min)) - (if (re-search-forward "Unseen-Sequence: \\(.*\\)$" nil t) - (setq unseen-seq-name (match-string 1)))))) - unseen-seq-name))) - -(defun mh-folder-unseen-seq-list () - "Return a list of unseen message numbers for current folder." - (if (not mh-folder-unseen-seq-name) - (setq mh-folder-unseen-seq-name (mh-folder-unseen-seq-name))) - (cond - ((not mh-folder-unseen-seq-name) - nil) - (t - (let ((folder mh-current-folder)) - (save-excursion - (with-temp-buffer - (unwind-protect - (progn - (call-process (expand-file-name "mark" mh-progs) - nil '(t t) nil - folder "-seq" mh-folder-unseen-seq-name - "-list") - (goto-char (point-min)) - (sort (mh-read-msg-list) '<))))))))) - (defmacro mh-generate-sequence-font-lock (seq prefix face) "Generate the appropriate code to fontify messages in SEQ. PREFIX is used to generate unique names for the variables and functions @@ -492,6 +451,8 @@ is done highlighting.") ;Rememeber original notation that ;is overwritten by `mh-note-seq'. +(defvar mh-colors-available-flag nil) ;Are colors available? + ;;; Macros and generic functions: (defun mh-mapc (function list) @@ -503,7 +464,7 @@ is done highlighting.") (defun mh-scan-format () "Return the output format argument for the scan program." (if (equal mh-scan-format-file t) - (list "-format" (if mh-nmh-flag + (list "-format" (if (mh-variant-p 'nmh 'mu-mh) (list (mh-update-scan-format mh-scan-format-nmh mh-cmd-note)) (list (mh-update-scan-format @@ -519,7 +480,7 @@ is done highlighting.") (defun mh-rmail (&optional arg) "Inc(orporate) new mail with MH. Scan an MH folder if ARG is non-nil. This function is an entry point to MH-E, -the Emacs front end to the MH mail system." +the Emacs interface to the MH mail system." (interactive "P") (mh-find-path) (if arg @@ -532,7 +493,7 @@ the Emacs front end to the MH mail system." (defun mh-nmail (&optional arg) "Check for new mail in inbox folder. Scan an MH folder if ARG is non-nil. This function is an entry point to MH-E, -the Emacs front end to the MH mail system." +the Emacs interface to the MH mail system." (interactive "P") (mh-find-path) ; init mh-inbox (if arg @@ -616,6 +577,7 @@ Do not call this function from outside MH-E; use \\[mh-rmail] instead." (setq folder mh-inbox)) (let ((threading-needed-flag nil)) (let ((config (current-window-configuration))) + (delete-other-windows) (cond ((not (get-buffer folder)) (mh-make-folder folder) (setq threading-needed-flag mh-show-threads-flag) @@ -659,25 +621,26 @@ last undeleted message then pause for a second after printing message." (if wait-after-complaining-flag (sit-for 1))))) (defun mh-folder-from-address () - "Determine folder name from address in From field. -Takes the address in the From: header field, and returns one of: + "Derive folder name from sender. - a) The folder name associated with the address in the alist - `mh-default-folder-list'. If the `Check Recipient' boolean - is set, then the `mh-default-folder-list' addresses are - checked against the recipient instead of the originator - (making possible to use this feature for mailing lists). - The first match found in `mh-default-folder-list' is used. +The name of the folder is derived as follows: - b) The address' corresponding alias from the user's personal - aliases file prefixed by `mh-default-folder-prefix'. + a) The folder name associated with the first address found in the list + `mh-default-folder-list' is used. Each element in this list contains a + `Check Recipient' item. If this item is turned on, then the address is + checked against the recipient instead of the sender. This is useful for + mailing lists. -Returns nil if the address was not found in either place or if the variable -`mh-default-folder-must-exist-flag' is nil and the folder does not exist." + b) An alias prefixed by `mh-default-folder-prefix' corresponding to the + address is used. The prefix is used to prevent clutter in your mail + directory. + +Return nil if a folder name was not derived, or if the variable +`mh-default-folder-must-exist-flag' is t and the folder does not exist." ;; Loop for all entries in mh-default-folder-list (save-restriction (goto-char (point-min)) - (re-search-forward "\n\n" nil t) + (re-search-forward "\n\n" nil 'limit) (narrow-to-region (point-min) (point)) (let ((to/cc (concat (or (message-fetch-field "to") "") ", " (or (message-fetch-field "cc") ""))) @@ -715,25 +678,24 @@ Returns nil if the address was not found in either place or if the variable "Prompt the user for a folder in which the message should be filed. The folder is returned as a string. -If `mh-default-folder-for-message-function' is a function then the message -being refiled is yanked into a temporary buffer and the function is called to -intelligently guess where the message is to be refiled. - -Otherwise, a default folder name is generated by `mh-folder-from-address'." +The default folder name is generated by the option +`mh-default-folder-for-message-function' if it is non-nil or +`mh-folder-from-address'." (mh-prompt-for-folder "Destination" - (let ((refile-file (mh-msg-filename (mh-get-msg-num t)))) - (save-excursion - (set-buffer (get-buffer-create mh-temp-buffer)) - (erase-buffer) - (insert-file-contents refile-file) - (or (and mh-default-folder-for-message-function - (let ((buffer-file-name refile-file)) - (funcall mh-default-folder-for-message-function))) - (mh-folder-from-address) - (and (eq 'refile (car mh-last-destination-folder)) - (symbol-name (cdr mh-last-destination-folder))) - ""))) + (let ((refile-file (ignore-errors (mh-msg-filename (mh-get-msg-num t))))) + (if (null refile-file) "" + (save-excursion + (set-buffer (get-buffer-create mh-temp-buffer)) + (erase-buffer) + (insert-file-contents refile-file) + (or (and mh-default-folder-for-message-function + (let ((buffer-file-name refile-file)) + (funcall mh-default-folder-for-message-function))) + (mh-folder-from-address) + (and (eq 'refile (car mh-last-destination-folder)) + (symbol-name (cdr mh-last-destination-folder))) + "")))) t)) (defun mh-refile-msg (range folder &optional dont-update-last-destination-flag) @@ -872,7 +834,9 @@ are skipped." (setq count (1- count))) (not (car unread-sequence))) (message "No more unread messages")) - (t (mh-goto-msg (car unread-sequence)))))) + (t (loop for msg in unread-sequence + when (mh-goto-msg msg t) return nil + finally (message "No more unread messages")))))) (defun mh-goto-next-button (backward-flag &optional criterion) "Search for next button satisfying criterion. @@ -1090,7 +1054,7 @@ interactive use." (if (not (mh-outstanding-commands-p)) (mh-set-folder-modified-p nil))) -;;;###mh-autoload + (defun mh-folder-line-matches-show-buffer-p () "Return t if the message under point in folder-mode is in the show buffer. Return nil in any other circumstance (no message under point, no show buffer, @@ -1123,7 +1087,6 @@ compiled then macro expansion happens at compile time." (defun mh-version () "Display version information about MH-E and the MH mail handling system." (interactive) - (mh-find-progs) (set-buffer (get-buffer-create mh-info-buffer)) (erase-buffer) ;; MH-E version. @@ -1140,19 +1103,12 @@ compiled then macro expansion happens at compile time." ;; Emacs version. (insert (emacs-version) "\n\n") ;; MH version. - (let ((help-start (point))) - (condition-case err-data - (mh-exec-cmd-output "inc" nil (if mh-nmh-flag "-version" "-help")) - (file-error (insert (mapconcat 'concat (cdr err-data) ": ") "\n"))) - (goto-char help-start) - (if mh-nmh-flag - (search-forward "inc -- " nil t) - (search-forward "version: " nil t)) - (delete-region help-start (point))) - (goto-char (point-max)) - (insert " mh-progs:\t" mh-progs "\n" - " mh-lib:\t" mh-lib "\n" - " mh-lib-progs:\t" mh-lib-progs "\n\n") + (if mh-variant-in-use + (insert mh-variant-in-use "\n" + " mh-progs:\t" mh-progs "\n" + " mh-lib:\t" mh-lib "\n" + " mh-lib-progs:\t" mh-lib-progs "\n\n") + (insert "No MH variant detected\n")) ;; Linux version. (condition-case () (call-process "uname" nil t nil "-a") @@ -1202,7 +1158,7 @@ used to avoid problems in corner cases involving folders whose names end with a (defun mh-folder-size-flist (folder) "Find size of FOLDER using `flist'." (with-temp-buffer - (call-process (expand-file-name "flist" mh-progs) nil t nil + (call-process (expand-file-name "flist" mh-progs) nil t nil "-showzero" "-norecurse" folder "-sequence" (symbol-name mh-unseen-seq)) (goto-char (point-min)) (multiple-value-bind (folder unseen total) @@ -1236,6 +1192,7 @@ regardless of the size of the `mh-large-folder' variable." (let ((config (current-window-configuration)) (current-buffer (current-buffer)) (threaded-view-flag mh-show-threads-flag)) + (delete-other-windows) (save-excursion (when (get-buffer folder) (set-buffer folder) @@ -1258,12 +1215,11 @@ regardless of the size of the `mh-large-folder' variable." (mh-toggle-threads)) (mh-index-data (mh-index-insert-folder-headers))) - (unless mh-showing-mode (delete-other-windows)) (unless (eq current-buffer (current-buffer)) (setq mh-previous-window-config config))) nil) -;;;###mh-autoload + (defun mh-update-sequences () "Update MH's Unseen-Sequence and current folder and message. Flush MH-E's state out to MH. The message at the cursor becomes current." @@ -1334,7 +1290,7 @@ arguments, after the message has been refiled." (mh-exec-cmd "refile" (mh-get-msg-num t) "-link" "-src" mh-current-folder (symbol-name folder)) - (message "Message not copied."))) + (message "Message not copied"))) (t (mh-set-folder-modified-p t) (cond ((null (assoc folder mh-refile-list)) @@ -1381,7 +1337,9 @@ With optional argument COUNT, COUNT-1 unread messages are skipped." (setq count (1- count))) (not (car unread-sequence))) (message "No more unread messages")) - (t (mh-goto-msg (car unread-sequence)))))) + (t (loop for msg in unread-sequence + when (mh-goto-msg msg t) return nil + finally (message "No more unread messages")))))) (defun mh-set-scan-mode () "Display the scan listing buffer, but do not show a message." @@ -1472,12 +1430,12 @@ Make it the current folder." ["Go to First Message" mh-first-msg t] ["Go to Last Message" mh-last-msg t] ["Go to Message by Number..." mh-goto-msg t] - ["Modify Message" mh-modify] + ["Modify Message" mh-modify t] ["Delete Message" mh-delete-msg (mh-get-msg-num nil)] ["Refile Message" mh-refile-msg (mh-get-msg-num nil)] - ["Undo Delete/Refile" mh-undo t] - ["Process Delete/Refile" mh-execute-commands - (or mh-refile-list mh-delete-list)] + ["Undo Delete/Refile" mh-undo (mh-outstanding-commands-p)] + ["Execute Delete/Refile" mh-execute-commands + (mh-outstanding-commands-p)] "--" ["Compose a New Message" mh-send t] ["Reply to Message..." mh-reply (mh-get-msg-num nil)] @@ -1501,7 +1459,7 @@ Make it the current folder." ["Incorporate New Mail" mh-inc-folder t] ["Toggle Show/Folder" mh-toggle-showing t] ["Execute Delete/Refile" mh-execute-commands - (or mh-refile-list mh-delete-list)] + (mh-outstanding-commands-p)] ["Rescan Folder" mh-rescan-folder t] ["Thread Folder" mh-toggle-threads (not (memq 'unthread mh-view-ops))] @@ -1541,6 +1499,12 @@ is used in previous versions and XEmacs." (defvar tool-bar-map) (defvar desktop-save-buffer)) ;Emacs 21.4 +;; Register mh-folder-mode as supporting which-function-mode... +(load "which-func" t t) +(when (and (boundp 'which-func-modes) + (not (member 'mh-folder-mode which-func-modes))) + (push 'mh-folder-mode which-func-modes)) + (define-derived-mode mh-folder-mode fundamental-mode "MH-Folder" "Major MH-E mode for \"editing\" an MH folder scan listing.\\ @@ -1548,16 +1512,49 @@ You can show the message the cursor is pointing to, and step through the messages. Messages can be marked for deletion or refiling into another folder; these commands are executed all at once with a separate command. -A prefix argument (\\[universal-argument]) to delete, refile, list, or undo -applies the action to a message sequence. If `transient-mark-mode', -is non-nil, the action is applied to the region. - Options that control this mode can be changed with \\[customize-group]; specify the \"mh\" group. In particular, please see the `mh-scan-format-file' option if you wish to modify scan's format. When a folder is visited, the hook `mh-folder-mode-hook' is run. +Ranges +====== +Many commands that operate on individual messages, such as `mh-forward' or +`mh-refile-msg' take a RANGE argument. This argument can be used in several +ways. + +If you provide the prefix argument (\\[universal-argument]) to these commands, +then you will be prompted for the message range. This can be any legal MH +range which can include messages, sequences, and the abbreviations (described +in the mh(1) man page): + +- + Indicates all messages in the range to , inclusive. The range + must be nonempty. + +`:N' +`:+N' +`:-N' + Up to N messages beginning with (or ending with) message num. Num may be + any of the pre-defined symbols: first, prev, cur, next or last. + +`first:N' +`prev:N' +`next:N' +`last:N' + The first, previous, next or last messages, if they exist. + +`all' + All of the messages. + +For example, a range that shows all of these things is `1 2 3 5-10 last:5 +unseen'. + +If the option `transient-mark-mode' is set to t and you set a region in the +MH-Folder buffer, then the MH-E command will perform the operation on all +messages in that region. + \\{mh-folder-mode-map}" (make-local-variable 'font-lock-defaults) @@ -1565,10 +1562,15 @@ When a folder is visited, the hook `mh-folder-mode-hook' is run. (make-local-variable 'desktop-save-buffer) (setq desktop-save-buffer t) (mh-make-local-vars + 'mh-colors-available-flag (mh-colors-available-p) + ; Do we have colors available 'mh-current-folder (buffer-name) ; Name of folder, a string 'mh-show-buffer (format "show-%s" (buffer-name)) ; Buffer that displays msgs 'mh-folder-filename ; e.g. "/usr/foobar/Mail/inbox/" (file-name-as-directory (mh-expand-file-name (buffer-name))) + 'mh-display-buttons-for-inline-parts-flag + mh-display-buttons-for-inline-parts-flag ; Allow for display of buttons to + ; be toggled. 'mh-arrow-marker (make-marker) ; Marker where arrow is displayed 'overlay-arrow-position nil ; Allow for simultaneous display in 'overlay-arrow-string ">" ; different MH-E buffers. @@ -1597,6 +1599,8 @@ When a folder is visited, the hook `mh-folder-mode-hook' is run. 'mh-sequence-notation-history (make-hash-table) ; Remember what is overwritten by ; mh-note-seq. + 'imenu-create-index-function 'mh-index-create-imenu-index + ; Setup imenu support 'mh-previous-window-config nil) ; Previous window configuration (mh-remove-xemacs-horizontal-scrollbar) (setq truncate-lines t) @@ -1620,6 +1624,26 @@ When a folder is visited, the hook `mh-folder-mode-hook' is run. font-lock-auto-fontify) (turn-on-font-lock))) ; Force font-lock in XEmacs. +(defun mh-toggle-mime-buttons () + "Toggle display of buttons for inline MIME parts." + (interactive) + (setq mh-display-buttons-for-inline-parts-flag + (not mh-display-buttons-for-inline-parts-flag)) + (mh-show nil t)) + +(defun mh-colors-available-p () + "Check if colors are available in the Emacs being used." + (or mh-xemacs-flag + (let ((color-cells + (or (ignore-errors (mh-funcall-if-exists display-color-cells)) + (ignore-errors (mh-funcall-if-exists + x-display-color-cells))))) + (and (numberp color-cells) (>= color-cells 8))))) + +(defun mh-colors-in-use-p () + "Check if colors are being used in the folder buffer." + (and mh-colors-available-flag font-lock-mode)) + (defun mh-make-local-vars (&rest pairs) "Initialize local variables according to the variable-value PAIRS." @@ -1631,7 +1655,11 @@ When a folder is visited, the hook `mh-folder-mode-hook' is run. (defun mh-restore-desktop-buffer (desktop-buffer-file-name desktop-buffer-name desktop-buffer-misc) - "Restore an MH folder buffer specified in a desktop file." + "Restore an MH folder buffer specified in a desktop file. +When desktop creates a buffer, DESKTOP-BUFFER-FILE-NAME holds the file name to +visit, DESKTOP-BUFFER-NAME holds the desired buffer name, and +DESKTOP-BUFFER-MISC holds a list of miscellaneous info used by the +`desktop-buffer-handlers' functions." (mh-find-path) (mh-visit-folder desktop-buffer-name) (current-buffer)) @@ -1641,6 +1669,8 @@ When a folder is visited, the hook `mh-folder-mode-hook' is run. If the optional argument DONT-EXEC-PENDING is non-nil then pending deletes and refiles aren't carried out. Return in the folder's buffer." + (when (stringp range) + (setq range (delete "" (split-string range "[ \t\n]")))) (cond ((null (get-buffer folder)) (mh-make-folder folder)) (t @@ -1693,7 +1723,9 @@ If UPDATE, append the scan lines, otherwise replace." (goto-char scan-start) (cond ((looking-at "scan: no messages in") (keep-lines mh-scan-valid-regexp)) ; Flush random scan lines - ((looking-at "scan: bad message list ") + ((looking-at (if (mh-variant-p 'mu-mh) + "scan: message set .* does not exist" + "scan: bad message list ")) (keep-lines mh-scan-valid-regexp)) ((looking-at "scan: ")) ; Keep error messages (t @@ -1869,46 +1901,21 @@ in what is now stored in the buffer-local variable `mh-mode-line-annotation'." ("")))))) (mh-logo-display)))) -;;; XXX: Remove this function, if no one uses it any more... -(defun mh-unmark-all-headers (remove-all-flags) - "Remove all '+' flags from the folder listing. -With non-nil argument REMOVE-ALL-FLAGS, remove all 'D', '^' and '%' flags too. -Optimized for speed (i.e., no regular expressions). - -This function is deprecated. Use `mh-remove-all-notation' instead." - (save-excursion - (let ((case-fold-search nil) - (last-line (1- (point-max))) - char) - (mh-first-msg) - (while (<= (point) last-line) - (forward-char mh-cmd-note) - (setq char (following-char)) - (if (or (and remove-all-flags - (or (= char (aref mh-note-deleted 0)) - (= char (aref mh-note-refiled 0)))) - (= char (aref mh-note-cur 0))) - (progn - (delete-char 1) - (insert " "))) - (if remove-all-flags - (progn - (forward-char 1) - (if (= (following-char) (aref mh-note-seq 0)) - (progn - (delete-char 1) - (insert " "))))) - (forward-line))))) - (defun mh-add-sequence-notation (msg internal-seq-flag) "Add sequence notation to the MSG on the current line. -If INTERNAL-SEQ-FLAG is non-nil, then just remove text properties from the -current line, so that font-lock would automatically refontify it." +If INTERNAL-SEQ-FLAG is non-nil, then refontify the scan line if font-lock is +turned on." (with-mh-folder-updating (t) (save-excursion (beginning-of-line) (if internal-seq-flag - (mh-notate nil nil mh-cmd-note) + (progn + ;; Change the buffer so that if transient-mark-mode is active + ;; and there is an active region it will get deactivated as in + ;; the case of user sequences. + (mh-notate nil nil mh-cmd-note) + (when font-lock-mode + (font-lock-fontify-region (point) (line-end-position)))) (forward-char (1+ mh-cmd-note)) (let ((stack (gethash msg mh-sequence-notation-history))) (setf (gethash msg mh-sequence-notation-history) @@ -1930,7 +1937,11 @@ If ALL is non-nil, then all sequence marks on the scan line are removed." (while (and all (cdr stack)) (setq stack (cdr stack))) (when stack - (mh-notate nil (car stack) (1+ mh-cmd-note))) + (save-excursion + (beginning-of-line) + (forward-char (1+ mh-cmd-note)) + (delete-char 1) + (insert (car stack)))) (setf (gethash msg mh-sequence-notation-history) (cdr stack)))))) (defun mh-remove-cur-notation () @@ -1953,7 +1964,7 @@ If ALL is non-nil, then all sequence marks on the scan line are removed." (mh-remove-sequence-notation msg nil t)) (clrhash mh-sequence-notation-history))) -;;;###mh-autoload + (defun mh-goto-cur-msg (&optional minimal-changes-flag) "Position the cursor at the current message. When optional argument MINIMAL-CHANGES-FLAG is non-nil, the function doesn't @@ -2102,7 +2113,10 @@ with no arguments, after the unseen sequence is updated." (defun mh-outstanding-commands-p () "Return non-nil if there are outstanding deletes or refiles." - (or mh-delete-list mh-refile-list)) + (save-excursion + (when (eq major-mode 'mh-show-mode) + (set-buffer mh-show-folder-buffer)) + (or mh-delete-list mh-refile-list))) (defun mh-coalesce-msg-list (messages) "Given a list of MESSAGES, return a list of message number ranges. @@ -2223,7 +2237,7 @@ numbers, a sequence, a region in a cons cell. If nil all messages are notated." "Return non-nil if NAME is the name of an internal MH-E sequence." (or (memq name mh-internal-seqs) (eq name mh-unseen-seq) - (and mh-tick-seq (eq name mh-tick-seq)) + (and (mh-colors-in-use-p) mh-tick-seq (eq name mh-tick-seq)) (eq name mh-previous-seq) (mh-folder-name-p name))) @@ -2264,6 +2278,15 @@ change." (when (and (eq sequence mh-unseen-seq) (mh-speed-flists-active-p)) (apply #'mh-speed-flists t folders-changed))))) +(defun mh-catchup (range) + "Delete RANGE from the `mh-unseen-seq' sequence. + +Check the document of `mh-interactive-range' to see how RANGE is read in +interactive use." + (interactive (list (mh-interactive-range "Catchup" + (cons (point-min) (point-max))))) + (mh-delete-msg-from-seq range mh-unseen-seq)) + (defun mh-delete-a-msg-from-seq (msg sequence internal-flag) "Delete MSG from SEQUENCE. If INTERNAL-FLAG is non-nil, then do not inform MH of the change." @@ -2291,23 +2314,6 @@ Signals an error if SEQ is an illegal name." "-sequence" (symbol-name seq) (mh-coalesce-msg-list msgs))))) -(defun mh-map-over-seqs (function seq-list) - "Apply FUNCTION to each sequence in SEQ-LIST. -The sequence name and the list of messages are passed as arguments." - (while seq-list - (funcall function - (mh-seq-name (car seq-list)) - (mh-seq-msgs (car seq-list))) - (setq seq-list (cdr seq-list)))) - -(defun mh-notate-if-in-one-seq (msg character offset seq) - "Notate MSG. -The CHARACTER is placed at the given OFFSET from the beginning of the listing. -The notation is performed if the MSG is only in SEQ." - (let ((in-seqs (mh-seq-containing-msg msg nil))) - (if (and (eq seq (car in-seqs)) (null (cdr in-seqs))) - (mh-notate msg character offset)))) - (defun mh-seq-containing-msg (msg &optional include-internal-flag) "Return a list of the sequences containing MSG. If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences in list." @@ -2362,7 +2368,6 @@ If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences in list." "g" mh-goto-msg "i" mh-inc-folder "k" mh-delete-subject-or-thread - "l" mh-print-msg "m" mh-alt-send "n" mh-next-undeleted-msg "\M-n" mh-next-unread-msg @@ -2382,6 +2387,7 @@ If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences in list." "?" mh-prefix-help "'" mh-index-ticked-messages "S" mh-sort-folder + "c" mh-catchup "f" mh-alt-visit-folder "i" mh-index-search "k" mh-kill-folder @@ -2402,6 +2408,17 @@ If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences in list." "b" mh-junk-blacklist "w" mh-junk-whitelist) +(gnus-define-keys (mh-ps-print-map "P" mh-folder-mode-map) + "?" mh-prefix-help + "A" mh-ps-print-toggle-mime + "C" mh-ps-print-toggle-color + "F" mh-ps-print-toggle-faces + "M" mh-ps-print-toggle-mime + "f" mh-ps-print-msg-file + "l" mh-print-msg + "p" mh-ps-print-msg + "s" mh-ps-print-msg-show) + (gnus-define-keys (mh-sequence-map "S" mh-folder-mode-map) "'" mh-narrow-to-tick "?" mh-prefix-help @@ -2446,8 +2463,10 @@ If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences in list." (gnus-define-keys (mh-mime-map "K" mh-folder-mode-map) "?" mh-prefix-help "a" mh-mime-save-parts + "e" mh-display-with-external-viewer "i" mh-folder-inline-mime-part "o" mh-folder-save-mime-part + "t" mh-toggle-mime-buttons "v" mh-folder-toggle-mime-part "\t" mh-next-button [backtab] mh-prev-button @@ -2484,6 +2503,9 @@ If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences in list." (?F "[l]ist; [v]isit folder;\n" "[n]ew messages; [']ticked messages; [s]earch; [i]ndexed search;\n" "[p]ack; [S]ort; [r]escan; [k]ill") + (?P "PS [p]rint message; [l]non-PS print;\n" + "PS Print [s]how window, message to [f]ile;\n" + "Toggle printing of [M]IME parts, [C]olor, [F]aces") (?S "[p]ut message in sequence, [n]arrow, [']narrow to ticked, [w]iden,\n" "[s]equences, [l]ist,\n" "[d]elete message from sequence, [k]ill sequence") diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el index 46201860e2a..ef745f4c06f 100644 --- a/lisp/mh-e/mh-funcs.el +++ b/lisp/mh-e/mh-funcs.el @@ -1,6 +1,6 @@ ;;; mh-funcs.el --- MH-E functions not everyone will use right away -;; Copyright (C) 1993, 1995, 2001, 02, 2003 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1995, 2001, 02, 03, 2004 Free Software Foundation, Inc. ;; Author: Bill Wohler ;; Maintainer: Bill Wohler @@ -34,6 +34,8 @@ ;;; Code: +(eval-when-compile (require 'mh-acros)) +(mh-require-cl) (require 'mh-e) ;;; Customization @@ -45,11 +47,13 @@ prefix argument. Normally default arguments to sortm are specified in the MH profile. For example, '(\"-nolimit\" \"-textfield\" \"subject\") is a useful setting.") +;;; Scan Line Formats + (defvar mh-note-copied "C" - "String whose first character is used to notate copied messages.") + "Copied messages are marked by this character.") (defvar mh-note-printed "P" - "String whose first character is used to notate printed messages.") + "Messages that have been printed are marked by this character.") ;;; Functions @@ -232,60 +236,6 @@ Otherwise just send the message's body without the headers." (forward-line 2)) (mh-recenter 0))) -;;;###mh-autoload -(defun mh-print-msg (range) - "Print RANGE on printer. - -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use. - -The variable `mh-lpr-command-format' is used to generate the print command. -The messages are formatted by mhl. See the variable `mhl-formfile'." - (interactive (list (mh-interactive-range "Print"))) - (message "Printing...") - (let (msgs) - ;; Gather message numbers and add them to "printed" sequence. - (mh-iterate-on-range msg range - (mh-add-msgs-to-seq msg 'printed t) - (mh-notate nil mh-note-printed mh-cmd-note) - (push msg msgs)) - (setq msgs (nreverse msgs)) - ;; Print scan listing if we have more than one message. - (if (> (length msgs) 1) - (let* ((msgs-string - (mapconcat 'identity (mh-list-to-string - (mh-coalesce-msg-list msgs)) " ")) - (lpr-command - (format mh-lpr-command-format - (cond ((listp range) - (format "Folder: %s, Messages: %s" - mh-current-folder msgs-string)) - ((symbolp range) - (format "Folder: %s, Sequence: %s" - mh-current-folder range))))) - (scan-command - (format "scan %s | %s" msgs-string lpr-command))) - (if mh-print-background-flag - (mh-exec-cmd-daemon shell-file-name nil "-c" scan-command) - (call-process shell-file-name nil nil nil "-c" scan-command)))) - ;; Print the messages - (dolist (msg msgs) - (let* ((mhl-command (format "%s %s %s" - (expand-file-name "mhl" mh-lib-progs) - (if mhl-formfile - (format " -form %s" mhl-formfile) - "") - (mh-msg-filename msg))) - (lpr-command - (format mh-lpr-command-format - (format "%s/%s" mh-current-folder msg))) - (print-command - (format "%s | %s" mhl-command lpr-command))) - (if mh-print-background-flag - (mh-exec-cmd-daemon shell-file-name nil "-c" print-command) - (call-process shell-file-name nil nil nil "-c" print-command))))) - (message "Printing...done")) - ;;;###mh-autoload (defun mh-sort-folder (&optional extra-args) "Sort the messages in the current folder by date. @@ -307,9 +257,8 @@ argument EXTRA-ARGS is given." (mh-index-data (mh-index-insert-folder-headers))))) ;;;###mh-autoload -(defun mh-undo-folder (&rest ignore) - "Undo all pending deletes and refiles in current folder. -Argument IGNORE is deprecated." +(defun mh-undo-folder () + "Undo all pending deletes and refiles in current folder." (interactive) (cond ((or mh-do-not-confirm-flag (yes-or-no-p "Undo all commands in folder? ")) @@ -320,10 +269,7 @@ Argument IGNORE is deprecated." (with-mh-folder-updating (nil) (mh-remove-all-notation))) (t - (message "Commands not undone.") - ;; Remove by 2003-06-30 if nothing seems amiss. XXX - ;; (sit-for 2) - ))) + (message "Commands not undone")))) ;;;###mh-autoload (defun mh-store-msg (directory) @@ -413,11 +359,15 @@ Default directory is the last directory used, or initially the value of ;;;###mh-autoload (defun mh-help () - "Display cheat sheet for the MH-Folder commands in minibuffer." + "Display cheat sheet for the MH-E commands." (interactive) - (mh-ephem-message - (substitute-command-keys - (mapconcat 'identity (cdr (assoc nil mh-help-messages)) "")))) + (with-electric-help + (function + (lambda () + (insert + (substitute-command-keys + (mapconcat 'identity (cdr (assoc nil mh-help-messages)) "")))) + mh-help-buffer))) ;;;###mh-autoload (defun mh-prefix-help () @@ -430,9 +380,14 @@ Default directory is the last directory used, or initially the value of ;; from the recent keys. (let* ((keys (recent-keys)) (prefix-char (elt keys (- (length keys) 2)))) - (mh-ephem-message - (substitute-command-keys - (mapconcat 'identity (cdr (assoc prefix-char mh-help-messages)) ""))))) + (with-electric-help + (function + (lambda () + (insert + (substitute-command-keys + (mapconcat 'identity + (cdr (assoc prefix-char mh-help-messages)) ""))))) + mh-help-buffer))) (provide 'mh-funcs) diff --git a/lisp/mh-e/mh-gnus.el b/lisp/mh-e/mh-gnus.el index 0a893efa3c9..b850c8fdc43 100644 --- a/lisp/mh-e/mh-gnus.el +++ b/lisp/mh-e/mh-gnus.el @@ -1,6 +1,6 @@ ;;; mh-gnus.el --- Make MH-E compatible with installed version of Gnus. -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; Author: Satyaki Das ;; Maintainer: Bill Wohler @@ -34,6 +34,7 @@ (load "mm-uu" t t) ; Non-fatal dependency (load "mailcap" t t) ; Non-fatal dependency (load "smiley" t t) ; Non-fatal dependency +(load "mailabbrev" t t) (defmacro mh-defun-compat (function arg-list &rest body) "This is a macro to define functions which are not defined. @@ -74,12 +75,28 @@ BODY." (put-text-property 0 (length (car handle)) parameter value (car handle)))) +;; Copy of function from mm-view.el +(mh-defun-compat mm-inline-text-vcard (handle) + (let (buffer-read-only) + (mm-insert-inline + handle + (concat "\n-- \n" + (ignore-errors + (if (fboundp 'vcard-pretty-print) + (vcard-pretty-print (mm-get-part handle)) + (vcard-format-string + (vcard-parse-string (mm-get-part handle) + 'vcard-standard-filter)))))))) + +;; Function from mm-decode.el used in PGP messages. Just define it with older +;; gnus to avoid compiler warning. +(mh-defun-compat mm-possibly-verify-or-decrypt (parts ctl) + nil) + ;; Copy of original macro is in mm-decode.el (mh-defmacro-compat mm-handle-multipart-ctl-parameter (handle parameter) `(get-text-property 0 ,parameter (car ,handle))) -(mh-do-in-xemacs (defvar default-enable-multibyte-characters)) - ;; Copy of original function in mm-decode.el (mh-defun-compat mm-readable-p (handle) "Say whether the content of HANDLE is readable." @@ -134,10 +151,23 @@ BODY." file))) (mm-save-part-to-file handle file)))) +(defun mh-mm-text-html-renderer () + "Find the renderer gnus is using to display text/html MIME parts." + (or (and (boundp 'mm-inline-text-html-renderer) mm-inline-text-html-renderer) + (and (boundp 'mm-text-html-renderer) mm-text-html-renderer))) + +(defun mh-mail-abbrev-make-syntax-table () + "Call `mail-abbrev-make-syntax-table' if available." + (when (fboundp 'mail-abbrev-make-syntax-table) + (mail-abbrev-make-syntax-table))) + (provide 'mh-gnus) + ;;; Local Variables: ;;; no-byte-compile: t ;;; no-update-autoloads: t +;;; indent-tabs-mode: nil +;;; sentence-end-double-space: nil ;;; End: ;; arch-tag: 1e3638af-cad3-4c69-8427-bc8eb6e5e4fa diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el index f4edc7a2087..2b430a52fe1 100644 --- a/lisp/mh-e/mh-identity.el +++ b/lisp/mh-e/mh-identity.el @@ -39,47 +39,50 @@ ;;; Code: - -(require 'mh-utils) +(eval-when-compile (require 'mh-acros)) (mh-require-cl) - -(eval-when (compile load eval) - (defvar mh-comp-loaded nil) - (unless mh-comp-loaded - (setq mh-comp-loaded t) - (require 'mh-comp))) ;Since we do this on sending +(require 'mh-comp) (autoload 'mml-insert-tag "mml") +(defvar mh-identity-pgg-default-user-id nil + "Holds the GPG key ID to be used by pgg.el. +This is normally set as part of an Identity in `mh-identity-list'.") +(make-variable-buffer-local 'mh-identity-pgg-default-user-id) + ;;;###mh-autoload (defun mh-identity-make-menu () - "Build (or rebuild) the Identity menu (e.g. after the list is modified)." - (when (and mh-identity-list (boundp 'mh-letter-mode-map)) - (easy-menu-define mh-identity-menu mh-letter-mode-map - "mh-e identity menu" - (append - '("Identity") - ;; Dynamically render :type corresponding to `mh-identity-list' - ;; e.g.: - ;; ["home" (mh-insert-identity "home") - ;; :style radio :active (not (equal mh-identity-local "home")) - ;; :selected (equal mh-identity-local "home")] - '(["Insert Auto Fields" (mh-insert-auto-fields) mh-auto-fields-list] - "--") - (mapcar (function - (lambda (arg) - `[,arg (mh-insert-identity ,arg) :style radio - :active (not (equal mh-identity-local ,arg)) - :selected (equal mh-identity-local ,arg)])) - (mapcar 'car mh-identity-list)) - '("--" - ["none" (mh-insert-identity "none") mh-identity-local] - ["Set Default for Session" - (setq mh-identity-default mh-identity-local) t] - ["Save as Default" - (customize-save-variable - 'mh-identity-default mh-identity-local) t] - ))))) + "Build the Identity menu. +This should be called any time `mh-identity-list' or `mh-auto-fields-list' +change." + (easy-menu-define mh-identity-menu mh-letter-mode-map + "MH-E identity menu" + (append + '("Identity") + ;; Dynamically render :type corresponding to `mh-identity-list' + ;; e.g.: + ;; ["Home" (mh-insert-identity "Home") + ;; :style radio :active (not (equal mh-identity-local "Home")) + ;; :selected (equal mh-identity-local "Home")] + '(["Insert Auto Fields" + (mh-insert-auto-fields) mh-auto-fields-list] + "--") + + (mapcar (function + (lambda (arg) + `[,arg (mh-insert-identity ,arg) :style radio + :selected (equal mh-identity-local ,arg)])) + (mapcar 'car mh-identity-list)) + '(["None" + (mh-insert-identity "None") :style radio + :selected (not mh-identity-local)] + "--" + ["Set Default for Session" + (setq mh-identity-default mh-identity-local) t] + ["Save as Default" + (customize-save-variable 'mh-identity-default mh-identity-local) t] + ["Customize Identities" (customize-variable 'mh-identity-list) t] + )))) ;;;###mh-autoload (defun mh-identity-list-set (symbol value) @@ -97,21 +100,36 @@ customization). This is called after 'customize is used to alter (defun mh-header-field-delete (field value-only) "Delete FIELD in the mail header, or only its value if VALUE-ONLY is t. Return t if anything is deleted." - (when (mh-goto-header-field field) - (if (not value-only) - (beginning-of-line) - (forward-char)) - (delete-region (point) - (progn (mh-header-field-end) - (if (not value-only) (forward-char 1)) - (point))) - t)) + (let ((field-colon (if (string-match "^.*:$" field) + field + (concat field ":")))) + (when (mh-goto-header-field field-colon) + (if (not value-only) + (beginning-of-line) + (forward-char)) + (delete-region (point) + (progn (mh-header-field-end) + (if (not value-only) (forward-char 1)) + (point))) + t))) (defvar mh-identity-signature-start nil "Marker for the beginning of a signature inserted by `mh-insert-identity'.") (defvar mh-identity-signature-end nil "Marker for the end of a signature inserted by `mh-insert-identity'.") +(defun mh-identity-field-handler (field) + "Return the handler for a FIELD or nil if none set. +The field name is downcased. If the FIELD begins with the character +`:', then it must have a special handler defined in +`mh-identity-handlers', else return an error since it is not a legal +message header." + (or (cdr (assoc (downcase field) mh-identity-handlers)) + (and (eq (aref field 0) ?:) + (error (format "Field %s - unknown mh-identity-handler" field))) + (cdr (assoc "default" mh-identity-handlers)) + 'mh-identity-handler-default)) + ;;;###mh-autoload (defun mh-insert-identity (identity) "Insert proper fields for given IDENTITY. @@ -120,7 +138,7 @@ Edit the `mh-identity-list' variable to define identity." (list (completing-read "Identity: " (if mh-identity-local - (cons '("none") + (cons '("None") (mapcar 'list (mapcar 'car mh-identity-list))) (mapcar 'list (mapcar 'car mh-identity-list))) nil t))) @@ -129,83 +147,135 @@ Edit the `mh-identity-list' variable to define identity." (when mh-identity-local (let ((pers-list (cadr (assoc mh-identity-local mh-identity-list)))) (while pers-list - (let ((field (concat (caar pers-list) ":"))) - (cond - ((string-equal "signature:" field) - (when (and (boundp 'mh-identity-signature-start) - (markerp mh-identity-signature-start)) - (goto-char mh-identity-signature-start) - (forward-char -1) - (delete-region (point) mh-identity-signature-end))) - ((mh-header-field-delete field nil)))) + (let* ((field (caar pers-list)) + (handler (mh-identity-field-handler field))) + (funcall handler field 'remove)) (setq pers-list (cdr pers-list))))) ;; Then insert the replacement - (when (not (equal "none" identity)) + (when (not (equal "None" identity)) (let ((pers-list (cadr (assoc identity mh-identity-list)))) (while pers-list - (let ((field (concat (caar pers-list) ":")) - (value (cdar pers-list))) - (cond - ;; No value, remove field - ((or (not value) - (string= value "")) - (mh-header-field-delete field nil)) - ;; Existing field, replace - ((mh-header-field-delete field t) - (insert value)) - ;; Handle "signature" special case. Insert file or call function. - ((and (string-equal "signature:" field) - (or (and (stringp value) - (file-readable-p value)) - (fboundp value))) - (goto-char (point-max)) - (if (not (looking-at "^$")) - (insert "\n")) - (insert "\n") - (save-restriction - (narrow-to-region (point) (point)) - (set (make-local-variable 'mh-identity-signature-start) - (make-marker)) - (set-marker mh-identity-signature-start (point)) - (cond - ;; If MIME composition done, insert signature at the end as - ;; an inline MIME part. - ((mh-mhn-directive-present-p) - (insert "#\n" "Content-Description: Signature\n")) - ((mh-mml-directive-present-p) - (mml-insert-tag 'part 'type "text/plain" - 'disposition "inline" - 'description "Signature"))) - (if (stringp value) - (insert-file-contents value) - (funcall value)) - (goto-char (point-min)) - (when (not (re-search-forward "^--" nil t)) - (cond ((mh-mhn-directive-present-p) - (forward-line 2)) - ((mh-mml-directive-present-p) - (forward-line 1))) - (insert "-- \n")) - (set (make-local-variable 'mh-identity-signature-end) - (make-marker)) - (set-marker mh-identity-signature-end (point-max)))) - ;; Handle "From" field differently, adding it at the beginning. - ((string-equal "From:" field) - (goto-char (point-min)) - (insert "From: " value "\n")) - ;; Skip empty signature (Can't remove what we don't know) - ((string-equal "signature:" field)) - ;; Other field, add at end - (t ;Otherwise, add the end. - (goto-char (point-min)) - (mh-goto-header-end 0) - (mh-insert-fields field value)))) + (let* ((field (caar pers-list)) + (value (cdar pers-list)) + (handler (mh-identity-field-handler field))) + (funcall handler field 'add value)) (setq pers-list (cdr pers-list)))))) ;; Remember what is in use in this buffer - (if (equal "none" identity) + (if (equal "None" identity) (setq mh-identity-local nil) (setq mh-identity-local identity))) +;;;###mh-autoload +(defun mh-identity-handler-gpg-identity (field action &optional value) + "For FIELD \"pgg-default-user-id\", process for ACTION 'remove or 'add. +The buffer-local variable `mh-identity-pgg-default-user-id' is set to VALUE +when action 'add is selected." + (cond + ((or (equal action 'remove) + (not value) + (string= value "")) + (setq mh-identity-pgg-default-user-id nil)) + ((equal action 'add) + (setq mh-identity-pgg-default-user-id value)))) + +;;;###mh-autoload +(defun mh-identity-handler-signature (field action &optional value) + "For FIELD \"signature\", process headers for ACTION 'remove or 'add. +The VALUE is added." + (cond + ((equal action 'remove) + (when (and (markerp mh-identity-signature-start) + (markerp mh-identity-signature-end)) + (delete-region mh-identity-signature-start + mh-identity-signature-end))) + (t + ;; Insert "signature". Nil value means to use `mh-signature-file-name'. + (when (not (mh-signature-separator-p)) ;...unless already present + (goto-char (point-max)) + (save-restriction + (narrow-to-region (point) (point)) + (if (null value) + (mh-insert-signature) + (mh-insert-signature value)) + (set (make-local-variable 'mh-identity-signature-start) + (point-min-marker)) + (set-marker-insertion-type mh-identity-signature-start t) + (set (make-local-variable 'mh-identity-signature-end) + (point-max-marker))))))) + +(defvar mh-identity-attribution-verb-start nil + "Marker for the beginning of the attribution verb.") +(defvar mh-identity-attribution-verb-end nil + "Marker for the end of the attribution verb.") + +;;;###mh-autoload +(defun mh-identity-handler-attribution-verb (field action &optional value) + "For FIELD \"attribution_verb\", process headers for ACTION 'remove or 'add. +The VALUE is added." + (when (and (markerp mh-identity-attribution-verb-start) + (markerp mh-identity-attribution-verb-end)) + (delete-region mh-identity-attribution-verb-start + mh-identity-attribution-verb-end) + (goto-char mh-identity-attribution-verb-start) + (cond + ((equal action 'remove) ; Replace with default + (mh-identity-insert-attribution-verb nil)) + (t ; Insert attribution verb. + (mh-identity-insert-attribution-verb value))))) + +;;;###mh-autoload +(defun mh-identity-insert-attribution-verb (value) + "Insert VALUE as attribution verb, setting up delimiting markers. +If VALUE is nil, use `mh-extract-from-attribution-verb'." + (save-restriction + (narrow-to-region (point) (point)) + (if (null value) + (insert mh-extract-from-attribution-verb) + (insert value)) + (set (make-local-variable 'mh-identity-attribution-verb-start) + (point-min-marker)) + (set-marker-insertion-type mh-identity-attribution-verb-start t) + (set (make-local-variable 'mh-identity-attribution-verb-end) + (point-max-marker)))) + +(defun mh-identity-handler-default (field action top &optional value) + "For FIELD, process mh-identity headers for ACTION 'remove or 'add. +if TOP is non-nil, add the field and it's VALUE at the top of the header, else +add it at the bottom of the header." + (let ((field-colon (if (string-match "^.*:$" field) + field + (concat field ":")))) + (cond + ((equal action 'remove) + (mh-header-field-delete field-colon nil)) + (t + (cond + ;; No value, remove field + ((or (not value) + (string= value "")) + (mh-header-field-delete field-colon nil)) + ;; Existing field, replace + ((mh-header-field-delete field-colon t) + (insert value)) + ;; Other field, add at end or top + (t + (goto-char (point-min)) + (if (not top) + (mh-goto-header-end 0)) + (insert field-colon " " value "\n"))))))) + +;;;###mh-autoload +(defun mh-identity-handler-top (field action &optional value) + "For FIELD, process mh-identity headers for ACTION 'remove or 'add. +If the field wasn't present, the VALUE is added at the top of the header." + (mh-identity-handler-default field action t value)) + +;;;###mh-autoload +(defun mh-identity-handler-bottom (field action &optional value) + "For FIELD, process mh-identity headers for ACTION 'remove or 'add. +If the field wasn't present, the VALUE is added at the bottom of the header." + (mh-identity-handler-default field action nil value)) + (provide 'mh-identity) ;;; Local Variables: diff --git a/lisp/mh-e/mh-inc.el b/lisp/mh-e/mh-inc.el index 1c052b140bd..42ca018506f 100644 --- a/lisp/mh-e/mh-inc.el +++ b/lisp/mh-e/mh-inc.el @@ -1,6 +1,6 @@ ;;; mh-inc.el --- MH-E `inc' and separate mail spool handling ;; -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; Author: Peter S. Galbraith ;; Maintainer: Bill Wohler @@ -34,7 +34,8 @@ ;;; Code: -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'mh-acros)) +(mh-require-cl) (defvar mh-inc-spool-map (make-sparse-keymap) "Keymap for MH-E's mh-inc-spool commands.") @@ -46,7 +47,8 @@ '(lambda () (interactive) (if mh-inc-spool-map-help - (mh-ephem-message (substring mh-inc-spool-map-help 0 -1)) + (let ((mh-help-messages (list (list nil mh-inc-spool-map-help)))) + (mh-help)) (mh-ephem-message "There are no keys defined yet. Customize `mh-inc-spool-list'")))) diff --git a/lisp/mh-e/mh-index.el b/lisp/mh-e/mh-index.el index 734ce938616..91eed420e2e 100644 --- a/lisp/mh-e/mh-index.el +++ b/lisp/mh-e/mh-index.el @@ -31,7 +31,6 @@ ;;; swish-e ;;; mairix ;;; namazu -;;; glimpse ;;; grep ;;; ;;; (2) To use this package, you first have to build an index. Please read @@ -43,7 +42,7 @@ ;;; Code: -(require 'mh-utils) +(eval-when-compile (require 'mh-acros)) (mh-require-cl) (require 'mh-e) (require 'mh-mime) @@ -66,8 +65,6 @@ mh-mairix-regexp-builder) (namazu mh-namazu-binary mh-namazu-execute-search mh-namazu-next-result nil) - (glimpse - mh-glimpse-binary mh-glimpse-execute-search mh-glimpse-next-result nil) (pick mh-pick-binary mh-pick-execute-search mh-pick-next-result mh-pick-regexp-builder) @@ -200,7 +197,8 @@ This function should only be called in the appropriate index folder buffer." (call-process "rm" nil nil nil (format "%s%s/%s" mh-user-path (substring mh-current-folder 1) msg)) - (remhash omsg (gethash ofolder mh-index-data)))) + (when (gethash ofolder mh-index-data) + (remhash omsg (gethash ofolder mh-index-data))))) (t (setf (gethash msg mh-index-msg-checksum-map) checksum) (when origin-map @@ -301,7 +299,8 @@ list of messages in that sequence." (pair (gethash checksum mh-index-checksum-origin-map)) (ofolder (car pair)) (omsg (cdr pair))) - (loop for seq in (gethash omsg (gethash ofolder seq-hash)) + (loop for seq in (ignore-errors + (gethash omsg (gethash ofolder seq-hash))) do (if (assoc seq seq-list) (push msg (cdr (assoc seq seq-list))) (push (list seq msg) seq-list))))) @@ -374,7 +373,6 @@ index for each program: - `mh-swish-execute-search' - `mh-mairix-execute-search' - `mh-namazu-execute-search' - - `mh-glimpse-execute-search' If none of these programs are present then we use pick. If desired grep can be used instead. Details about these methods can be found in: @@ -436,7 +434,7 @@ This has the effect of renaming already present X-MHE-Checksum headers." (save-excursion (mh-exec-cmd-quiet nil "rmf" buffer-name)) (mh-exec-cmd-quiet nil "folder" "-create" "-fast" buffer-name) (setq index-folder buffer-name)) - (setq index-folder (mh-index-new-folder index-folder))) + (setq index-folder (mh-index-new-folder index-folder search-regexp))) (let ((folder-path (format "%s%s" mh-user-path (substring folder 1))) (folder-results-map (make-hash-table :test #'equal)) @@ -587,13 +585,6 @@ PROC is used to convert the value to actual data." mh-previous-window-config) (error "No search terms")))) -(defun mh-replace-string (old new) - "Replace all occurrences of OLD with NEW in the current buffer." - (goto-char (point-min)) - (let ((case-fold-search t)) - (while (search-forward old nil t) - (replace-match new t t)))) - ;;;###mh-autoload (defun mh-index-parse-search-regexp (input-string) "Construct parse tree for INPUT-STRING. @@ -739,28 +730,48 @@ results." "Check if MSG exists in FOLDER." (file-exists-p (format "%s%s/%s" mh-user-path (substring folder 1) msg))) -(defun mh-index-new-folder (name) - "Create and return an MH folder name based on NAME. -If the folder NAME already exists then check if NAME<2> exists. If it doesn't -then it is created and returned. Otherwise try NAME<3>. This is repeated till -we find a new folder name." +(defun mh-index-new-folder (name search-regexp) + "Return a folder name based on NAME for search results of SEARCH-REGEXP. + +If folder NAME already exists and was generated for the same SEARCH-REGEXP +then it is reused. + +Otherwise if the folder NAME was generated from a different search then check +if NAME<2> can be used. Otherwise try NAME<3>. This is repeated till we find a +new folder name. + +If the folder returned doesn't exist then it is created." (unless (mh-folder-name-p name) (error "The argument should be a valid MH folder name")) - (let ((chosen-name name)) - (block unique-name - (unless (mh-folder-exists-p name) - (return-from unique-name)) - (loop for index from 2 - do (let ((new-name (format "%s<%s>" name index))) - (unless (mh-folder-exists-p new-name) - (setq chosen-name new-name) - (return-from unique-name))))) + (let ((chosen-name + (loop for i from 1 + for candidate = (if (equal i 1) name (format "%s<%s>" name i)) + when (or (not (mh-folder-exists-p candidate)) + (equal (mh-index-folder-search-regexp candidate) + search-regexp)) + return candidate))) + ;; Do pending refiles/deletes... + (when (get-buffer chosen-name) + (mh-process-or-undo-commands chosen-name)) + ;; Recreate folder... + (save-excursion (mh-exec-cmd-quiet nil "rmf" chosen-name)) (mh-exec-cmd-quiet nil "folder" "-create" "-fast" chosen-name) (mh-remove-from-sub-folders-cache chosen-name) (when (boundp 'mh-speed-folder-map) (mh-speed-add-folder chosen-name)) chosen-name)) +(defun mh-index-folder-search-regexp (folder) + "If FOLDER was created by a index search, return the search regexp. +Return nil if FOLDER doesn't exist or the .mhe_index file is garbled." + (ignore-errors + (with-temp-buffer + (insert-file-contents + (format "%s%s/%s" mh-user-path (substring folder 1) mh-index-data-file)) + (goto-char (point-min)) + (forward-list 3) + (cadr (read (current-buffer)))))) + ;;;###mh-autoload (defun mh-index-insert-folder-headers () "Annotate the search results with original folder names." @@ -777,8 +788,27 @@ we find a new folder name." (insert (if last-folder "\n" "") current-folder "\n") (setq last-folder current-folder)) (forward-line)) - (when cur-msg (mh-goto-msg cur-msg t)) - (set-buffer-modified-p old-buffer-modified-flag))) + (when cur-msg + (mh-notate-cur) + (mh-goto-msg cur-msg t)) + (set-buffer-modified-p old-buffer-modified-flag)) + (mh-index-create-imenu-index)) + +;;;###mh-autoload +(defun mh-index-create-imenu-index () + "Create alist of folder names and positions in index folder buffers." + (save-excursion + (setq which-func-mode t) + (let ((alist ())) + (goto-char (point-min)) + (while (re-search-forward "^+" nil t) + (save-excursion + (beginning-of-line) + (push (cons (buffer-substring-no-properties + (point) (line-end-position)) + (set-marker (make-marker) (point))) + alist))) + (setq imenu--index-alist (nreverse alist))))) ;;;###mh-autoload (defun mh-index-group-by-folder () @@ -837,23 +867,6 @@ list of messages originally from that folder." folder (loop for x being the hash-keys of (gethash folder mh-index-data) when (mh-msg-exists-p x folder) collect x))))) -;;;###mh-autoload -(defun mh-index-update-unseen (msg) - "Remove counterpart of MSG in source folder from `mh-unseen-seq'. -Also `mh-update-unseen' is called in the original folder, if we have it open." - (let* ((checksum (gethash msg mh-index-msg-checksum-map)) - (folder-msg-pair (gethash checksum mh-index-checksum-origin-map)) - (orig-folder (car folder-msg-pair)) - (orig-msg (cdr folder-msg-pair))) - (when (mh-index-match-checksum orig-msg orig-folder checksum) - (when (get-buffer orig-folder) - (save-excursion - (set-buffer orig-folder) - (unless (member orig-msg mh-seen-list) (push orig-msg mh-seen-list)) - (mh-update-unseen))) - (mh-exec-cmd-daemon "mark" #'ignore orig-folder (format "%s" orig-msg) - "-sequence" (symbol-name mh-unseen-seq) "-del")))) - (defun mh-index-match-checksum (msg folder checksum) "Check if MSG in FOLDER has X-MHE-Checksum header value of CHECKSUM." (with-temp-buffer @@ -973,90 +986,6 @@ update the source folder buffer if present." -;; Glimpse interface - -(defvar mh-glimpse-binary (executable-find "glimpse")) -(defvar mh-glimpse-directory ".glimpse") - -;;;###mh-autoload -(defun mh-glimpse-execute-search (folder-path search-regexp) - "Execute glimpse and read the results. - -In the examples below, replace /home/user/Mail with the path to your MH -directory. - -First create the directory /home/user/Mail/.glimpse. Then create the file -/home/user/Mail/.glimpse/.glimpse_exclude with the following contents: - - */.* - */#* - */,* - */*~ - ^/home/user/Mail/.glimpse - ^/home/user/Mail/mhe-index - -If there are any directories you would like to ignore, append lines like the -following to .glimpse_exclude: - - ^/home/user/Mail/scripts - -You do not want to index the folders that hold the results of your searches -since they tend to be ephemeral and the original messages are indexed anyway. -The configuration file above assumes that the results are found in sub-folders -of `mh-index-folder' which is +mhe-index by default. - -Use the following command line to generate the glimpse index. Run this -daily from cron: - - glimpseindex -H /home/user/Mail/.glimpse /home/user/Mail - -FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search." - (set-buffer (get-buffer-create mh-index-temp-buffer)) - (erase-buffer) - (call-process mh-glimpse-binary nil '(t nil) nil - ;(format "-%s" fuzz) - "-i" "-y" - "-H" (format "%s%s" mh-user-path mh-glimpse-directory) - "-F" (format "^%s" folder-path) - search-regexp) - (goto-char (point-min))) - -(defun mh-glimpse-next-result () - "Read the next result. -Parse it and return the message folder, message index and the match. If no -other matches left then return nil. If the current record is invalid return -'error." - (prog1 - (block nil - (when (eobp) - (return nil)) - (let ((eol-pos (line-end-position)) - (bol-pos (line-beginning-position)) - folder-start msg-end) - (goto-char bol-pos) - (unless (search-forward mh-user-path eol-pos t) - (return 'error)) - (setq folder-start (point)) - (unless (search-forward ": " eol-pos t) - (return 'error)) - (let ((match (buffer-substring-no-properties (point) eol-pos))) - (forward-char -2) - (setq msg-end (point)) - (unless (search-backward "/" folder-start t) - (return 'error)) - (list (format "+%s" (buffer-substring-no-properties - folder-start (point))) - (let ((val (ignore-errors (read-from-string - (buffer-substring-no-properties - (1+ (point)) msg-end))))) - (if (and (consp val) (integerp (car val))) - (car val) - (return 'error))) - match)))) - (forward-line))) - - - ;; Pick interface (defvar mh-index-pick-folder) @@ -1319,16 +1248,12 @@ then the folders are searched recursively. All parameters ARGS are ignored." ;;;###mh-autoload (defun mh-index-sequenced-messages (folders sequence) "Display messages from FOLDERS in SEQUENCE. -By default the folders specified by `mh-index-new-messages-folders' are -searched. With a prefix argument, enter a space-separated list of folders, or -nothing to search all folders. - -Argument SEQUENCE defaults to `mh-unseen-seq' and is the sequence that the -function searches for in each of the FOLDERS. With a prefix argument, enter a -sequence to use." +All messages in the sequence you provide from the folders in +`mh-index-new-messages-folders' are listed. With a prefix argument, enter a +space-separated list of folders, or nothing to search all folders." (interactive (list (if current-prefix-arg - (split-string (read-string "Search folder(s) [all]? ")) + (split-string (read-string "Search folder(s): [all] ")) mh-index-new-messages-folders) (mh-read-seq-default "Search" nil))) (unless sequence (setq sequence mh-unseen-seq)) @@ -1367,26 +1292,26 @@ sequence to use." ;;;###mh-autoload (defun mh-index-new-messages (folders) "Display unseen messages. -All messages in the `unseen' sequence from FOLDERS are displayed. -By default the folders specified by `mh-index-new-messages-folders' -are searched. With a prefix argument, enter a space-separated list of -folders, or nothing to search all folders." +If you use a program such as `procmail' to use `rcvstore' to file your +incoming mail automatically, you can display new, unseen, messages using this +command. All messages in the `unseen' sequence from the folders in +`mh-index-new-messages-folders' are listed. With a prefix argument, enter a +space-separated list of FOLDERS, or nothing to search all folders." (interactive (list (if current-prefix-arg - (split-string (read-string "Search folder(s) [all]? ")) + (split-string (read-string "Search folder(s): [all] ")) mh-index-new-messages-folders))) (mh-index-sequenced-messages folders mh-unseen-seq)) ;;;###mh-autoload (defun mh-index-ticked-messages (folders) "Display ticked messages. -All messages in the `tick' sequence from FOLDERS are displayed. -By default the folders specified by `mh-index-ticked-messages-folders' -are searched. With a prefix argument, enter a space-separated list of -folders, or nothing to search all folders." +All messages in `mh-tick-seq' from the folders in +`mh-index-ticked-messages-folders' are listed. With a prefix argument, enter a +space-separated list of FOLDERS, or nothing to search all folders." (interactive (list (if current-prefix-arg - (split-string (read-string "Search folder(s) [all]? ")) + (split-string (read-string "Search folder(s): [all] ")) mh-index-ticked-messages-folders))) (mh-index-sequenced-messages folders mh-tick-seq)) diff --git a/lisp/mh-e/mh-junk.el b/lisp/mh-e/mh-junk.el index 42ec4c444d3..095a8c3c3fd 100644 --- a/lisp/mh-e/mh-junk.el +++ b/lisp/mh-e/mh-junk.el @@ -1,6 +1,6 @@ ;;; mh-junk.el --- Interface to anti-spam measures -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; Author: Satyaki Das , ;; Bill Wohler @@ -32,6 +32,8 @@ ;;; Code: +(eval-when-compile (require 'mh-acros)) +(mh-require-cl) (require 'mh-e) ;; Interactive functions callable from the folder buffer @@ -39,36 +41,33 @@ (defun mh-junk-blacklist (range) "Blacklist RANGE as spam. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use. +This command trains the spam program in use (see the `mh-junk-program' option) +with the content of the range (see `mh-interactive-range') and then handles +the message(s) as specified by the `mh-junk-disposition' option. -First the appropriate function is called depending on the value of -`mh-junk-choice'. Then if `mh-junk-mail-folder' is a string then the message is -refiled to that folder. If nil, the message is deleted. - -To change the spam program being used, customize `mh-junk-program'. Directly -setting `mh-junk-choice' is not recommended. - -The documentation for the following functions describes what setup is needed -for the different spam fighting programs: +For more information about using your particular spam fighting program, see: + - `mh-spamassassin-blacklist' - `mh-bogofilter-blacklist' - - `mh-spamprobe-blacklist' - - `mh-spamassassin-blacklist'" + - `mh-spamprobe-blacklist'" (interactive (list (mh-interactive-range "Blacklist"))) (let ((blacklist-func (nth 1 (assoc mh-junk-choice mh-junk-function-alist)))) (unless blacklist-func (error "Customize `mh-junk-program' appropriately")) - (let ((dest (cond ((null mh-junk-mail-folder) nil) - ((equal mh-junk-mail-folder "") "+") - ((eq (aref mh-junk-mail-folder 0) ?+) - mh-junk-mail-folder) - ((eq (aref mh-junk-mail-folder 0) ?@) + (let ((dest (cond ((null mh-junk-disposition) nil) + ((equal mh-junk-disposition "") "+") + ((eq (aref mh-junk-disposition 0) ?+) + mh-junk-disposition) + ((eq (aref mh-junk-disposition 0) ?@) (concat mh-current-folder "/" - (substring mh-junk-mail-folder 1))) - (t (concat "+" mh-junk-mail-folder))))) + (substring mh-junk-disposition 1))) + (t (concat "+" mh-junk-disposition))))) (mh-iterate-on-range msg range + (message (format "Blacklisting message %d..." msg)) (funcall (symbol-function blacklist-func) msg) + (message (format "Blacklisting message %d...done" msg)) + (if (not (memq msg mh-seen-list)) + (setq mh-seen-list (cons msg mh-seen-list))) (if dest (mh-refile-a-msg nil (intern dest)) (mh-delete-a-msg nil))) @@ -76,231 +75,124 @@ for the different spam fighting programs: ;;;###mh-autoload (defun mh-junk-whitelist (range) - "Whitelist RANGE incorrectly classified as spam. + "Whitelist RANGE as ham. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use. +This command reclassifies a range of messages (see `mh-interactive-range') as +ham if it were incorrectly classified as spam. It then refiles the message +into the `+inbox' folder. -First the appropriate function is called depending on the value of -`mh-junk-choice'. Then the message is refiled to `mh-inbox'. - -To change the spam program being used, customize `mh-junk-program'. Directly -setting `mh-junk-choice' is not recommended." +The `mh-junk-program' option specifies the spam program in use." (interactive (list (mh-interactive-range "Whitelist"))) (let ((whitelist-func (nth 2 (assoc mh-junk-choice mh-junk-function-alist)))) (unless whitelist-func (error "Customize `mh-junk-program' appropriately")) (mh-iterate-on-range msg range + (message (format "Whitelisting message %d..." msg)) (funcall (symbol-function whitelist-func) msg) + (message (format "Whitelisting message %d...done" msg)) (mh-refile-a-msg nil (intern mh-inbox))) (mh-next-msg))) -;; Bogofilter Interface - -(defvar mh-bogofilter-executable (executable-find "bogofilter")) - -(defun mh-bogofilter-blacklist (msg) - "Classify MSG as spam. -Tell bogofilter that the message is spam. - -Bogofilter is a Bayesian spam filtering program. Get it from your local -distribution or from: - http://bogofilter.sourceforge.net/ - -You first need to teach bogofilter. This is done by running - - bogofilter -n < good-message - -on every good message, and - - bogofilter -s < spam-message - -on every spam message. Most Bayesian filters need 1000 to 5000 of each to -start doing a good job. - -To use bogofilter, add the following .procmailrc recipes which you can also -find in the bogofilter man page: - - # Bogofilter - :0fw - | bogofilter -u -e -p - - :0 - * ^X-Bogosity: Yes, tests=bogofilter - $SPAM - -Bogofilter continues to feed the messages it classifies back into its -database. Occasionally it misses, and those messages need to be reclassified. -MH-E can do this for you. Use \\[mh-junk-blacklist] to reclassify messges in -your +inbox as spam, and \\[mh-junk-whitelist] to reclassify messages in your -spambox as good messages." - (unless mh-bogofilter-executable - (error "Couldn't find the bogofilter executable")) - (let ((msg-file (mh-msg-filename msg mh-current-folder))) - (call-process mh-bogofilter-executable msg-file 0 nil "-Ns"))) - -(defun mh-bogofilter-whitelist (msg) - "Reinstate incorrectly filtered MSG. -Train bogofilter to think of the message as non-spam." - (unless mh-bogofilter-executable - (error "Couldn't find the bogofilter executable")) - (let ((msg-file (mh-msg-filename msg mh-current-folder))) - (call-process mh-bogofilter-executable msg-file 0 nil "-Sn"))) - - - -;; Spamprobe Interface - -(defvar mh-spamprobe-executable (executable-find "spamprobe")) - -(defun mh-spamprobe-blacklist (msg) - "Classify MSG as spam. -Tell spamprobe that the message is spam. - -Spamprobe is a Bayesian spam filtering program. More info about the program can -be found at: - http://spamprobe.sourceforge.net - -Here is a procmail recipe to stores incoming spam mail into the folder +spam -and good mail in /home/user/Mail/mdrop/mbox. This recipe is provided as an -example in the spamprobe man page. - - PATH=/bin:/usr/bin:/usr/local/bin - DEFAULT=/home/user/Mail/mdrop/mbox - SPAM=/home/user/Mail/spam/. - - # Spamprobe filtering - :0 - SCORE=| spamprobe receive - :0 wf - | formail -I \"X-SpamProbe: $SCORE\" - :0 a: - *^X-SpamProbe: SPAM - $SPAM - -Occasionally some good mail gets misclassified as spam. You can use -\\[mh-junk-whitelist] to reclassify that as good mail." - (unless mh-spamprobe-executable - (error "Couldn't find the spamprobe executable")) - (let ((msg-file (mh-msg-filename msg mh-current-folder))) - (call-process mh-spamprobe-executable msg-file 0 nil "spam"))) - -(defun mh-spamprobe-whitelist (msg) - "Reinstate incorrectly filtered MSG. -Train spamprobe to think of the message as non-spam." - (unless mh-spamprobe-executable - (error "Couldn't find the spamprobe executable")) - (let ((msg-file (mh-msg-filename msg mh-current-folder))) - (call-process mh-spamprobe-executable msg-file 0 nil "good"))) - - - ;; Spamassassin Interface (defvar mh-spamassassin-executable (executable-find "spamassassin")) (defvar mh-sa-learn-executable (executable-find "sa-learn")) (defun mh-spamassassin-blacklist (msg) - "Blacklist MSG. -This is done by sending the message to Razor and by appending the sender to -~/.spamassassin/user_prefs in a blacklist_from rule. If sa-learn is available, -the message is also recategorized as spam. + "Blacklist MSG with SpamAssassin. -Spamassassin is an excellent spam filter. For more information, see: - http://spamassassin.org/. +SpamAssassin is one of the more popular spam filtering programs. Get it from +your local distribution or from http://spamassassin.org/. -I ran \"spamassassin -t\" on every mail message in my archive and ran an -analysis in Gnumeric to find that the standard deviation of good mail -scored under 5 (coincidentally, the spamassassin default for \"spam\"). +To use SpamAssassin, add the following recipes to `.procmailrc': -Furthermore, I observed that there weren't any messages with a score of 8 -or more that were interesting, so I added a couple of points to be -conservative and send any message with a score of 10 or more down the -drain. You might want to use a score of 12 or 13 to be really conservative. -I have found that this really decreases the amount of junk to review. + MAILDIR=$HOME/`mhparam Path` -Messages with a score of 5-9 are set aside for later review. The major -weakness of rules-based filters is a plethora of false positives\; I catch one -or two legitimate messages in here a week, so it is worthwhile to check. + # Fight spam with SpamAssassin. + :0fw + | spamc -You might choose to do this analysis yourself to pick a good score for -deleting spam sight unseen, or you might pick a score out of a hat, or you -might choose to be very conservative and not delete any messages at all. + # Anything with a spam level of 10 or more is junked immediately. + :0: + * ^X-Spam-Level: .......... + /dev/null -Based upon this discussion, here is what the associated ~/.procmailrc -entries look like. These rules appear before my list filters so that spam -sent to mailing lists gets pruned too. + :0: + * ^X-Spam-Status: Yes + spam/. - # - # Spam - # - :0fw - | spamc +If you don't use `spamc', use `spamassassin -P -a'. - # Anything with a spam level of 10 or more is junked immediately. - :0: - * ^X-Spam-Level: .......... - /dev/null +Note that one of the recipes above throws away messages with a score greater +than or equal to 10. Here's how you can determine a value that works best for +you. - :0 - * ^X-Spam-Status: Yes - $SPAM +First, run `spamassassin -t' on every mail message in your archive and use +Gnumeric to verify that the average plus the standard deviation of good mail +is under 5, the SpamAssassin default for \"spam\". -If you don't use \"spamc\", use \"spamassassin -P -a\". +Using Gnumeric, sort the messages by score and view the messages with the +highest score. Determine the score which encompasses all of your interesting +messages and add a couple of points to be conservative. Add that many dots to +the `X-Spam-Level:' header field above to send messages with that score down +the drain. -A handful of spam does find its way into +inbox. In this case, use -\\[mh-junk-blacklist] to add a \"blacklist_from\" line to -~/spamassassin/user_prefs, delete the message, and send the message to the -Razor, so that others might not see this spam. +In the example above, messages with a score of 5-9 are set aside in the +`+spam' folder for later review. The major weakness of rules-based filters is +a plethora of false positives so it is worthwhile to check. -Over time, you see some patterns in the blacklisted addresses and can -replace several lines with wildcards. For example, it is clear that High -Speed Media is the biggest bunch of jerks on the Net. Here are some of the -entries I have for them, and the list continues to grow. +If SpamAssassin classifies a message incorrectly, or is unsure, you can use +the MH-E commands \\[mh-junk-blacklist] and \\[mh-junk-whitelist]. - blacklist_from *@*-hsm-*.com - blacklist_from *@*182*643*.com - blacklist_from *@*antarhsm*.com - blacklist_from *@*h*speed* - blacklist_from *@*hsm*182*.com - blacklist_from *@*hsm*643*.com - blacklist_from *@*hsmridi2983cslt227.com - blacklist_from *@*list*hsm*.com - blacklist_from *@h*s*media* - blacklist_from *@hsmdrct.com - blacklist_from *@hsmridi2983csltsite.com +The \\[mh-junk-blacklist] command adds a `blacklist_from' entry to +`~/spamassassin/user_prefs', deletes the message, and sends the message to the +Razor, so that others might not see this spam. If the `sa-learn' command is +available, the message is also recategorized as spam. -The function `mh-spamassassin-identify-spammers' is provided that shows the -frequency counts of the host and domain names in your blacklist_from -entries. This can be helpful when editing the blacklist_from entries. +The \\[mh-junk-whitelist] command adds a `whitelist_from' rule to the +`~/.spamassassin/user_prefs' file. If the `sa-learn' command is available, the +message is also recategorized as ham. -In versions of spamassassin (2.50 and on) that support a Bayesian classifier, -\\[mh-junk-blacklist] uses the sa-learn program to recategorize the message as -spam. Neither MH-E, nor spamassassin, rebuilds the database after adding -words, so you will need to run \"sa-learn --rebuild\" periodically. This can -be done by adding the following to your crontab: +Over time, you'll observe that the same host or domain occurs repeatedly in +the `blacklist_from' entries, so you might think that you could avoid future +spam by blacklisting all mail from a particular domain. The utility function +`mh-spamassassin-identify-spammers' helps you do precisely that. This function +displays a frequency count of the hosts and domains in the `blacklist_from' +entries from the last blank line in `~/.spamassassin/user_prefs' to the end of +the file. This information can be used so that you can replace multiple +`blacklist_from' entries with a single wildcard entry such as: - 0 * * * * sa-learn --rebuild > /dev/null 2>&1" + blacklist_from *@*amazingoffersdirect2u.com + +In versions of SpamAssassin (2.50 and on) that support a Bayesian classifier, +\\[mh-junk-blacklist] uses the `sa-learn' program to recategorize the message +as spam. Neither MH-E, nor SpamAssassin, rebuilds the database after adding +words, so you will need to run `sa-learn --rebuild' periodically. This can be +done by adding the following to your crontab: + + 0 * * * * sa-learn --rebuild > /dev/null 2>&1" (unless mh-spamassassin-executable - (error "Couldn't find the spamassassin executable")) + (error "Unable to find the spamassassin executable")) (let ((current-folder mh-current-folder) (msg-file (mh-msg-filename msg mh-current-folder)) (sender)) (save-excursion - (message "Giving this message the Razor...") + (message (format "Reporting message %d..." msg)) (mh-truncate-log-buffer) (call-process mh-spamassassin-executable msg-file mh-log-buffer nil - "--report" "--remove-from-whitelist") + ;;"--report" "--remove-from-whitelist" + "-r" "-R") ; spamassassin V2.20 (when mh-sa-learn-executable (message "Recategorizing this message as spam...") (call-process mh-sa-learn-executable msg-file mh-log-buffer nil "--single" "--spam" "--local" "--no-rebuild")) - (message "Blacklisting address...") + (message (format "Blacklisting message %d..." msg)) (set-buffer (get-buffer-create mh-temp-buffer)) (erase-buffer) - (call-process (expand-file-name mh-scan-prog mh-progs) nil t nil + (call-process (expand-file-name mh-scan-prog mh-progs) mh-junk-background + t nil (format "%s" msg) current-folder "-format" "%<(mymbox{from})%|%(addr{from})%>") (goto-char (point-min)) @@ -308,15 +200,19 @@ be done by adding the following to your crontab: (progn (setq sender (match-string 0)) (mh-spamassassin-add-rule "blacklist_from" sender) - (message "Blacklisting address...done")) - (message "Blacklisting address...not done (from my address)"))))) + (message (format "Blacklisting message %d...done" msg))) + (message (format "Blacklisting message %d...not done (from my address)" msg)))))) (defun mh-spamassassin-whitelist (msg) - "Whitelist MSG. -Add a whitelist_from rule to the ~/.spamassassin/user_prefs file. If sa-learn -is available, then the message is recategorized as ham." + "Whitelist MSG with SpamAssassin. + +The \\[mh-junk-whitelist] command adds a `whitelist_from' rule to the +`~/.spamassassin/user_prefs' file. If the `sa-learn' command is available, the +message is also recategorized as ham. + +See `mh-spamassassin-blacklist' for more information." (unless mh-spamassassin-executable - (error "Couldn't find the spamassassin executable")) + (error "Unable to find the spamassassin executable")) (let ((msg-file (mh-msg-filename msg mh-current-folder)) (show-buffer (get-buffer mh-show-buffer)) from) @@ -325,7 +221,8 @@ is available, then the message is recategorized as ham." (erase-buffer) (message "Removing spamassassin markup from message...") (call-process mh-spamassassin-executable msg-file mh-temp-buffer nil - "--remove-markup") + ;; "--remove-markup" + "-d") ; spamassassin V2.20 (if show-buffer (kill-buffer show-buffer)) (write-file msg-file) @@ -333,15 +230,17 @@ is available, then the message is recategorized as ham." (message "Recategorizing this message as ham...") (call-process mh-sa-learn-executable msg-file mh-temp-buffer nil "--single" "--ham" "--local --no-rebuild")) - (message "Whitelisting address...") - (setq from (car (ietf-drums-parse-address (mh-get-header-field "From:")))) + (message (format "Whitelisting message %d..." msg)) + (setq from + (car (mh-funcall-if-exists + ietf-drums-parse-address (mh-get-header-field "From:")))) (kill-buffer nil) - (unless (equal from "") + (unless (or (null from) (equal from "")) (mh-spamassassin-add-rule "whitelist_from" from)) - (message "Whitelisting address...done")))) + (message (format "Whitelisting message %d...done" msg))))) (defun mh-spamassassin-add-rule (rule body) - "Add a new rule to ~/.spamassassin/user_prefs. + "Add a new rule to `~/.spamassassin/user_prefs'. The name of the rule is RULE and its body is BODY." (save-window-excursion (let* ((line (format "%s\t%s\n" rule body)) @@ -358,15 +257,15 @@ The name of the rule is RULE and its body is BODY." (kill-buffer nil))))) (defun mh-spamassassin-identify-spammers () - "Identifies spammers who are repeat offenders. + "Identify spammers who are repeat offenders. -For each blacklist_from entry from the last blank line of -~/.spamassassin/user_prefs to the end of the file, a list of host and domain -names along with their frequency counts is displayed. This information can be -used to replace multiple blacklist_from entries with a single wildcard entry -such as: +This function displays a frequency count of the hosts and domains in the +`blacklist_from' entries from the last blank line in +`~/.spamassassin/user_prefs' to the end of the file. This information can be +used so that you can replace multiple `blacklist_from' entries with a single +wildcard entry such as: - blacklist_from *@*amazingoffersdirect2u.com" + blacklist_from *@*amazingoffersdirect2u.com" (interactive) (let* ((file (expand-file-name "~/.spamassassin/user_prefs")) (domains (make-hash-table :test 'equal))) @@ -385,7 +284,7 @@ such as: ;; Add counts for each host and domain part. (while host (setq value (gethash (car host) domains)) - (puthash (car host) (1+ (if (not value) 0 value)) domains) + (setf (gethash (car host) domains) (1+ (if (not value) 0 value))) (setq host (cdr host)))))) ;; Output @@ -400,6 +299,121 @@ such as: (reverse-region (point-min) (point-max)) (goto-char (point-min)))) + + +;; Bogofilter Interface + +(defvar mh-bogofilter-executable (executable-find "bogofilter")) + +(defun mh-bogofilter-blacklist (msg) + "Blacklist MSG with Bogofilter. + +Bogofilter is a Bayesian spam filtering program. Get it from your local +distribution or from http://bogofilter.sourceforge.net/. + +Bogofilter is taught by running: + + bogofilter -n < good-message + +on every good message, and + + bogofilter -s < spam-message + +on every spam message. This is called a full training; three other +training methods are described in the FAQ that is distributed with bogofilter. +Note that most Bayesian filters need 1000 to 5000 of each type of message to +start doing a good job. + +To use Bogofilter, add the following recipes to `.procmailrc': + + MAILDIR=$HOME/`mhparam Path` + + # Fight spam with Bogofilter. + :0fw + | bogofilter -3 -e -p + + :0: + * ^X-Bogosity: Yes, tests=bogofilter + spam/. + + :0: + * ^X-Bogosity: Unsure, tests=bogofilter + spam/unsure/. + +If Bogofilter classifies a message incorrectly, or is unsure, you can use the +MH-E commands \\[mh-junk-blacklist] and \\[mh-junk-whitelist] to update +Bogofilter's training. + +The \"Bogofilter FAQ\" suggests that you run the following +occasionally to shrink the database: + + bogoutil -d wordlist.db | bogoutil -l wordlist.db.new + mv wordlist.db wordlist.db.prv + mv wordlist.db.new wordlist.db + +The \"Bogofilter tuning HOWTO\" describes how you can fine-tune Bogofilter." + (unless mh-bogofilter-executable + (error "Unable to find the bogofilter executable")) + (let ((msg-file (mh-msg-filename msg mh-current-folder))) + (call-process mh-bogofilter-executable msg-file mh-junk-background + nil "-s"))) + +(defun mh-bogofilter-whitelist (msg) + "Whitelist MSG with Bogofilter. + +See `mh-bogofilter-blacklist' for more information." + (unless mh-bogofilter-executable + (error "Unable to find the bogofilter executable")) + (let ((msg-file (mh-msg-filename msg mh-current-folder))) + (call-process mh-bogofilter-executable msg-file mh-junk-background + nil "-n"))) + + + +;; Spamprobe Interface + +(defvar mh-spamprobe-executable (executable-find "spamprobe")) + +(defun mh-spamprobe-blacklist (msg) + "Blacklist MSG with SpamProbe. + +SpamProbe is a Bayesian spam filtering program. Get it from your local +distribution or from http://spamprobe.sourceforge.net. + +To use SpamProbe, add the following recipes to `.procmailrc': + + MAILDIR=$HOME/`mhparam Path` + + # Fight spam with SpamProbe. + :0 + SCORE=| spamprobe receive + + :0 wf + | formail -I \"X-SpamProbe: $SCORE\" + + :0: + *^X-SpamProbe: SPAM + spam/. + +If SpamProbe classifies a message incorrectly, you can use the MH-E commands +\\[mh-junk-blacklist] and \\[mh-junk-whitelist] to update SpamProbe's +training." + (unless mh-spamprobe-executable + (error "Unable to find the spamprobe executable")) + (let ((msg-file (mh-msg-filename msg mh-current-folder))) + (call-process mh-spamprobe-executable msg-file mh-junk-background + nil "spam"))) + +(defun mh-spamprobe-whitelist (msg) + "Whitelist MSG with SpamProbe. + +See `mh-spamprobe-blacklist' for more information." + (unless mh-spamprobe-executable + (error "Unable to find the spamprobe executable")) + (let ((msg-file (mh-msg-filename msg mh-current-folder))) + (call-process mh-spamprobe-executable msg-file mh-junk-background + nil "good"))) + (provide 'mh-junk) ;;; Local Variables: diff --git a/lisp/mh-e/mh-loaddefs.el b/lisp/mh-e/mh-loaddefs.el index a5578760845..43119b62be0 100644 --- a/lisp/mh-e/mh-loaddefs.el +++ b/lisp/mh-e/mh-loaddefs.el @@ -11,22 +11,24 @@ ;;;;;; mh-beginning-of-word mh-complete-word mh-open-line mh-fully-kill-draft ;;;;;; mh-yank-cur-msg mh-insert-letter mh-send-letter mh-insert-auto-fields ;;;;;; mh-check-whom mh-insert-signature mh-to-fcc mh-to-field mh-fill-paragraph-function -;;;;;; mh-send-other-window mh-send mh-reply mh-redistribute mh-forward -;;;;;; mh-extract-rejected-mail mh-edit-again) "mh-comp" "mh-comp.el" -;;;;;; (16625 53169)) +;;;;;; mh-get-header-field mh-send-other-window mh-send mh-reply +;;;;;; mh-redistribute mh-forward mh-extract-rejected-mail mh-edit-again) +;;;;;; "mh-comp" "mh-comp.el" (16665 55172)) ;;; Generated autoloads from mh-comp.el (autoload (quote mh-edit-again) "mh-comp" "\ Clean up a draft or a message MSG previously sent and make it resendable. Default is the current message. The variable `mh-new-draft-cleaned-headers' specifies the headers to remove. -See also documentation for `\\[mh-send]' function." t nil) + +See also `mh-send'." t nil) (autoload (quote mh-extract-rejected-mail) "mh-comp" "\ Extract message MSG returned by the mail system and make it resendable. Default is the current message. The variable `mh-new-draft-cleaned-headers' gives the headers to clean out of the original message. -See also documentation for `\\[mh-send]' function." t nil) + +See also `mh-send'." t nil) (autoload (quote mh-forward) "mh-comp" "\ Forward messages to the recipients TO and CC. @@ -36,7 +38,7 @@ Default is the displayed message. Check the documentation of `mh-interactive-range' to see how RANGE is read in interactive use. -See also documentation for `\\[mh-send]' function." t nil) +See also `mh-send'." t nil) (autoload (quote mh-redistribute) "mh-comp" "\ Redistribute displayed message to recipients TO and CC. @@ -55,11 +57,12 @@ to reply to: If optional prefix argument INCLUDEP provided, then include the message in the reply using filter `mhl.reply' in your MH directory. If the file named by `mh-repl-formfile' exists, it is used as a skeleton -for the reply. See also documentation for `\\[mh-send]' function." t nil) +for the reply. + +See also `mh-send'." t nil) (autoload (quote mh-send) "mh-comp" "\ Compose and send a letter. - Do not call this function from outside MH-E; use \\[mh-smail] instead. The file named by `mh-comp-formfile' will be used as the form. @@ -70,7 +73,6 @@ passed three arguments: TO, CC, and SUBJECT." t nil) (autoload (quote mh-send-other-window) "mh-comp" "\ Compose and send a letter in another window. - Do not call this function from outside MH-E; use \\[mh-smail-other-window] instead. @@ -80,6 +82,11 @@ details. If `mh-compose-letter-function' is defined, it is called on the draft and passed three arguments: TO, CC, and SUBJECT." t nil) +(autoload (quote mh-get-header-field) "mh-comp" "\ +Find and return the body of FIELD in the mail header. +Returns the empty string if the field is not in the header of the +current buffer." nil nil) + (autoload (quote mh-fill-paragraph-function) "mh-comp" "\ Fill paragraph at or after point. Prefix ARG means justify as well. This function enables `fill-paragraph' to @@ -96,9 +103,12 @@ Insert an Fcc: FOLDER field in the current message. Prompt for the field name with a completion list of the current folders." t nil) (autoload (quote mh-insert-signature) "mh-comp" "\ -Insert the file named by `mh-signature-file-name' at point. +Insert the signature specified by `mh-signature-file-name' or FILE at point. +A signature separator (`-- ') will be added if the signature block does not +contain one and `mh-signature-separator-flag' is on. The value of `mh-letter-insert-signature-hook' is a list of functions to be -called, with no arguments, before the signature is actually inserted." t nil) +called, with no arguments, after the signature is inserted. +The signature can also be inserted with `mh-identity-list'." t nil) (autoload (quote mh-check-whom) "mh-comp" "\ Verify recipients of the current letter, showing expansion of any aliases." t nil) @@ -109,7 +119,9 @@ Sets buffer-local `mh-insert-auto-fields-done-local' when done and inserted something. If NON-INTERACTIVE is non-nil, do not be verbose and only attempt matches if `mh-insert-auto-fields-done-local' is nil. -An `identity' entry is skipped if one was already entered manually." t nil) +An `identity' entry is skipped if one was already entered manually. + +Return t if fields added; otherwise return nil." t nil) (autoload (quote mh-send-letter) "mh-comp" "\ Send the draft letter in the current buffer. @@ -117,13 +129,12 @@ If optional prefix argument ARG is provided, monitor delivery. The value of `mh-before-send-letter-hook' is a list of functions to be called, with no arguments, before doing anything. Run `\\[mh-edit-mhn]' if mhn directives are present; otherwise -run `\\[mh-mml-to-mime]' if mml directives are present. -Insert X-Mailer field if variable `mh-insert-x-mailer-flag' is set. -Insert X-Face field if the file specified by `mh-x-face-file' exists." t nil) +run `\\[mh-mml-to-mime]' if mml directives are present." t nil) (autoload (quote mh-insert-letter) "mh-comp" "\ Insert a message into the current letter. -Removes the header fields according to the variable `mh-invisible-headers'. +Removes the header fields according to the variable +`mh-invisible-header-fields-compiled'. Prefixes each non-blank line with `mh-ins-buf-prefix', unless `mh-yank-from-start-of-msg' is set for supercite in which case supercite is used to format the message. @@ -166,44 +177,13 @@ In the message header, go to the next field. Elsewhere call Cycle to the previous header field. If we are at the first header field go to the start of the message body." t nil) -;;;*** - -;;;### (autoloads (mh-customize) "mh-customize" "mh-customize.el" -;;;;;; (16625 53481)) -;;; Generated autoloads from mh-customize.el - -(autoload (quote mh-customize) "mh-customize" "\ -Customize MH-E variables. -With optional argument DELETE-OTHER-WINDOWS-FLAG, other windows in the frame -are removed." t nil) - -;;;*** - -;;;### (autoloads (mh-goto-cur-msg mh-update-sequences mh-folder-line-matches-show-buffer-p) -;;;;;; "mh-e" "mh-e.el" (16627 22341)) -;;; Generated autoloads from mh-e.el - -(autoload (quote mh-folder-line-matches-show-buffer-p) "mh-e" "\ -Return t if the message under point in folder-mode is in the show buffer. -Return nil in any other circumstance (no message under point, no show buffer, -the message in the show buffer doesn't match." nil nil) - -(autoload (quote mh-update-sequences) "mh-e" "\ -Update MH's Unseen-Sequence and current folder and message. -Flush MH-E's state out to MH. The message at the cursor becomes current." t nil) - -(autoload (quote mh-goto-cur-msg) "mh-e" "\ -Position the cursor at the current message. -When optional argument MINIMAL-CHANGES-FLAG is non-nil, the function doesn't -recenter the folder buffer." nil nil) - ;;;*** ;;;### (autoloads (mh-prefix-help mh-help mh-ephem-message mh-store-buffer -;;;;;; mh-store-msg mh-undo-folder mh-sort-folder mh-print-msg mh-page-digest-backwards +;;;;;; mh-store-msg mh-undo-folder mh-sort-folder mh-page-digest-backwards ;;;;;; mh-page-digest mh-pipe-msg mh-pack-folder mh-list-folders ;;;;;; mh-kill-folder mh-copy-msg mh-burst-digest) "mh-funcs" "mh-funcs.el" -;;;;;; (16625 54011)) +;;;;;; (16671 49652)) ;;; Generated autoloads from mh-funcs.el (autoload (quote mh-burst-digest) "mh-funcs" "\ @@ -245,15 +225,6 @@ Advance displayed message to next digested message." t nil) (autoload (quote mh-page-digest-backwards) "mh-funcs" "\ Back up displayed message to previous digested message." t nil) -(autoload (quote mh-print-msg) "mh-funcs" "\ -Print RANGE on printer. - -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use. - -The variable `mh-lpr-command-format' is used to generate the print command. -The messages are formatted by mhl. See the variable `mhl-formfile'." t nil) - (autoload (quote mh-sort-folder) "mh-funcs" "\ Sort the messages in the current folder by date. Calls the MH program sortm to do the work. @@ -261,8 +232,7 @@ The arguments in the list `mh-sortm-args' are passed to sortm if the optional argument EXTRA-ARGS is given." t nil) (autoload (quote mh-undo-folder) "mh-funcs" "\ -Undo all pending deletes and refiles in current folder. -Argument IGNORE is deprecated." t nil) +Undo all pending deletes and refiles in current folder." t nil) (autoload (quote mh-store-msg) "mh-funcs" "\ Store the file(s) contained in the current message into DIRECTORY. @@ -280,19 +250,24 @@ Default directory is the last directory used, or initially the value of Display STRING in the minibuffer momentarily." nil nil) (autoload (quote mh-help) "mh-funcs" "\ -Display cheat sheet for the MH-Folder commands in minibuffer." t nil) +Display cheat sheet for the MH-E commands." t nil) (autoload (quote mh-prefix-help) "mh-funcs" "\ Display cheat sheet for the commands of the current prefix in minibuffer." t nil) ;;;*** -;;;### (autoloads (mh-insert-identity mh-identity-list-set mh-identity-make-menu) -;;;;;; "mh-identity" "mh-identity.el" (16625 54171)) +;;;### (autoloads (mh-identity-handler-bottom mh-identity-handler-top +;;;;;; mh-identity-insert-attribution-verb mh-identity-handler-attribution-verb +;;;;;; mh-identity-handler-signature mh-identity-handler-gpg-identity +;;;;;; mh-insert-identity mh-identity-list-set mh-identity-make-menu) +;;;;;; "mh-identity" "mh-identity.el" (16665 55172)) ;;; Generated autoloads from mh-identity.el (autoload (quote mh-identity-make-menu) "mh-identity" "\ -Build (or rebuild) the Identity menu (e.g. after the list is modified)." nil nil) +Build the Identity menu. +This should be called any time `mh-identity-list' or `mh-auto-fields-list' +change." nil nil) (autoload (quote mh-identity-list-set) "mh-identity" "\ Update the `mh-identity-list' variable, and rebuild the menu. @@ -304,10 +279,35 @@ customization). This is called after 'customize is used to alter Insert proper fields for given IDENTITY. Edit the `mh-identity-list' variable to define identity." t nil) +(autoload (quote mh-identity-handler-gpg-identity) "mh-identity" "\ +For FIELD \"pgg-default-user-id\", process for ACTION 'remove or 'add. +The buffer-local variable `mh-identity-pgg-default-user-id' is set to VALUE +when action 'add is selected." nil nil) + +(autoload (quote mh-identity-handler-signature) "mh-identity" "\ +For FIELD \"signature\", process headers for ACTION 'remove or 'add. +The VALUE is added." nil nil) + +(autoload (quote mh-identity-handler-attribution-verb) "mh-identity" "\ +For FIELD \"attribution_verb\", process headers for ACTION 'remove or 'add. +The VALUE is added." nil nil) + +(autoload (quote mh-identity-insert-attribution-verb) "mh-identity" "\ +Insert VALUE as attribution verb, setting up delimiting markers. +If VALUE is nil, use `mh-extract-from-attribution-verb'." nil nil) + +(autoload (quote mh-identity-handler-top) "mh-identity" "\ +For FIELD, process mh-identity headers for ACTION 'remove or 'add. +If the field wasn't present, the VALUE is added at the top of the header." nil nil) + +(autoload (quote mh-identity-handler-bottom) "mh-identity" "\ +For FIELD, process mh-identity headers for ACTION 'remove or 'add. +If the field wasn't present, the VALUE is added at the bottom of the header." nil nil) + ;;;*** -;;;### (autoloads (mh-inc-spool-list-set) "mh-inc" "mh-inc.el" (16625 -;;;;;; 54212)) +;;;### (autoloads (mh-inc-spool-list-set) "mh-inc" "mh-inc.el" (16671 +;;;;;; 49652)) ;;; Generated autoloads from mh-inc.el (autoload (quote mh-inc-spool-list-set) "mh-inc" "\ @@ -319,14 +319,14 @@ This is called after 'customize is used to alter `mh-inc-spool-list'." nil nil) ;;;### (autoloads (mh-index-choose mh-namazu-execute-search mh-swish++-execute-search ;;;;;; mh-swish-execute-search mh-index-ticked-messages mh-index-new-messages -;;;;;; mh-index-sequenced-messages mh-glimpse-execute-search mh-index-delete-from-sequence -;;;;;; mh-index-add-to-sequence mh-index-execute-commands mh-index-update-unseen -;;;;;; mh-index-visit-folder mh-index-delete-folder-headers mh-index-group-by-folder +;;;;;; mh-index-sequenced-messages mh-index-delete-from-sequence +;;;;;; mh-index-add-to-sequence mh-index-execute-commands mh-index-visit-folder +;;;;;; mh-index-delete-folder-headers mh-index-group-by-folder mh-index-create-imenu-index ;;;;;; mh-index-insert-folder-headers mh-index-previous-folder mh-index-next-folder ;;;;;; mh-index-parse-search-regexp mh-index-do-search mh-index-p ;;;;;; mh-index-read-data mh-index-search mh-index-create-sequences ;;;;;; mh-create-sequence-map mh-index-update-maps) "mh-index" "mh-index.el" -;;;;;; (16625 54348)) +;;;;;; (16665 55172)) ;;; Generated autoloads from mh-index.el (autoload (quote mh-index-update-maps) "mh-index" "\ @@ -367,7 +367,6 @@ index for each program: - `mh-swish-execute-search' - `mh-mairix-execute-search' - `mh-namazu-execute-search' - - `mh-glimpse-execute-search' If none of these programs are present then we use pick. If desired grep can be used instead. Details about these methods can be found in: @@ -411,6 +410,9 @@ Jump to the previous folder marker." t nil) (autoload (quote mh-index-insert-folder-headers) "mh-index" "\ Annotate the search results with original folder names." nil nil) +(autoload (quote mh-index-create-imenu-index) "mh-index" "\ +Create alist of folder names and positions in index folder buffers." nil nil) + (autoload (quote mh-index-group-by-folder) "mh-index" "\ Partition the messages based on source folder. Returns an alist with the the folder names in the car and the cdr being the @@ -422,10 +424,6 @@ Delete the folder headers." nil nil) (autoload (quote mh-index-visit-folder) "mh-index" "\ Visit original folder from where the message at point was found." t nil) -(autoload (quote mh-index-update-unseen) "mh-index" "\ -Remove counterpart of MSG in source folder from `mh-unseen-seq'. -Also `mh-update-unseen' is called in the original folder, if we have it open." nil nil) - (autoload (quote mh-index-execute-commands) "mh-index" "\ Delete/refile the actual messages. The copies in the searched folder are then deleted/refiled to get the desired @@ -442,62 +440,25 @@ Delete from SEQ the messages in MSGS. This function updates the source folder sequences. Also makes an attempt to update the source folder buffer if present." nil nil) -(autoload (quote mh-glimpse-execute-search) "mh-index" "\ -Execute glimpse and read the results. - -In the examples below, replace /home/user/Mail with the path to your MH -directory. - -First create the directory /home/user/Mail/.glimpse. Then create the file -/home/user/Mail/.glimpse/.glimpse_exclude with the following contents: - - */.* - */#* - */,* - */*~ - ^/home/user/Mail/.glimpse - ^/home/user/Mail/mhe-index - -If there are any directories you would like to ignore, append lines like the -following to .glimpse_exclude: - - ^/home/user/Mail/scripts - -You do not want to index the folders that hold the results of your searches -since they tend to be ephemeral and the original messages are indexed anyway. -The configuration file above assumes that the results are found in sub-folders -of `mh-index-folder' which is +mhe-index by default. - -Use the following command line to generate the glimpse index. Run this -daily from cron: - - glimpseindex -H /home/user/Mail/.glimpse /home/user/Mail - -FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search." nil nil) - (autoload (quote mh-index-sequenced-messages) "mh-index" "\ Display messages from FOLDERS in SEQUENCE. -By default the folders specified by `mh-index-new-messages-folders' are -searched. With a prefix argument, enter a space-separated list of folders, or -nothing to search all folders. - -Argument SEQUENCE defaults to `mh-unseen-seq' and is the sequence that the -function searches for in each of the FOLDERS. With a prefix argument, enter a -sequence to use." t nil) +All messages in the sequence you provide from the folders in +`mh-index-new-messages-folders' are listed. With a prefix argument, enter a +space-separated list of folders, or nothing to search all folders." t nil) (autoload (quote mh-index-new-messages) "mh-index" "\ Display unseen messages. -All messages in the `unseen' sequence from FOLDERS are displayed. -By default the folders specified by `mh-index-new-messages-folders' -are searched. With a prefix argument, enter a space-separated list of -folders, or nothing to search all folders." t nil) +If you use a program such as `procmail' to use `rcvstore' to file your +incoming mail automatically, you can display new, unseen, messages using this +command. All messages in the `unseen' sequence from the folders in +`mh-index-new-messages-folders' are listed. With a prefix argument, enter a +space-separated list of FOLDERS, or nothing to search all folders." t nil) (autoload (quote mh-index-ticked-messages) "mh-index" "\ Display ticked messages. -All messages in the `tick' sequence from FOLDERS are displayed. -By default the folders specified by `mh-index-ticked-messages-folders' -are searched. With a prefix argument, enter a space-separated list of -folders, or nothing to search all folders." t nil) +All messages in `mh-tick-seq' from the folders in +`mh-index-ticked-messages-folders' are listed. With a prefix argument, enter a +space-separated list of FOLDERS, or nothing to search all folders." t nil) (autoload (quote mh-swish-execute-search) "mh-index" "\ Execute swish-e and read the results. @@ -618,56 +579,71 @@ The side-effects of this function are that the variables `mh-indexer', set according to the first indexer in `mh-indexer-choices' present on the system." nil nil) +;;;*** + +;;;### (autoloads (mh-variants mh-variant-p mh-variant-set) "mh-init" +;;;;;; "mh-init.el" (16671 49652)) +;;; Generated autoloads from mh-init.el + +(autoload (quote mh-variant-set) "mh-init" "\ +Set the MH variant to VARIANT. +Sets `mh-progs', `mh-lib', `mh-lib-progs' and `mh-flists-present-flag'. +If the VARIANT is `autodetect', then first try nmh, then MH and finally +GNU mailutils." t nil) + +(autoload (quote mh-variant-p) "mh-init" "\ +Return t if variant is any of VARIANTS. +Currently known variants are 'mh and 'nmh." nil nil) + +(autoload (quote mh-variants) "mh-init" "\ +Return a list of installed variants of MH on the system. +This function looks for MH in `mh-sys-path', `mh-path' and +`exec-path'. The format of the list of variants that is returned is described +by the variable `mh-variants'." nil nil) + ;;;*** ;;;### (autoloads (mh-junk-whitelist mh-junk-blacklist) "mh-junk" -;;;;;; "mh-junk.el" (16625 54386)) +;;;;;; "mh-junk.el" (16671 49652)) ;;; Generated autoloads from mh-junk.el (autoload (quote mh-junk-blacklist) "mh-junk" "\ Blacklist RANGE as spam. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use. +This command trains the spam program in use (see the `mh-junk-program' option) +with the content of the range (see `mh-interactive-range') and then handles +the message(s) as specified by the `mh-junk-disposition' option. -First the appropriate function is called depending on the value of -`mh-junk-choice'. Then if `mh-junk-mail-folder' is a string then the message is -refiled to that folder. If nil, the message is deleted. - -To change the spam program being used, customize `mh-junk-program'. Directly -setting `mh-junk-choice' is not recommended. - -The documentation for the following functions describes what setup is needed -for the different spam fighting programs: +For more information about using your particular spam fighting program, see: + - `mh-spamassassin-blacklist' - `mh-bogofilter-blacklist' - - `mh-spamprobe-blacklist' - - `mh-spamassassin-blacklist'" t nil) + - `mh-spamprobe-blacklist'" t nil) (autoload (quote mh-junk-whitelist) "mh-junk" "\ -Whitelist RANGE incorrectly classified as spam. +Whitelist RANGE as ham. -Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use. +This command reclassifies a range of messages (see `mh-interactive-range') as +ham if it were incorrectly classified as spam. It then refiles the message +into the `+inbox' folder. -First the appropriate function is called depending on the value of -`mh-junk-choice'. Then the message is refiled to `mh-inbox'. - -To change the spam program being used, customize `mh-junk-program'. Directly -setting `mh-junk-choice' is not recommended." t nil) +The `mh-junk-program' option specifies the spam program in use." t nil) ;;;*** -;;;### (autoloads (mh-mime-inline-part mh-mime-save-part mh-push-button -;;;;;; mh-press-button mh-mime-display mh-decode-message-header -;;;;;; mh-mime-save-parts mh-display-emphasis mh-display-smileys -;;;;;; mh-add-missing-mime-version-header mh-destroy-postponed-handles -;;;;;; mh-mime-cleanup mh-mml-directive-present-p mh-mml-secure-message-encrypt-pgpmime -;;;;;; mh-mml-secure-message-sign-pgpmime mh-mml-attach-file mh-mml-forward-message -;;;;;; mh-mml-to-mime mh-mhn-directive-present-p mh-revert-mhn-edit -;;;;;; mh-edit-mhn mh-mhn-compose-forw mh-mhn-compose-external-compressed-tar -;;;;;; mh-mhn-compose-anon-ftp mh-mhn-compose-insertion mh-compose-forward -;;;;;; mh-compose-insertion) "mh-mime" "mh-mime.el" (16625 54523)) +;;;### (autoloads (mh-display-with-external-viewer mh-mime-inline-part +;;;;;; mh-mime-save-part mh-push-button mh-press-button mh-mime-display +;;;;;; mh-decode-message-header mh-mime-save-parts mh-display-emphasis +;;;;;; mh-display-smileys mh-add-missing-mime-version-header mh-destroy-postponed-handles +;;;;;; mh-mime-cleanup mh-mml-directive-present-p mh-mml-secure-message-signencrypt +;;;;;; mh-mml-secure-message-encrypt mh-mml-secure-message-sign +;;;;;; mh-mml-unsecure-message mh-mml-attach-file mh-mml-query-cryptographic-method +;;;;;; mh-mml-forward-message mh-mml-to-mime mh-mhn-directive-present-p +;;;;;; mh-revert-mhn-edit mh-edit-mhn mh-mhn-compose-forw mh-mhn-compose-external-type +;;;;;; mh-mhn-compose-external-compressed-tar mh-mhn-compose-anon-ftp +;;;;;; mh-mhn-compose-insertion mh-file-mime-type mh-have-file-command +;;;;;; mh-compose-forward mh-compose-insertion) "mh-mime" "mh-mime.el" +;;;;;; (16665 55171)) ;;; Generated autoloads from mh-mime.el (autoload (quote mh-compose-insertion) "mh-mime" "\ @@ -686,6 +662,14 @@ come. Optional argument MESSAGE is the message to forward. If any of the optional arguments are absent, they are prompted for." t nil) +(autoload (quote mh-have-file-command) "mh-mime" "\ +Return t if 'file' command is on the system. +'file -i' is used to get MIME type of composition insertion." nil nil) + +(autoload (quote mh-file-mime-type) "mh-mime" "\ +Return MIME type of FILENAME from file command. +Returns nil if file command not on system." nil nil) + (autoload (quote mh-mhn-compose-insertion) "mh-mime" "\ Add a directive to insert a MIME message part from a file. This is the typical way to insert non-text parts in a message. @@ -718,6 +702,18 @@ DESCRIPTION, a line of text for the Content-description header. See also \\[mh-edit-mhn]." t nil) +(autoload (quote mh-mhn-compose-external-type) "mh-mime" "\ +Add a directive to include a MIME reference to a remote file. +The file should be available via anonymous ftp. This directive tells MH to +include a reference to a message/external-body part. + +Arguments are ACCESS-TYPE, HOST and FILENAME, which tell where to find the +file and TYPE which is the MIME Content-Type. Optional arguments include +DESCRIPTION, a line of text for the Content-description header, ATTRIBUTES, +EXTRA-PARAMS, and COMMENT. + +See also \\[mh-edit-mhn]." t nil) + (autoload (quote mh-mhn-compose-forw) "mh-mime" "\ Add a forw directive to this message, to forward a message with MIME. This directive tells MH to include the named messages in this one. @@ -758,7 +754,9 @@ Undo the effect of \\[mh-edit-mhn] by reverting to the backup file. Optional non-nil argument NOCONFIRM means don't ask for confirmation." t nil) (autoload (quote mh-mhn-directive-present-p) "mh-mime" "\ -Check if the current buffer has text which might be a MHN directive." nil nil) +Check if the text between BEGIN and END might be a MHN directive. +The optional argument BEGIN defaults to the beginning of the buffer, while END +defaults to the the end of the buffer." nil nil) (autoload (quote mh-mml-to-mime) "mh-mime" "\ Compose MIME message from mml directives. @@ -770,6 +768,9 @@ Forward a message as attachment. The function will prompt the user for a DESCRIPTION, a FOLDER and MESSAGE number." nil nil) +(autoload (quote mh-mml-query-cryptographic-method) "mh-mime" "\ +Read the cryptographic method to use." nil nil) + (autoload (quote mh-mml-attach-file) "mh-mime" "\ Attach a file to the outgoing MIME message. The file is not inserted or encoded until you send the message with @@ -781,12 +782,18 @@ This is basically `mml-attach-file' from gnus, modified such that a prefix argument yields an `inline' disposition and Content-Type is determined automatically." nil nil) -(autoload (quote mh-mml-secure-message-sign-pgpmime) "mh-mime" "\ -Add directive to encrypt/sign the entire message." t nil) +(autoload (quote mh-mml-unsecure-message) "mh-mime" "\ +Remove any secure message directives. +The IGNORE argument is not used." t nil) -(autoload (quote mh-mml-secure-message-encrypt-pgpmime) "mh-mime" "\ -Add directive to encrypt and sign the entire message. -If called with a prefix argument DONTSIGN, only encrypt (do NOT sign)." t nil) +(autoload (quote mh-mml-secure-message-sign) "mh-mime" "\ +Add security directive to sign the entire message using METHOD." t nil) + +(autoload (quote mh-mml-secure-message-encrypt) "mh-mime" "\ +Add security directive to encrypt the entire message using METHOD." t nil) + +(autoload (quote mh-mml-secure-message-signencrypt) "mh-mime" "\ +Add security directive to encrypt and sign the entire message using METHOD." t nil) (autoload (quote mh-mml-directive-present-p) "mh-mime" "\ Check if the current buffer has text which may be an MML directive." nil nil) @@ -840,10 +847,13 @@ Save MIME part at point." t nil) (autoload (quote mh-mime-inline-part) "mh-mime" "\ Toggle display of the raw MIME part." t nil) +(autoload (quote mh-display-with-external-viewer) "mh-mime" "\ +View MIME PART-INDEX externally." t nil) + ;;;*** -;;;### (autoloads (mh-do-search mh-pick-do-search mh-do-pick-search -;;;;;; mh-search-folder) "mh-pick" "mh-pick.el" (16625 54571)) +;;;### (autoloads (mh-do-search mh-pick-do-search mh-search-folder) +;;;;;; "mh-pick" "mh-pick.el" (16671 49652)) ;;; Generated autoloads from mh-pick.el (autoload (quote mh-search-folder) "mh-pick" "\ @@ -853,13 +863,6 @@ Add the messages found to the sequence named `search'. Argument WINDOW-CONFIG is the current window configuration and is used when the search folder is dismissed." t nil) -(autoload (quote mh-do-pick-search) "mh-pick" "\ -Find messages that match the qualifications in the current pattern buffer. -Messages are searched for in the folder named in `mh-searching-folder'. -Add the messages found to the sequence named `search'. - -This is a deprecated function and `mh-pick-do-search' should be used instead." t nil) - (autoload (quote mh-pick-do-search) "mh-pick" "\ Find messages that match the qualifications in the current pattern buffer. Messages are searched for in the folder named in `mh-searching-folder'. @@ -871,6 +874,50 @@ If \\[mh-search-folder] was used to create the search pattern then pick is used to search the folder. Otherwise if \\[mh-index-search] was used then the indexing program specified in `mh-index-program' is used." t nil) +;;;*** + +;;;### (autoloads (mh-print-msg mh-ps-print-toggle-mime mh-ps-print-toggle-color +;;;;;; mh-ps-print-toggle-faces mh-ps-print-msg-show mh-ps-print-msg-file +;;;;;; mh-ps-print-msg) "mh-print" "mh-print.el" (16671 49652)) +;;; Generated autoloads from mh-print.el + +(autoload (quote mh-ps-print-msg) "mh-print" "\ +Print the messages in RANGE. + +Check the documentation of `mh-interactive-range' to see how RANGE is read in +interactive use." t nil) + +(autoload (quote mh-ps-print-msg-file) "mh-print" "\ +Print to FILE the messages in RANGE. + +Check the documentation of `mh-interactive-range' to see how RANGE is read in +interactive use." t nil) + +(autoload (quote mh-ps-print-msg-show) "mh-print" "\ +Print current show buffer to FILE." t nil) + +(autoload (quote mh-ps-print-toggle-faces) "mh-print" "\ +Toggle whether printing is done with faces or not." t nil) + +(autoload (quote mh-ps-print-toggle-color) "mh-print" "\ +Toggle whether color is used in printing messages." t nil) + +(autoload (quote mh-ps-print-toggle-mime) "mh-print" "\ +Cycle through available choices on how MIME parts should be printed. +The available settings are: + 1. Print only inline MIME parts. + 2. Print all MIME parts. + 3. Print no MIME parts." t nil) + +(autoload (quote mh-print-msg) "mh-print" "\ +Print RANGE on printer. + +Check the documentation of `mh-interactive-range' to see how RANGE is read in +interactive use. + +The variable `mh-lpr-command-format' is used to generate the print command. +The messages are formatted by mhl. See the variable `mhl-formfile'." t nil) + ;;;*** ;;;### (autoloads (mh-narrow-to-tick mh-toggle-tick mh-thread-refile @@ -879,13 +926,12 @@ indexing program specified in `mh-index-program' is used." t nil) ;;;;;; mh-thread-add-spaces mh-thread-update-scan-line-map mh-thread-inc ;;;;;; mh-delete-subject-or-thread mh-delete-subject mh-narrow-to-range ;;;;;; mh-narrow-to-to mh-narrow-to-cc mh-narrow-to-from mh-narrow-to-subject -;;;;;; mh-region-to-msg-list mh-interactive-range mh-range-to-msg-list -;;;;;; mh-iterate-on-range mh-iterate-on-messages-in-region mh-add-to-sequence -;;;;;; mh-notate-cur mh-notate-seq mh-map-to-seq-msgs mh-rename-seq -;;;;;; mh-translate-range mh-read-range mh-read-seq-default mh-notate-deleted-and-refiled -;;;;;; mh-widen mh-put-msg-in-seq mh-narrow-to-seq mh-msg-is-in-seq -;;;;;; mh-list-sequences mh-delete-seq) "mh-seq" "mh-seq.el" (16625 -;;;;;; 54690)) +;;;;;; mh-interactive-range mh-range-to-msg-list mh-iterate-on-range +;;;;;; mh-iterate-on-messages-in-region mh-add-to-sequence mh-notate-cur +;;;;;; mh-rename-seq mh-translate-range mh-read-range mh-read-seq-default +;;;;;; mh-notate-deleted-and-refiled mh-widen mh-put-msg-in-seq +;;;;;; mh-narrow-to-seq mh-msg-is-in-seq mh-list-sequences mh-delete-seq) +;;;;;; "mh-seq" "mh-seq.el" (16668 22297)) ;;; Generated autoloads from mh-seq.el (autoload (quote mh-delete-seq) "mh-seq" "\ @@ -895,8 +941,9 @@ Delete the SEQUENCE." t nil) List the sequences defined in the folder being visited." t nil) (autoload (quote mh-msg-is-in-seq) "mh-seq" "\ -Display the sequences that contain MESSAGE. -Default is the displayed message." t nil) +Display the sequences in which the current message appears. +Use a prefix argument to display the sequences in which another MESSAGE +appears." t nil) (autoload (quote mh-narrow-to-seq) "mh-seq" "\ Restrict display of this folder to just messages in SEQUENCE. @@ -909,10 +956,8 @@ Check the documentation of `mh-interactive-range' to see how RANGE is read in interactive use." t nil) (autoload (quote mh-widen) "mh-seq" "\ -Remove last restriction from current folder. -If optional prefix argument ALL-FLAG is non-nil, then unwind to the beginning -of the view stack thereby showing all messages that the buffer originally -contained." t nil) +Restore the previous limit. +If optional prefix argument ALL-FLAG is non-nil, remove all limits." t nil) (autoload (quote mh-notate-deleted-and-refiled) "mh-seq" "\ Notate messages marked for deletion or refiling. @@ -965,16 +1010,6 @@ In FOLDER, translate the string EXPR to a list of messages numbers." nil nil) (autoload (quote mh-rename-seq) "mh-seq" "\ Rename SEQUENCE to have NEW-NAME." t nil) -(autoload (quote mh-map-to-seq-msgs) "mh-seq" "\ -Invoke the FUNC at each message in the SEQ. -SEQ can either be a list of messages or a MH sequence. The remaining ARGS are -passed as arguments to FUNC." nil nil) - -(autoload (quote mh-notate-seq) "mh-seq" "\ -Mark the scan listing. -All messages in SEQ are marked with NOTATION at OFFSET from the beginning of -the line." nil nil) - (autoload (quote mh-notate-cur) "mh-seq" "\ Mark the MH sequence cur. In addition to notating the current message with `mh-note-cur' the function @@ -1019,37 +1054,44 @@ RANGE-PROMPT. A list of messages in that range is returned. If a MH range is given, say something like last:20, then a list containing the messages in that range is returned. +If DEFAULT non-nil then it is returned. + Otherwise, the message number at point is returned. This function is usually used with `mh-iterate-on-range' in order to provide a uniform interface to MH-E functions." nil nil) -(autoload (quote mh-region-to-msg-list) "mh-seq" "\ -Return a list of messages within the region between BEGIN and END." nil nil) - (autoload (quote mh-narrow-to-subject) "mh-seq" "\ -Narrow to a sequence containing all following messages with same subject." t nil) +Limit to messages with same subject. +With a prefix argument, edit PICK-EXPR. + +Use \\\\[mh-widen] to undo this command." t nil) (autoload (quote mh-narrow-to-from) "mh-seq" "\ -Limit to messages with the same From header field as the message at point. -With a prefix argument, prompt for the regular expression, REGEXP given to -pick." t nil) +Limit to messages with the same `From:' field. +With a prefix argument, edit PICK-EXPR. + +Use \\\\[mh-widen] to undo this command." t nil) (autoload (quote mh-narrow-to-cc) "mh-seq" "\ -Limit to messages with the same Cc header field as the message at point. -With a prefix argument, prompt for the regular expression, REGEXP given to -pick." t nil) +Limit to messages with the same `Cc:' field. +With a prefix argument, edit PICK-EXPR. + +Use \\\\[mh-widen] to undo this command." t nil) (autoload (quote mh-narrow-to-to) "mh-seq" "\ -Limit to messages with the same To header field as the message at point. -With a prefix argument, prompt for the regular expression, REGEXP given to -pick." t nil) +Limit to messages with the same `To:' field. +With a prefix argument, edit PICK-EXPR. + +Use \\\\[mh-widen] to undo this command." t nil) (autoload (quote mh-narrow-to-range) "mh-seq" "\ Limit to messages in RANGE. Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use." t nil) +interactive use. + +Use \\\\[mh-widen] to undo this command." t nil) (autoload (quote mh-delete-subject) "mh-seq" "\ Mark all following messages with same subject to be deleted. @@ -1103,14 +1145,15 @@ Mark current message and all its children for refiling to FOLDER." t nil) Toggle tick mark of all messages in RANGE." t nil) (autoload (quote mh-narrow-to-tick) "mh-seq" "\ -Restrict display of this folder to just messages in `mh-tick-seq'. +Limit to messages in `mh-tick-seq'. + Use \\\\[mh-widen] to undo this command." t nil) ;;;*** ;;;### (autoloads (mh-speed-add-folder mh-speed-invalidate-map mh-speed-flists ;;;;;; mh-speed-view mh-speed-toggle mh-folder-speedbar-buttons) -;;;;;; "mh-speed" "mh-speed.el" (16625 54721)) +;;;;;; "mh-speed" "mh-speed.el" (16665 55171)) ;;; Generated autoloads from mh-speed.el (autoload (quote mh-folder-speedbar-buttons) "mh-speed" "\ @@ -1143,33 +1186,26 @@ Remove FOLDER from various optimization caches." t nil) Add FOLDER since it is being created. The function invalidates the latest ancestor that is present." nil nil) -;;;*** - -;;;### (autoloads (mh-get-msg-num mh-goto-address-find-address-at-point) -;;;;;; "mh-utils" "mh-utils.el" (16625 54979)) -;;; Generated autoloads from mh-utils.el - -(autoload (quote mh-goto-address-find-address-at-point) "mh-utils" "\ -Find e-mail address around or before point. -Then search backwards to beginning of line for the start of an e-mail -address. If no e-mail address found, return nil." nil nil) - -(autoload (quote mh-get-msg-num) "mh-utils" "\ -Return the message number of the displayed message. -If the argument ERROR-IF-NO-MESSAGE is non-nil, then complain if the cursor is -not pointing to a message." nil nil) - ;;;*** ;;;### (autoloads (mh-alias-apropos mh-alias-add-address-under-point -;;;;;; mh-alias-grab-from-field mh-alias-add-alias mh-alias-from-has-no-alias-p +;;;;;; mh-alias-grab-from-field mh-alias-add-alias mh-alias-for-from-p ;;;;;; mh-alias-address-to-alias mh-alias-letter-expand-alias mh-alias-minibuffer-confirm-address ;;;;;; mh-read-address mh-alias-reload-maybe mh-alias-reload) "mh-alias" -;;;;;; "mh-alias.el" (16625 53006)) +;;;;;; "mh-alias.el" (16671 49553)) ;;; Generated autoloads from mh-alias.el (autoload (quote mh-alias-reload) "mh-alias" "\ -Load MH aliases into `mh-alias-alist'." t nil) +Reload MH aliases. + +Since aliases are updated frequently, MH-E will reload aliases automatically +whenever an alias lookup occurs if an alias source (a file listed in your +`Aliasfile:' profile component and your password file if variable +`mh-alias-local-users' is non-nil) has changed. However, you can reload your +aliases manually by calling this command directly. + +The value of `mh-alias-reloaded-hook' is a list of functions to be called, +with no arguments, after the aliases have been loaded." t nil) (autoload (quote mh-alias-reload-maybe) "mh-alias" "\ Load new MH aliases." nil nil) @@ -1186,26 +1222,25 @@ Expand mail alias before point." nil nil) (autoload (quote mh-alias-address-to-alias) "mh-alias" "\ Return the ADDRESS alias if defined, or nil." nil nil) -(autoload (quote mh-alias-from-has-no-alias-p) "mh-alias" "\ -Return t is From has no current alias set. -In the exceptional situation where there isn't a From header in the message the -function returns nil." nil nil) +(autoload (quote mh-alias-for-from-p) "mh-alias" "\ +Return t if sender's address has a corresponding alias." nil nil) (autoload (quote mh-alias-add-alias) "mh-alias" "\ *Add ALIAS for ADDRESS in personal alias file. -Prompts for confirmation if the address already has an alias. -If the alias is already is use, `mh-alias-add-alias-to-file' will prompt." t nil) +This function prompts you for an alias and address. If the alias exists +already, you will have the choice of inserting the new alias before or after +the old alias. In the former case, this alias will be used when sending mail +to this alias. In the latter case, the alias serves as an additional folder +name hint when filing messages." t nil) (autoload (quote mh-alias-grab-from-field) "mh-alias" "\ -*Add ALIAS for ADDRESS in personal alias file. -Prompts for confirmation if the alias is already in use or if the address -already has an alias." t nil) +*Add alias for the sender of the current message." t nil) (autoload (quote mh-alias-add-address-under-point) "mh-alias" "\ -Insert an alias for email address under point." t nil) +Insert an alias for address under point." t nil) (autoload (quote mh-alias-apropos) "mh-alias" "\ -Show all aliases that match REGEXP either in name or content." t nil) +Show all aliases or addresses that match REGEXP." t nil) ;;;*** diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index 91cbcec0c06..6b3c5793be5 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -34,7 +34,7 @@ ;;; Code: -(require 'mh-utils) +(eval-when-compile (require 'mh-acros)) (mh-require-cl) (require 'mh-comp) (require 'gnus-util) @@ -46,8 +46,7 @@ (autoload 'gnus-eval-format "gnus-spec") (autoload 'widget-convert-button "wid-edit") (autoload 'message-options-set-recipient "message") -(autoload 'mml-secure-message-sign-pgpmime "mml-sec") -(autoload 'mml-secure-message-encrypt-pgpmime "mml-sec") +(autoload 'mml-unsecure-message "mml-sec") (autoload 'mml-minibuffer-read-file "mml") (autoload 'mml-minibuffer-read-description "mml") (autoload 'mml-insert-empty-tag "mml") @@ -82,7 +81,7 @@ If any of the optional arguments are absent, they are prompted for." (read-string "Forw Content-description: ") (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) (read-string (format "Messages%s: " - (if mh-sent-from-msg + (if (numberp mh-sent-from-msg) (format " [%d]" mh-sent-from-msg) ""))))) (if (equal mh-compose-insertion 'gnus) @@ -114,6 +113,7 @@ MH profile.") ;; the variable, so things should work exactly as before. (defvar mh-have-file-command) +;;;###mh-autoload (defun mh-have-file-command () "Return t if 'file' command is on the system. 'file -i' is used to get MIME type of composition insertion." @@ -129,7 +129,8 @@ MH profile.") (defvar mh-file-mime-type-substitutions '(("application/msword" "\.xls" "application/ms-excel") - ("application/msword" "\.ppt" "application/ms-powerpoint")) + ("application/msword" "\.ppt" "application/ms-powerpoint") + ("text/plain" "\.vcf" "text/x-vcard")) "Substitutions to make for Content-Type returned from file command. The first element is the Content-Type returned by the file command. The second element is a regexp matching the file name, usually the extension. @@ -151,6 +152,7 @@ Substitutions are made from the `mh-file-mime-type-substitutions' variable." (setq subst (cdr subst)))) answer)) +;;;###mh-autoload (defun mh-file-mime-type (filename) "Return MIME type of FILENAME from file command. Returns nil if file command not on system." @@ -192,12 +194,38 @@ Returns nil if file command not on system." ("message/external-body") ("message/partial") ("message/rfc822") ("text/enriched") ("text/html") ("text/plain") ("text/rfc822-headers") - ("text/richtext") ("text/xml") + ("text/richtext") ("text/x-vcard") ("text/xml") ("video/mpeg") ("video/quicktime")) "Legal MIME content types. See documentation for \\[mh-edit-mhn].") +;; RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: +;; Format of Internet Message Bodies. +;; RFC 2046 - Multipurpose Internet Mail Extensions (MIME) Part Two: +;; Media Types. +;; RFC 2049 - Multipurpose Internet Mail Extensions (MIME) Part Five: +;; Conformance Criteria and Examples. +;; RFC 2017 - Definition of the URL MIME External-Body Access-Type +;; RFC 1738 - Uniform Resource Locators (URL) +(defvar mh-access-types + '(("anon-ftp") ; RFC2046 Anonymous File Transfer Protocol + ("file") ; RFC1738 Host-specific file names + ("ftp") ; RFC2046 File Transfer Protocol + ("gopher") ; RFC1738 The Gopher Protocol + ("http") ; RFC1738 Hypertext Transfer Protocol + ("local-file") ; RFC2046 Local file access + ("mail-server") ; RFC2046 mail-server Electronic mail address + ("mailto") ; RFC1738 Electronic mail address + ("news") ; RFC1738 Usenet news + ("nntp") ; RFC1738 Usenet news using NNTP access + ("propspero") ; RFC1738 Prospero Directory Service + ("telnet") ; RFC1738 Telnet + ("tftp") ; RFC2046 Trivial File Transfer Protocol + ("url") ; RFC2017 URL scheme MIME access-type Protocol + ("wais")) ; RFC1738 Wide Area Information Servers + "Legal MIME access-type values.") + ;;;###mh-autoload (defun mh-mhn-compose-insertion (filename type description attributes) "Add a directive to insert a MIME message part from a file. @@ -286,7 +314,7 @@ See also \\[mh-edit-mhn]." "type=tar; conversions=x-compress" "mode=image")) - +;;;###mh-autoload (defun mh-mhn-compose-external-type (access-type host filename type &optional description attributes extra-params @@ -301,6 +329,18 @@ DESCRIPTION, a line of text for the Content-description header, ATTRIBUTES, EXTRA-PARAMS, and COMMENT. See also \\[mh-edit-mhn]." + (interactive (list + (completing-read "Access Type: " mh-access-types) + (read-string "Remote host: ") + (read-string "Remote url-path: ") + (completing-read "Content-Type: " + (if (fboundp 'mailcap-mime-types) + (mapcar 'list (mailcap-mime-types)) + mh-mime-content-types)) + (if current-prefix-arg (read-string "Content-description: ")) + (if current-prefix-arg (read-string "Attributes: ")) + (if current-prefix-arg (read-string "Extra Parameters: ")) + (if current-prefix-arg (read-string "Comment: ")))) (beginning-of-line) (insert "#@" type) (and attributes @@ -314,7 +354,9 @@ See also \\[mh-edit-mhn]." (insert "access-type=" access-type "; ") (insert "site=" host) (insert "; name=" (file-name-nondirectory filename)) - (insert "; directory=\"" (file-name-directory filename) "\"") + (let ((directory (file-name-directory filename))) + (and directory + (insert "; directory=\"" directory "\""))) (and extra-params (insert "; " extra-params)) (insert "\n")) @@ -332,7 +374,7 @@ See also \\[mh-edit-mhn]." (read-string "Forw Content-description: ") (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) (read-string (format "Messages%s: " - (if mh-sent-from-msg + (if (numberp mh-sent-from-msg) (format " [%d]" mh-sent-from-msg) ""))))) (beginning-of-line) @@ -349,7 +391,7 @@ See also \\[mh-edit-mhn]." (let ((start (point))) (insert " " messages) (subst-char-in-region start (point) ?, ? )) - (if mh-sent-from-msg + (if (numberp mh-sent-from-msg) (insert " " (int-to-string mh-sent-from-msg)))) (insert "\n")) @@ -380,10 +422,11 @@ arguments, after performing the conversion. The mhn program is part of MH version 6.8 or later." (interactive "*P") + (mh-mhn-quote-unescaped-sharp) (save-buffer) (message "mhn editing...") (cond - (mh-nmh-flag + ((mh-variant-p 'nmh) (mh-exec-cmd-error nil "mhbuild" (if extra-args mh-mhn-args) buffer-file-name)) (t @@ -393,6 +436,19 @@ The mhn program is part of MH version 6.8 or later." (message "mhn editing...done") (run-hooks 'mh-edit-mhn-hook)) +(defun mh-mhn-quote-unescaped-sharp () + "Quote `#' characters that haven't been quoted for `mhbuild'. +If the `#' character is present in the first column, but it isn't part of a +MHN directive then `mhbuild' gives an error. This function will quote all such +characters." + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "^#" nil t) + (beginning-of-line) + (unless (mh-mhn-directive-present-p (point) (line-end-position)) + (insert "#")) + (goto-char (line-end-position))))) + ;;;###mh-autoload (defun mh-revert-mhn-edit (noconfirm) "Undo the effect of \\[mh-edit-mhn] by reverting to the backup file. @@ -422,18 +478,24 @@ Optional non-nil argument NOCONFIRM means don't ask for confirmation." (after-find-file nil))) ;;;###mh-autoload -(defun mh-mhn-directive-present-p () - "Check if the current buffer has text which might be a MHN directive." +(defun mh-mhn-directive-present-p (&optional begin end) + "Check if the text between BEGIN and END might be a MHN directive. +The optional argument BEGIN defaults to the beginning of the buffer, while END +defaults to the the end of the buffer." + (unless begin (setq begin (point-min))) + (unless end (setq end (point-max))) (save-excursion (block 'search-for-mhn-directive - (goto-char (point-min)) - (while (re-search-forward "^#" nil t) + (goto-char begin) + (while (re-search-forward "^#" end t) (let ((s (buffer-substring-no-properties (point) (line-end-position)))) (cond ((equal s "")) ((string-match "^forw[ \t\n]+" s) (return-from 'search-for-mhn-directive t)) (t (let ((first-token (car (split-string s "[ \t;@]")))) - (when (string-match mh-media-type-regexp first-token) + (when (and first-token + (string-match mh-media-type-regexp + first-token)) (return-from 'search-for-mhn-directive t))))))) nil))) @@ -450,14 +512,23 @@ function may be called manually before sending the draft as well." (require 'message) (when mh-gnus-pgp-support-flag ;; This is only needed for PGP (message-options-set-recipient)) - (mml-to-mime)) + (let ((saved-text (buffer-string)) + (buffer (current-buffer)) + (modified-flag (buffer-modified-p))) + (condition-case err (mml-to-mime) + (error + (with-current-buffer buffer + (delete-region (point-min) (point-max)) + (insert saved-text) + (set-buffer-modified-p modified-flag)) + (error (error-message-string err)))))) ;;;###mh-autoload (defun mh-mml-forward-message (description folder message) "Forward a message as attachment. The function will prompt the user for a DESCRIPTION, a FOLDER and MESSAGE number." - (let ((msg (if (equal message "") + (let ((msg (if (and (equal message "") (numberp mh-sent-from-msg)) mh-sent-from-msg (car (read-from-string message))))) (cond ((integerp msg) @@ -473,6 +544,19 @@ number." description))) (t (error "The message number, %s is not a integer!" msg))))) +(defvar mh-mml-cryptographic-method-history ()) + +;;;###mh-autoload +(defun mh-mml-query-cryptographic-method () + "Read the cryptographic method to use." + (if current-prefix-arg + (let ((def (or (car mh-mml-cryptographic-method-history) + mh-mml-method-default))) + (completing-read (format "Method: [%s] " def) + '(("pgp") ("pgpmime") ("smime")) + nil t nil 'mh-mml-cryptographic-method-history def)) + mh-mml-method-default)) + ;;;###mh-autoload (defun mh-mml-attach-file (&optional disposition) "Attach a file to the outgoing MIME message. @@ -499,22 +583,56 @@ automatically." (mml-insert-empty-tag 'part 'type type 'filename file 'disposition dispos 'description description))) -;;;###mh-autoload -(defun mh-mml-secure-message-sign-pgpmime () - "Add directive to encrypt/sign the entire message." - (interactive) +(defun mh-secure-message (method mode &optional identity) + "Add directive to Encrypt/Sign an entire message. +METHOD should be one of: \"pgpmime\", \"pgp\", \"smime\". +MODE should be one of: \"sign\", \"encrypt\", \"signencrypt\", \"none\". +IDENTITY is optionally the default-user-id to use." (if (not mh-gnus-pgp-support-flag) (error "Sorry. Your version of gnus does not support PGP/GPG") - (mml-secure-message-sign-pgpmime))) + ;; Check the arguments + (let ((valid-methods (list "pgpmime" "pgp" "smime")) + (valid-modes (list "sign" "encrypt" "signencrypt" "none"))) + (if (not (member method valid-methods)) + (error (format "Sorry. METHOD \"%s\" is invalid." method))) + (if (not (member mode valid-modes)) + (error (format "Sorry. MODE \"%s\" is invalid" mode))) + (mml-unsecure-message) + (if (not (string= mode "none")) + (save-excursion + (goto-char (point-min)) + (mh-goto-header-end 1) + (if mh-identity-pgg-default-user-id + (mml-insert-tag 'secure 'method method 'mode mode + 'sender mh-identity-pgg-default-user-id) + (mml-insert-tag 'secure 'method method 'mode mode))))))) ;;;###mh-autoload -(defun mh-mml-secure-message-encrypt-pgpmime (&optional dontsign) - "Add directive to encrypt and sign the entire message. -If called with a prefix argument DONTSIGN, only encrypt (do NOT sign)." +(defun mh-mml-unsecure-message (&optional ignore) + "Remove any secure message directives. +The IGNORE argument is not used." (interactive "P") (if (not mh-gnus-pgp-support-flag) (error "Sorry. Your version of gnus does not support PGP/GPG") - (mml-secure-message-encrypt-pgpmime dontsign))) + (mml-unsecure-message))) + +;;;###mh-autoload +(defun mh-mml-secure-message-sign (method) + "Add security directive to sign the entire message using METHOD." + (interactive (list (mh-mml-query-cryptographic-method))) + (mh-secure-message method "sign" mh-identity-pgg-default-user-id)) + +;;;###mh-autoload +(defun mh-mml-secure-message-encrypt (method) + "Add security directive to encrypt the entire message using METHOD." + (interactive (list (mh-mml-query-cryptographic-method))) + (mh-secure-message method "encrypt" mh-identity-pgg-default-user-id)) + +;;;###mh-autoload +(defun mh-mml-secure-message-signencrypt (method) + "Add security directive to encrypt and sign the entire message using METHOD." + (interactive (list (mh-mml-query-cryptographic-method))) + (mh-secure-message method "signencrypt" mh-identity-pgg-default-user-id)) ;;;###mh-autoload (defun mh-mml-directive-present-p () @@ -667,19 +785,19 @@ actual storing." (folder (if (eq major-mode 'mh-show-mode) mh-show-folder-buffer mh-current-folder)) - (command (if mh-nmh-flag "mhstore" "mhn")) + (command (if (mh-variant-p 'nmh) "mhstore" "mhn")) (directory (cond ((and (or arg (equal nil mh-mime-save-parts-default-directory) (equal t mh-mime-save-parts-default-directory)) (not mh-mime-save-parts-directory)) - (read-file-name "Store in what directory? " nil nil t nil)) + (read-file-name "Store in directory: " nil nil t nil)) ((and (or arg (equal t mh-mime-save-parts-default-directory)) mh-mime-save-parts-directory) (read-file-name (format - "Store in what directory? [%s] " + "Store in directory: [%s] " mh-mime-save-parts-directory) "" mh-mime-save-parts-directory t "")) ((stringp mh-mime-save-parts-default-directory) @@ -689,7 +807,7 @@ actual storing." (if (and (equal directory "") mh-mime-save-parts-directory) (setq directory mh-mime-save-parts-directory)) (if (not (file-directory-p directory)) - (message "No directory specified.") + (message "No directory specified") (if (equal nil mh-mime-save-parts-default-directory) (setq mh-mime-save-parts-directory directory)) (save-excursion @@ -766,17 +884,18 @@ displayed." (mh-mime-handles (mh-buffer-data)))) (unless handles (mh-decode-message-body))) - (when (and handles - (or (not (stringp (car handles))) (cdr handles))) - ;; Goto start of message body - (goto-char (point-min)) - (or (search-forward "\n\n" nil t) (goto-char (point-max))) + (cond ((and handles + (or (not (stringp (car handles))) (cdr handles))) + ;; Goto start of message body + (goto-char (point-min)) + (or (search-forward "\n\n" nil t) (goto-char (point-max))) - ;; Delete the body - (delete-region (point) (point-max)) + ;; Delete the body + (delete-region (point) (point-max)) - ;; Display the MIME handles - (mh-mime-display-part handles))) + ;; Display the MIME handles + (mh-mime-display-part handles)) + (t (mh-signature-highlight)))) (error (message "Please report this error. The error message is:\n %s" (error-message-string err)) @@ -874,7 +993,7 @@ This is only useful if a Content-Disposition header is not present." (save-restriction (widen) (goto-char (point-min)) - (not (re-search-forward "^-- $" nil t))))))) + (not (mh-signature-separator-p))))))) (defun mh-mime-display-single (handle) "Display a leaf node, HANDLE in the MIME tree." @@ -904,7 +1023,8 @@ This is only useful if a Content-Disposition header is not present." (insert "\n") (mh-insert-mime-button handle (mh-mime-part-index handle) nil)) ((and displayp (not mh-display-buttons-for-inline-parts-flag)) - (or (mm-display-part handle) (mm-display-part handle))) + (or (mm-display-part handle) (mm-display-part handle)) + (mh-signature-highlight handle)) ((and displayp mh-display-buttons-for-inline-parts-flag) (insert "\n") (mh-insert-mime-button handle (mh-mime-part-index handle) nil) @@ -912,6 +1032,28 @@ This is only useful if a Content-Disposition header is not present." (mh-mm-display-part handle))) (goto-char (point-max))))) +(defun mh-signature-highlight (&optional handle) + "Highlight message signature in HANDLE. +The optional argument, HANDLE is a MIME handle if the function is being used +to highlight the signature in a MIME part." + (let ((regexp + (cond ((not handle) "^-- $") + ((not (and (equal (mm-handle-media-supertype handle) "text") + (equal (mm-handle-media-subtype handle) "html"))) + "^-- $") + ((eq (mh-mm-text-html-renderer) 'lynx) "^ --$") + (t "^--$")))) + (save-excursion + (goto-char (point-max)) + (when (re-search-backward regexp nil t) + (mh-do-in-gnu-emacs + (let ((ov (make-overlay (point) (point-max)))) + (overlay-put ov 'face 'mh-show-signature-face) + (overlay-put ov 'evaporate t))) + (mh-do-in-xemacs + (set-extent-property (make-extent (point) (point-max)) + 'face 'mh-show-signature-face)))))) + (mh-do-in-xemacs (defvar dots) (defvar type)) @@ -954,7 +1096,9 @@ like \"K v\" which operate on individual MIME parts." :action 'mh-widget-press-button :button-keymap mh-mime-button-map :help-echo - "Mouse-2 click or press RET (in show buffer) to toggle display"))) + "Mouse-2 click or press RET (in show buffer) to toggle display") + (dolist (ov (mh-funcall-if-exists overlays-in begin end)) + (mh-funcall-if-exists overlay-put ov 'evaporate t)))) ;; There is a bug in Gnus inline image display due to which an extra line ;; gets inserted every time it is viewed. To work around that problem we are @@ -1009,7 +1153,8 @@ like \"K v\" which operate on individual MIME parts." (when (eq mh-highlight-citation-p 'gnus) (mh-gnus-article-highlight-citation)) (mh-display-smileys) - (mh-display-emphasis)) + (mh-display-emphasis) + (mh-signature-highlight handle)) (setq region (cons (progn (goto-char (point-min)) (point-marker)) (progn (goto-char (point-max)) @@ -1098,6 +1243,31 @@ button." (goto-char point) (set-buffer-modified-p nil))) +;;;###mh-autoload +(defun mh-display-with-external-viewer (part-index) + "View MIME PART-INDEX externally." + (interactive "P") + (when (consp part-index) (setq part-index (car part-index))) + (mh-folder-mime-action + part-index + #'(lambda () + (let* ((part (get-text-property (point) 'mh-data)) + (type (mm-handle-media-type part)) + (methods (mapcar (lambda (x) (list (cdr (assoc 'viewer x)))) + (mailcap-mime-info type 'all))) + (def (caar methods)) + (prompt (format "Viewer: %s" (if def (format "[%s] " def) ""))) + (method (completing-read prompt methods nil nil nil nil def)) + (folder mh-show-folder-buffer) + (buffer-read-only nil)) + (when (string-match "^[^% \t]+$" method) + (setq method (concat method " %s"))) + (flet ((mm-handle-set-external-undisplayer (handle function) + (mh-handle-set-external-undisplayer folder handle function))) + (unwind-protect (mm-display-external part method) + (set-buffer-modified-p nil))))) + nil)) + (defun mh-widget-press-button (widget el) "Callback for widget, WIDGET. Parameter EL is unused." @@ -1106,9 +1276,9 @@ Parameter EL is unused." (defun mh-mime-display-security (handle) "Display PGP encrypted/signed message, HANDLE." - (insert "\n") (save-restriction (narrow-to-region (point) (point)) + (insert "\n") (mh-insert-mime-security-button handle) (mh-mime-display-mixed (cdr handle)) (insert "\n") @@ -1116,9 +1286,7 @@ Parameter EL is unused." mh-mime-security-button-end-line-format)) (mh-insert-mime-security-button handle)) (mm-set-handle-multipart-parameter - handle 'mh-region - (cons (set-marker (make-marker) (point-min)) - (set-marker (make-marker) (point-max)))))) + handle 'mh-region (cons (point-min-marker) (point-max-marker))))) ;;; I rewrote the security part because Gnus doesn't seem to ever minimize ;;; the button. That is once the mime-security button is pressed there seems @@ -1149,8 +1317,22 @@ Parameter EL is unused." (defun mh-mime-security-press-button (handle) "Callback from security button for part HANDLE." - (when (mm-handle-multipart-ctl-parameter handle 'gnus-info) - (mh-mime-security-show-details handle))) + (if (mm-handle-multipart-ctl-parameter handle 'gnus-info) + (mh-mime-security-show-details handle) + (let ((region (mm-handle-multipart-ctl-parameter handle 'mh-region)) + point) + (setq point (point)) + (goto-char (car region)) + (delete-region (car region) (cdr region)) + (with-current-buffer (mm-handle-multipart-ctl-parameter handle 'buffer) + (let* ((mm-verify-option 'known) + (mm-decrypt-option 'known) + (new (mm-possibly-verify-or-decrypt (cdr handle) handle))) + (unless (eq new (cdr handle)) + (mm-destroy-parts (cdr handle)) + (setcdr handle new)))) + (mh-mime-display-security handle) + (goto-char point)))) ;; These variables should already be initialized in mm-decode.el if we have a ;; recent enough Gnus. The defvars are here to avoid compiler warnings. @@ -1191,6 +1373,8 @@ Parameter EL is unused." :action 'mh-widget-press-button :button-keymap mh-mime-security-button-map :help-echo "Mouse-2 click or press RET (in show buffer) to see security details.") + (dolist (ov (mh-funcall-if-exists overlays-in begin end)) + (mh-funcall-if-exists overlay-put ov 'evaporate t)) (when (equal info "Failed") (let* ((type (if (equal (car handle) "multipart/signed") "verification" "decryption")) @@ -1204,8 +1388,8 @@ The function decodes the message and displays it. It avoids decoding the same message multiple times." (let ((b (point)) (clean-message-header mh-clean-message-header-flag) - (invisible-headers mh-invisible-headers) - (visible-headers mh-visible-headers)) + (invisible-headers mh-invisible-header-fields-compiled) + (visible-headers nil)) (save-excursion (save-restriction (narrow-to-region b b) diff --git a/lisp/mh-e/mh-pick.el b/lisp/mh-e/mh-pick.el index a888f02154f..b92a98f26cc 100644 --- a/lisp/mh-e/mh-pick.el +++ b/lisp/mh-e/mh-pick.el @@ -1,6 +1,6 @@ ;;; mh-pick.el --- make a search pattern and search for a message in MH-E -;; Copyright (C) 1993, 1995, 2001, 2003 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1995, 2001, 2003, 2004 Free Software Foundation, Inc. ;; Author: Bill Wohler ;; Maintainer: Bill Wohler @@ -32,6 +32,8 @@ ;;; Code: +(eval-when-compile (require 'mh-acros)) +(mh-require-cl) (require 'mh-e) (require 'easymenu) (require 'gnus-util) @@ -44,6 +46,9 @@ (defvar mh-searching-folder nil) ;Folder this pick is searching. (defvar mh-searching-function nil) +(defconst mh-pick-single-dash '(cc date from subject to) + "Search components that are supported by single-dash option in pick.") + ;;;###mh-autoload (defun mh-search-folder (folder window-config) "Search FOLDER for messages matching a pattern. @@ -138,16 +143,6 @@ with no arguments, upon entry to this mode. (setq mh-help-messages mh-pick-mode-help-messages) (run-hooks 'mh-pick-mode-hook)) -;;;###mh-autoload -(defun mh-do-pick-search () - "Find messages that match the qualifications in the current pattern buffer. -Messages are searched for in the folder named in `mh-searching-folder'. -Add the messages found to the sequence named `search'. - -This is a deprecated function and `mh-pick-do-search' should be used instead." - (interactive) - (mh-pick-do-search)) - ;;;###mh-autoload (defun mh-pick-do-search () "Find messages that match the qualifications in the current pattern buffer. @@ -260,6 +255,13 @@ COMPONENT is the component to search." "-rbrace")) (t (error "Unknown operator '%s' seen" (car expr))))) +;; All implementations of pick have special options -cc, -date, -from and +;; -subject that allow to search for corresponding components. Any other +;; component is searched using option --COMPNAME, for example: `pick +;; --x-mailer mh-e'. Mailutils `pick' supports this option using a certain +;; kludge, but it prefers the following syntax for this purpose: +;; `--component=COMPNAME --pattern=PATTERN'. +;; -- Sergey Poznyakoff, Aug 2003 (defun mh-pick-regexp-builder (pattern-list) "Generate pick search expression from PATTERN-LIST." (let ((result ())) @@ -267,9 +269,18 @@ COMPONENT is the component to search." (when (cdr pattern) (setq result `(,@result "-and" "-lbrace" ,@(mh-pick-construct-regexp - (cdr pattern) (if (car pattern) - (format "-%s" (car pattern)) - "-search")) + (if (and (mh-variant-p 'mu-mh) (car pattern)) + (format "--pattern=%s" (cdr pattern)) + (cdr pattern)) + (if (car pattern) + (cond + ((mh-variant-p 'mu-mh) + (format "--component=%s" (car pattern))) + ((member (car pattern) mh-pick-single-dash) + (format "-%s" (car pattern))) + (t + (format "--%s" (car pattern)))) + "-search")) "-rbrace")))) (cdr result))) diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el index 20950d36c4c..8d2369ed19a 100644 --- a/lisp/mh-e/mh-seq.el +++ b/lisp/mh-e/mh-seq.el @@ -70,7 +70,7 @@ ;;; Code: -(require 'mh-utils) +(eval-when-compile (require 'mh-acros)) (mh-require-cl) (require 'mh-e) @@ -78,15 +78,15 @@ (defvar tool-bar-mode) ;;; Data structures (used in message threading)... -(defstruct (mh-thread-message (:conc-name mh-message-) - (:constructor mh-thread-make-message)) +(mh-defstruct (mh-thread-message (:conc-name mh-message-) + (:constructor mh-thread-make-message)) (id nil) (references ()) (subject "") (subject-re-p nil)) -(defstruct (mh-thread-container (:conc-name mh-container-) - (:constructor mh-thread-make-container)) +(mh-defstruct (mh-thread-container (:conc-name mh-container-) + (:constructor mh-thread-make-container)) message parent children (real-child-p t)) @@ -201,12 +201,15 @@ redone to get the new thread tree. This makes incremental threading easier.") ;;;###mh-autoload (defun mh-msg-is-in-seq (message) - "Display the sequences that contain MESSAGE. -Default is the displayed message." - (interactive (list (mh-get-msg-num t))) + "Display the sequences in which the current message appears. +Use a prefix argument to display the sequences in which another MESSAGE +appears." + (interactive "P") + (if (not message) + (setq message (mh-get-msg-num t))) (let* ((dest-folder (loop for seq in mh-refile-list - until (member message (cdr seq)) - finally return (car seq))) + when (member message (cdr seq)) return (car seq) + finally return nil)) (deleted-flag (unless dest-folder (member message mh-delete-list)))) (message "Message %d%s is in sequences: %s" message @@ -269,12 +272,11 @@ interactive use." (let* ((internal-seq-flag (mh-internal-seq sequence)) (original-msgs (mh-seq-msgs (mh-find-seq sequence))) (folders (list mh-current-folder)) - (msg-list ())) + (msg-list (mh-range-to-msg-list range))) + (mh-add-msgs-to-seq msg-list sequence nil t) (mh-iterate-on-range m range - (push m msg-list) (unless (memq m original-msgs) (mh-add-sequence-notation m internal-seq-flag))) - (mh-add-msgs-to-seq msg-list sequence nil t) (if (not internal-seq-flag) (setq mh-last-seq-used sequence)) (when mh-index-data @@ -292,10 +294,8 @@ OP is one of 'widen and 'unthread." ;;;###mh-autoload (defun mh-widen (&optional all-flag) - "Remove last restriction from current folder. -If optional prefix argument ALL-FLAG is non-nil, then unwind to the beginning -of the view stack thereby showing all messages that the buffer originally -contained." + "Restore the previous limit. +If optional prefix argument ALL-FLAG is non-nil, remove all limits." (interactive "P") (let ((msg (mh-get-msg-num nil))) (when mh-folder-view-stack @@ -532,28 +532,6 @@ should be replaced with: (mh-undefine-sequence sequence (mh-seq-msgs old-seq)) (rplaca old-seq new-name))) -;;;###mh-autoload -(defun mh-map-to-seq-msgs (func seq &rest args) - "Invoke the FUNC at each message in the SEQ. -SEQ can either be a list of messages or a MH sequence. The remaining ARGS are -passed as arguments to FUNC." - (save-excursion - (let ((msgs (if (listp seq) seq (mh-seq-to-msgs seq)))) - (while msgs - (if (mh-goto-msg (car msgs) t t) - (apply func (car msgs) args)) - (setq msgs (cdr msgs)))))) - -;;;###mh-autoload -(defun mh-notate-seq (seq notation offset) - "Mark the scan listing. -All messages in SEQ are marked with NOTATION at OFFSET from the beginning of -the line." - (let ((msg-list (mh-seq-to-msgs seq))) - (mh-iterate-on-messages-in-region msg (point-min) (point-max) - (when (member msg msg-list) - (mh-notate nil notation offset))))) - ;;;###mh-autoload (defun mh-notate-cur () "Mark the MH sequence cur. @@ -577,14 +555,6 @@ uses `overlay-arrow-position' to put a marker in the fringe." "-sequence" (symbol-name seq) (mh-coalesce-msg-list msgs))))) -;; This has a tricky bug. mh-map-to-seq-msgs uses mh-goto-msg, which assumes -;; that the folder buffer is sorted. However in this case that assumption -;; doesn't hold. So we will do this the dumb way. -;(defun mh-copy-seq-to-point (seq location) -; ;; Copy the scan listing of the messages in SEQUENCE to after the point -; ;; LOCATION in the current buffer. -; (mh-map-to-seq-msgs 'mh-copy-line-to-point seq location)) - (defvar mh-thread-last-ancestor) (defun mh-copy-seq-to-eob (seq) @@ -614,21 +584,6 @@ uses `overlay-arrow-position' to put a marker in the fringe." (mh-index-data (mh-index-insert-folder-headers))))))) -(defun mh-copy-line-to-point (msg location) - "Copy current message line to a specific location. -The argument MSG is not used. The message in the current line is copied to -LOCATION." - ;; msg is not used? - ;; Copy the current line to the LOCATION in the current buffer. - (beginning-of-line) - (save-excursion - (let ((beginning-of-line (point)) - end) - (forward-line 1) - (setq end (point)) - (goto-char location) - (insert-buffer-substring (current-buffer) beginning-of-line end)))) - ;;;###mh-autoload (defmacro mh-iterate-on-messages-in-region (var begin end &rest body) "Iterate over region. @@ -702,7 +657,7 @@ a region in a cons cell." (nreverse msg-list))) ;;;###mh-autoload -(defun mh-interactive-range (range-prompt) +(defun mh-interactive-range (range-prompt &optional default) "Return interactive specification for message, sequence, range or region. By convention, the name of this argument is RANGE. @@ -715,24 +670,17 @@ RANGE-PROMPT. A list of messages in that range is returned. If a MH range is given, say something like last:20, then a list containing the messages in that range is returned. +If DEFAULT non-nil then it is returned. + Otherwise, the message number at point is returned. This function is usually used with `mh-iterate-on-range' in order to provide a uniform interface to MH-E functions." (cond ((mh-mark-active-p t) (cons (region-beginning) (region-end))) (current-prefix-arg (mh-read-range range-prompt nil nil t t)) + (default default) (t (mh-get-msg-num t)))) -;;;###mh-autoload -(defun mh-region-to-msg-list (begin end) - "Return a list of messages within the region between BEGIN and END." - ;; If end is end of buffer back up one position - (setq end (if (equal end (point-max)) (1- end) end)) - (let ((result)) - (mh-iterate-on-messages-in-region index begin end - (when (numberp index) (push index result))) - result)) - ;;; Commands to handle new 'subject sequence. @@ -772,7 +720,7 @@ Return number of messages put in the sequence: (if (or (not (looking-at mh-scan-subject-regexp)) (not (match-string 3)) (string-equal "" (match-string 3))) - (progn (message "No subject line.") + (progn (message "No subject line") nil) (let ((subject (match-string-no-properties 3)) (list)) @@ -835,61 +783,57 @@ This function can only be used the folder is threaded." (mh-container-message (gethash (gethash msg mh-thread-index-id-map) mh-thread-id-table))))) -;;;###mh-autoload -(defun mh-narrow-to-subject () - "Narrow to a sequence containing all following messages with same subject." - (interactive) - (let ((num (mh-get-msg-num nil)) - (count (mh-subject-to-sequence t))) - (cond - ((not count) ; No subject line, delete msg anyway - nil) - ((= 0 count) ; No other msgs, delete msg anyway. - (message "No other messages with same Subject following this one.") - nil) - (t ; We have a subject sequence. - (message "Found %d messages for subject sequence." count) - (mh-narrow-to-seq 'subject) - (if (numberp num) - (mh-goto-msg num t t)))))) - -(defun mh-read-pick-regexp (default) - "With prefix arg read a pick regexp. +(defun mh-edit-pick-expr (default) + "With prefix arg edit a pick expression. If no prefix arg is given, then return DEFAULT." (let ((default-string (loop for x in default concat (format " %s" x)))) (if (or current-prefix-arg (equal default-string "")) - (delete "" (split-string (read-string "Pick regexp: " default-string))) + (delete "" (split-string (read-string "Pick expression: " + default-string))) default))) ;;;###mh-autoload -(defun mh-narrow-to-from (&optional regexp) - "Limit to messages with the same From header field as the message at point. -With a prefix argument, prompt for the regular expression, REGEXP given to -pick." +(defun mh-narrow-to-subject (&optional pick-expr) + "Limit to messages with same subject. +With a prefix argument, edit PICK-EXPR. + +Use \\\\[mh-widen] to undo this command." (interactive - (list (mh-read-pick-regexp (mh-current-message-header-field 'from)))) - (mh-narrow-to-header-field 'from regexp)) + (list (mh-edit-pick-expr (mh-current-message-header-field 'subject)))) + (mh-narrow-to-header-field 'subject pick-expr)) ;;;###mh-autoload -(defun mh-narrow-to-cc (&optional regexp) - "Limit to messages with the same Cc header field as the message at point. -With a prefix argument, prompt for the regular expression, REGEXP given to -pick." +(defun mh-narrow-to-from (&optional pick-expr) + "Limit to messages with the same `From:' field. +With a prefix argument, edit PICK-EXPR. + +Use \\\\[mh-widen] to undo this command." (interactive - (list (mh-read-pick-regexp (mh-current-message-header-field 'cc)))) - (mh-narrow-to-header-field 'cc regexp)) + (list (mh-edit-pick-expr (mh-current-message-header-field 'from)))) + (mh-narrow-to-header-field 'from pick-expr)) ;;;###mh-autoload -(defun mh-narrow-to-to (&optional regexp) - "Limit to messages with the same To header field as the message at point. -With a prefix argument, prompt for the regular expression, REGEXP given to -pick." - (interactive - (list (mh-read-pick-regexp (mh-current-message-header-field 'to)))) - (mh-narrow-to-header-field 'to regexp)) +(defun mh-narrow-to-cc (&optional pick-expr) + "Limit to messages with the same `Cc:' field. +With a prefix argument, edit PICK-EXPR. -(defun mh-narrow-to-header-field (header-field regexp) - "Limit to messages whose HEADER-FIELD match REGEXP. +Use \\\\[mh-widen] to undo this command." + (interactive + (list (mh-edit-pick-expr (mh-current-message-header-field 'cc)))) + (mh-narrow-to-header-field 'cc pick-expr)) + +;;;###mh-autoload +(defun mh-narrow-to-to (&optional pick-expr) + "Limit to messages with the same `To:' field. +With a prefix argument, edit PICK-EXPR. + +Use \\\\[mh-widen] to undo this command." + (interactive + (list (mh-edit-pick-expr (mh-current-message-header-field 'to)))) + (mh-narrow-to-header-field 'to pick-expr)) + +(defun mh-narrow-to-header-field (header-field pick-expr) + "Limit to messages whose HEADER-FIELD match PICK-EXPR. The MH command pick is used to do the match." (let ((folder mh-current-folder) (original (mh-coalesce-msg-list @@ -897,7 +841,7 @@ The MH command pick is used to do the match." (msg-list ())) (with-temp-buffer (apply #'mh-exec-cmd-output "pick" nil folder - (append original (list "-list") regexp)) + (append original (list "-list") pick-expr)) (goto-char (point-min)) (while (not (eobp)) (let ((num (read-from-string @@ -939,7 +883,9 @@ The MH command pick is used to do the match." "Limit to messages in RANGE. Check the documentation of `mh-interactive-range' to see how RANGE is read in -interactive use." +interactive use. + +Use \\\\[mh-widen] to undo this command." (interactive (list (mh-interactive-range "Narrow to"))) (when (assoc 'range mh-seq-list) (mh-delete-seq 'range)) (mh-add-msgs-to-seq (mh-range-to-msg-list range) 'range) @@ -958,7 +904,7 @@ subject sequence." ((not count) ; No subject line, delete msg anyway (mh-delete-msg (mh-get-msg-num t))) ((= 0 count) ; No other msgs, delete msg anyway. - (message "No other messages with same Subject following this one.") + (message "No other messages with same Subject following this one") (mh-delete-msg (mh-get-msg-num t))) (t ; We have a subject sequence. (message "Marked %d messages for deletion" count) @@ -1078,13 +1024,12 @@ SUBJECT and REFS fields." message) (container (setf (mh-container-message container) - (mh-thread-make-message :subject subject - :subject-re-p subject-re-p - :id id :references refs))) - (t (let ((message (mh-thread-make-message - :subject subject - :subject-re-p subject-re-p - :id id :references refs))) + (mh-thread-make-message :id id :references refs + :subject subject + :subject-re-p subject-re-p))) + (t (let ((message (mh-thread-make-message :id id :references refs + :subject-re-p subject-re-p + :subject subject))) (prog1 message (mh-thread-get-message-container message))))))) @@ -1450,8 +1395,7 @@ MSG is the message being notated with NOTATION at OFFSET." (cur-scan-line (and mh-thread-scan-line-map (gethash msg mh-thread-scan-line-map))) (old-scan-lines (loop for map in mh-thread-scan-line-map-stack - collect (and map (gethash msg map)))) - (notation (if (stringp notation) (aref notation 0) notation))) + collect (and map (gethash msg map))))) (when cur-scan-line (setf (aref (car cur-scan-line) offset) notation)) (dolist (line old-scan-lines) @@ -1486,7 +1430,8 @@ MSG is the message being notated with NOTATION at OFFSET." (setf (gethash msg mh-thread-scan-line-map) v)))) (when (> (hash-table-count mh-thread-scan-line-map) 0) (insert (if (bobp) "" "\n") (car x) "\n") - (mh-thread-generate-scan-lines thread-tree -2))))))) + (mh-thread-generate-scan-lines thread-tree -2)))) + (mh-index-create-imenu-index)))) (defun mh-thread-folder () "Generate thread view of folder." @@ -1711,11 +1656,12 @@ start of the region and the second is the point at the end." (push msg unticked) (setcdr tick-seq (delq msg (cdr tick-seq))) (when (null (cdr tick-seq)) (setq mh-last-seq-used nil)) - (mh-remove-sequence-notation msg t)) + (mh-remove-sequence-notation msg (mh-colors-in-use-p))) (t (push msg ticked) (setq mh-last-seq-used mh-tick-seq) - (mh-add-sequence-notation msg t)))) + (let ((mh-seq-list (cons `(,mh-tick-seq ,msg) mh-seq-list))) + (mh-add-sequence-notation msg (mh-colors-in-use-p)))))) (mh-add-msgs-to-seq ticked mh-tick-seq nil t) (mh-undefine-sequence mh-tick-seq unticked) (when mh-index-data @@ -1724,16 +1670,16 @@ start of the region and the second is the point at the end." ;;;###mh-autoload (defun mh-narrow-to-tick () - "Restrict display of this folder to just messages in `mh-tick-seq'. + "Limit to messages in `mh-tick-seq'. + Use \\\\[mh-widen] to undo this command." (interactive) (cond ((not mh-tick-seq) (error "Enable ticking by customizing `mh-tick-seq'")) ((null (mh-seq-msgs (mh-find-seq mh-tick-seq))) - (message "No messages in tick sequence")) + (message "No messages in %s sequence" mh-tick-seq)) (t (mh-narrow-to-seq mh-tick-seq)))) - (provide 'mh-seq) ;;; Local Variables: diff --git a/lisp/mh-e/mh-speed.el b/lisp/mh-e/mh-speed.el index 967984d1104..2617a941de1 100644 --- a/lisp/mh-e/mh-speed.el +++ b/lisp/mh-e/mh-speed.el @@ -34,10 +34,11 @@ ;;; Code: ;; Requires -(require 'mh-utils) +(eval-when-compile (require 'mh-acros)) (mh-require-cl) (require 'mh-e) (require 'speedbar) +(require 'timer) ;; Global variables (defvar mh-speed-refresh-flag nil) @@ -90,26 +91,25 @@ BUFFER is the MH-E buffer for which the speedbar buffer is to be created." "+" mh-speed-expand-folder "-" mh-speed-contract-folder "\r" mh-speed-view - "f" mh-speed-flists - "i" mh-speed-invalidate-map) + "r" mh-speed-refresh) (defvar mh-show-speedbar-key-map mh-folder-speedbar-key-map) (defvar mh-letter-speedbar-key-map mh-folder-speedbar-key-map) ;; Menus for speedbar... (defvar mh-folder-speedbar-menu-items - '(["Visit Folder" mh-speed-view + '("--" + ["Visit Folder" mh-speed-view (save-excursion (set-buffer speedbar-buffer) (get-text-property (line-beginning-position) 'mh-folder))] - ["Expand nested folders" mh-speed-expand-folder + ["Expand Nested Folders" mh-speed-expand-folder (and (get-text-property (line-beginning-position) 'mh-children-p) (not (get-text-property (line-beginning-position) 'mh-expanded)))] - ["Contract nested folders" mh-speed-contract-folder + ["Contract Nested Folders" mh-speed-contract-folder (and (get-text-property (line-beginning-position) 'mh-children-p) (get-text-property (line-beginning-position) 'mh-expanded))] - ["Run Flists" mh-speed-flists t] - ["Invalidate cached folders" mh-speed-invalidate-map t]) + ["Refresh Speedbar" mh-speed-refresh t]) "Extra menu items for speedbar.") (defvar mh-show-speedbar-menu-items mh-folder-speedbar-menu-items) @@ -352,6 +352,14 @@ Optional ARGS are ignored." (defvar mh-speed-current-folder nil) (defvar mh-speed-flists-folder nil) +(defmacro mh-process-kill-without-query (process) + "PROCESS can be killed without query on Emacs exit. +Avoid using `process-kill-without-query' if possible since it is now +obsolete." + (if (fboundp 'set-process-query-on-exit-flag) + `(set-process-query-on-exit-flag ,process nil) + `(process-kill-without-query ,process))) + ;;;###mh-autoload (defun mh-speed-flists (force &rest folders) "Execute flists -recurse and update message counts. @@ -396,6 +404,7 @@ only for that one folder." (or mh-speed-flists-folder '("-recurse")))) ;; Run flists on all folders the next time around... (setq mh-speed-flists-folder nil) + (mh-process-kill-without-query mh-speed-flists-process) (set-process-filter mh-speed-flists-process 'mh-speed-parse-flists-output))))))) @@ -494,6 +503,14 @@ next." (when (equal folder "") (clrhash mh-sub-folders-cache))))) +(defun mh-speed-refresh () + "Refresh the speedbar. +Use this function to refresh the speedbar if folders have been added or +deleted or message ranges have been updated outside of MH-E." + (interactive) + (mh-speed-flists t) + (mh-speed-invalidate-map "")) + ;;;###mh-autoload (defun mh-speed-add-folder (folder) "Add FOLDER since it is being created. diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index b1966915e86..a57567a7bd3 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el @@ -33,20 +33,14 @@ ;;; Code: -;; Is this XEmacs-land? Located here since needed by mh-customize.el. -(defvar mh-xemacs-flag (featurep 'xemacs) - "Non-nil means the current Emacs is XEmacs.") - -;; The Emacs coding conventions require that the cl package not be required at -;; runtime. However, the cl package in versions of Emacs prior to 21.4 left cl -;; routines in their macro expansions. Use mh-require-cl to provide the cl -;; routines in the best way possible. -(eval-when-compile (require 'cl)) -(defmacro mh-require-cl () - (if (eq (car (macroexpand '(setf (gethash foo bar) baz))) 'cl-puthash) - `(require 'cl) - `(eval-when-compile (require 'cl)))) +(defvar recursive-load-depth-limit) +(eval-and-compile + (if (and (boundp 'recursive-load-depth-limit) + (integerp recursive-load-depth-limit) + (> 50 recursive-load-depth-limit)) + (setq recursive-load-depth-limit 50))) +(eval-when-compile (require 'mh-acros)) (mh-require-cl) (require 'gnus-util) (require 'font-lock) @@ -58,6 +52,7 @@ (load "mm-decode" t t) ; Non-fatal dependency (load "mm-view" t t) ; Non-fatal dependency +(load "vcard" t t) ; Non-fatal dependency (load "hl-line" t t) ; Non-fatal dependency (load "executable" t t) ; Non-fatal dependency on ; executable-find @@ -69,43 +64,12 @@ ;;; Autoloads (autoload 'gnus-article-highlight-citation "gnus-cite") +(autoload 'message-fetch-field "message") +(autoload 'message-tokenize-header "message") (require 'sendmail) -(autoload 'Info-goto-node "info") (unless (fboundp 'make-hash-table) (autoload 'make-hash-table "cl")) -;;; Set for local environment: -;;; mh-progs and mh-lib used to be set in paths.el, which tried to -;;; figure out at build time which of several possible directories MH -;;; was installed into. But if you installed MH after building Emacs, -;;; this would almost certainly be wrong, so now we do it at run time. - -(defvar mh-progs nil - "Directory containing MH commands, such as inc, repl, and rmm.") - -(defvar mh-lib nil - "Directory containing the MH library. -This directory contains, among other things, the components file.") - -(defvar mh-lib-progs nil - "Directory containing MH helper programs. -This directory contains, among other things, the mhl program.") - -(defvar mh-nmh-flag nil - "Non-nil means nmh is installed on this system instead of MH.") - -(defvar mh-flists-present-flag nil - "Non-nil means that we have `flists'.") - -;;;###autoload -(put 'mh-progs 'risky-local-variable t) -;;;###autoload -(put 'mh-lib 'risky-local-variable t) -;;;###autoload -(put 'mh-lib-progs 'risky-local-variable t) -;;;###autoload -(put 'mh-nmh-flag 'risky-local-variable t) - ;;; CL Replacements (defun mh-search-from-end (char string) "Return the position of last occurrence of CHAR in STRING. @@ -115,92 +79,52 @@ of `search' in the CL package." when (equal (aref string index) char) return index finally return nil)) -;;; Macros to generate correct code for different emacs variants - -(defmacro mh-do-in-gnu-emacs (&rest body) - "Execute BODY if in GNU Emacs." - (unless mh-xemacs-flag `(progn ,@body))) -(put 'mh-do-in-gnu-emacs 'lisp-indent-hook 'defun) - -(defmacro mh-do-in-xemacs (&rest body) - "Execute BODY if in GNU Emacs." - (when mh-xemacs-flag `(progn ,@body))) -(put 'mh-do-in-xemacs 'lisp-indent-hook 'defun) - -(defmacro mh-funcall-if-exists (function &rest args) - "Call FUNCTION with ARGS as parameters if it exists." - (if (fboundp function) - `(funcall ',function ,@args))) - -(defmacro mh-make-local-hook (hook) - "Make HOOK local if needed. -XEmacs and versions of GNU Emacs before 21.1 require `make-local-hook' to be -called." - (when (and (fboundp 'make-local-hook) - (not (get 'make-local-hook 'byte-obsolete-info))) - `(make-local-hook ,hook))) - -(defmacro mh-mark-active-p (check-transient-mark-mode-flag) - "A macro that expands into appropriate code in XEmacs and nil in GNU Emacs. -In GNU Emacs if CHECK-TRANSIENT-MARK-MODE-FLAG is non-nil then check if -variable `transient-mark-mode' is active." - (cond (mh-xemacs-flag ;XEmacs - `(and (boundp 'zmacs-regions) zmacs-regions (region-active-p))) - ((not check-transient-mark-mode-flag) ;GNU Emacs - `(and (boundp 'mark-active) mark-active)) - (t ;GNU Emacs - `(and (boundp 'transient-mark-mode) transient-mark-mode - (boundp 'mark-active) mark-active)))) - ;;; Additional header fields that might someday be added: ;;; "Sender: " "Reply-to: " + +;;; Scan Line Formats + (defvar mh-scan-msg-number-regexp "^ *\\([0-9]+\\)" - "Regexp to find the number of a message in a scan line. -The message's number must be surrounded with \\( \\)") + "This regexp is used to extract the message number from a scan line. +Note that the message number must be placed in a parenthesized expression as +in the default of \"^ *\\\\([0-9]+\\\\)\".") (defvar mh-scan-msg-overflow-regexp "^[?0-9][0-9]" - "Regexp to find a scan line in which the message number overflowed. -The message's number is left truncated in this case.") + "This regexp matches scan lines in which the message number overflowed.") (defvar mh-scan-msg-format-regexp "%\\([0-9]*\\)(msg)" - "Regexp to find message number width in an scan format. -The message number width must be surrounded with \\( \\).") + "This regexp is used to find the message number width in a scan format. +Note that the message number must be placed in a parenthesized expression as +in the default of \"%\\\\([0-9]*\\\\)(msg)\".") (defvar mh-scan-msg-format-string "%d" - "Format string for width of the message number in a scan format. + "This is a format string for width of the message number in a scan format. Use `0%d' for zero-filled message numbers.") (defvar mh-scan-msg-search-regexp "^[^0-9]*%d[^0-9]" - "Format string containing a regexp matching the scan listing for a message. -The desired message's number will be an argument to format.") + "This format string regexp matches the scan line for a particular message. +Use `%d' to represent the location of the message number within the +expression as in the default of \"^[^0-9]*%d[^0-9]\".") -(defvar mh-default-folder-for-message-function nil - "Function to select a default folder for refiling or Fcc. -If set to a function, that function is called with no arguments by -`\\[mh-refile-msg]' and `\\[mh-to-fcc]' to get a default when -prompting the user for a folder. The function is called from within a -`save-excursion', with point at the start of the message. It should -return the folder to offer as the refile or Fcc folder, as a string -with a leading `+' sign. It can also return an empty string to use no -default, or nil to calculate the default the usual way. -NOTE: This variable is not an ordinary hook; -It may not be a list of functions.") +(defvar mh-cmd-note 4 + "This is the number of characters to skip over before inserting notation. +This variable should be set with the function `mh-set-cmd-note'. This variable +may be updated dynamically if `mh-adaptive-cmd-note-flag' is non-nil and +`mh-scan-format-file' is t.") +(make-variable-buffer-local 'mh-cmd-note) + +(defvar mh-note-seq ?% + "Messages in a user-defined sequence are marked by this character. +Messages in the `search' sequence are marked by this character as well.") + + (defvar mh-show-buffer-mode-line-buffer-id " {show-%s} %d" "Format string to produce `mode-line-buffer-identification' for show buffers. First argument is folder name. Second is message number.") -(defvar mh-cmd-note 4 - "Column to insert notation. -Use `mh-set-cmd-note' to modify it. -This value may be dynamically updated if `mh-adaptive-cmd-note-flag' is -non-nil and `mh-scan-format-file' is t. -Note that the first column is column number 0.") -(make-variable-buffer-local 'mh-cmd-note) - -(defvar mh-note-seq "%" - "String whose first character is used to notate messages in a sequence.") + (defvar mh-mail-header-separator "--------" "*Line used by MH to separate headers from text in messages being composed. @@ -213,11 +137,29 @@ Do not make this a regexp as it may be the argument to `insert' and it is passed through `regexp-quote' before being used by functions like `re-search-forward'.") +(defvar mh-signature-separator-regexp "^-- $" + "Regexp used to find signature separator. +See `mh-signature-separator'.") + +(defvar mh-signature-separator "-- \n" + "Text of a signature separator. +A signature separator is used to separate the body of a message from the +signature. This can be used by user agents such as MH-E to render the +signature differently or to suppress the inclusion of the signature in a +reply. +Use `mh-signature-separator-regexp' when searching for a separator.") + +(defun mh-signature-separator-p () + "Return non-nil if buffer includes \"^-- $\"." + (save-excursion + (goto-char (point-min)) + (re-search-forward mh-signature-separator-regexp nil t))) + ;; Variables for MIME display ;; Structure to keep track of MIME handles on a per buffer basis. -(defstruct (mh-buffer-data (:conc-name mh-mime-) - (:constructor mh-make-buffer-data)) +(mh-defstruct (mh-buffer-data (:conc-name mh-mime-) + (:constructor mh-make-buffer-data)) (handles ()) ; List of MIME handles (handles-cache (make-hash-table)) ; Cache to avoid multiple decodes of ; nested messages @@ -331,7 +273,7 @@ passed through `regexp-quote' before being used by functions like "A regular expression probably matching an e-mail address.") ;; From goto-addr.el, which we don't want to force-load on users. -;;;###mh-autoload + (defun mh-goto-address-find-address-at-point () "Find e-mail address around or before point. Then search backwards to beginning of line for the start of an e-mail @@ -348,7 +290,18 @@ address. If no e-mail address found, return nil." In MH-E we frequently need to find the end of headers in nested messages, where the buffer has been narrowed. This function works in this situation." (save-excursion - (rfc822-goto-eoh) + ;; XXX: The following replaces a call to rfc822-goto-eoh. Occasionally, + ;; mail headers that MH-E has to read contains lines of the form: + ;; From xxx@yyy Mon May 10 11:48:07 2004 + ;; In this situation, rfc822-goto-eoh doesn't go to the end of the + ;; header. The replacement allows From_ lines in the mail header. + (goto-char (point-min)) + (loop for p = (re-search-forward + "^\\([:\n]\\|[^: \t\n]+[ \t\n]\\)" nil 'move) + do (cond ((null p) (return)) + (t (goto-char (match-beginning 0)) + (unless (looking-at "From ") (return)) + (goto-char p)))) (point))) (defun mh-in-header-p () @@ -528,17 +481,20 @@ message about the fontification operation." ;; hidden and can be programmatically removed in mh-quit), and the variable ;; names have the form mh-temp-.*-buffer. (defconst mh-temp-buffer " *mh-temp*") ;scratch +(defconst mh-temp-fetch-buffer " *mh-fetch*") ;wget/curl/fetch output ;; The names of MH-E buffers that are not ephemeral and can be used by the ;; user (and deleted by the user when no longer needed) have a "*MH-E " prefix ;; (so they can be programmatically removed in mh-quit), and the variable ;; names have the form mh-.*-buffer. +(defconst mh-aliases-buffer "*MH-E Aliases*") ;alias lookups (defconst mh-folders-buffer "*MH-E Folders*") ;folder list +(defconst mh-help-buffer "*MH-E Help*") ;quick help (defconst mh-info-buffer "*MH-E Info*") ;version information buffer (defconst mh-log-buffer "*MH-E Log*") ;output of MH commands and so on +(defconst mh-mail-delivery-buffer "*MH-E Mail Delivery*") ;mail delivery log (defconst mh-recipients-buffer "*MH-E Recipients*") ;killed when draft sent (defconst mh-sequences-buffer "*MH-E Sequences*") ;sequences list -(defconst mh-mail-delivery-buffer "*MH-E Mail Delivery*") ;mail delivery log ;; Number of lines to keep in mh-log-buffer. (defvar mh-log-buffer-lines 100) @@ -593,7 +549,6 @@ message about the fontification operation." (cons modeline-buffer-id-left-extent "XEmacs%N:")) (cons modeline-buffer-id-right-extent " %17b"))))) - ;;; This holds a documentation string used by describe-mode. (defun mh-showing-mode (&optional arg) "Change whether messages should be displayed. @@ -614,7 +569,6 @@ With arg, display messages iff ARG is positive." ;; Showing message with headers or normally. (defvar mh-showing-with-headers nil) - ;;; MH-E macros (defmacro with-mh-folder-updating (save-modification-flag &rest body) @@ -742,7 +696,7 @@ of the buffer in the event window is preserved." (unlock-buffer) (setq buffer-file-name nil)) -;;;###mh-autoload + (defun mh-get-msg-num (error-if-no-message) "Return the message number of the displayed message. If the argument ERROR-IF-NO-MESSAGE is non-nil, then complain if the cursor is @@ -915,6 +869,16 @@ still visible.\n") (mh-defun-show-buffer mh-show-index-ticked-messages mh-index-ticked-messages) (mh-defun-show-buffer mh-show-index-sequenced-messages mh-index-sequenced-messages) +(mh-defun-show-buffer mh-show-catchup mh-catchup) +(mh-defun-show-buffer mh-show-ps-print-toggle-mime mh-ps-print-toggle-mime) +(mh-defun-show-buffer mh-show-ps-print-toggle-color mh-ps-print-toggle-color) +(mh-defun-show-buffer mh-show-ps-print-toggle-faces mh-ps-print-toggle-faces) +(mh-defun-show-buffer mh-show-ps-print-msg-file mh-ps-print-msg-file) +(mh-defun-show-buffer mh-show-ps-print-msg mh-ps-print-msg) +(mh-defun-show-buffer mh-show-ps-print-msg-show mh-ps-print-msg-show) +(mh-defun-show-buffer mh-show-toggle-mime-buttons mh-toggle-mime-buttons) +(mh-defun-show-buffer mh-show-display-with-external-viewer + mh-display-with-external-viewer) ;;; Populate mh-show-mode-map (gnus-define-keys mh-show-mode-map @@ -941,7 +905,6 @@ still visible.\n") "g" mh-show-goto-msg "i" mh-show-inc-folder "k" mh-show-delete-subject-or-thread - "l" mh-show-print-msg "m" mh-show-send "n" mh-show-next-undeleted-msg "\M-n" mh-show-next-unread-msg @@ -961,6 +924,7 @@ still visible.\n") "?" mh-prefix-help "'" mh-index-ticked-messages "S" mh-show-sort-folder + "c" mh-show-catchup "f" mh-show-visit-folder "i" mh-index-search "k" mh-show-kill-folder @@ -992,6 +956,17 @@ still visible.\n") "b" mh-show-junk-blacklist "w" mh-show-junk-whitelist) +(gnus-define-keys (mh-show-ps-print-map "P" mh-show-mode-map) + "?" mh-prefix-help + "A" mh-show-ps-print-toggle-mime + "C" mh-show-ps-print-toggle-color + "F" mh-show-ps-print-toggle-faces + "M" mh-show-ps-print-toggle-mime + "f" mh-show-ps-print-msg-file + "l" mh-show-print-msg + "p" mh-show-ps-print-msg + "s" mh-show-ps-print-msg-show) + (gnus-define-keys (mh-show-thread-map "T" mh-show-mode-map) "?" mh-prefix-help "u" mh-show-thread-ancestor @@ -1026,9 +1001,11 @@ still visible.\n") (gnus-define-keys (mh-show-mime-map "K" mh-show-mode-map) "?" mh-prefix-help "a" mh-mime-save-parts + "e" mh-show-display-with-external-viewer "v" mh-show-toggle-mime-part "o" mh-show-save-mime-part "i" mh-show-inline-mime-part + "t" mh-show-toggle-mime-buttons "\t" mh-show-next-button [backtab] mh-show-prev-button "\M-\t" mh-show-prev-button) @@ -1115,7 +1092,10 @@ still visible.\n") (define-derived-mode mh-show-mode text-mode "MH-Show" "Major mode for showing messages in MH-E.\\ The value of `mh-show-mode-hook' is a list of functions to -be called, with no arguments, upon entry to this mode." +be called, with no arguments, upon entry to this mode. +See also `mh-folder-mode'. + +\\{mh-show-mode-map}" (set (make-local-variable 'mail-header-separator) mh-mail-header-separator) (setq paragraph-start (default-value 'paragraph-start)) (mh-show-unquote-From) @@ -1210,8 +1190,9 @@ be called, with no arguments, upon entry to this mode." (mh-do-in-xemacs (defvar default-enable-multibyte-characters)) (defun mh-face-display-function () - "Display a Face or X-Face header field. -Display Face if both are present." + "Display a Face, X-Face, or X-Image-URL header field. +If more than one of these are present, then the first one found in this order +is used." (save-restriction (goto-char (point-min)) (re-search-forward "\n\n" (point-max) t) @@ -1226,7 +1207,8 @@ Display Face if both are present." type 'png)) (x-face (setq raw (mh-uncompface x-face) type 'pbm)) - (url (setq type 'url))) + (url (setq type 'url)) + (t (multiple-value-setq (type raw) (mh-picon-get-image)))) (when type (goto-char (point-min)) (when (re-search-forward "^from:" (point-max) t) @@ -1261,10 +1243,15 @@ Display Face if both are present." ((and (eq type 'pbm) (fboundp 'x-face-xmas-wl-display-x-face) (fboundp 'executable-find) (executable-find "uncompface")) - (mh-funcall-if-exists x-face-xmas-wl-display-x-face))) + (mh-funcall-if-exists x-face-xmas-wl-display-x-face)) + ;; Picon display + ((and raw (member type '(xpm xbm gif))) + (when (featurep type) + (set-extent-begin-glyph + (make-extent (point) (point)) + (make-glyph (vector type ':data raw)))))) (when raw (insert " ")))))))) - (defun mh-show-xface () "Display X-Face." (when (and window-system mh-show-use-xface-flag @@ -1274,49 +1261,207 @@ Display Face if both are present." +;; Picon display + +;;; XXX: This should be customizable. As a side-effect of setting this +;;; variable, arrange to reset mh-picon-existing-directory-list to 'unset. +(defvar mh-picon-directory-list + '("~/.picons" "~/.picons/users" "~/.picons/usenix" "~/.picons/news" + "~/.picons/domains" "~/.picons/misc" + "/usr/share/picons/" "/usr/share/picons/users" "/usr/share/picons/usenix" + "/usr/share/picons/news" "/usr/share/picons/domains" + "/usr/share/picons/misc") + "List of directories where picons reside. +The directories are searched for in the order they appear in the list.") + +(defvar mh-picon-existing-directory-list 'unset + "List of directories to search in.") + +(defvar mh-picon-cache (make-hash-table :test #'equal)) + +(defvar mh-picon-image-types + (loop for type in '(xpm xbm gif) + when (or (mh-do-in-gnu-emacs + (ignore-errors + (mh-funcall-if-exists image-type-available-p type))) + (mh-do-in-xemacs (featurep type))) + collect type)) + +(defun mh-picon-set-directory-list () + "Update `mh-picon-existing-directory-list' if needed." + (when (eq mh-picon-existing-directory-list 'unset) + (setq mh-picon-existing-directory-list + (loop for x in mh-picon-directory-list + when (file-directory-p x) collect x)))) + +(defun* mh-picon-get-image () + "Find the best possible match and return contents." + (mh-picon-set-directory-list) + (save-restriction + (let* ((from-field (ignore-errors (car (message-tokenize-header + (mh-get-header-field "from:"))))) + (from (car (ignore-errors + (mh-funcall-if-exists ietf-drums-parse-address + from-field)))) + (host (and from + (string-match "\\([^+]*\\)\\(+.*\\)?@\\(.*\\)" from) + (downcase (match-string 3 from)))) + (user (and host (downcase (match-string 1 from)))) + (canonical-address (format "%s@%s" user host)) + (cached-value (gethash canonical-address mh-picon-cache)) + (host-list (and host (delete "" (split-string host "\\.")))) + (match nil)) + (cond (cached-value (return-from mh-picon-get-image cached-value)) + ((not host-list) (return-from mh-picon-get-image nil))) + (setq match + (block 'loop + ;; u@h search + (loop for dir in mh-picon-existing-directory-list + do (loop for type in mh-picon-image-types + ;; [path]user@host + for file1 = (format "%s/%s.%s" + dir canonical-address type) + when (file-exists-p file1) + do (return-from 'loop file1) + ;; [path]user + for file2 = (format "%s/%s.%s" dir user type) + when (file-exists-p file2) + do (return-from 'loop file2) + ;; [path]host + for file3 = (format "%s/%s.%s" dir host type) + when (file-exists-p file3) + do (return-from 'loop file3))) + ;; facedb search + ;; Search order for user@foo.net: + ;; [path]net/foo/user + ;; [path]net/foo/user/face + ;; [path]net/user + ;; [path]net/user/face + ;; [path]net/foo/unknown + ;; [path]net/foo/unknown/face + ;; [path]net/unknown + ;; [path]net/unknown/face + (loop for u in (list user "unknown") + do (loop for dir in mh-picon-existing-directory-list + do (loop for x on host-list by #'cdr + for y = (mh-picon-generate-path x u dir) + do (loop for type in mh-picon-image-types + for z1 = (format "%s.%s" y type) + when (file-exists-p z1) + do (return-from 'loop z1) + for z2 = (format "%s/face.%s" + y type) + when (file-exists-p z2) + do (return-from 'loop z2))))))) + (setf (gethash canonical-address mh-picon-cache) + (mh-picon-file-contents match))))) + +(defun mh-picon-file-contents (file) + "Return details about FILE. +A list of consisting of a symbol for the type of the file and the file +contents as a string is returned. If FILE is nil, then both elements of the +list are nil." + (if (stringp file) + (with-temp-buffer + (let ((type (and (string-match ".*\\.\\(...\\)$" file) + (intern (match-string 1 file))))) + (insert-file-contents-literally file) + (values type (buffer-string)))) + (values nil nil))) + +(defun mh-picon-generate-path (host-list user directory) + "Generate the image file path. +HOST-LIST is the parsed host address of the email address, USER the username +and DIRECTORY is the directory relative to which the path is generated." + (loop with acc = "" + for elem in host-list + do (setq acc (format "%s/%s" elem acc)) + finally return (format "%s/%s%s" directory acc user))) + + + ;; X-Image-URL display (defvar mh-x-image-cache-directory nil "Directory where X-Image-URL images are cached.") - -(defvar mh-convert-executable (executable-find "convert")) -(defvar mh-wget-executable (executable-find "wget")) +(defvar mh-x-image-scaling-function + (cond ((executable-find "convert") + 'mh-x-image-scale-with-convert) + ((and (executable-find "anytopnm") (executable-find "pnmscale") + (executable-find "pnmtopng")) + 'mh-x-image-scale-with-pnm) + (t 'ignore)) + "Function to use to scale image to proper size.") +(defvar mh-wget-executable nil) +(defvar mh-wget-choice + (or (and (setq mh-wget-executable (executable-find "wget")) 'wget) + (and (setq mh-wget-executable (executable-find "fetch")) 'fetch) + (and (setq mh-wget-executable (executable-find "curl")) 'curl))) +(defvar mh-wget-option + (cdr (assoc mh-wget-choice '((curl . "-o") (fetch . "-o") (wget . "-O"))))) (defvar mh-x-image-temp-file nil) (defvar mh-x-image-url nil) (defvar mh-x-image-marker nil) (defvar mh-x-image-url-cache-file nil) +;; Functions to scale image to proper size +(defun mh-x-image-scale-with-pnm (input output) + "Scale image in INPUT file and write to OUTPUT file using pnm tools." + (let ((res (shell-command-to-string + (format "anytopnm < %s | pnmscale -xysize 96 48 | pnmtopng > %s" + input output)))) + (unless (equal res "") + (delete-file output)))) + +(defun mh-x-image-scale-with-convert (input output) + "Scale image in INPUT file and write to OUTPUT file using ImageMagick." + (call-process "convert" nil nil nil "-geometry" "96x48" input output)) + (defun mh-x-image-url-cache-canonicalize (url) "Canonicalize URL. -Replace the ?/ character with a ?! character." - (with-temp-buffer - (insert url) - (goto-char (point-min)) - (while (search-forward "/" nil t) (replace-match "!")) - (format "%s/%s.png" mh-x-image-cache-directory (buffer-string)))) +Replace the ?/ character with a ?! character and append .png." + (format "%s/%s.png" mh-x-image-cache-directory + (with-temp-buffer + (insert url) + (mh-replace-string "/" "!") + (buffer-string)))) + +(defun mh-x-image-set-download-state (file data) + "Setup a symbolic link from FILE to DATA." + (if data + (make-symbolic-link (symbol-name data) file t) + (delete-file file))) + +(defun mh-x-image-get-download-state (file) + "Check the state of FILE by following any symbolic links." + (unless (file-exists-p mh-x-image-cache-directory) + (call-process "mkdir" nil nil nil mh-x-image-cache-directory)) + (cond ((file-symlink-p file) + (intern (file-name-nondirectory (file-chase-links file)))) + ((not (file-exists-p file)) nil) + (t 'ok))) (defun mh-x-image-url-fetch-image (url cache-file marker sentinel) "Fetch and display the image specified by URL. After the image is fetched, it is stored in CACHE-FILE. It will be displayed in a buffer and position specified by MARKER. The actual display is carried out by the SENTINEL function." - (if (and mh-wget-executable - mh-fetch-x-image-url - (or (eq mh-fetch-x-image-url t) - (y-or-n-p (format "Fetch %s? " url)))) - (let ((buffer (get-buffer-create (generate-new-buffer-name " *mh-url*"))) - (filename (make-temp-name "/tmp/mhe-wget"))) + (if mh-wget-executable + (let ((buffer (get-buffer-create (generate-new-buffer-name + mh-temp-fetch-buffer))) + (filename (or (mh-funcall-if-exists make-temp-file "mhe-fetch") + (expand-file-name (make-temp-name "~/mhe-fetch"))))) (save-excursion (set-buffer buffer) (set (make-local-variable 'mh-x-image-url-cache-file) cache-file) (set (make-local-variable 'mh-x-image-marker) marker) (set (make-local-variable 'mh-x-image-temp-file) filename)) (set-process-sentinel - (start-process "*wget*" buffer mh-wget-executable "-O" filename url) + (start-process "*mh-x-image-url-fetch*" buffer + mh-wget-executable mh-wget-option filename url) sentinel)) - ;; Make sure we don't ask about this image again - (when (and mh-wget-executable (eq mh-fetch-x-image-url 'ask)) - (make-symbolic-link mh-x-image-cache-directory cache-file t)))) + ;; Temporary failure + (mh-x-image-set-download-state cache-file 'try-again))) (defun mh-x-image-display (image marker) "Display IMAGE at MARKER." @@ -1326,7 +1471,8 @@ out by the SENTINEL function." (default-enable-multibyte-characters nil) (buffer-modified-flag (buffer-modified-p))) (unwind-protect - (when (and (file-readable-p image) (not (file-symlink-p image))) + (when (and (file-readable-p image) (not (file-symlink-p image)) + (eq marker mh-x-image-marker)) (goto-char marker) (mh-do-in-gnu-emacs (mh-funcall-if-exists insert-image (create-image image 'png))) @@ -1350,32 +1496,56 @@ The argument CHANGE is ignored." (setq marker mh-x-image-marker cache-filename mh-x-image-url-cache-file temp-file mh-x-image-temp-file)) - (when mh-convert-executable - (call-process mh-convert-executable nil nil nil "-resize" "96x48" - temp-file cache-filename)) - (if (file-exists-p cache-filename) - (mh-x-image-display cache-filename marker) - (make-symbolic-link mh-x-image-cache-directory cache-filename t)) + (cond + ;; Check if we have `convert' + ((eq mh-x-image-scaling-function 'ignore) + (message "The `convert' program is needed to display X-Image-URL") + (mh-x-image-set-download-state cache-filename 'try-again)) + ;; Scale fetched image + ((and (funcall mh-x-image-scaling-function temp-file cache-filename) + nil)) + ;; Attempt to display image if we have it + ((file-exists-p cache-filename) + (mh-x-image-display cache-filename marker)) + ;; We didn't find the image. Should we try to display it the next time? + (t (mh-x-image-set-download-state cache-filename 'try-again))) (ignore-errors (set-marker marker nil) (delete-process process) (kill-buffer wget-buffer) (delete-file temp-file))))) +(defun mh-x-image-url-sane-p (url) + "Check if URL is something sensible." + (let ((len (length url))) + (cond ((< len 5) nil) + ((not (equal (substring url 0 5) "http:")) nil) + ((> len 100) nil) + (t t)))) + (defun mh-x-image-url-display (url) "Display image from location URL. If the URL isn't present in the cache then it is fetched with wget." - (let ((cache-filename (mh-x-image-url-cache-canonicalize url)) - (marker (set-marker (make-marker) (point)))) - (cond ((file-exists-p cache-filename) + (let* ((cache-filename (mh-x-image-url-cache-canonicalize url)) + (state (mh-x-image-get-download-state cache-filename)) + (marker (set-marker (make-marker) (point)))) + (set (make-local-variable 'mh-x-image-marker) marker) + (cond ((not (mh-x-image-url-sane-p url))) + ((eq state 'ok) (mh-x-image-display cache-filename marker)) + ((or (not mh-wget-executable) + (eq mh-x-image-scaling-function 'ignore))) + ((eq state 'never)) ((not mh-fetch-x-image-url) (set-marker marker nil)) - ((and (not (file-exists-p mh-x-image-cache-directory)) - (call-process "mkdir" nil nil nil mh-x-image-cache-directory) - nil)) - ((and (file-exists-p mh-x-image-cache-directory) - (file-directory-p mh-x-image-cache-directory)) + ((eq state 'try-again) + (mh-x-image-set-download-state cache-filename nil) + (mh-x-image-url-fetch-image url cache-filename marker + 'mh-x-image-scale-and-display)) + ((and (eq mh-fetch-x-image-url 'ask) + (not (y-or-n-p (format "Fetch %s? " url)))) + (mh-x-image-set-download-state cache-filename 'never)) + ((eq state nil) (mh-x-image-url-fetch-image url cache-filename marker 'mh-x-image-scale-and-display))))) @@ -1386,27 +1556,32 @@ If the URL isn't present in the cache then it is fetched with wget." If optional arg MSG is non-nil, display that message instead." (if mh-showing-mode (mh-show msg))) -(defun mh-show (&optional message) +(defun mh-show (&optional message redisplay-flag) "Show message at cursor. If optional argument MESSAGE is non-nil, display that message instead. Force a two-window display with the folder window on top (size given by the variable `mh-summary-height') and the show buffer below it. If the message is already visible, display the start of the message. +If REDISPLAY-FLAG is non-nil, the default when called interactively, the +message is redisplayed even if the show buffer was already displaying the +correct message. + Display of the message is controlled by setting the variables `mh-clean-message-header-flag' and `mhl-formfile'. The default behavior is to scroll uninteresting headers off the top of the window. Type \"\\[mh-header-display]\" to see the message with all its headers." - (interactive) - (and mh-showing-with-headers - (or mhl-formfile mh-clean-message-header-flag) - (mh-invalidate-show-buffer)) + (interactive (list nil t)) + (when (or redisplay-flag + (and mh-showing-with-headers + (or mhl-formfile mh-clean-message-header-flag))) + (mh-invalidate-show-buffer)) (mh-show-msg message)) -(defun mh-show-mouse (EVENT) +(defun mh-show-mouse (event) "Move point to mouse EVENT and show message." (interactive "e") - (mouse-set-point EVENT) + (mouse-set-point event) (mh-show)) (defun mh-summary-height () @@ -1428,10 +1603,12 @@ arguments, after the message has been displayed." (let ((folder mh-current-folder) (folders (list mh-current-folder)) (clean-message-header mh-clean-message-header-flag) - (show-window (get-buffer-window mh-show-buffer))) + (show-window (get-buffer-window mh-show-buffer)) + (display-mime-buttons-flag mh-display-buttons-for-inline-parts-flag)) (if (not (eq (next-window (minibuffer-window)) (selected-window))) (delete-other-windows)) ; force ourself to the top window (mh-in-show-buffer (mh-show-buffer) + (setq mh-display-buttons-for-inline-parts-flag display-mime-buttons-flag) (if (and show-window (equal (mh-msg-filename msg folder) buffer-file-name)) (progn ;just back up to start @@ -1443,6 +1620,9 @@ arguments, after the message has been displayed." (shrink-window (- (window-height) (or mh-summary-height (mh-summary-height))))) (mh-recenter nil) + ;; The following line is a nop which forces update of the scan line so + ;; that font-lock will update it (if needed)... + (mh-notate nil nil mh-cmd-note) (if (not (memq msg mh-seen-list)) (setq mh-seen-list (cons msg mh-seen-list))) (when mh-update-sequences-after-mh-show-flag @@ -1518,8 +1698,8 @@ Sets the current buffer to the show buffer." ;; Bind variables in folder buffer in case they are local (let ((formfile mhl-formfile) (clean-message-header mh-clean-message-header-flag) - (invisible-headers mh-invisible-headers) - (visible-headers mh-visible-headers) + (invisible-headers mh-invisible-header-fields-compiled) + (visible-headers nil) (msg-filename (mh-msg-filename msg-num folder-name)) (show-buffer mh-show-buffer) (mm-inline-media-tests mh-mm-inline-media-tests)) @@ -1596,7 +1776,10 @@ Sets the current buffer to the show buffer." Header is cleaned from START to the end of the message header. INVISIBLE-HEADERS contains a regular expression specifying lines to delete from the header. VISIBLE-HEADERS contains a regular expression specifying the -lines to display. INVISIBLE-HEADERS is ignored if VISIBLE-HEADERS is non-nil." +lines to display. INVISIBLE-HEADERS is ignored if VISIBLE-HEADERS is non-nil. + +Note that MH-E no longer supports the `mh-visible-headers' variable, so +this function could be trimmed of this feature too." (let ((case-fold-search t) (buffer-read-only nil) (after-change-functions nil)) ;Work around emacs-20 font-lock bug @@ -1639,8 +1822,7 @@ If NOTATION is nil then no change in the buffer occurs." (with-mh-folder-updating (t) (beginning-of-line) (forward-char offset) - (let* ((change-stack-flag (and (stringp notation) - (equal offset (1+ mh-cmd-note)) + (let* ((change-stack-flag (and (equal offset (1+ mh-cmd-note)) (not (eq notation mh-note-seq)))) (msg (and change-stack-flag (or msg (mh-get-msg-num nil)))) (stack (and msg (gethash msg mh-sequence-notation-history))) @@ -1652,7 +1834,7 @@ If NOTATION is nil then no change in the buffer occurs." ;; at the bottom of the stack. If the sequence is deleted, ;; the correct notation will be shown. (setf (gethash msg mh-sequence-notation-history) - (reverse (cons (aref notation 0) (cdr (reverse stack))))) + (reverse (cons notation (cdr (reverse stack))))) ;; Since we don't have any sequence notations in the way, just ;; notate the scan line. (delete-char 1) @@ -1660,25 +1842,6 @@ If NOTATION is nil then no change in the buffer occurs." (when change-stack-flag (mh-thread-update-scan-line-map msg notation offset))))))) -(defun mh-find-msg-get-num (step) - "Return the message number of the message nearest the cursor. -Jumps over non-message lines, such as inc errors. -If we have to search, STEP tells whether to search forward or backward." - (or (mh-get-msg-num nil) - (let ((msg-num nil) - (nreverses 0)) - (while (and (not msg-num) - (< nreverses 2)) - (cond ((eobp) - (setq step -1) - (setq nreverses (1+ nreverses))) - ((bobp) - (setq step 1) - (setq nreverses (1+ nreverses)))) - (forward-line step) - (setq msg-num (mh-get-msg-num nil))) - msg-num))) - (defun mh-goto-msg (number &optional no-error-if-no-message dont-show) "Position the cursor at message NUMBER. Optional non-nil second argument NO-ERROR-IF-NO-MESSAGE means return nil @@ -1699,10 +1862,6 @@ Non-nil third argument DONT-SHOW means not to show the message." (or dont-show (not return-value) (mh-maybe-show number)) return-value)) -(defun mh-msg-search-pat (n) - "Return a search pattern for message N in the scan listing." - (format mh-scan-msg-search-regexp n)) - (defun mh-get-profile-field (field) "Find and return the value of FIELD in the current buffer. Returns nil if the field is not in the buffer." @@ -1716,120 +1875,65 @@ Returns nil if the field is not in the buffer." (end-of-line) (buffer-substring start (point))))))) -(defvar mail-user-agent) -(defvar read-mail-command) - (defvar mh-find-path-run nil "Non-nil if `mh-find-path' has been run already.") (defun mh-find-path () - "Set `mh-progs', `mh-lib', and `mh-lib-progs' variables. + "Set variables from user's MH profile. Set `mh-user-path', `mh-draft-folder', `mh-unseen-seq', `mh-previous-seq', `mh-inbox' from user's MH profile. The value of `mh-find-path-hook' is a list of functions to be called, with no arguments, after these variable have been set." - (mh-find-progs) + (mh-variants) (unless mh-find-path-run (setq mh-find-path-run t) - (setq read-mail-command 'mh-rmail) - (setq mail-user-agent 'mh-e-user-agent)) - (save-excursion - ;; Be sure profile is fully expanded before switching buffers - (let ((profile (expand-file-name (or (getenv "MH") "~/.mh_profile")))) - (set-buffer (get-buffer-create mh-temp-buffer)) - (setq buffer-offer-save nil) ;for people who set default to t - (erase-buffer) - (condition-case err - (insert-file-contents profile) - (file-error - (mh-install profile err))) - (setq mh-user-path (mh-get-profile-field "Path:")) - (if (not mh-user-path) - (setq mh-user-path "Mail")) - (setq mh-user-path - (file-name-as-directory - (expand-file-name mh-user-path (expand-file-name "~")))) - (unless mh-x-image-cache-directory - (setq mh-x-image-cache-directory - (expand-file-name ".mhe-x-image-cache" mh-user-path))) - (setq mh-draft-folder (mh-get-profile-field "Draft-Folder:")) - (if mh-draft-folder - (progn - (if (not (mh-folder-name-p mh-draft-folder)) - (setq mh-draft-folder (format "+%s" mh-draft-folder))) - (if (not (file-exists-p (mh-expand-file-name mh-draft-folder))) - (error "Draft folder \"%s\" not found. Create it and try again" - (mh-expand-file-name mh-draft-folder))))) - (setq mh-inbox (mh-get-profile-field "Inbox:")) - (cond ((not mh-inbox) - (setq mh-inbox "+inbox")) - ((not (mh-folder-name-p mh-inbox)) - (setq mh-inbox (format "+%s" mh-inbox)))) - (setq mh-unseen-seq (mh-get-profile-field "Unseen-Sequence:")) - (if mh-unseen-seq - (setq mh-unseen-seq (intern mh-unseen-seq)) - (setq mh-unseen-seq 'unseen)) ;old MH default? - (setq mh-previous-seq (mh-get-profile-field "Previous-Sequence:")) - (if mh-previous-seq - (setq mh-previous-seq (intern mh-previous-seq))) - (run-hooks 'mh-find-path-hook) - (mh-collect-folder-names)))) + (save-excursion + ;; Be sure profile is fully expanded before switching buffers + (let ((profile (expand-file-name (or (getenv "MH") "~/.mh_profile")))) + (set-buffer (get-buffer-create mh-temp-buffer)) + (setq buffer-offer-save nil) ;for people who set default to t + (erase-buffer) + (condition-case err + (insert-file-contents profile) + (file-error + (mh-install profile err))) + (setq mh-user-path (mh-get-profile-field "Path:")) + (if (not mh-user-path) + (setq mh-user-path "Mail")) + (setq mh-user-path + (file-name-as-directory + (expand-file-name mh-user-path (expand-file-name "~")))) + (unless mh-x-image-cache-directory + (setq mh-x-image-cache-directory + (expand-file-name ".mhe-x-image-cache" mh-user-path))) + (setq mh-draft-folder (mh-get-profile-field "Draft-Folder:")) + (if mh-draft-folder + (progn + (if (not (mh-folder-name-p mh-draft-folder)) + (setq mh-draft-folder (format "+%s" mh-draft-folder))) + (if (not (file-exists-p (mh-expand-file-name mh-draft-folder))) + (error + "Draft folder \"%s\" not found. Create it and try again" + (mh-expand-file-name mh-draft-folder))))) + (setq mh-inbox (mh-get-profile-field "Inbox:")) + (cond ((not mh-inbox) + (setq mh-inbox "+inbox")) + ((not (mh-folder-name-p mh-inbox)) + (setq mh-inbox (format "+%s" mh-inbox)))) + (setq mh-unseen-seq (mh-get-profile-field "Unseen-Sequence:")) + (if mh-unseen-seq + (setq mh-unseen-seq (intern mh-unseen-seq)) + (setq mh-unseen-seq 'unseen)) ;old MH default? + (setq mh-previous-seq (mh-get-profile-field "Previous-Sequence:")) + (if mh-previous-seq + (setq mh-previous-seq (intern mh-previous-seq))) + (run-hooks 'mh-find-path-hook) + (mh-collect-folder-names))))) (defun mh-file-command-p (file) "Return t if file FILE is the name of a executable regular file." (and (file-regular-p file) (file-executable-p file))) -(defun mh-find-progs () - "Find the directories for the installed MH/nmh binaries and config files. -Set the `mh-progs' and `mh-lib', and `mh-lib-progs' variables to the -directory names and set `mh-nmh-flag' if we detect nmh instead of MH." - (unless (and mh-progs mh-lib mh-lib-progs) - (let ((path (or (mh-path-search exec-path "mhparam") - (mh-path-search '("/usr/local/nmh/bin" ; nmh default - "/usr/local/bin/mh/" - "/usr/local/mh/" - "/usr/bin/mh/" ;Ultrix 4.2, Linux - "/usr/new/mh/" ;Ultrix <4.2 - "/usr/contrib/mh/bin/" ;BSDI - "/usr/pkg/bin/" ; NetBSD - "/usr/local/bin/" - ) - "mhparam")))) - (if (not path) - (error "Unable to find the `mhparam' command")) - (save-excursion - (let ((tmp-buffer (get-buffer-create mh-temp-buffer))) - (set-buffer tmp-buffer) - (unwind-protect - (progn - (call-process (expand-file-name "mhparam" path) - nil '(t nil) nil "libdir" "etcdir") - (goto-char (point-min)) - (if (search-forward-regexp "^libdir:\\s-\\(\\S-+\\)\\s-*$" - nil t) - (setq mh-lib-progs (match-string 1) - mh-lib mh-lib-progs - mh-progs path)) - (goto-char (point-min)) - (if (search-forward-regexp "^etcdir:\\s-\\(\\S-+\\)\\s-*$" - nil t) - (setq mh-lib (match-string 1) - mh-nmh-flag t))) - (kill-buffer tmp-buffer)))) - (unless (and mh-progs mh-lib mh-lib-progs) - (error "Unable to determine paths from `mhparam' command")) - (setq mh-flists-present-flag - (file-exists-p (expand-file-name "flists" mh-progs)))))) - -(defun mh-path-search (path file) - "Search PATH, a list of directory names, for FILE. -Returns the element of PATH that contains FILE, or nil if not found." - (while (and path - (not (funcall 'mh-file-command-p - (expand-file-name file (car path))))) - (setq path (cdr path))) - (car path)) - (defvar mh-no-install nil) ;do not run install-mh (defun mh-install (profile error-val) @@ -1911,18 +2015,18 @@ not updated." (let ((entry (mh-find-seq seq)) (internal-seq-flag (mh-internal-seq seq))) (if (and msgs (atom msgs)) (setq msgs (list msgs))) - (unless internal-flag - (mh-add-to-sequence seq msgs) - (when (not dont-annotate-flag) - (mh-iterate-on-range msg msgs - (unless (memq msg (cdr entry)) - (mh-add-sequence-notation msg internal-seq-flag))))) (if (null entry) (setq mh-seq-list (cons (mh-make-seq seq (mh-canonicalize-sequence msgs)) mh-seq-list)) (if msgs (setcdr entry (mh-canonicalize-sequence - (append msgs (mh-seq-msgs entry)))))))) + (append msgs (mh-seq-msgs entry)))))) + (unless internal-flag + (mh-add-to-sequence seq msgs) + (when (not dont-annotate-flag) + (mh-iterate-on-range msg msgs + (unless (memq msg (cdr entry)) + (mh-add-sequence-notation msg internal-seq-flag))))))) (defun mh-canonicalize-sequence (msgs) "Sort MSGS in decreasing order and remove duplicates." @@ -2076,12 +2180,15 @@ aren't usually mail folders are hidden." (goto-char (point-min)) (while (not (and (eolp) (bolp))) (goto-char (line-end-position)) - (let ((has-pos (search-backward " has " (line-beginning-position) t))) + (let ((start-pos (line-beginning-position)) + (has-pos (search-backward " has " (line-beginning-position) t))) (when (integerp has-pos) (while (equal (char-after has-pos) ? ) (decf has-pos)) (incf has-pos) - (let* ((name (buffer-substring (line-beginning-position) has-pos)) + (while (equal (char-after start-pos) ? ) + (incf start-pos)) + (let* ((name (buffer-substring start-pos has-pos)) (first-char (aref name 0)) (last-char (aref name (1- (length name))))) (unless (member first-char '(?. ?# ?,)) @@ -2189,7 +2296,9 @@ whether the completion is over." If ALLOW-ROOT-FOLDER-FLAG is non-nil then \"+\" is allowed to be a folder name corresponding to `mh-user-path'." (mh-normalize-folder-name - (let ((minibuffer-local-completion-map mh-folder-completion-map) + (let ((minibuffer-completing-file-name t) + (completion-root-regexp "^[+/]") + (minibuffer-local-completion-map mh-folder-completion-map) (mh-allow-root-folder-flag allow-root-folder-flag)) (completing-read prompt 'mh-folder-completion-function nil nil nil 'mh-folder-hist default)) @@ -2206,11 +2315,10 @@ non-nil then the function will accept the folder +, which means all folders when used in searching." (if (null default) (setq default "")) - (let* ((default-string (cond (default-string (format " [%s]? " - default-string)) - ((equal "" default) "? ") - (t (format " [%s]? " default)))) - (prompt (format "%s folder%s" prompt default-string)) + (let* ((default-string (cond (default-string (format "[%s] " default-string)) + ((equal "" default) "") + (t (format "[%s] " default)))) + (prompt (format "%s folder: %s" prompt default-string)) (mh-current-folder-name mh-current-folder) read-name folder-name) (while (and (setq read-name (mh-folder-completing-read @@ -2452,6 +2560,13 @@ Put the output into buffer after point. Set mark after inserted text." (setq l (cdr l))) new-list)) +(defun mh-replace-string (old new) + "Replace all occurrences of OLD with NEW in the current buffer." + (goto-char (point-min)) + (let ((case-fold-search t)) + (while (search-forward old nil t) + (replace-match new t t)))) + (defun mh-replace-in-string (regexp newtext string) "Replace REGEXP with NEWTEXT everywhere in STRING and return result. NEWTEXT is taken literally---no \\DIGIT escapes will be recognized. From c3ff5bc11c41cbb4e6d361e38675556eb455a372 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 16 Aug 2004 00:07:23 +0000 Subject: [PATCH 136/341] term/x-win.el (x-selection-value): If utf8 was successful but ctext was not, use utf8 string. --- lisp/ChangeLog | 5 +++++ lisp/term/x-win.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c10c342abe5..a3552763a8c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-15 Kenichi Handa + + * term/x-win.el (x-selection-value): If utf8 was successful but + ctext was not, use utf8 string. + 2004-08-14 Davis Herring * isearch.el: Remove accidental changes of March 4. Fix backing diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index d9700809413..61602d1f355 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -2212,7 +2212,8 @@ order until succeed.") (if utf8 (setq text (x-select-utf8-or-ctext utf8 ctext)) ;; Othewise, choose CTEXT. - (setq text ctext)))) + (setq text ctext)) + (setq text utf8))) ;; If not yet decided, try STRING. (or text (setq text (condition-case nil From 863e5e3966c6919efb869955ac5245872432c1e1 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Mon, 16 Aug 2004 02:55:02 +0000 Subject: [PATCH 137/341] Upgraded to MH-E version 7.4.80. See etc/MH-E-NEWS and lisp/mh-e/ChangeLog for details. --- lisp/mh-e/mh-acros.el | 142 +++++++++++++++++++ lisp/mh-e/mh-init.el | 307 ++++++++++++++++++++++++++++++++++++++++++ lisp/mh-e/mh-print.el | 278 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 727 insertions(+) create mode 100644 lisp/mh-e/mh-acros.el create mode 100644 lisp/mh-e/mh-init.el create mode 100644 lisp/mh-e/mh-print.el diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el new file mode 100644 index 00000000000..e07eb6e4ed1 --- /dev/null +++ b/lisp/mh-e/mh-acros.el @@ -0,0 +1,142 @@ +;;; mh-acros.el --- Macros used in MH-E + +;; Copyright (C) 2004 Free Software Foundation, Inc. + +;; Author: Satyaki Das +;; Maintainer: Bill Wohler +;; Keywords: mail +;; See: mh-e.el + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; This file contains macros that would normally be in mh-utils.el except that +;; their presence there would cause a dependency loop with mh-customize.el. +;; This file must always be included like this: +;; +;; (eval-when-compile (require 'mh-acros)) +;; +;; It is so named with a silent `m' so that it is compiled first. Otherwise, +;; "make recompile" in Emacs 21.4 fails. + +;;; Change Log: + +;;; Code: + +(require 'cl) + +;; The Emacs coding conventions require that the cl package not be required at +;; runtime. However, the cl package in versions of Emacs prior to 21.4 left cl +;; routines in their macro expansions. Use mh-require-cl to provide the cl +;; routines in the best way possible. +(defmacro mh-require-cl () + "Macro to load `cl' if needed. +Some versions of `cl' produce code for the expansion of +\(setf (gethash ...) ...) that uses functions in `cl' at run time. This macro +recognizes that and loads `cl' where appropriate." + (if (eq (car (macroexpand '(setf (gethash foo bar) baz))) 'cl-puthash) + `(progn + (require 'cl) + ;; Autoloads of CL functions go here... + (autoload 'cl-puthash "cl") + (autoload 'values "cl") + (autoload 'copy-tree "cl")) + `(eval-when-compile (require 'cl)))) + +;;; Macros to generate correct code for different emacs variants + +(defmacro mh-do-in-gnu-emacs (&rest body) + "Execute BODY if in GNU Emacs." + (unless (featurep 'xemacs) `(progn ,@body))) +(put 'mh-do-in-gnu-emacs 'lisp-indent-hook 'defun) + +(defmacro mh-do-in-xemacs (&rest body) + "Execute BODY if in GNU Emacs." + (when (featurep 'xemacs) `(progn ,@body))) +(put 'mh-do-in-xemacs 'lisp-indent-hook 'defun) + +(defmacro mh-funcall-if-exists (function &rest args) + "Call FUNCTION with ARGS as parameters if it exists." + (if (fboundp function) + `(funcall ',function ,@args))) + +(defmacro mh-make-local-hook (hook) + "Make HOOK local if needed. +XEmacs and versions of GNU Emacs before 21.1 require `make-local-hook' to be +called." + (when (and (fboundp 'make-local-hook) + (not (get 'make-local-hook 'byte-obsolete-info))) + `(make-local-hook ,hook))) + +(defmacro mh-mark-active-p (check-transient-mark-mode-flag) + "A macro that expands into appropriate code in XEmacs and nil in GNU Emacs. +In GNU Emacs if CHECK-TRANSIENT-MARK-MODE-FLAG is non-nil then check if +variable `transient-mark-mode' is active." + (cond ((featurep 'xemacs) ;XEmacs + `(and (boundp 'zmacs-regions) zmacs-regions (region-active-p))) + ((not check-transient-mark-mode-flag) ;GNU Emacs + `(and (boundp 'mark-active) mark-active)) + (t ;GNU Emacs + `(and (boundp 'transient-mark-mode) transient-mark-mode + (boundp 'mark-active) mark-active)))) + +(defmacro mh-defstruct (name-spec &rest fields) + "Replacement for `defstruct' from the `cl' package. +The `defstruct' in the `cl' library produces compiler warnings, and generates +code that uses functions present in `cl' at run-time. This is a partial +replacement, that avoids these issues. + +NAME-SPEC declares the name of the structure, while FIELDS describes the +various structure fields. Lookup `defstruct' for more details." + (let* ((struct-name (if (atom name-spec) name-spec (car name-spec))) + (conc-name (or (and (consp name-spec) + (cadr (assoc :conc-name (cdr name-spec)))) + (format "%s-" struct-name))) + (predicate (intern (format "%s-p" struct-name))) + (constructor (or (and (consp name-spec) + (cadr (assoc :constructor (cdr name-spec)))) + (intern (format "make-%s" struct-name)))) + (field-names (mapcar #'(lambda (x) (if (atom x) x (car x))) fields)) + (field-init-forms (mapcar #'(lambda (x) (and (consp x) (cadr x))) + fields)) + (struct (gensym "S")) + (x (gensym "X")) + (y (gensym "Y"))) + `(progn + (defun* ,constructor (&key ,@(mapcar* #'(lambda (x y) (list x y)) + field-names field-init-forms)) + (list ,@field-names)) + (defun ,predicate (arg) + (and (consp arg) (eql (length arg) ,(length fields)))) + ,@(loop for x from 0 + for y in field-names + collect `(defmacro ,(intern (format "%s%s" conc-name y)) (z) + (list 'nth ,x z))) + (quote ,struct-name)))) + + +(provide 'mh-acros) + +;;; Local Variables: +;;; no-byte-compile: t +;;; indent-tabs-mode: nil +;;; sentence-end-double-space: nil +;;; End: + +;;; mh-acros.el ends here diff --git a/lisp/mh-e/mh-init.el b/lisp/mh-e/mh-init.el new file mode 100644 index 00000000000..7011070a2d8 --- /dev/null +++ b/lisp/mh-e/mh-init.el @@ -0,0 +1,307 @@ +;;; mh-init.el --- MH-E initialization. + +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. + +;; Author: Peter S. Galbraith +;; Maintainer: Bill Wohler +;; Keywords: mail +;; See: mh-e.el + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; Sets up the MH variant (currently nmh or MH). +;; +;; Users may customize `mh-variant' to switch between available variants. +;; Available MH variants are described in the variable `mh-variants'. +;; Developers may check which variant is currently in use with the +;; variable `mh-variant-in-use' or the function `mh-variant-p'. + +;;; Change Log: + +;;; Code: + +(eval-when-compile (require 'mh-acros)) +(mh-require-cl) +(require 'mh-utils) + +;;; Set for local environment: +;;; mh-progs and mh-lib used to be set in paths.el, which tried to +;;; figure out at build time which of several possible directories MH +;;; was installed into. But if you installed MH after building Emacs, +;;; this would almost certainly be wrong, so now we do it at run time. + +(defvar mh-progs nil + "Directory containing MH commands, such as inc, repl, and rmm.") + +(defvar mh-lib nil + "Directory containing the MH library. +This directory contains, among other things, the components file.") + +(defvar mh-lib-progs nil + "Directory containing MH helper programs. +This directory contains, among other things, the mhl program.") + +(defvar mh-flists-present-flag nil + "Non-nil means that we have `flists'.") + +;;;###autoload +(put 'mh-progs 'risky-local-variable t) +;;;###autoload +(put 'mh-lib 'risky-local-variable t) +;;;###autoload +(put 'mh-lib-progs 'risky-local-variable t) + +(defvar mh-variant-in-use nil + "The MH variant currently in use; a string with variant and version number. +This differs from `mh-variant' when the latter is set to `autodetect'.") + +;;;###mh-autoload +(defun mh-variant-set (variant) + "Set the MH variant to VARIANT. +Sets `mh-progs', `mh-lib', `mh-lib-progs' and `mh-flists-present-flag'. +If the VARIANT is `autodetect', then first try nmh, then MH and finally +GNU mailutils." + (interactive + (list (completing-read + "MH Variant: " + (mapcar (lambda (x) (list (car x))) (mh-variants)) + nil t))) + (let ((valid-list (mapcar (lambda (x) (car x)) (mh-variants)))) + (cond + ((eq variant 'none)) + ((eq variant 'autodetect) + (cond + ((mh-variant-set-variant 'nmh) + (message "%s installed as MH variant" mh-variant-in-use)) + ((mh-variant-set-variant 'MH) + (message "%s installed as MH variant" mh-variant-in-use)) + ((mh-variant-set-variant 'mu-mh) + (message "%s installed as MH variant" mh-variant-in-use)) + (t + (message "No MH variant found on the system!")))) + ((member variant valid-list) + (when (not (mh-variant-set-variant variant)) + (message "Warning: %s variant not found. Autodetecting..." variant) + (mh-variant-set 'autodetect))) + (t + (message "Unknown variant. Use %s" + (mapconcat '(lambda (x) (format "%s" (car x))) + mh-variants " or ")))))) + +(defun mh-variant-set-variant (variant) + "Setup the system variables for the MH variant named VARIANT. +If VARIANT is a string, use that key in the variable `mh-variants'. +If VARIANT is a symbol, select the first entry that matches that variant." + (cond + ((stringp variant) ;e.g. "nmh 1.1-RC1" + (when (assoc variant mh-variants) + (let* ((alist (cdr (assoc variant mh-variants))) + (lib-progs (cadr (assoc 'mh-lib-progs alist))) + (lib (cadr (assoc 'mh-lib alist))) + (progs (cadr (assoc 'mh-progs alist))) + (flists (cadr (assoc 'flists alist)))) + ;;(set-default mh-variant variant) + (setq mh-x-mailer-string nil + mh-flists-present-flag flists + mh-lib-progs lib-progs + mh-lib lib + mh-progs progs + mh-variant-in-use variant)))) + ((symbolp variant) ;e.g. 'nmh (pick the first match) + (loop for variant-list in mh-variants + when (eq variant (cadr (assoc 'variant (cdr variant-list)))) + return (let* ((version (car variant-list)) + (alist (cdr variant-list)) + (lib-progs (cadr (assoc 'mh-lib-progs alist))) + (lib (cadr (assoc 'mh-lib alist))) + (progs (cadr (assoc 'mh-progs alist))) + (flists (cadr (assoc 'flists alist)))) + ;;(set-default mh-variant flavor) + (setq mh-x-mailer-string nil + mh-flists-present-flag flists + mh-lib-progs lib-progs + mh-lib lib + mh-progs progs + mh-variant-in-use version) + t))))) + +;;;###mh-autoload +(defun mh-variant-p (&rest variants) + "Return t if variant is any of VARIANTS. +Currently known variants are 'mh and 'nmh." + (let ((variant-in-use + (cadr (assoc 'variant (assoc mh-variant-in-use mh-variants))))) + (not (null (member variant-in-use variants))))) + +(defvar mh-sys-path + '("/usr/local/nmh/bin" ; nmh default + "/usr/local/bin/mh/" + "/usr/local/mh/" + "/usr/bin/mh/" ; Ultrix 4.2, Linux + "/usr/new/mh/" ; Ultrix < 4.2 + "/usr/contrib/mh/bin/" ; BSDI + "/usr/pkg/bin/" ; NetBSD + "/usr/local/bin/" + "/usr/local/bin/mu-mh/" ; GNU mailutils - default + "/usr/bin/mu-mh/") ; GNU mailutils - packaged + "List of directories to search for variants of the MH variant. +The list `exec-path' is searched in addition to this list. +There's no need for users to modify this list. Instead add extra +directories to the customizable variable `mh-path'.") + +(defcustom mh-path nil + "*List of directories to search for variants of the MH variant. +The directories will be searched for `mhparam' in addition to directories +listed in `mh-sys-path' and `exec-path'." + :group 'mh + :type '(repeat (directory))) + +(defvar mh-variants nil + "List describing known MH variants. +Created by the function `mh-variants'") + +(defun mh-variant-mh-info (dir) + "Return info for MH variant in DIR assuming a temporary buffer is setup." + ;; MH does not have the -version option. + ;; Its version number is included in the output of `-help' as: + ;; + ;; version: MH 6.8.4 #2[UCI] (burrito) of Fri Jan 15 20:01:39 EST 1999 + ;; options: [ATHENA] [BIND] [DUMB] [LIBLOCKFILE] [LOCALE] [MAILGROUP] [MHE] + ;; [MHRC] [MIME] [MORE='"/usr/bin/sensible-pager"'] [NLINK_HACK] + ;; [NORUSERPASS] [OVERHEAD] [POP] [POPSERVICE='"pop-3"'] [RENAME] + ;; [RFC1342] [RPATHS] [RPOP] [SENDMTS] [SMTP] [SOCKETS] + ;; [SPRINTFTYPE=int] [SVR4] [SYS5] [SYS5DIR] [TERMINFO] + ;; [TYPESIG=void] [UNISTD] [UTK] [VSPRINTF] + (let ((mhparam (expand-file-name "mhparam" dir))) + (when (and (file-exists-p mhparam) (file-executable-p mhparam)) + (erase-buffer) + (call-process mhparam nil '(t nil) nil "-help") + (goto-char (point-min)) + (when (search-forward-regexp "version: MH \\(\\S +\\)" nil t) + (let ((version (format "MH %s" (match-string 1)))) + (erase-buffer) + (call-process mhparam nil '(t nil) nil "libdir") + (goto-char (point-min)) + (when (search-forward-regexp "^.*$" nil t) + (let ((libdir (match-string 0))) + `(,version + (variant mh) + (mh-lib-progs ,libdir) + (mh-lib ,libdir) + (mh-progs ,dir) + (flists nil))))))))) + +(defun mh-variant-mu-mh-info (dir) + "Return info for GNU mailutils variant in DIR. +This assumes that a temporary buffer is setup." + ;; 'mhparam -version' output: + ;; mhparam (GNU mailutils 0.3.2) + (let ((mhparam (expand-file-name "mhparam" dir))) + (when (and (file-exists-p mhparam) (file-executable-p mhparam)) + (erase-buffer) + (call-process mhparam nil '(t nil) nil "-version") + (goto-char (point-min)) + (when (search-forward-regexp "mhparam (\\(GNU [Mm]ailutils \\S +\\))" + nil t) + (let ((version (match-string 1))) + (erase-buffer) + (call-process mhparam nil '(t nil) nil "libdir" "etcdir") + (goto-char (point-min)) + (when (search-forward-regexp "^libdir:\\s-\\(\\S-+\\)\\s-*$" nil t) + (let ((libdir (match-string 1))) + (goto-char (point-min)) + (when (search-forward-regexp + "^etcdir:\\s-\\(\\S-+\\)\\s-*$" nil t) + (let ((etcdir (match-string 1)) + (flists (file-exists-p (expand-file-name "flists" dir)))) + `(,version + (variant mu-mh) + (mh-lib-progs ,libdir) + (mh-lib ,etcdir) + (mh-progs ,dir) + (flists ,flists))))))))))) + +(defun mh-variant-nmh-info (dir) + "Return info for nmh variant in DIR assuming a temporary buffer is setup." + ;; `mhparam -version' outputs: + ;; mhparam -- nmh-1.1-RC1 [compiled on chaak at Fri Jun 20 11:03:28 PDT 2003] + (let ((mhparam (expand-file-name "mhparam" dir))) + (when (and (file-exists-p mhparam) (file-executable-p mhparam)) + (erase-buffer) + (call-process mhparam nil '(t nil) nil "-version") + (goto-char (point-min)) + (when (search-forward-regexp "mhparam -- nmh-\\(\\S +\\)" nil t) + (let ((version (format "nmh %s" (match-string 1)))) + (erase-buffer) + (call-process mhparam nil '(t nil) nil "libdir" "etcdir") + (goto-char (point-min)) + (when (search-forward-regexp "^libdir:\\s-\\(\\S-+\\)\\s-*$" nil t) + (let ((libdir (match-string 1))) + (goto-char (point-min)) + (when (search-forward-regexp + "^etcdir:\\s-\\(\\S-+\\)\\s-*$" nil t) + (let ((etcdir (match-string 1)) + (flists (file-exists-p (expand-file-name "flists" dir)))) + `(,version + (variant nmh) + (mh-lib-progs ,libdir) + (mh-lib ,etcdir) + (mh-progs ,dir) + (flists ,flists))))))))))) + +(defun mh-variant-info (dir) + "Return MH variant found in DIR, or nil if none present." + (save-excursion + (let ((tmp-buffer (get-buffer-create mh-temp-buffer))) + (set-buffer tmp-buffer) + (cond + ((mh-variant-mh-info dir)) + ((mh-variant-nmh-info dir)) + ((mh-variant-mu-mh-info dir)))))) + +;;;###mh-autoload +(defun mh-variants () + "Return a list of installed variants of MH on the system. +This function looks for MH in `mh-sys-path', `mh-path' and +`exec-path'. The format of the list of variants that is returned is described +by the variable `mh-variants'." + (if mh-variants + mh-variants + (let ((list-unique)) + ;; Make a unique list of directories, keeping the given order. + ;; We don't want the same MH variant to be listed multiple times. + (loop for dir in (append mh-path mh-sys-path exec-path) do + (setq dir (file-chase-links (directory-file-name dir))) + (add-to-list 'list-unique dir)) + (loop for dir in (nreverse list-unique) do + (when (and dir (file-directory-p dir) (file-readable-p dir)) + (let ((variant (mh-variant-info dir))) + (if variant + (add-to-list 'mh-variants variant))))) + mh-variants))) + +(provide 'mh-init) + +;;; Local Variables: +;;; indent-tabs-mode: nil +;;; sentence-end-double-space: nil +;;; End: + +;;; mh-init.el ends here diff --git a/lisp/mh-e/mh-print.el b/lisp/mh-e/mh-print.el new file mode 100644 index 00000000000..83feae3c528 --- /dev/null +++ b/lisp/mh-e/mh-print.el @@ -0,0 +1,278 @@ +;;; mh-print.el --- MH-E printing support + +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. + +;; Author: Jeffrey C Honig +;; Maintainer: Bill Wohler +;; Keywords: mail +;; See: mh-e.el + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: +;; Pp Print to lpr | Default inline settings +;; Pf Print to file | Generate a postscript file +;; Ps Print show buffer | Fails if no show buffer +;; +;; PA Toggle inline/attachments +;; PC Toggle color +;; PF Toggle faces + +;;; Change Log: + +;;; Code: + +(eval-when-compile (require 'mh-acros)) +(mh-require-cl) +(require 'ps-print) +(require 'mh-utils) +(require 'mh-funcs) +(eval-when-compile (require 'mh-seq)) + +(defvar mh-ps-print-mime nil + "Control printing of MIME parts. +The three possible states are: + 1. nil to not print inline parts + 2. t to print inline parts + 3. non-zero to print inline parts and attachments") + +(defvar mh-ps-print-color-option ps-print-color-p + "MH-E's version of `\\[ps-print-color-p]'.") + +(defvar mh-ps-print-func 'ps-spool-buffer-with-faces + "Function to use to spool a buffer. +Sensible choices are the functions `ps-spool-buffer' and +`ps-spool-buffer-with-faces'.") + +;; XXX - If buffer is already being displayed, use that buffer +;; XXX - What about showing MIME content? +;; XXX - Default print buffer is bogus +(defun mh-ps-spool-buffer (buffer) + "Send BUFFER to printer queue." + (message (format "mh-ps-spool-buffer %s" buffer)) + (save-excursion + (set-buffer buffer) + (let ((ps-print-color-p mh-ps-print-color-option) + (ps-left-header + (list + (concat "(" + (mh-get-header-field "Subject:") ")") + (concat "(" + (mh-get-header-field "From:") ")"))) + (ps-right-header + (list + "/pagenumberstring load" + (concat "(" + (mh-get-header-field "Date:") ")")))) + (funcall mh-ps-print-func)))) + +(defun mh-ps-spool-a-msg (msg buffer) + "Print MSG. +First the message is decoded in BUFFER before the results are sent to the +printer." + (message (format "mh-ps-spool-a-msg msg %s buffer %s" + msg buffer)) + (let ((mh-show-buffer mh-show-buffer) + (folder mh-current-folder) + ;; The following is commented out because + ;; `clean-message-header-flag' isn't used anywhere. I + ;; commented rather than deleted in case somebody had some + ;; future plans for it. --SY. + ;(clean-message-header-flag mh-clean-message-header-flag) + ) + (unwind-protect + (progn + (setq mh-show-buffer buffer) + (save-excursion + ;; + ;; XXX - Use setting of mh-ps-print-mime + ;; + (mh-display-msg msg folder) + (mh-ps-spool-buffer mh-show-buffer) + (kill-buffer mh-show-buffer)))))) + +;;;###mh-autoload +(defun mh-ps-print-msg (range) + "Print the messages in RANGE. + +Check the documentation of `mh-interactive-range' to see how RANGE is read in +interactive use." + (interactive (list (mh-interactive-range "Print"))) + (message (format "mh-ps-print-msg range %s keys %s" + range (this-command-keys))) + (mh-iterate-on-range msg range + (let ((buffer (get-buffer-create mh-temp-buffer))) + (unwind-protect + (mh-ps-spool-a-msg msg buffer) + (kill-buffer buffer))) + (mh-notate nil mh-note-printed mh-cmd-note)) + (ps-despool nil)) + +(defun mh-ps-print-preprint (prefix-arg) + "Replacement for `ps-print-preprint'. +The original function does not handle the fact that MH folders are directories +nicely, when generating the default file name. This function works around +that. The function is passed the interactive PREFIX-ARG." + (let ((buffer-file-name (format "/tmp/%s" (substring (buffer-name) 1)))) + (ps-print-preprint prefix-arg))) + +;;;###mh-autoload +(defun mh-ps-print-msg-file (file range) + "Print to FILE the messages in RANGE. + +Check the documentation of `mh-interactive-range' to see how RANGE is read in +interactive use." + (interactive (list + (mh-ps-print-preprint 1) + (mh-interactive-range "Print"))) + (mh-iterate-on-range msg range + (let ((buffer (get-buffer-create mh-temp-buffer))) + (unwind-protect + (mh-ps-spool-a-msg msg buffer) + (kill-buffer buffer))) + (mh-notate nil mh-note-printed mh-cmd-note)) + (ps-despool file)) + +;;;###mh-autoload +(defun mh-ps-print-msg-show (file) + "Print current show buffer to FILE." + (interactive (list (mh-ps-print-preprint current-prefix-arg))) + (message (format "mh-ps-print-msg-show file %s keys %s mh-show-buffer %s" + file (this-command-keys) mh-show-buffer)) + (let ((msg (mh-get-msg-num t)) + (folder mh-current-folder) + (show-buffer mh-show-buffer) + (show-window (get-buffer-window mh-show-buffer))) + (if (and show-buffer show-window) + (mh-in-show-buffer (show-buffer) + (if (equal (mh-msg-filename msg folder) buffer-file-name) + (progn + (mh-ps-spool-buffer show-buffer) + (ps-despool file)) + (message "Current message is not being shown(1)."))) + (message "Current message is not being shown(2).")))) + +;;;###mh-autoload +(defun mh-ps-print-toggle-faces () + "Toggle whether printing is done with faces or not." + (interactive) + (if (eq mh-ps-print-func 'ps-spool-buffer-with-faces) + (progn + (setq mh-ps-print-func 'ps-spool-buffer) + (message "Printing without faces")) + (setq mh-ps-print-func 'ps-spool-buffer-with-faces) + (message "Printing with faces"))) + +;;;###mh-autoload +(defun mh-ps-print-toggle-color () + "Toggle whether color is used in printing messages." + (interactive) + (if (eq mh-ps-print-color-option nil) + (progn + (setq mh-ps-print-color-option 'black-white) + (message "Colors will be printed as black & white.")) + (if (eq mh-ps-print-color-option 'black-white) + (progn + (setq mh-ps-print-color-option t) + (message "Colors will be printed.")) + (setq mh-ps-print-color-option nil) + (message "Colors will not be printed.")))) + +;;; XXX: Check option 3. Documentation doesn't sound right. +;;;###mh-autoload +(defun mh-ps-print-toggle-mime () + "Cycle through available choices on how MIME parts should be printed. +The available settings are: + 1. Print only inline MIME parts. + 2. Print all MIME parts. + 3. Print no MIME parts." + (interactive) + (if (eq mh-ps-print-mime nil) + (progn + (setq mh-ps-print-mime t) + (message "Inline parts will be printed, attachments will not be printed.")) + (if (eq mh-ps-print-mime t) + (progn + (setq mh-ps-print-mime 1) + (message "Both Inline parts and attachments will be printed.")) + (setq mh-ps-print-mime nil) + (message "Neither inline parts nor attachments will be printed.")))) + +;;; Old non-PS based printing +;;;###mh-autoload +(defun mh-print-msg (range) + "Print RANGE on printer. + +Check the documentation of `mh-interactive-range' to see how RANGE is read in +interactive use. + +The variable `mh-lpr-command-format' is used to generate the print command. +The messages are formatted by mhl. See the variable `mhl-formfile'." + (interactive (list (mh-interactive-range "Print"))) + (message "Printing...") + (let (msgs) + ;; Gather message numbers and add them to "printed" sequence. + (mh-iterate-on-range msg range + (mh-add-msgs-to-seq msg 'printed t) + (mh-notate nil mh-note-printed mh-cmd-note) + (push msg msgs)) + (setq msgs (nreverse msgs)) + ;; Print scan listing if we have more than one message. + (if (> (length msgs) 1) + (let* ((msgs-string + (mapconcat 'identity (mh-list-to-string + (mh-coalesce-msg-list msgs)) " ")) + (lpr-command + (format mh-lpr-command-format + (cond ((listp range) + (format "Folder: %s, Messages: %s" + mh-current-folder msgs-string)) + ((symbolp range) + (format "Folder: %s, Sequence: %s" + mh-current-folder range))))) + (scan-command + (format "scan %s | %s" msgs-string lpr-command))) + (if mh-print-background-flag + (mh-exec-cmd-daemon shell-file-name nil "-c" scan-command) + (call-process shell-file-name nil nil nil "-c" scan-command)))) + ;; Print the messages + (dolist (msg msgs) + (let* ((mhl-command (format "%s %s %s" + (expand-file-name "mhl" mh-lib-progs) + (if mhl-formfile + (format " -form %s" mhl-formfile) + "") + (mh-msg-filename msg))) + (lpr-command + (format mh-lpr-command-format + (format "%s/%s" mh-current-folder msg))) + (print-command + (format "%s | %s" mhl-command lpr-command))) + (if mh-print-background-flag + (mh-exec-cmd-daemon shell-file-name nil "-c" print-command) + (call-process shell-file-name nil nil nil "-c" print-command))))) + (message "Printing...done")) + +(provide 'mh-print) + +;;; Local Variables: +;;; indent-tabs-mode: nil +;;; sentence-end-double-space: nil +;;; End: + +;;; mh-print.el ends here From b22103fe010f91ae13ce100a74a1576ef86e501a Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 16 Aug 2004 03:48:53 +0000 Subject: [PATCH 138/341] Add arch taglines --- lisp/mh-e/mh-acros.el | 1 + lisp/mh-e/mh-init.el | 1 + lisp/mh-e/mh-print.el | 1 + 3 files changed, 3 insertions(+) diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el index e07eb6e4ed1..c409cf8d36e 100644 --- a/lisp/mh-e/mh-acros.el +++ b/lisp/mh-e/mh-acros.el @@ -139,4 +139,5 @@ various structure fields. Lookup `defstruct' for more details." ;;; sentence-end-double-space: nil ;;; End: +;; arch-tag: b383b49a-494f-4ed0-a30a-cb6d5d2da4ff ;;; mh-acros.el ends here diff --git a/lisp/mh-e/mh-init.el b/lisp/mh-e/mh-init.el index 7011070a2d8..ac7305fa217 100644 --- a/lisp/mh-e/mh-init.el +++ b/lisp/mh-e/mh-init.el @@ -304,4 +304,5 @@ by the variable `mh-variants'." ;;; sentence-end-double-space: nil ;;; End: +;; arch-tag: e8372aeb-d803-42b1-9c95-3c93ad22f63c ;;; mh-init.el ends here diff --git a/lisp/mh-e/mh-print.el b/lisp/mh-e/mh-print.el index 83feae3c528..7539e455919 100644 --- a/lisp/mh-e/mh-print.el +++ b/lisp/mh-e/mh-print.el @@ -275,4 +275,5 @@ The messages are formatted by mhl. See the variable `mhl-formfile'." ;;; sentence-end-double-space: nil ;;; End: +;; arch-tag: 8d84d50b-2a49-4d0d-b51e-ba9c9b6fc679 ;;; mh-print.el ends here From 5d38808271763fa13da9ee6079cef7289abb409f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 16 Aug 2004 12:03:15 +0000 Subject: [PATCH 139/341] ("georgian"): Call quail-define-package with the show-layout arg t. --- leim/quail/georgian.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leim/quail/georgian.el b/leim/quail/georgian.el index d823b2c4cd9..9a08ff5ef42 100644 --- a/leim/quail/georgian.el +++ b/leim/quail/georgian.el @@ -34,7 +34,7 @@ (quail-define-package "georgian" "Georgian" "გ" t "A common Georgian transliteration (using Unicode)" - nil t nil nil nil nil nil nil nil nil t) + nil t nil nil t nil nil nil nil nil t) (quail-define-rules ("a" ?áƒ) From 68fbea3aa9bbccdae34f0e52b7f971608bb4d587 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 16 Aug 2004 12:07:15 +0000 Subject: [PATCH 140/341] (ps-mule-font-info-database): Fix docstring. --- lisp/ChangeLog | 4 ++++ lisp/ps-mule.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a3552763a8c..8c6ed8bf189 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-08-16 Kenichi Handa + + * ps-mule.el (ps-mule-font-info-database): Fix docstring. + 2004-08-15 Kenichi Handa * term/x-win.el (x-selection-value): If utf8 was successful but diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el index 1d13358f53d..4b41c41b69c 100644 --- a/lisp/ps-mule.el +++ b/lisp/ps-mule.el @@ -273,7 +273,7 @@ CHARSET is a charset (symbol) for this font family, FONT-TYPE is a font type: normal, bold, italic, or bold-italic. -FONT-SRC is a font source: builtin, ps-bdf, vflib, or nil. +FONT-SRC is a font source: builtin, bdf, vflib, or nil. If FONT-SRC is builtin, FONT-NAME is a built-in PostScript font name. From 3eec7894d4839a4a642c8e46b9e34ea2d003f88b Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 16 Aug 2004 12:50:25 +0000 Subject: [PATCH 141/341] (isearch-string, isearch-message-string, isearch-point) (isearch-success, isearch-forward-flag, isearch-other-end) (isearch-word, isearch-invalid-regexp, isearch-wrapped) (isearch-barrier, isearch-within-brackets) (isearch-case-fold-search): Fix broken `nth'-like calls to `aref'. From Davis Herring . --- lisp/isearch.el | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 3ec972a39ec..2c20d45bbd8 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -778,40 +778,40 @@ REGEXP says which ring to use." (defsubst isearch-string (frame) "Return the search string in FRAME." - (aref 0 frame)) + (aref frame 0)) (defsubst isearch-message-string (frame) "Return the search string to display to the user in FRAME." - (aref 1 frame)) + (aref frame 1)) (defsubst isearch-point (frame) "Return the point in FRAME." - (aref 2 frame)) + (aref frame 2)) (defsubst isearch-success (frame) "Return the success flag in FRAME." - (aref 3 frame)) + (aref frame 3)) (defsubst isearch-forward-flag (frame) "Return the searching-forward flag in FRAME." - (aref 4 frame)) + (aref frame 4)) (defsubst isearch-other-end (frame) "Return the other end of the match in FRAME." - (aref 5 frame)) + (aref frame 5)) (defsubst isearch-word (frame) "Return the search-by-word flag in FRAME." - (aref 6 frame)) + (aref frame 6)) (defsubst isearch-invalid-regexp (frame) "Return the regexp error message in FRAME, or nil if its regexp is valid." - (aref 7 frame)) + (aref frame 7)) (defsubst isearch-wrapped (frame) "Return the search-wrapped flag in FRAME." - (aref 8 frame)) + (aref frame 8)) (defsubst isearch-barrier (frame) "Return the barrier value in FRAME." - (aref 9 frame)) + (aref frame 9)) (defsubst isearch-within-brackets (frame) "Return the in-character-class flag in FRAME." - (aref 10 frame)) + (aref frame 10)) (defsubst isearch-case-fold-search (frame) "Return the case-folding flag in FRAME." - (aref 11 frame)) + (aref frame 11)) (defun isearch-top-state () (let ((cmd (car isearch-cmds))) From be3a95100e96913a6dfac355bf6a436e2587308c Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 16 Aug 2004 13:03:52 +0000 Subject: [PATCH 142/341] *** empty log message *** --- lisp/ChangeLog | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8c6ed8bf189..5c2d7d10e65 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2004-08-16 Davis Herring + + * isearch.el (isearch-string, isearch-message-string, isearch-point) + (isearch-success, isearch-forward-flag, isearch-other-end) + (isearch-word, isearch-invalid-regexp, isearch-wrapped) + (isearch-barrier, isearch-within-brackets) + (isearch-case-fold-search): Fix broken `nth'-like calls to `aref'. + 2004-08-16 Kenichi Handa * ps-mule.el (ps-mule-font-info-database): Fix docstring. @@ -23,11 +31,10 @@ (isearch-*-char, isearch-|-char): Now just call `isearch-fallback' appropriately. (isearch-mode-map): Bind `}' to `isearch-}-char'. - (isearch-string, isearch-message,string, isearch-point, - isearch-success, isearch-forward-flag, isearch-other-end, - isearch-word, isearch-invalid-regexp, isearch-wrapped, - isearch-barrier, isearch-within-brackets, - isearch-case-fold-search): + (isearch-string, isearch-message,string, isearch-point) + (isearch-success, isearch-forward-flag, isearch-other-end) + (isearch-word, isearch-invalid-regexp, isearch-wrapped) + (isearch-barrier, isearch-within-brackets, isearch-case-fold-search): New inline functions to read fields of a stack frame. 2004-08-14 Kurt Hornik (tiny change) From 9a69579e35eded8550448022462c6221cf044d84 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:40:47 +0000 Subject: [PATCH 143/341] Several doc fixes: don't say variables are buffer-local. --- lisp/imenu.el | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lisp/imenu.el b/lisp/imenu.el index 238adfe9505..1c82fcacf34 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -211,8 +211,6 @@ menu. See the info section on Regexps for more information. INDEX points to the substring in REGEXP that contains the name (of the function, variable or type) that is to appear in the menu. -The variable is buffer-local. - The variable `imenu-case-fold-search' determines whether or not the regexp matches are case sensitive, and `imenu-syntax-alist' can be used to alter the syntax table for the search. @@ -240,9 +238,7 @@ A nested sub-alist element looks like (INDEX-NAME SUB-ALIST). The function `imenu--subalist-p' tests an element and returns t if it is a sub-alist. -This function is called within a `save-excursion'. - -The variable is buffer-local.") +This function is called within a `save-excursion'.") ;;;###autoload (make-variable-buffer-local 'imenu-create-index-function) @@ -977,8 +973,7 @@ A trivial interface to `imenu-add-to-menubar' suitable for use in a hook." (defvar imenu-buffer-menubar nil) (defvar imenu-menubar-modified-tick 0 - "The value of (buffer-modified-tick) as of last call to `imenu-update-menubar'. -This value becomes local in every buffer when it is set.") + "The value of (buffer-modified-tick) as of last call to `imenu-update-menubar'.") (make-variable-buffer-local 'imenu-menubar-modified-tick) (defun imenu-update-menubar () From 35985318379a1fe30f91fb797757ea722f402b3e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:41:56 +0000 Subject: [PATCH 144/341] (term-default-fg-color, term-default-bg-color) (ansi-term-color-vector): Use `unspecified', not nil, as default. --- lisp/term.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/term.el b/lisp/term.el index f1bd8d9a4f6..9866db7e29c 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -705,18 +705,18 @@ Buffer local variable.") ;;; faces -mm -(defcustom term-default-fg-color nil +(defcustom term-default-fg-color 'unspecified "Default color for foreground in `term'." :group 'term :type 'string) -(defcustom term-default-bg-color nil +(defcustom term-default-bg-color 'unspecified "Default color for background in `term'." :group 'term :type 'string) (defvar ansi-term-color-vector - [nil "black" "red" "green" "yellow" "blue" + [unspecified "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white"]) ;;; Inspiration came from comint.el -mm @@ -3080,8 +3080,7 @@ See `term-prompt-regexp'." (setq term-current-face (append '(:underline t) term-current-face)))))) -; (message "Debug %S" term-current-face) - +;;; (message "Debug %S" term-current-face) (setq term-ansi-face-already-done 0)) From 693118160404cef460e0db29953176d67a8aa29a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:43:09 +0000 Subject: [PATCH 145/341] (copyright-years-regexp): New variable. (copyright-update-year): Detect continuation of list of years. --- lisp/emacs-lisp/copyright.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 6a95c60f859..4ed82d22239 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -54,6 +54,13 @@ The second \\( \\) construct must match the years." :group 'copyright :type 'regexp) +(defcustom copyright-years-regexp + "\\(\\s *\\)\\([1-9]\\([-0-9, ';/*%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" + "*Match additional copyright notice years. +The second \\( \\) construct must match the years." + :group 'copyright + :type 'regexp) + (defcustom copyright-query 'function "*If non-nil, ask user before changing copyright. @@ -77,6 +84,23 @@ When this is `function', only ask when called non-interactively." (defun copyright-update-year (replace noquery) (when (re-search-forward copyright-regexp (+ (point) copyright-limit) t) + ;; If the years are continued onto multiple lined + ;; that are marked as comments, skip to the end of the years anyway. + (while (save-excursion + (and (eq (following-char) ?,) + (progn (forward-char 1) t) + (progn (skip-chars-forward " \t") (eolp)) + comment-start-skip + (save-match-data + (forward-line 1) + (and (looking-at comment-start-skip) + (goto-char (match-end 0)))) + (save-match-data + (looking-at copyright-years-regexp)))) + (forward-line 1) + (re-search-forward comment-start-skip) + (re-search-forward copyright-years-regexp)) + ;; Note that `current-time-string' isn't locale-sensitive. (setq copyright-current-year (substring (current-time-string) -4)) (unless (string= (buffer-substring (- (match-end 2) 2) (match-end 2)) From 06f308a7e2a68c82627b1dc5fb1f0e760f7a52d0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:44:11 +0000 Subject: [PATCH 146/341] (eval-last-sexp): Don't cons a new symbol each time. (eval-last-sexp-fake-value): New variable. --- lisp/emacs-lisp/lisp-mode.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d471ad79538..df05555ae7b 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -555,13 +555,15 @@ With argument, print output into current buffer." )))) +(defvar eval-last-sexp-fake-value (make-symbol "t")) + (defun eval-last-sexp (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in minibuffer. Interactively, with prefix argument, print output into current buffer." (interactive "P") (if (null eval-expression-debug-on-error) (eval-last-sexp-1 eval-last-sexp-arg-internal) - (let ((old-value (make-symbol "t")) new-value value) + (let ((old-value eval-last-sexp-fake-value) new-value value) (let ((debug-on-error old-value)) (setq value (eval-last-sexp-1 eval-last-sexp-arg-internal)) (setq new-value debug-on-error)) From 8ff2ed527d8c7164a110f1cae9cd3f0140751f8b Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:44:56 +0000 Subject: [PATCH 147/341] (compilation-mode): Doc fix. --- lisp/progmodes/compile.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 033ce883e5f..32fa246b9f6 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1101,7 +1101,9 @@ from a different message." move point to the error message line and type \\[compile-goto-error]. To kill the compilation, type \\[kill-compilation]. -Runs `compilation-mode-hook' with `run-hooks' (which see)." +Runs `compilation-mode-hook' with `run-hooks' (which see). + +\\{compilation-mode-map}" (interactive) (kill-all-local-variables) (use-local-map compilation-mode-map) From 8a0d0722d825f1ca08ac04a5aa2f59e43d60d31b Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:45:52 +0000 Subject: [PATCH 148/341] (sh-set-shell): Use sh-mode-abbrev-table. (sh-mode-abbrev-table): New variable. --- lisp/progmodes/sh-script.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index f47ca3a73d4..cef86f8f90e 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -353,6 +353,11 @@ the car and cdr are the same symbol.") (defvar sh-shell (sh-canonicalize-shell (file-name-nondirectory sh-shell-file)) "The shell being programmed. This is set by \\[sh-set-shell].") +(defvar sh-mode-abbrev-table nil) + +(define-abbrev-table 'sh-mode-abbrev-table ()) + + ;; I turned off this feature because it doesn't permit typing commands ;; in the usual way without help. ;;(defvar sh-abbrevs @@ -1483,7 +1488,7 @@ Calls the value of `sh-set-shell-hook' if set." (setq require-final-newline tem))) (setq comment-start-skip "#+[\t ]*" -;;; local-abbrev-table (sh-feature sh-abbrevs) + local-abbrev-table sh-mode-abbrev-table mode-line-process (format "[%s]" sh-shell) sh-shell-variables nil sh-shell-variables-initialized nil From a03748044a92bd693fe81c40651b77bfa69a67c4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:46:26 +0000 Subject: [PATCH 149/341] (which-func-update-1): Doc fix. --- lisp/progmodes/which-func.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 87df0769314..845c995371d 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -186,7 +186,7 @@ It creates the Imenu index for the buffer, if necessary." (which-func-update-1 (selected-window))) (defun which-func-update-1 (window) - "Update the Which-Function mode display for window WINDOW." + "Update the Which Function mode display for window WINDOW." (with-selected-window window (when which-func-mode (condition-case info From 6f368e2d1cfb2e1bee4587d6b803d3721ec12e45 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:48:22 +0000 Subject: [PATCH 150/341] (Non-ASCII Rebinding): C-q always inserts the right code to pass to global-set-key. --- man/custom.texi | 43 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/man/custom.texi b/man/custom.texi index ce52431f3c6..aa5b35dc43e 100644 --- a/man/custom.texi +++ b/man/custom.texi @@ -1619,14 +1619,13 @@ because the terminal sends the same character in both cases. @cindex rebinding non-@acronym{ASCII} keys @cindex non-@acronym{ASCII} keys, binding -If your keyboard has keys that send non-@acronym{ASCII} characters, such as -accented letters, rebinding these keys is a bit tricky. There are two -solutions you can use. One is to specify a keyboard coding system, -using @code{set-keyboard-coding-system} (@pxref{Specify Coding}). -Then you can bind these keys in the usual way@footnote{Note that you -should avoid the string syntax for binding 8-bit characters, since -they will be interpreted as meta keys. @xref{Strings of -Events,,,elisp, The Emacs Lisp Reference Manual}.}, like this: +If your keyboard has keys that send non-@acronym{ASCII} +characters, such as accented letters, rebinding these keys +must be done by using a vector like this@footnote{Note that +you should avoid the string syntax for binding +non-@acronym{ASCII} characters, since they will be +interpreted as meta keys. @xref{Strings of Events,,,elisp, +The Emacs Lisp Reference Manual}.}: @example (global-set-key [?@var{char}] 'some-function) @@ -1635,27 +1634,15 @@ Events,,,elisp, The Emacs Lisp Reference Manual}.}, like this: @noindent Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}. -Since this puts a non-@acronym{ASCII} character in the @file{.emacs}, you should -specify the proper coding system for that file. @xref{Init Syntax}. -Specify the same coding system for the file that you use for your -keyboard. +Since this puts a non-@acronym{ASCII} character in the @file{.emacs}, +you should specify the proper coding system for that file. @xref{Init +Syntax}. You should specify the same coding system for the file that +you use for your keyboard. -If you don't specify a keyboard coding system, that approach won't -work. Instead, you need to find out the actual code that the terminal -sends. The easiest way to do this in Emacs is to create an empty -buffer with @kbd{C-x b temp @key{RET}}, make it unibyte with @kbd{M-x -toggle-enable-multibyte-characters @key{RET}}, then type the key to -insert the character into this buffer. - -Move point before the character, then type @kbd{C-x =}. This -displays a message in the minibuffer, showing the character code in -three ways, octal, decimal and hexadecimal, all within a set of -parentheses. Use the second of the three numbers, the decimal one, -inside the vector to bind: - -@example -(global-set-key [@var{decimal-code}] 'some-function) -@end example +@strong{Warning:} if you change the keyboard encoding, or change +from unibyte to multibyte mode, such that the code that +@kbd{C-q} inserts becomes different, you'll need to edit the +Lisp expression accordingly. If you bind 8-bit characters like this in your init file, you may find it convenient to specify that it is unibyte. @xref{Enabling Multibyte}. From a401596d50cc830dbd04c574fa0f5472165732c9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:49:16 +0000 Subject: [PATCH 151/341] (Momentary Mark): Minor cleanups. --- man/mark.texi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/man/mark.texi b/man/mark.texi index 414fa470348..b4154f9c3ae 100644 --- a/man/mark.texi +++ b/man/mark.texi @@ -247,20 +247,20 @@ command twice.) @item C-u C-x C-x @kindex C-u C-x C-x -Activate the mark without changing it, enable Transient Mark mode just -once until the mark is deactivated. (This is the @kbd{C-x C-x} command, -@code{exchange-point-and-mark}, with a prefix argument.) +Activate the mark without changing it; enable Transient Mark mode just +once, until the mark is deactivated. (This is the @kbd{C-x C-x} +command, @code{exchange-point-and-mark}, with a prefix argument.) @end table One of the secondary features of Transient Mark mode is that certain -commands operate on the region when there is an active region. If you -don't use Transient Mark mode, the region once set never becomes -inactive, so there is no way these commands to make such a +commands operate only on the region, when there is an active region. +If you don't use Transient Mark mode, the region once set never +becomes inactive, so there is no way for these commands to make such a distinction. Enabling Transient Mark mode momentarily gives you a way to use these commands on the region. - The other way momentarily use of Transient Mark mode is useful -is that it highlights the region for the time being. + Momentary use of Transient Mark mode is also a way to highlight the +region for the time being. @node Using Region @section Operating on the Region From b3ada79133ad045690d1b48a40cbddb40d2c612a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:50:44 +0000 Subject: [PATCH 152/341] (Yanking, Killing): Minor cleanups. --- man/killing.texi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/man/killing.texi b/man/killing.texi index 60b5129389d..b5f1ce30772 100644 --- a/man/killing.texi +++ b/man/killing.texi @@ -31,8 +31,8 @@ one buffer and yank it in another buffer. @cindex killing text @cindex cutting text @cindex deletion - Most commands which erase text from the buffer save it in the kill -ring so that you can move or copy it to other parts of the buffer. + Most commands which erase text from the buffer save it in the @dfn{kill +ring} so that you can move or copy it to other parts of the buffer. These commands are known as @dfn{kill} commands. The rest of the commands that erase text do not save it in the kill ring; they are known as @dfn{delete} commands. (This distinction is made only for erasure of @@ -274,7 +274,8 @@ single kill ring entry as usual. @dfn{Yanking} means reinserting text previously killed. This is what some systems call ``pasting.'' The usual way to move or copy text is to -kill it and then yank it elsewhere one or more times. +kill it and then yank it elsewhere one or more times. This is very safe +because Emacs remembers many recent kills, not just the last one. @table @kbd @item C-y From 97d8f112efe9d0b1d5e6f56a6f6eaaec1900df9f Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:52:29 +0000 Subject: [PATCH 153/341] (move_if_not_intangible): Force POSITION to be between BEGV and ZV. --- src/intervals.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/intervals.c b/src/intervals.c index 33ef9a34177..a822dafefcf 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -2275,6 +2275,10 @@ move_if_not_intangible (position) pos = Fnext_char_property_change (pos, Qnil); } + else if (position < BEGV) + position = BEGV; + else if (position > ZV) + position = ZV; /* If the whole stretch between PT and POSITION isn't intangible, try moving to POSITION (which means we actually move farther From d9639b25df7ed0391cd652ba7fb771a049d93822 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:53:28 +0000 Subject: [PATCH 154/341] (merge_face_ref): Specifying `unspecified' is a no-op. --- src/xfaces.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xfaces.c b/src/xfaces.c index f78ecacee1a..aafd762b73b 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -3626,7 +3626,10 @@ merge_face_ref (f, face_ref, to, err_msgs, named_merge_points) Lisp_Object value = XCAR (XCDR (face_ref)); int err = 0; - if (EQ (keyword, QCfamily)) + /* Specifying `unspecified' is a no-op. */ + if (EQ (value, Qunspecified)) + ; + else if (EQ (keyword, QCfamily)) { if (STRINGP (value)) to[LFACE_FAMILY_INDEX] = value; From 7f916a363e63bdf1874c4f877ec33ec680b5c1b0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 22:57:26 +0000 Subject: [PATCH 155/341] (process_send_signal) [SIGNALS_VIA_CHARACTERS, HAVE_TERMIOS]: Clean up. Do nothing if the character is CVDISABLE. --- src/process.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/process.c b/src/process.c index 5e83214f4f9..3c8aca9560e 100644 --- a/src/process.c +++ b/src/process.c @@ -5549,29 +5549,32 @@ process_send_signal (process, signo, current_group, nomsg) work. If the system has it, use it. */ #ifdef HAVE_TERMIOS struct termios t; + cc_t *sig_char = NULL; + + tcgetattr (XINT (p->infd), &t); switch (signo) { case SIGINT: - tcgetattr (XINT (p->infd), &t); - send_process (proc, &t.c_cc[VINTR], 1, Qnil); - return; + sig_char = &t.c_cc[VINTR]; + break; case SIGQUIT: - tcgetattr (XINT (p->infd), &t); - send_process (proc, &t.c_cc[VQUIT], 1, Qnil); - return; + sig_char = &t.c_cc[VQUIT]; + break; case SIGTSTP: - tcgetattr (XINT (p->infd), &t); #if defined (VSWTCH) && !defined (PREFER_VSUSP) - send_process (proc, &t.c_cc[VSWTCH], 1, Qnil); + sig_char = &t.c_cc[VSWTCH]; #else - send_process (proc, &t.c_cc[VSUSP], 1, Qnil); + sig_char = &t.c_cc[VSUSP]; #endif - return; + break; } + if (sig_char && *sig_char != CVDISABLE) + send_process (proc, sig_char, 1, Qnil); + return; #else /* ! HAVE_TERMIOS */ /* On Berkeley descendants, the following IOCTL's retrieve the From dfe598b54e166b5fa9803a39ad8dfff538041899 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 23:02:19 +0000 Subject: [PATCH 156/341] (child_setup_tty) [SIGNALS_VIA_CHARACTERS]: Set VQUIT and VINTR chars to the standard ones if they are unset. [AIX]: Don't do that here. And don't force VINTR to standard when SIGNALS_VIA_CHARACTERS. --- src/sysdep.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/sysdep.c b/src/sysdep.c index d5236a3f88a..7ffb2bb7db5 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -610,6 +610,15 @@ child_setup_tty (out) s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */ #endif /* HPUX */ +#ifdef SIGNALS_VIA_CHARACTERS + /* the QUIT and INTR character are used in process_send_signal + so set them here to something useful. */ + if (s.main.c_cc[VQUIT] == 0377) + s.main.c_cc[VQUIT] = '\\'&037; /* Control-\ */ + if (s.main.c_cc[VINTR] == 0377) + s.main.c_cc[VINTR] = 'C'&037; /* Control-C */ +#endif /* not SIGNALS_VIA_CHARACTERS */ + #ifdef AIX /* AIX enhanced edit loses NULs, so disable it */ #ifndef IBMR2AIX @@ -620,16 +629,10 @@ child_setup_tty (out) don't ignore break, but don't signal either, so it looks like NUL. */ s.main.c_iflag &= ~IGNBRK; s.main.c_iflag &= ~BRKINT; - /* QUIT and INTR work better as signals, so disable character forms */ - s.main.c_cc[VINTR] = 0377; -#ifdef SIGNALS_VIA_CHARACTERS - /* the QUIT and INTR character are used in process_send_signal - so set them here to something useful. */ - if (s.main.c_cc[VQUIT] == 0377) - s.main.c_cc[VQUIT] = '\\'&037; /* Control-\ */ - if (s.main.c_cc[VINTR] == 0377) - s.main.c_cc[VINTR] = 'C'&037; /* Control-C */ -#else /* no TIOCGPGRP or no TIOCGLTC or no TIOCGETC */ + /* rms: Formerly it set s.main.c_cc[VINTR] to 0377 here + unconditionally. Then a SIGNALS_VIA_CHARACTERS conditional + would force it to 0377. That looks like duplicated code. */ +#ifndef SIGNALS_VIA_CHARACTERS /* QUIT and INTR work better as signals, so disable character forms */ s.main.c_cc[VQUIT] = 0377; s.main.c_cc[VINTR] = 0377; From 8afc13c66a1bd5a569e5179583b06bccd6746020 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 16 Aug 2004 23:02:46 +0000 Subject: [PATCH 157/341] *** empty log message *** --- lisp/ChangeLog | 21 +++++++++++++++++++++ man/ChangeLog | 11 +++++++++++ src/ChangeLog | 20 ++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5c2d7d10e65..eb23145c207 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,24 @@ +2004-08-16 Richard M. Stallman + + * progmodes/which-func.el (which-func-update-1): Doc fix. + + * progmodes/sh-script.el (sh-set-shell): Use sh-mode-abbrev-table. + (sh-mode-abbrev-table): New variable. + + * progmodes/compile.el (compilation-mode): Doc fix. + + * emacs-lisp/lisp-mode.el (eval-last-sexp): + Don't cons a new symbol each time. + (eval-last-sexp-fake-value): New variable. + + * emacs-lisp/copyright.el (copyright-years-regexp): New variable. + (copyright-update-year): Detect continuation of list of years. + + * term.el (term-default-fg-color, term-default-bg-color) + (ansi-term-color-vector): Use `unspecified', not nil, as default. + + * imenu.el: Several doc fixes: don't say variables are buffer-local. + 2004-08-16 Davis Herring * isearch.el (isearch-string, isearch-message-string, isearch-point) diff --git a/man/ChangeLog b/man/ChangeLog index 541ac26f3a9..bfa31da0332 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,14 @@ +2004-08-16 Richard M. Stallman + + * killing.texi (Yanking, Killing): Minor cleanups. + + * mark.texi (Momentary Mark): Minor cleanups. + +2004-08-15 Kenichi Handa + + * custom.texi (Non-ASCII Rebinding): + C-q always inserts the right code to pass to global-set-key. + 2004-08-14 Eli Zaretskii * Makefile.in (../info/tramp, tramp.dvi): Depend on trampver.texi. diff --git a/src/ChangeLog b/src/ChangeLog index dc39a6d24b9..ba43b4754ba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2004-08-16 Richard M. Stallman + + * sysdep.c (child_setup_tty) [SIGNALS_VIA_CHARACTERS]: + Set VQUIT and VINTR chars to the standard ones if they are unset. + [AIX]: Don't do that here. And don't force VINTR to standard + when SIGNALS_VIA_CHARACTERS. + + * process.c (process_send_signal) + [SIGNALS_VIA_CHARACTERS, HAVE_TERMIOS]: Clean up. + Do nothing if the character is CVDISABLE. + + * xfaces.c (merge_face_ref): Specifying `unspecified' is a no-op. + + * intervals.c (move_if_not_intangible): + Force POSITION to be between BEGV and ZV. + 2004-08-14 John Paul Wallington * buffer.c (Frestore_buffer_modified_p): Doc fix. @@ -74,6 +90,10 @@ * callint.c (Fcall_interactively): Doc fix. +2004-07-30 Richard M. Stallman + + * abbrev.c (Fexpand_abbrev): Undo previous change. + 2004-07-30 Kim F. Storm * editfns.c (Fformat): Allocate extra (dummy) element in info. From ee1fcbddee2f787cfdb1c824f6f22a0d71c87c9e Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Tue, 17 Aug 2004 09:58:06 +0000 Subject: [PATCH 158/341] (reb-mode-map): Define within defvar. (reb-force-update): Doc fix. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/re-builder.el | 30 ++++++++++++++---------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eb23145c207..4501d08b4d2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-17 John Paul Wallington + + * emacs-lisp/re-builder.el (reb-mode-map): Define within defvar. + (reb-force-update): Doc fix. + 2004-08-16 Richard M. Stallman * progmodes/which-func.el (which-func-update-1): Doc fix. diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 6eb1ffa2e54..77a12167c30 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -45,7 +45,7 @@ ;; call `reb-force-update' ("\C-c\C-u") which should reveal the error. ;; The target buffer can be changed with `reb-change-target-buffer' -;; ("\C-c\C-b"). Changing the target buffer automatically removes +;; ("\C-c\C-b"). Changing the target buffer automatically removes ;; the overlays from the old buffer and displays the new one in the ;; target window. @@ -229,22 +229,20 @@ Except for Lisp syntax this is the same as `reb-regexp'.") "Buffer to use for the RE Builder.") ;; Define the local "\C-c" keymap -(defvar reb-mode-map nil +(defvar reb-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-c\C-c" 'reb-toggle-case) + (define-key map "\C-c\C-q" 'reb-quit) + (define-key map "\C-c\C-w" 'reb-copy) + (define-key map "\C-c\C-s" 'reb-next-match) + (define-key map "\C-c\C-r" 'reb-prev-match) + (define-key map "\C-c\C-i" 'reb-change-syntax) + (define-key map "\C-c\C-e" 'reb-enter-subexp-mode) + (define-key map "\C-c\C-b" 'reb-change-target-buffer) + (define-key map "\C-c\C-u" 'reb-force-update) + map) "Keymap used by the RE Builder.") -(if (not reb-mode-map) - (progn - (setq reb-mode-map (make-sparse-keymap)) - (define-key reb-mode-map "\C-c\C-c" 'reb-toggle-case) - (define-key reb-mode-map "\C-c\C-q" 'reb-quit) - (define-key reb-mode-map "\C-c\C-w" 'reb-copy) - (define-key reb-mode-map "\C-c\C-s" 'reb-next-match) - (define-key reb-mode-map "\C-c\C-r" 'reb-prev-match) - (define-key reb-mode-map "\C-c\C-i" 'reb-change-syntax) - (define-key reb-mode-map "\C-c\C-e" 'reb-enter-subexp-mode) - (define-key reb-mode-map "\C-c\C-b" 'reb-change-target-buffer) - (define-key reb-mode-map "\C-c\C-u" 'reb-force-update))) - (defun reb-mode () "Major mode for interactively building Regular Expressions. \\{reb-mode-map}" @@ -367,7 +365,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.") (reb-update-modestring)))) (defun reb-force-update () - "Forces an update in the RE Builder target window without a match limit." + "Force an update in the RE Builder target window without a match limit." (interactive) (let ((reb-auto-match-limit nil)) From be16bf871e21bf4cd7fe495251fbd0869b5df4fb Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 17 Aug 2004 21:59:07 +0000 Subject: [PATCH 159/341] (process_send_signal): Fix last change--use _POSIX_VDISABLE instead of CVDISABLE when available. --- src/process.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/process.c b/src/process.c index 3c8aca9560e..09f55b569dd 100644 --- a/src/process.c +++ b/src/process.c @@ -5572,7 +5572,15 @@ process_send_signal (process, signo, current_group, nomsg) break; } - if (sig_char && *sig_char != CVDISABLE) +#ifndef _POSIX_VDISABLE +#ifdef CVDISABLE +#define _POSIX_VDISABLE CVDISABLE +#else +#define _POSIX_VDISABLE '\0' +#endif +#endif + + if (sig_char && *sig_char != _POSIX_VDISABLE) send_process (proc, sig_char, 1, Qnil); return; #else /* ! HAVE_TERMIOS */ From 107ed38d4bdec03002b2a23619e205722cd5b8d1 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 17 Aug 2004 22:24:29 +0000 Subject: [PATCH 160/341] (Faccept_process_output): Add arg JUST-THIS-ONE; forward to wait_reading_process_input via DO_DISPLAY arg. (wait_reading_process_input): If DO_DISPLAY < 0 for a process object, only process output from that process; also inhibit running timers if DO_DISPLAY==-2. --- src/process.c | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/process.c b/src/process.c index 09f55b569dd..49fef36d41a 100644 --- a/src/process.c +++ b/src/process.c @@ -3718,7 +3718,7 @@ close_process_descs () } DEFUN ("accept-process-output", Faccept_process_output, Saccept_process_output, - 0, 3, 0, + 0, 4, 0, doc: /* Allow any pending output from subprocesses to be read by Emacs. It is read into the process' buffers or given to their filter functions. Non-nil arg PROCESS means do not return until some output has been received @@ -3726,15 +3726,20 @@ from PROCESS. Non-nil second arg TIMEOUT and third arg TIMEOUT-MSECS are number of seconds and microseconds to wait; return after that much time whether or not there is input. +If optional fourth arg JUST-THIS-ONE is non-nil, only accept output +from PROCESS, suspending reading output from other processes. +If JUST-THIS-ONE is an integer, don't run any timers either. Return non-nil iff we received any output before the timeout expired. */) - (process, timeout, timeout_msecs) - register Lisp_Object process, timeout, timeout_msecs; + (process, timeout, timeout_msecs, just_this_one) + register Lisp_Object process, timeout, timeout_msecs, just_this_one; { int seconds; int useconds; if (! NILP (process)) CHECK_PROCESS (process); + else + just_this_one = Qnil; if (! NILP (timeout_msecs)) { @@ -3776,7 +3781,9 @@ Return non-nil iff we received any output before the timeout expired. */) XSETFASTINT (process, 0); return - (wait_reading_process_input (seconds, useconds, process, 0) + (wait_reading_process_input (seconds, useconds, process, + NILP (just_this_one) ? 0 : + !INTEGERP (just_this_one) ? -1 : -2) ? Qt : Qnil); } @@ -4009,8 +4016,11 @@ wait_reading_process_input_1 () process. The return value is true iff we read some input from that process. - DO_DISPLAY != 0 means redisplay should be done to show subprocess - output that arrives. + If READ_KBD is a process object, DO_DISPLAY < 0 means handle only + output from that process (suspending output from other processes) + and DO_DISPLAY == -2 specifically means don't run any timers either. + Otherwise, != 0 means redisplay should be done to show subprocess + output that arrives. If READ_KBD is a pointer to a struct Lisp_Process, then the function returns true iff we received input from that process @@ -4032,6 +4042,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) EMACS_TIME timeout, end_time; int wait_channel = -1; struct Lisp_Process *wait_proc = 0; + int just_wait_proc = 0; int got_some_input = 0; /* Either nil or a cons cell, the car of which is of interest and may be changed outside of this routine. */ @@ -4048,6 +4059,11 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) wait_proc = XPROCESS (read_kbd); wait_channel = XINT (wait_proc->infd); XSETFASTINT (read_kbd, 0); + if (do_display < 0) + { + just_wait_proc = do_display; + do_display = 0; + } } /* If waiting for non-nil in a cell, record where. */ @@ -4122,7 +4138,8 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) But not if wait_for_cell; in those cases, the wait is supposed to be short, and those callers cannot handle running arbitrary Lisp code here. */ - if (NILP (wait_for_cell)) + if (NILP (wait_for_cell) + && just_wait_proc != -2) { EMACS_TIME timer_delay; @@ -4258,7 +4275,12 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) /* Wait till there is something to do */ - if (!NILP (wait_for_cell)) + if (just_wait_proc) + { + FD_SET (XINT (wait_proc->infd), &Available); + check_connect = check_delay = 0; + } + else if (!NILP (wait_for_cell)) { Available = non_process_wait_mask; check_connect = check_delay = 0; From c438dc33d55cc4d9034a885d3c11f1e7de238db5 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 17 Aug 2004 22:34:56 +0000 Subject: [PATCH 161/341] *** empty log message *** --- lispref/ChangeLog | 5 +++++ src/ChangeLog | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index ed0c2e9d421..3a701aaeb63 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +2004-08-18 Kim F. Storm + + * processes.texi (Accepting Output): Add `just-this-one' arg to + `accept-process-output'. + 2004-08-10 Luc Teirlinck * keymaps.texi: Various changes in addition to: diff --git a/src/ChangeLog b/src/ChangeLog index ba43b4754ba..fa80a4f860a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-08-17 Kim F. Storm + + * process.c (process_send_signal): Fix last change--use + _POSIX_VDISABLE instead of CVDISABLE when available. + 2004-08-16 Richard M. Stallman * sysdep.c (child_setup_tty) [SIGNALS_VIA_CHARACTERS]: @@ -5,13 +10,13 @@ [AIX]: Don't do that here. And don't force VINTR to standard when SIGNALS_VIA_CHARACTERS. - * process.c (process_send_signal) + * process.c (process_send_signal) [SIGNALS_VIA_CHARACTERS, HAVE_TERMIOS]: Clean up. Do nothing if the character is CVDISABLE. * xfaces.c (merge_face_ref): Specifying `unspecified' is a no-op. - * intervals.c (move_if_not_intangible): + * intervals.c (move_if_not_intangible): Force POSITION to be between BEGV and ZV. 2004-08-14 John Paul Wallington From 410bcc31682953f35314402005b1bd75c0cdcda5 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 17 Aug 2004 22:35:13 +0000 Subject: [PATCH 162/341] (Accepting Output): Add `just-this-one' arg to `accept-process-output'. --- lispref/processes.texi | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lispref/processes.texi b/lispref/processes.texi index f580a774ae7..16d7aa96c1d 100644 --- a/lispref/processes.texi +++ b/lispref/processes.texi @@ -1240,7 +1240,7 @@ or terminal input. Occasionally it is useful in a Lisp program to explicitly permit output to arrive at a specific point, or even to wait until output arrives from a process. -@defun accept-process-output &optional process seconds millisec +@defun accept-process-output &optional process seconds millisec just-this-one This function allows Emacs to read pending output from processes. The output is inserted in the associated buffers or given to their filter functions. If @var{process} is non-@code{nil} then this function does @@ -1263,6 +1263,15 @@ Not all operating systems support waiting periods other than multiples of a second; on those that do not, you get an error if you specify nonzero @var{millisec}. +@c Emacs 21.4 feature +If @var{process} is a process, and the argument @var{just-this-one} is +non-nil, only output from that process is handled, suspending output +from other processes until some output has been received from that +process or the timeout expires. If @var{just-this-one} is an integer, +also inhibit running timers. This feature is generally not +recommended, but may be necessary for specific applications, such as +speech synthesis. + The function @code{accept-process-output} returns non-@code{nil} if it did get some output, or @code{nil} if the timeout expired before output arrived. @@ -1664,7 +1673,7 @@ meaning ask the system to allocate an unused port to listen on. @end defun @node Datagrams -@section Datagrams +@section Datagrams @cindex datagrams A datagram connection communicates with individual packets rather @@ -1951,7 +1960,7 @@ the port number. @example (featurep 'make-network-process '(@var{keyword} @var{value})) -@end example +@end example @noindent The result of the first form is @code{t} if it works to specify @@ -1977,7 +1986,7 @@ Non-@code{nil} if the system can select the port for a server. @example (featurep 'make-network-process '@var{keyword}) -@end example +@end example Here are some of the option @var{keyword}s you can test in this way. From bfa96fa20de4659874dd0966eb4ababca7bf78f4 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 17 Aug 2004 22:41:51 +0000 Subject: [PATCH 163/341] (Output from Processes): New var `process-adaptive-read-buffering'. --- lispref/processes.texi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lispref/processes.texi b/lispref/processes.texi index 16d7aa96c1d..ccf8f76d87e 100644 --- a/lispref/processes.texi +++ b/lispref/processes.texi @@ -929,6 +929,16 @@ process and only then specify its buffer or filter function; no output can arrive before you finish, if the code in between does not call any primitive that waits. +@defvar process-adaptive-read-buffering +On some systems, when Emacs reads the output from a subprocess, the +output data is read in very small blocks, potentially resulting in +very poor performance. This behaviour can be remedied to some extent +by setting the variable @var{process-adaptive-read-buffering} to a +non-nil value (the default), as it will automatically delay reading +from such processes, thus allowing them to produce more output before +Emacs tries to read it. +@end defvar + It is impossible to separate the standard output and standard error streams of the subprocess, because Emacs normally spawns the subprocess inside a pseudo-TTY, and a pseudo-TTY has only one output channel. If From 101c421e7ea88d48465415253d15d227c06e1ada Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 17 Aug 2004 22:42:23 +0000 Subject: [PATCH 164/341] *** empty log message *** --- etc/NEWS | 8 +++++++- lispref/ChangeLog | 1 + src/ChangeLog | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 43af2c90549..e966270f4bb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3271,7 +3271,13 @@ and modify elements on this property list. The new low-level functions process-plist and set-process-plist are used to access and replace the entire property list of a process. -??? +*** Function accept-process-output now has an optional fourth arg +`just-this-one'. If non-nil, only output from the specified process +is handled, suspending output from other processes. If value is an +integer, also inhibit running timers. This feature is generally not +recommended, but may be necessary for specific applications, such as +speech synthesis. + *** Adaptive read buffering of subprocess output. On some systems, when emacs reads the output from a subprocess, the diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 3a701aaeb63..4a2314b58dd 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -2,6 +2,7 @@ * processes.texi (Accepting Output): Add `just-this-one' arg to `accept-process-output'. + (Output from Processes): New var `process-adaptive-read-buffering'. 2004-08-10 Luc Teirlinck diff --git a/src/ChangeLog b/src/ChangeLog index fa80a4f860a..9d9c4ee498c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-08-18 Kim F. Storm + + * process.c (Faccept_process_output): Add arg JUST-THIS-ONE; + forward to wait_reading_process_input via DO_DISPLAY arg. + (wait_reading_process_input): If DO_DISPLAY < 0 for a process + object, only process output from that process; also inhibit + running timers if DO_DISPLAY==-2. + 2004-08-17 Kim F. Storm * process.c (process_send_signal): Fix last change--use From 697f502a87969aa238c060e018181c5975da6185 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Wed, 18 Aug 2004 02:11:36 +0000 Subject: [PATCH 165/341] (copyright-update-year): Delete code that replaces 20xy with xy. --- lisp/emacs-lisp/copyright.el | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 4ed82d22239..3d160f54606 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -100,7 +100,7 @@ When this is `function', only ask when called non-interactively." (forward-line 1) (re-search-forward comment-start-skip) (re-search-forward copyright-years-regexp)) - + ;; Note that `current-time-string' isn't locale-sensitive. (setq copyright-current-year (substring (current-time-string) -4)) (unless (string= (buffer-substring (- (match-end 2) 2) (match-end 2)) @@ -124,26 +124,6 @@ When this is `function', only ask when called non-interactively." (eq (char-after (+ (point) size -2)) ?-))) ;; This is a range so just replace the end part. (delete-char size) - ;; Detect if this is using the following shorthand: - ;; (C) 1993, 94, 95, 1998, 2000, 01, 02, 2003 - (if (and - ;; Check that the last year was 4-chars and same century. - (eq size -4) - (equal (buffer-substring (- (point) 4) (- (point) 2)) - (substring copyright-current-year 0 2)) - ;; Check that there are 2-char years as well. - (save-excursion - (re-search-backward "[^0-9][0-9][0-9][^0-9]" - (line-beginning-position) t)) - ;; Make sure we don't remove the first century marker. - (save-excursion - (forward-char size) - (re-search-backward - (concat (buffer-substring (point) (+ (point) 2)) - "[0-9][0-9]") - (line-beginning-position) t))) - ;; Remove the century marker of the last entry. - (delete-region (- (point) 4) (- (point) 2))) ;; Insert a comma with the preferred number of spaces. (insert (save-excursion From 6326f9e56c157d9017bf012be6e4e8720316333b Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Wed, 18 Aug 2004 02:21:00 +0000 Subject: [PATCH 166/341] (Top): Mention "cutting" and "pasting" as synonyms for "killing" and "yanking" in main menu. --- man/emacs.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/emacs.texi b/man/emacs.texi index 893f01e3baf..ad9658ab368 100644 --- a/man/emacs.texi +++ b/man/emacs.texi @@ -158,8 +158,8 @@ Fundamental Editing Commands Important Text-Changing Commands * Mark:: The mark: how to delimit a ``region'' of text. -* Killing:: Killing text. -* Yanking:: Recovering killed text. Moving text. +* Killing:: Killing (cutting) text. +* Yanking:: Recovering killed text. Moving text. (Pasting.) * Accumulating Text:: Other ways of copying text. * Rectangles:: Operating on the text inside a rectangle on the screen. * Registers:: Saving a text string or a location in the buffer. From eacd5edcd3f50db44271fae73dce8949ceb47ca8 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Wed, 18 Aug 2004 02:21:51 +0000 Subject: [PATCH 167/341] *** empty log message *** --- lisp/ChangeLog | 5 +++++ man/ChangeLog | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4501d08b4d2..58ab47fe3f7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-17 Luc Teirlinck + + * emacs-lisp/copyright.el (copyright-update-year): Delete code + that replaces 20xy with xy. + 2004-08-17 John Paul Wallington * emacs-lisp/re-builder.el (reb-mode-map): Define within defvar. diff --git a/man/ChangeLog b/man/ChangeLog index bfa31da0332..3ff412eb881 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2004-08-17 Luc Teirlinck + + * emacs.texi (Top): Mention "cutting" and "pasting" as synonyms + for "killing" and "yanking" in main menu. + 2004-08-16 Richard M. Stallman * killing.texi (Yanking, Killing): Minor cleanups. From 7be5dbd48ee3352bae791560fa259e0a70efb5fe Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 18 Aug 2004 08:53:21 +0000 Subject: [PATCH 168/341] Register koi8-r in ctext-non-standard-encodings-alist. ("Cyrillic-KOI8"): Add ctext-non-standard-encoding. --- lisp/language/cyrillic.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/language/cyrillic.el b/lisp/language/cyrillic.el index dc05f24698a..302929a116b 100644 --- a/lisp/language/cyrillic.el +++ b/lisp/language/cyrillic.el @@ -186,6 +186,13 @@ This works whether or not the table is Unicode-based or (define-coding-system-alias 'koi8 'cyrillic-koi8) (define-coding-system-alias 'cp878 'cyrillic-koi8) +(let ((elt `("koi8-r" koi8-r 1 + ,(get 'cyrillic-koi8-r-encode-table 'translation-table))) + (slot (assoc "koi8-r" ctext-non-standard-encodings-alist))) + (if slot + (setcdr slot (cdr elt)) + (push elt ctext-non-standard-encodings-alist))) + ;; Allow displaying some of KOI & al with an 8859-5-encoded font. We ;; won't bother about the exceptions when encoding the font, since ;; NBSP will fall through below and work anyhow, and we'll have @@ -219,6 +226,7 @@ This works whether or not the table is Unicode-based or 'translation-table)) (coding-system cyrillic-koi8) (coding-priority cyrillic-koi8 cyrillic-iso-8bit) + (ctext-non-standard-encoding "koi8-r") (input-method . "russian-typewriter") (features cyril-util) (unibyte-display . cyrillic-koi8) From a503f8b70c578522a64fdb4e9cbe07362e91f3fa Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 18 Aug 2004 12:22:41 +0000 Subject: [PATCH 169/341] ("Cyrillic-KOI8"): Fix typo. --- lisp/language/cyrillic.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/language/cyrillic.el b/lisp/language/cyrillic.el index 302929a116b..32ad01602e2 100644 --- a/lisp/language/cyrillic.el +++ b/lisp/language/cyrillic.el @@ -226,7 +226,7 @@ This works whether or not the table is Unicode-based or 'translation-table)) (coding-system cyrillic-koi8) (coding-priority cyrillic-koi8 cyrillic-iso-8bit) - (ctext-non-standard-encoding "koi8-r") + (ctext-non-standard-encodings "koi8-r") (input-method . "russian-typewriter") (features cyril-util) (unibyte-display . cyrillic-koi8) From 2b8d823f69bd0dd9f912b9a7535f41bf318f9c37 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Thu, 19 Aug 2004 07:52:01 +0000 Subject: [PATCH 170/341] (elp-results-symname-map): New keymap. (elp-results-jump-to-definition-by-mouse) (elp-results-jump-to-definition, elp-output-insert-symname): New Functions. (elp-output-result): Use elp-output-insert-symname. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/elp.el | 28 +++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 58ab47fe3f7..b0384b9eba4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2004-08-19 Masatake YAMATO + + * emacs-lisp/elp.el (elp-results-symname-map): New keymap. + (elp-results-jump-to-definition-by-mouse) + (elp-results-jump-to-definition, elp-output-insert-symname): New Functions. + (elp-output-result): Use elp-output-insert-symname. + 2004-08-17 Luc Teirlinck * emacs-lisp/copyright.el (copyright-update-year): Delete code diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el index 44400dcaa2c..f8d41f200d2 100644 --- a/lisp/emacs-lisp/elp.el +++ b/lisp/emacs-lisp/elp.el @@ -513,7 +513,7 @@ original definition, use \\[elp-restore-function] or \\[elp-restore-all]." (numberp elp-report-limit) (< cc elp-report-limit)) nil - (insert symname) + (elp-output-insert-symname symname) (insert-char 32 (+ elp-field-len (- (length symname)) 2)) ;; print stuff out, formatting it nicely (insert callcnt) @@ -525,6 +525,32 @@ original definition, use \\[elp-restore-function] or \\[elp-restore-all]." (insert atstr)) (insert "\n")))) +(defvar elp-results-symname-map + (let ((map (make-sparse-keymap))) + (define-key map [mouse-2] 'elp-results-jump-to-definition-by-mouse) + (define-key map "\C-m" 'elp-results-jump-to-definition) + map) + "Keymap used on the function name column." ) + +(defun elp-results-jump-to-definition-by-mouse (event) + "Jump to the definition of the function under the place specified by EVENT." + (interactive "e") + (posn-set-point (event-end event)) + (elp-results-jump-to-definition)) + +(defun elp-results-jump-to-definition () + "Jump to the definition of the function under the point." + (interactive) + (find-function (get-text-property (point) 'elp-symname))) + +(defun elp-output-insert-symname (symname) + ;; Insert SYMNAME with text properties. + (insert (propertize symname + 'elp-symname (intern symname) + 'keymap elp-results-symname-map + 'mouse-face 'highlight + 'help-echo (substitute-command-keys "\\{elp-results-symname-map}")))) + ;;;###autoload (defun elp-results () "Display current profiling results. From 2439909e48d3ad6f3cc50f9b51017401b808d817 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 19 Aug 2004 10:07:06 +0000 Subject: [PATCH 171/341] *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 9d9c4ee498c..e29ffcf0864 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-08-19 Kim F. Storm + + * process.c (process_send_signal): Use CDISABLE. + + * sysdep.c (child_setup_tty, init_sys_modes): Use CDISABLE. + 2004-08-18 Kim F. Storm * process.c (Faccept_process_output): Add arg JUST-THIS-ONE; From ca4313d5ab8ce1f4802a35dd35764887507e7c5e Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 19 Aug 2004 10:08:00 +0000 Subject: [PATCH 172/341] (process_send_signal): Use CDISABLE. --- src/process.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/process.c b/src/process.c index 49fef36d41a..ae9741ac478 100644 --- a/src/process.c +++ b/src/process.c @@ -5594,15 +5594,7 @@ process_send_signal (process, signo, current_group, nomsg) break; } -#ifndef _POSIX_VDISABLE -#ifdef CVDISABLE -#define _POSIX_VDISABLE CVDISABLE -#else -#define _POSIX_VDISABLE '\0' -#endif -#endif - - if (sig_char && *sig_char != _POSIX_VDISABLE) + if (sig_char && *sig_char != CDISABLE) send_process (proc, sig_char, 1, Qnil); return; #else /* ! HAVE_TERMIOS */ From fa51fa32b7d7eb52f3c61d6c12da1054192f0758 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 19 Aug 2004 10:08:15 +0000 Subject: [PATCH 173/341] (child_setup_tty, init_sys_modes): Use CDISABLE. --- src/sysdep.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/sysdep.c b/src/sysdep.c index 7ffb2bb7db5..b120dcd950d 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -613,9 +613,9 @@ child_setup_tty (out) #ifdef SIGNALS_VIA_CHARACTERS /* the QUIT and INTR character are used in process_send_signal so set them here to something useful. */ - if (s.main.c_cc[VQUIT] == 0377) + if (s.main.c_cc[VQUIT] == CDISABLE) s.main.c_cc[VQUIT] = '\\'&037; /* Control-\ */ - if (s.main.c_cc[VINTR] == 0377) + if (s.main.c_cc[VINTR] == CDISABLE) s.main.c_cc[VINTR] = 'C'&037; /* Control-C */ #endif /* not SIGNALS_VIA_CHARACTERS */ @@ -634,11 +634,11 @@ child_setup_tty (out) would force it to 0377. That looks like duplicated code. */ #ifndef SIGNALS_VIA_CHARACTERS /* QUIT and INTR work better as signals, so disable character forms */ - s.main.c_cc[VQUIT] = 0377; - s.main.c_cc[VINTR] = 0377; + s.main.c_cc[VQUIT] = CDISABLE; + s.main.c_cc[VINTR] = CDISABLE; s.main.c_lflag &= ~ISIG; #endif /* no TIOCGPGRP or no TIOCGLTC or no TIOCGETC */ - s.main.c_cc[VEOL] = 0377; + s.main.c_cc[VEOL] = CDISABLE; s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */ #endif /* AIX */ @@ -1479,10 +1479,10 @@ nil means don't delete them until `list-processes' is run. */); tty.main.c_line = 0; tty.main.c_iflag &= ~ASCEDIT; #else - tty.main.c_cc[VSTRT] = 255; - tty.main.c_cc[VSTOP] = 255; - tty.main.c_cc[VSUSP] = 255; - tty.main.c_cc[VDSUSP] = 255; + tty.main.c_cc[VSTRT] = CDISABLE; + tty.main.c_cc[VSTOP] = CDISABLE; + tty.main.c_cc[VSUSP] = CDISABLE; + tty.main.c_cc[VDSUSP] = CDISABLE; #endif /* IBMR2AIX */ if (flow_control) { From 6ba0f14c1f1df33480fff61a7d0b9f7c49ac286c Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 19 Aug 2004 13:56:39 +0000 Subject: [PATCH 174/341] *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index e29ffcf0864..2999a43f14d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2004-08-19 Kim F. Storm + * process.c (wait_reading_process_input): Clean up. + Add wait_for_cell, wait_proc, and just_wait_proc args + to avoid overloading `read_kbd' and `do_display' args. + Change read_kbd arg to int. All callers changed. + * process.c (process_send_signal): Use CDISABLE. * sysdep.c (child_setup_tty, init_sys_modes): Use CDISABLE. From b89a415ab18b6ed14f70518d8bd336d1f3364c9c Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 19 Aug 2004 13:57:17 +0000 Subject: [PATCH 175/341] * process.c (wait_reading_process_input): Clean up. Add wait_for_cell, wait_proc, and just_wait_proc args to avoid overloading `read_kbd' and `do_display' args. Change read_kbd arg to int. All callers changed. --- src/process.c | 158 +++++++++++++++++++++----------------------------- 1 file changed, 65 insertions(+), 93 deletions(-) diff --git a/src/process.c b/src/process.c index ae9741ac478..ae4d366a694 100644 --- a/src/process.c +++ b/src/process.c @@ -3777,13 +3777,12 @@ Return non-nil iff we received any output before the timeout expired. */) else seconds = NILP (process) ? -1 : 0; - if (NILP (process)) - XSETFASTINT (process, 0); - return - (wait_reading_process_input (seconds, useconds, process, + (wait_reading_process_input (seconds, useconds, 0, 0, + Qnil, + !NILP (process) ? XPROCESS (process) : NULL, NILP (just_this_one) ? 0 : - !INTEGERP (just_this_one) ? -1 : -2) + !INTEGERP (just_this_one) ? 1 : -1) ? Qt : Qnil); } @@ -4010,28 +4009,32 @@ wait_reading_process_input_1 () 1 to return when input is available, or -1 meaning caller will actually read the input, so don't throw to the quit handler, or - a cons cell, meaning wait until its car is non-nil - (and gobble terminal input into the buffer if any arrives), or - a process object, meaning wait until something arrives from that - process. The return value is true iff we read some input from - that process. - If READ_KBD is a process object, DO_DISPLAY < 0 means handle only - output from that process (suspending output from other processes) - and DO_DISPLAY == -2 specifically means don't run any timers either. - Otherwise, != 0 means redisplay should be done to show subprocess + DO_DISPLAY != 0 means redisplay should be done to show subprocess output that arrives. - If READ_KBD is a pointer to a struct Lisp_Process, then the - function returns true iff we received input from that process - before the timeout elapsed. + If WAIT_FOR_CELL is a cons cell, wait until its car is non-nil + (and gobble terminal input into the buffer if any arrives). + + If WAIT_PROC is specified, wait until something arrives from that + process. The return value is true iff we read some input from + that process. + + If JUST_WAIT_PROC is non-nil, handle only output from WAIT_PROC + (suspending output from other processes). A negative value + means don't run any timers either. + + If WAIT_PROC is specified, then the function returns true iff we + received input from that process before the timeout elapsed. Otherwise, return true iff we received input from any process. */ int -wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) - int time_limit, microsecs; - Lisp_Object read_kbd; - int do_display; +wait_reading_process_input (time_limit, microsecs, read_kbd, do_display, + wait_for_cell, wait_proc, just_wait_proc) + int time_limit, microsecs, read_kbd, do_display; + Lisp_Object wait_for_cell; + struct Lisp_Process *wait_proc; + int just_wait_proc; { register int channel, nfds; SELECT_TYPE Available; @@ -4041,39 +4044,19 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) Lisp_Object proc; EMACS_TIME timeout, end_time; int wait_channel = -1; - struct Lisp_Process *wait_proc = 0; - int just_wait_proc = 0; int got_some_input = 0; /* Either nil or a cons cell, the car of which is of interest and may be changed outside of this routine. */ - Lisp_Object wait_for_cell = Qnil; int saved_waiting_for_user_input_p = waiting_for_user_input_p; FD_ZERO (&Available); FD_ZERO (&Connecting); - /* If read_kbd is a process to watch, set wait_proc and wait_channel - accordingly. */ - if (PROCESSP (read_kbd)) - { - wait_proc = XPROCESS (read_kbd); - wait_channel = XINT (wait_proc->infd); - XSETFASTINT (read_kbd, 0); - if (do_display < 0) - { - just_wait_proc = do_display; - do_display = 0; - } - } + /* If wait_proc is a process to watch, set wait_channel accordingly. */ + if (wait_proc != NULL) + wait_channel = XINT (wait_proc->infd); - /* If waiting for non-nil in a cell, record where. */ - if (CONSP (read_kbd)) - { - wait_for_cell = read_kbd; - XSETFASTINT (read_kbd, 0); - } - - waiting_for_user_input_p = XINT (read_kbd); + waiting_for_user_input_p = read_kbd; /* Since we may need to wait several times, compute the absolute time to return at. */ @@ -4101,7 +4084,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) /* If calling from keyboard input, do not quit since we want to return C-g as an input character. Otherwise, do pending quit if requested. */ - if (XINT (read_kbd) >= 0) + if (read_kbd >= 0) QUIT; #ifdef SYNC_INPUT else if (interrupt_input_pending) @@ -4139,7 +4122,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) the wait is supposed to be short, and those callers cannot handle running arbitrary Lisp code here. */ if (NILP (wait_for_cell) - && just_wait_proc != -2) + && just_wait_proc >= 0) { EMACS_TIME timer_delay; @@ -4167,7 +4150,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) while (!detect_input_pending ()); /* If there is unread keyboard input, also return. */ - if (XINT (read_kbd) != 0 + if (read_kbd != 0 && requeued_events_pending_p ()) break; @@ -4195,7 +4178,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) It is important that we do this before checking for process activity. If we get a SIGCHLD after the explicit checks for process activity, timeout is the only way we will know. */ - if (XINT (read_kbd) < 0) + if (read_kbd < 0) set_waiting_for_input (&timeout); /* If status of something has changed, and no input is @@ -4275,8 +4258,10 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) /* Wait till there is something to do */ - if (just_wait_proc) + if (wait_proc && just_wait_proc) { + if (XINT (wait_proc->infd) < 0) /* Terminated */ + break; FD_SET (XINT (wait_proc->infd), &Available); check_connect = check_delay = 0; } @@ -4287,7 +4272,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) } else { - if (! XINT (read_kbd)) + if (! read_kbd) Available = non_keyboard_wait_mask; else Available = input_wait_mask; @@ -4304,12 +4289,12 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) { clear_waiting_for_input (); redisplay_preserve_echo_area (11); - if (XINT (read_kbd) < 0) + if (read_kbd < 0) set_waiting_for_input (&timeout); } no_avail = 0; - if (XINT (read_kbd) && detect_input_pending ()) + if (read_kbd && detect_input_pending ()) { nfds = 0; no_avail = 1; @@ -4429,7 +4414,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) And on hpux, since we turn off polling in wait_reading_process_input, it might never get read at all if we don't spend much time outside of wait_reading_process_input. */ - if (XINT (read_kbd) && interrupt_input + if (read_kbd && interrupt_input && keyboard_bit_set (&Available) && input_polling_used ()) kill (getpid (), SIGALRM); @@ -4439,7 +4424,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) /* If there is any, return immediately to give it higher priority than subprocesses */ - if (XINT (read_kbd) != 0) + if (read_kbd != 0) { int old_timers_run = timers_run; struct buffer *old_buffer = current_buffer; @@ -4464,7 +4449,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) } /* If there is unread keyboard input, also return. */ - if (XINT (read_kbd) != 0 + if (read_kbd != 0 && requeued_events_pending_p ()) break; @@ -4475,7 +4460,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) That would causes delays in pasting selections, for example. (We used to do this only if wait_for_cell.) */ - if (XINT (read_kbd) == 0 && detect_input_pending ()) + if (read_kbd == 0 && detect_input_pending ()) { swallow_events (do_display); #if 0 /* Exiting when read_kbd doesn't request that seems wrong, though. */ @@ -4494,7 +4479,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) In that case, there really is no input and no SIGIO, but select says there is input. */ - if (XINT (read_kbd) && interrupt_input + if (read_kbd && interrupt_input && keyboard_bit_set (&Available) && ! noninteractive) kill (getpid (), SIGIO); #endif @@ -4504,7 +4489,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) /* If checking input just got us a size-change event from X, obey it now if we should. */ - if (XINT (read_kbd) || ! NILP (wait_for_cell)) + if (read_kbd || ! NILP (wait_for_cell)) do_pending_window_change (0); /* Check for data from a process. */ @@ -4679,7 +4664,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) /* If calling from keyboard input, do not quit since we want to return C-g as an input character. Otherwise, do pending quit if requested. */ - if (XINT (read_kbd) >= 0) + if (read_kbd >= 0) { /* Prevent input_pending from remaining set if we quit. */ clear_input_pending (); @@ -5326,7 +5311,6 @@ send_process (proc, buf, len, object) that may allow the program to finish doing output and read more. */ { - Lisp_Object zero; int offset = 0; #ifdef BROKEN_PTY_READ_AFTER_EAGAIN @@ -5361,11 +5345,10 @@ send_process (proc, buf, len, object) else if (STRINGP (object)) offset = buf - SDATA (object); - XSETFASTINT (zero, 0); #ifdef EMACS_HAS_USECS - wait_reading_process_input (0, 20000, zero, 0); + wait_reading_process_input (0, 20000, 0, 0, Qnil, NULL, 0); #else - wait_reading_process_input (1, 0, zero, 0); + wait_reading_process_input (1, 0, 0, 0, Qnil, NULL, 0); #endif if (BUFFERP (object)) @@ -6887,10 +6870,9 @@ Lisp_Object QCtype; 1 to return when input is available, or -1 means caller will actually read the input, so don't throw to the quit handler. - a cons cell, meaning wait until its car is non-nil - (and gobble terminal input into the buffer if any arrives), or - We know that read_kbd will never be a Lisp_Process, since - `subprocesses' isn't defined. + + see full version for other parameters. We know that wait_proc will + always be NULL, since `subprocesses' isn't defined. do_display != 0 means redisplay should be done to show subprocess output that arrives. @@ -6898,27 +6880,17 @@ Lisp_Object QCtype; Return true iff we received input from any process. */ int -wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) - int time_limit, microsecs; - Lisp_Object read_kbd; - int do_display; +wait_reading_process_input (time_limit, microsecs, read_kbd, do_display, + wait_for_cell, wait_proc, just_wait_proc) + int time_limit, microsecs, read_kbd, do_display; + Lisp_Object wait_for_cell; + struct Lisp_Process *wait_proc; + int just_wait_proc; { register int nfds; EMACS_TIME end_time, timeout; SELECT_TYPE waitchannels; int xerrno; - /* Either nil or a cons cell, the car of which is of interest and - may be changed outside of this routine. */ - Lisp_Object wait_for_cell; - - wait_for_cell = Qnil; - - /* If waiting for non-nil in a cell, record where. */ - if (CONSP (read_kbd)) - { - wait_for_cell = read_kbd; - XSETFASTINT (read_kbd, 0); - } /* What does time_limit really mean? */ if (time_limit || microsecs) @@ -6941,7 +6913,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) /* If calling from keyboard input, do not quit since we want to return C-g as an input character. Otherwise, do pending quit if requested. */ - if (XINT (read_kbd) >= 0) + if (read_kbd >= 0) QUIT; /* Exit now if the cell we're waiting for became non-nil. */ @@ -6992,7 +6964,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) while (!detect_input_pending ()); /* If there is unread keyboard input, also return. */ - if (XINT (read_kbd) != 0 + if (read_kbd != 0 && requeued_events_pending_p ()) break; @@ -7010,12 +6982,12 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) /* Cause C-g and alarm signals to take immediate action, and cause input available signals to zero out timeout. */ - if (XINT (read_kbd) < 0) + if (read_kbd < 0) set_waiting_for_input (&timeout); /* Wait till there is something to do. */ - if (! XINT (read_kbd) && NILP (wait_for_cell)) + if (! read_kbd && NILP (wait_for_cell)) FD_ZERO (&waitchannels); else FD_SET (0, &waitchannels); @@ -7026,11 +6998,11 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) { clear_waiting_for_input (); redisplay_preserve_echo_area (15); - if (XINT (read_kbd) < 0) + if (read_kbd < 0) set_waiting_for_input (&timeout); } - if (XINT (read_kbd) && detect_input_pending ()) + if (read_kbd && detect_input_pending ()) { nfds = 0; FD_ZERO (&waitchannels); @@ -7066,13 +7038,13 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) kill (getpid (), SIGIO); #endif #ifdef SIGIO - if (XINT (read_kbd) && interrupt_input && (waitchannels & 1)) + if (read_kbd && interrupt_input && (waitchannels & 1)) kill (getpid (), SIGIO); #endif /* Check for keyboard input */ - if ((XINT (read_kbd) != 0) + if (read_kbd && detect_input_pending_run_timers (do_display)) { swallow_events (do_display); @@ -7081,7 +7053,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) } /* If there is unread keyboard input, also return. */ - if (XINT (read_kbd) != 0 + if (read_kbd && requeued_events_pending_p ()) break; From bb41f093dde33efca8a7d5baf6eb1c364ea684c4 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 19 Aug 2004 13:59:28 +0000 Subject: [PATCH 176/341] Adapt to new wait_reading_process_input args. --- src/dispnew.c | 13 +++---------- src/keyboard.c | 5 +---- src/lisp.h | 5 ++++- src/xselect.c | 6 ++++-- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index 8a713857273..0d2ce118e0f 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6331,12 +6331,7 @@ Emacs was built without floating point support. if (sec < 0 || (sec == 0 && usec == 0)) return Qnil; - { - Lisp_Object zero; - - XSETFASTINT (zero, 0); - wait_reading_process_input (sec, usec, zero, 0); - } + wait_reading_process_input (sec, usec, 0, 0, Qnil, NULL, 0); /* We should always have wait_reading_process_input; we have a dummy implementation for systems which don't support subprocesses. */ @@ -6386,8 +6381,6 @@ Lisp_Object sit_for (sec, usec, reading, display, initial_display) int sec, usec, reading, display, initial_display; { - Lisp_Object read_kbd; - swallow_events (display); if (detect_input_pending_run_timers (display) || !NILP (Vexecuting_macro)) @@ -6403,8 +6396,8 @@ sit_for (sec, usec, reading, display, initial_display) gobble_input (0); #endif - XSETINT (read_kbd, reading ? -1 : 1); - wait_reading_process_input (sec, usec, read_kbd, display); + wait_reading_process_input (sec, usec, reading ? -1 : 1, display, + Qnil, NULL, 0); return detect_input_pending () ? Qnil : Qt; } diff --git a/src/keyboard.c b/src/keyboard.c index 268d782e478..77b3886d809 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3899,10 +3899,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu) break; #endif { - Lisp_Object minus_one; - - XSETINT (minus_one, -1); - wait_reading_process_input (0, 0, minus_one, 1); + wait_reading_process_input (0, 0, -1, 1, Qnil, NULL, 0); if (!interrupt_input && kbd_fetch_ptr == kbd_store_ptr) /* Pass 1 for EXPECT since we just waited to have input. */ diff --git a/src/lisp.h b/src/lisp.h index a0345653924..e4fd7ef2c16 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2964,7 +2964,10 @@ EXFUN (Fprocess_send_eof, 1); EXFUN (Fwaiting_for_user_input_p, 0); extern Lisp_Object Qprocessp; extern void kill_buffer_processes P_ ((Lisp_Object)); -extern int wait_reading_process_input P_ ((int, int, Lisp_Object, int)); +extern int wait_reading_process_input P_ ((int, int, int, int, + Lisp_Object, + struct Lisp_Process *, + int)); extern void deactivate_process P_ ((Lisp_Object)); extern void add_keyboard_wait_descriptor P_ ((int)); extern void delete_keyboard_wait_descriptor P_ ((int)); diff --git a/src/xselect.c b/src/xselect.c index 7be238651a0..bf7b21cf323 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1109,7 +1109,8 @@ wait_for_property_change (location) secs = x_selection_timeout / 1000; usecs = (x_selection_timeout % 1000) * 1000; TRACE2 (" Waiting %d secs, %d usecs", secs, usecs); - wait_reading_process_input (secs, usecs, property_change_reply, 0); + wait_reading_process_input (secs, usecs, 0, 0, + property_change_reply, NULL, 0); if (NILP (XCAR (property_change_reply))) { @@ -1288,7 +1289,8 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp) secs = x_selection_timeout / 1000; usecs = (x_selection_timeout % 1000) * 1000; TRACE1 (" Start waiting %d secs for SelectionNotify", secs); - wait_reading_process_input (secs, usecs, reading_selection_reply, 0); + wait_reading_process_input (secs, usecs, 0, 0, + reading_selection_reply, NULL, 0); TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply))); BLOCK_INPUT; From 00267f94d1c7b303cd8ba1294e9d849f2888517c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 19 Aug 2004 17:31:37 +0000 Subject: [PATCH 177/341] * xfns.c (x_set_name, x_set_title): Encode title to UTF8 before passing it to gtk_window_set_title. --- src/ChangeLog | 5 +++++ src/xfns.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2999a43f14d..0ef292aae16 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-08-19 Jan Dj,Ad(Brv + + * xfns.c (x_set_name, x_set_title): Encode title to UTF8 before + passing it to gtk_window_set_title. + 2004-08-19 Kim F. Storm * process.c (wait_reading_process_input): Clean up. diff --git a/src/xfns.c b/src/xfns.c index dd8b4a4cb12..3f484f3935a 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1651,7 +1651,7 @@ x_set_name (f, name, explicit) } #ifdef USE_GTK gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - SDATA (name)); + SDATA (ENCODE_UTF_8 (name))); #else /* not USE_GTK */ XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); #endif /* not USE_GTK */ @@ -1759,7 +1759,7 @@ x_set_title (f, name, old_name) #ifdef USE_GTK gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - SDATA (name)); + SDATA (ENCODE_UTF_8 (name))); #else /* not USE_GTK */ XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); #endif /* not USE_GTK */ From 709a47ceff00db8bb094a61364dd69d11cb635b2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 19 Aug 2004 19:00:58 +0000 Subject: [PATCH 178/341] (char_quoted): Mixup byte/char pos. --- src/syntax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/syntax.c b/src/syntax.c index 83763061d82..e1fb7532b85 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -292,7 +292,7 @@ char_quoted (charpos, bytepos) DEC_BOTH (charpos, bytepos); - while (bytepos >= beg) + while (charpos >= beg) { int c; From 789f332078f832f5cba45cf72ad3ec7acbe05084 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 19 Aug 2004 22:17:59 +0000 Subject: [PATCH 179/341] (back_comment): Fixup globals in all cases. --- src/syntax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/syntax.c b/src/syntax.c index e1fb7532b85..18c88b458e6 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -673,7 +673,7 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p { from = comstart_pos; from_byte = comstart_byte; - /* Globals are correct now. */ + UPDATE_SYNTAX_TABLE_FORWARD (from - 1); } else { From 80a831bcfd0f4972ca54ae9a93c1ee9c225d74ad Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 19 Aug 2004 22:29:06 +0000 Subject: [PATCH 180/341] (cvs-parse-table, cvs-parse-commit): Try to adapt to the newer format of some messages in cvs-1.12.1. --- lisp/pcvs-parse.el | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el index c1726ee84c7..84dbf218581 100644 --- a/lisp/pcvs-parse.el +++ b/lisp/pcvs-parse.el @@ -1,7 +1,7 @@ ;;; pcvs-parse.el --- the CVS output parser -;; Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,02,2003 -;; Free Software Foundation, Inc. +;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +;; 2000, 2002, 2003, 2004 Free Software Foundation, Inc. ;; Author: Stefan Monnier ;; Keywords: pcl-cvs @@ -370,7 +370,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." ;; File you removed still exists. Ignore (will be noted as removed). (cvs-match ".* should be removed and is still there$") ;; just a note - (cvs-match "use '.+ commit' to \\sw+ th\\sw+ files? permanently$") + (cvs-match "use ['`].+ commit' to \\sw+ th\\sw+ files? permanently$") ;; [add,status] followed by a more complete status description anyway (and (cvs-match "nothing known about \\(.*\\)$" (path 1)) (cvs-parsed-fileinfo 'DEAD path 'trust)) @@ -492,12 +492,14 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." :head-rev head-rev)))) (defun cvs-parse-commit () - (let (path base-rev subtype) + (let (path file base-rev subtype) (cvs-or (and - (cvs-match "\\(Checking in\\|Removing\\) \\(.*\\);$" (path 2)) - (cvs-match ".*,v <-- .*$") + (cvs-or + (cvs-match "\\(Checking in\\|Removing\\) \\(.*\\);$" (path 2)) + t) + (cvs-match ".*,v <-- \\(.*\\)$" (file 1)) (cvs-or ;; deletion (cvs-match "new revision: delete; previous revision: \\([0-9.]*\\)$" @@ -508,7 +510,7 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." ;; update (cvs-match "new revision: \\([0-9.]*\\); previous revision: .*$" (subtype 'COMMITTED) (base-rev 1))) - (cvs-match "done$") + (cvs-or (cvs-match "done$") t) (progn ;; Try to remove the temp files used by VC. (vc-delete-automatic-version-backups (expand-file-name path)) @@ -516,7 +518,8 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." ;; because `cvs commit' might begin by a series of Examining messages ;; so the processing of the actual checkin messages might begin with ;; a `current-dir' set to something different from "" - (cvs-parsed-fileinfo (cons 'UP-TO-DATE subtype) path 'trust + (cvs-parsed-fileinfo (cons 'UP-TO-DATE subtype) + (or path file) (if path 'trust) :base-rev base-rev))) ;; useless message added before the actual addition: ignored @@ -525,5 +528,5 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." (provide 'pcvs-parse) -;;; arch-tag: 35418375-1a23-40a0-957d-96b0262f91d6 +;; arch-tag: 35418375-1a23-40a0-957d-96b0262f91d6 ;;; pcvs-parse.el ends here From 9c9c88db5a0a988e06bd5892afc6a273c073dee2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 19 Aug 2004 22:29:36 +0000 Subject: [PATCH 181/341] Add some ange-ftp items. --- etc/TODO | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etc/TODO b/etc/TODO index 4efeada3aa0..dc692db8965 100644 --- a/etc/TODO +++ b/etc/TODO @@ -62,6 +62,11 @@ to the FSF. * Other features we would like: +** ange-ftp +*** understand sftp +*** ignore some irrelevant errors (like IPv6 and kerberos thingies). +*** Use MLS for ange-ftp-insert-directory if a list of files is specified. + ** Ability to map a key, including all modified-combinations. E.g map mouse-4 to wheel-up as well as M-mouse-4 -> M-wheel-up M-C-mouse-4 -> M-C-wheel-up, H-S-C-M-s-double-mouse-4 -> From 27615979e50fb973298f4dcf83b68bb5b8c9ef8d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 19 Aug 2004 22:30:02 +0000 Subject: [PATCH 182/341] *** empty log message *** --- lisp/ChangeLog | 5 +++++ src/ChangeLog | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0384b9eba4..d54f857f171 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-19 Stefan Monnier + + * pcvs-parse.el (cvs-parse-table, cvs-parse-commit): Try to adapt to + the newer format of some messages in cvs-1.12.1. + 2004-08-19 Masatake YAMATO * emacs-lisp/elp.el (elp-results-symname-map): New keymap. diff --git a/src/ChangeLog b/src/ChangeLog index 0ef292aae16..469584d6bf9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-08-19 Stefan Monnier + + * syntax.c (char_quoted): Mixup byte/char pos. + (back_comment): Fixup globals in all cases. + 2004-08-19 Jan Dj,Ad(Brv * xfns.c (x_set_name, x_set_title): Encode title to UTF8 before From 1ad6e4db01d302f032d8f2928ae1bf7dafb2da6c Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 20 Aug 2004 08:46:50 +0000 Subject: [PATCH 183/341] (skip_chars): Fix for unibyte case. --- src/syntax.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/syntax.c b/src/syntax.c index 18c88b458e6..272e9cf1b12 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -1728,12 +1728,12 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes) if (negate) break; else - goto fwd_ok; + goto fwd_unibyte_ok; } if (!fastmap[*p]) break; - + fwd_unibyte_ok: p++, pos++; } } @@ -1801,12 +1801,12 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes) if (negate) break; else - goto fwd_ok; + goto back_unibyte_ok; } if (!fastmap[p[-1]]) break; - + back_unibyte_ok: p--, pos--; } } From 295f3b30f6456b0fece7c3f946df096b79ce9067 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 20 Aug 2004 08:48:47 +0000 Subject: [PATCH 184/341] *** empty log message *** --- leim/ChangeLog | 5 +++++ lisp/ChangeLog | 6 ++++++ src/ChangeLog | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/leim/ChangeLog b/leim/ChangeLog index c30c488c0b7..3074b183f6b 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog @@ -1,3 +1,8 @@ +2004-08-16 Kenichi Handa + + * quail/georgian.el ("georgian"): Call quail-define-package with + the show-layout arg t. + 2004-08-06 Andreas Schwab * Makefile.in (install): Remove .arch-inventory files. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d54f857f171..93fca8e4f71 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -10,6 +10,12 @@ (elp-results-jump-to-definition, elp-output-insert-symname): New Functions. (elp-output-result): Use elp-output-insert-symname. +2004-08-18 Kenichi Handa + + * language/cyrillic.el: Register koi8-r in + ctext-non-standard-encodings-alist. + ("Cyrillic-KOI8"): Add ctext-non-standard-encoding. + 2004-08-17 Luc Teirlinck * emacs-lisp/copyright.el (copyright-update-year): Delete code diff --git a/src/ChangeLog b/src/ChangeLog index 469584d6bf9..7cde31b91dd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-08-20 Kenichi Handa + + * syntax.c (skip_chars): Fix for unibyte case. + 2004-08-19 Stefan Monnier * syntax.c (char_quoted): Mixup byte/char pos. From 9a1ba2ea28d75abbd0a15a7688c0deff3324de83 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 20 Aug 2004 10:22:39 +0000 Subject: [PATCH 185/341] *** empty log message *** --- src/ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 7cde31b91dd..dcd16f17f07 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2004-08-20 Kim F. Storm + + * process.c (wait_reading_process_output): Rename from + wait_reading_process_input. All uses changed. + (wait_reading_process_output_1): Rename from + wait_reading_process_input_1. All uses changed. + + * dispnew.c (Fsleep_for): Remove obsolete code. + 2004-08-20 Kenichi Handa * syntax.c (skip_chars): Fix for unibyte case. From dcd1ca45ed1d3e07390ca976f5026006ccae4444 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 20 Aug 2004 10:33:05 +0000 Subject: [PATCH 186/341] (Fsleep_for): Remove obsolete code. Rename wait_reading_process_input to wait_reading_process_output. --- src/dispnew.c | 42 ++++-------------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index 0d2ce118e0f..903bdaabf3b 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6331,47 +6331,13 @@ Emacs was built without floating point support. if (sec < 0 || (sec == 0 && usec == 0)) return Qnil; - wait_reading_process_input (sec, usec, 0, 0, Qnil, NULL, 0); - - /* We should always have wait_reading_process_input; we have a dummy - implementation for systems which don't support subprocesses. */ -#if 0 - /* No wait_reading_process_input */ - immediate_quit = 1; - QUIT; - -#ifdef VMS - sys_sleep (sec); -#else /* not VMS */ -/* The reason this is done this way - (rather than defined (H_S) && defined (H_T)) - is because the VMS preprocessor doesn't grok `defined'. */ -#ifdef HAVE_SELECT - EMACS_GET_TIME (end_time); - EMACS_SET_SECS_USECS (timeout, sec, usec); - EMACS_ADD_TIME (end_time, end_time, timeout); - - while (1) - { - EMACS_GET_TIME (timeout); - EMACS_SUB_TIME (timeout, end_time, timeout); - if (EMACS_TIME_NEG_P (timeout) - || !select (1, 0, 0, 0, &timeout)) - break; - } -#else /* not HAVE_SELECT */ - sleep (sec); -#endif /* HAVE_SELECT */ -#endif /* not VMS */ - - immediate_quit = 0; -#endif /* no subprocesses */ + wait_reading_process_output (sec, usec, 0, 0, Qnil, NULL, 0); return Qnil; } -/* This is just like wait_reading_process_input, except that +/* This is just like wait_reading_process_output, except that it does the redisplay. It's also much like Fsit_for, except that it can be used for @@ -6396,8 +6362,8 @@ sit_for (sec, usec, reading, display, initial_display) gobble_input (0); #endif - wait_reading_process_input (sec, usec, reading ? -1 : 1, display, - Qnil, NULL, 0); + wait_reading_process_output (sec, usec, reading ? -1 : 1, display, + Qnil, NULL, 0); return detect_input_pending () ? Qnil : Qt; } From 214d60691b6ecc0c3cf469f70ceab6709c773954 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 20 Aug 2004 10:33:25 +0000 Subject: [PATCH 187/341] (wait_reading_process_output): Rename from wait_reading_process_input. All uses changed. (wait_reading_process_output_1): Rename from wait_reading_process_input_1. All uses changed. --- src/process.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/process.c b/src/process.c index ae4d366a694..21ab46f0d85 100644 --- a/src/process.c +++ b/src/process.c @@ -3778,11 +3778,11 @@ Return non-nil iff we received any output before the timeout expired. */) seconds = NILP (process) ? -1 : 0; return - (wait_reading_process_input (seconds, useconds, 0, 0, - Qnil, - !NILP (process) ? XPROCESS (process) : NULL, - NILP (just_this_one) ? 0 : - !INTEGERP (just_this_one) ? 1 : -1) + (wait_reading_process_output (seconds, useconds, 0, 0, + Qnil, + !NILP (process) ? XPROCESS (process) : NULL, + NILP (just_this_one) ? 0 : + !INTEGERP (just_this_one) ? 1 : -1) ? Qt : Qnil); } @@ -3982,12 +3982,12 @@ server_accept_connection (server, channel) lisp code is being evalled. This is also used in record_asynch_buffer_change. For that purpose, this must be 0 - when not inside wait_reading_process_input. */ + when not inside wait_reading_process_output. */ static int waiting_for_user_input_p; /* This is here so breakpoints can be put on it. */ static void -wait_reading_process_input_1 () +wait_reading_process_output_1 () { } @@ -4029,8 +4029,8 @@ wait_reading_process_input_1 () Otherwise, return true iff we received input from any process. */ int -wait_reading_process_input (time_limit, microsecs, read_kbd, do_display, - wait_for_cell, wait_proc, just_wait_proc) +wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, + wait_for_cell, wait_proc, just_wait_proc) int time_limit, microsecs, read_kbd, do_display; Lisp_Object wait_for_cell; struct Lisp_Process *wait_proc; @@ -4168,7 +4168,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display, else if (time_limit != -1) { /* This is so a breakpoint can be put here. */ - wait_reading_process_input_1 (); + wait_reading_process_output_1 (); } } @@ -4411,9 +4411,9 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display, /* If we are using polling for input, and we see input available, make it get read now. Otherwise it might not actually get read for a second. - And on hpux, since we turn off polling in wait_reading_process_input, + And on hpux, since we turn off polling in wait_reading_process_output, it might never get read at all if we don't spend much time - outside of wait_reading_process_input. */ + outside of wait_reading_process_output. */ if (read_kbd && interrupt_input && keyboard_bit_set (&Available) && input_polling_used ()) @@ -5346,9 +5346,9 @@ send_process (proc, buf, len, object) offset = buf - SDATA (object); #ifdef EMACS_HAS_USECS - wait_reading_process_input (0, 20000, 0, 0, Qnil, NULL, 0); + wait_reading_process_output (0, 20000, 0, 0, Qnil, NULL, 0); #else - wait_reading_process_input (1, 0, 0, 0, Qnil, NULL, 0); + wait_reading_process_output (1, 0, 0, 0, Qnil, NULL, 0); #endif if (BUFFERP (object)) @@ -6210,7 +6210,7 @@ sigchld_handler (signo) FD_CLR (XINT (p->infd), &non_keyboard_wait_mask); } - /* Tell wait_reading_process_input that it needs to wake up and + /* Tell wait_reading_process_output that it needs to wake up and look around. */ if (input_available_clear_time) EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); @@ -6228,7 +6228,7 @@ sigchld_handler (signo) else if (WIFSIGNALED (w)) synch_process_termsig = WTERMSIG (w); - /* Tell wait_reading_process_input that it needs to wake up and + /* Tell wait_reading_process_output that it needs to wake up and look around. */ if (input_available_clear_time) EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); @@ -6880,8 +6880,8 @@ Lisp_Object QCtype; Return true iff we received input from any process. */ int -wait_reading_process_input (time_limit, microsecs, read_kbd, do_display, - wait_for_cell, wait_proc, just_wait_proc) +wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, + wait_for_cell, wait_proc, just_wait_proc) int time_limit, microsecs, read_kbd, do_display; Lisp_Object wait_for_cell; struct Lisp_Process *wait_proc; From d64b707cb1e268b4c77a51f064d7e3fd95e3df85 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 20 Aug 2004 10:34:12 +0000 Subject: [PATCH 188/341] Rename wait_reading_process_input to wait_reading_process_output. --- src/keyboard.c | 4 ++-- src/lisp.h | 8 ++++---- src/msdos.c | 2 +- src/w32proc.c | 2 +- src/w32term.c | 2 +- src/xdisp.c | 2 +- src/xselect.c | 8 ++++---- src/xterm.c | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 77b3886d809..78e7498287e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3899,7 +3899,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu) break; #endif { - wait_reading_process_input (0, 0, -1, 1, Qnil, NULL, 0); + wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0); if (!interrupt_input && kbd_fetch_ptr == kbd_store_ptr) /* Pass 1 for EXPECT since we just waited to have input. */ @@ -9917,7 +9917,7 @@ clear_input_pending () } /* Return nonzero if there are pending requeued events. - This isn't used yet. The hope is to make wait_reading_process_input + This isn't used yet. The hope is to make wait_reading_process_output call it, and return if it runs Lisp code that unreads something. The problem is, kbd_buffer_get_event needs to be fixed to know what to do in that case. It isn't trivial. */ diff --git a/src/lisp.h b/src/lisp.h index e4fd7ef2c16..7e1e122fbc2 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2964,10 +2964,10 @@ EXFUN (Fprocess_send_eof, 1); EXFUN (Fwaiting_for_user_input_p, 0); extern Lisp_Object Qprocessp; extern void kill_buffer_processes P_ ((Lisp_Object)); -extern int wait_reading_process_input P_ ((int, int, int, int, - Lisp_Object, - struct Lisp_Process *, - int)); +extern int wait_reading_process_output P_ ((int, int, int, int, + Lisp_Object, + struct Lisp_Process *, + int)); extern void deactivate_process P_ ((Lisp_Object)); extern void add_keyboard_wait_descriptor P_ ((int)); extern void delete_keyboard_wait_descriptor P_ ((int)); diff --git a/src/msdos.c b/src/msdos.c index 2653f0bf213..f2d1dc66a69 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -5102,7 +5102,7 @@ dos_yield_time_slice (void) /* Only event queue is checked. */ /* We don't have to call timer_check here - because wait_reading_process_input takes care of that. */ + because wait_reading_process_output takes care of that. */ int sys_select (nfds, rfds, wfds, efds, timeout) int nfds; diff --git a/src/w32proc.c b/src/w32proc.c index 8452337f7e2..9abee2bf0c2 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -1218,7 +1218,7 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, { DebPrint (("select.WaitForMultipleObjects (%d, %lu) failed with %lu\n", nh + nc, timeout_ms, GetLastError ())); - /* don't return EBADF - this causes wait_reading_process_input to + /* don't return EBADF - this causes wait_reading_process_output to abort; WAIT_FAILED is returned when single-stepping under Windows 95 after switching thread focus in debugger, and possibly at other times. */ diff --git a/src/w32term.c b/src/w32term.c index 71125fe4195..f71736dffad 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -4570,7 +4570,7 @@ w32_read_socket (sd, expected, hold_quit) f->async_visible = 1; f->async_iconified = 0; - /* wait_reading_process_input will notice this and update + /* wait_reading_process_output will notice this and update the frame's display structures. */ SET_FRAME_GARBAGED (f); diff --git a/src/xdisp.c b/src/xdisp.c index 7a727938a2c..334ebb72fcb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10381,7 +10381,7 @@ redisplay_internal (preserve_echo_area) This is useful in situations where you need to redisplay but no user action has occurred, making it inappropriate for the message area to be cleared. See tracking_off and - wait_reading_process_input for examples of these situations. + wait_reading_process_output for examples of these situations. FROM_WHERE is an integer saying from where this function was called. This is useful for debugging. */ diff --git a/src/xselect.c b/src/xselect.c index bf7b21cf323..5de1beb9ac4 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1109,8 +1109,8 @@ wait_for_property_change (location) secs = x_selection_timeout / 1000; usecs = (x_selection_timeout % 1000) * 1000; TRACE2 (" Waiting %d secs, %d usecs", secs, usecs); - wait_reading_process_input (secs, usecs, 0, 0, - property_change_reply, NULL, 0); + wait_reading_process_output (secs, usecs, 0, 0, + property_change_reply, NULL, 0); if (NILP (XCAR (property_change_reply))) { @@ -1289,8 +1289,8 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp) secs = x_selection_timeout / 1000; usecs = (x_selection_timeout % 1000) * 1000; TRACE1 (" Start waiting %d secs for SelectionNotify", secs); - wait_reading_process_input (secs, usecs, 0, 0, - reading_selection_reply, NULL, 0); + wait_reading_process_output (secs, usecs, 0, 0, + reading_selection_reply, NULL, 0); TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply))); BLOCK_INPUT; diff --git a/src/xterm.c b/src/xterm.c index 593716032e1..5e6a236c4be 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6174,7 +6174,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) f = x_top_window_to_frame (dpyinfo, event.xmap.window); if (f) { - /* wait_reading_process_input will notice this and update + /* wait_reading_process_output will notice this and update the frame's display structures. If we where iconified, we should not set garbaged, because that stops redrawing on Expose events. This looks From 88b4ca188b176d79d4a03f4f81fcc3d0af86e8ff Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 20 Aug 2004 21:59:42 +0000 Subject: [PATCH 189/341] (mouse-avoidance-ignore-p): New fun. Also ignore switch-frame, select-window, double, and triple clicks. (mouse-avoidance-banish-hook, mouse-avoidance-exile-hook) (mouse-avoidance-fancy-hook): Use it. --- lisp/avoid.el | 82 +++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/lisp/avoid.el b/lisp/avoid.el index 536b80abdbe..b5e7d1f9b62 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el @@ -1,6 +1,6 @@ ;;; avoid.el --- make mouse pointer stay out of the way of editing -;;; Copyright (C) 1993, 1994, 2000 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1994, 2000, 2004 Free Software Foundation, Inc. ;; Author: Boris Goldowsky ;; Keywords: mouse @@ -52,7 +52,7 @@ ;; ;; Bugs / Warnings / To-Do: ;; -;; - Using this code does slow emacs down. "banish" mode shouldn't +;; - Using this code does slow Emacs down. "banish" mode shouldn't ;; be too bad, and on my workstation even "animate" is reasonable. ;; ;; - It ought to find out where any overlapping frames are and avoid them, @@ -96,7 +96,7 @@ use either \\[customize] or the function `mouse-avoidance-mode'." (defcustom mouse-avoidance-nudge-dist 15 "*Average distance that mouse will be moved when approached by cursor. -Only applies in mouse-avoidance-mode `jump' and its derivatives. +Only applies in Mouse-Avoidance mode `jump' and its derivatives. For best results make this larger than `mouse-avoidance-threshold'." :type 'integer :group 'avoid) @@ -137,7 +137,7 @@ Only applies in mouse-avoidance-modes `animate' and `jump'." (defun mouse-avoidance-point-position () "Return the position of point as (FRAME X . Y). -Analogous to mouse-position." +Analogous to `mouse-position'." (let* ((w (selected-window)) (edges (window-inside-edges w)) (list @@ -194,10 +194,11 @@ Acceptable distance is defined by `mouse-avoidance-threshold'." mouse-avoidance-threshold)))))) (defun mouse-avoidance-banish-destination () - "The position to which mouse-avoidance-mode `banish' moves the mouse. + "The position to which Mouse-Avoidance mode `banish' moves the mouse. You can redefine this if you want the mouse banished to a different corner." - (cons (1- (frame-width)) - 0)) + (let* ((pos (window-edges))) + (cons (- (nth 2 pos) 2) + (nth 1 pos)))) (defun mouse-avoidance-banish-mouse () ;; Put the mouse pointer in the upper-right corner of the current frame. @@ -225,22 +226,27 @@ You can redefine this if you want the mouse banished to a different corner." (t 0)))) (defun mouse-avoidance-nudge-mouse () - ;; Push the mouse a little way away, possibly animating the move + ;; Push the mouse a little way away, possibly animating the move. ;; For these modes, state keeps track of the total offset that we've ;; accumulated, and tries to keep it close to zero. (let* ((cur (mouse-position)) (cur-frame (car cur)) (cur-pos (cdr cur)) + (pos (window-edges)) + (wleft (pop pos)) + (wtop (pop pos)) + (wright (pop pos)) + (wbot (pop pos)) (deltax (mouse-avoidance-delta (car cur-pos) (- (random mouse-avoidance-nudge-var) (car mouse-avoidance-state)) mouse-avoidance-nudge-dist mouse-avoidance-nudge-var - 0 (frame-width))) + wleft (1- wright))) (deltay (mouse-avoidance-delta (cdr cur-pos) (- (random mouse-avoidance-nudge-var) (cdr mouse-avoidance-state)) mouse-avoidance-nudge-dist mouse-avoidance-nudge-var - 0 (frame-height)))) + wtop (1- wbot)))) (setq mouse-avoidance-state (cons (+ (car mouse-avoidance-state) deltax) (+ (cdr mouse-avoidance-state) deltay))) @@ -277,33 +283,34 @@ redefine this function to suit your own tastes." (nth (random mouse-avoidance-n-pointer-shapes) mouse-avoidance-pointer-shapes)) +(defun mouse-avoidance-ignore-p () + (let ((mp (mouse-position))) + (or executing-kbd-macro ; don't check inside macro + (null (cadr mp)) ; don't move unless in an Emacs frame + (not (eq (car mp) (selected-frame))) + ;; Don't do anything if last event was a mouse event. + ;; FIXME: this code fails in the case where the mouse was moved + ;; since the last key-press but without generating any event. + (and (consp last-input-event) + (symbolp (car last-input-event)) + (let ((modifiers (event-modifiers (car last-input-event)))) + (or (memq (car last-input-event) + '(mouse-movement scroll-bar-movement + select-window switch-frame)) + (memq 'click modifiers) + (memq 'double modifiers) + (memq 'triple modifiers) + (memq 'drag modifiers) + (memq 'down modifiers))))))) + (defun mouse-avoidance-banish-hook () - (if (and (not executing-kbd-macro) ; don't check inside macro - (cadr (mouse-position)) ; don't move unless in an Emacs frame - ;; Don't do anything if last event was a mouse event. - (not (and (consp last-input-event) - (symbolp (car last-input-event)) - (let ((modifiers (event-modifiers (car last-input-event)))) - (or (memq (car last-input-event) - '(mouse-movement scroll-bar-movement)) - (memq 'click modifiers) - (memq 'drag modifiers) - (memq 'down modifiers)))))) + (if (not (mouse-avoidance-ignore-p)) (mouse-avoidance-banish-mouse))) (defun mouse-avoidance-exile-hook () ;; For exile mode, the state is nil when the mouse is in its normal ;; position, and set to the old mouse-position when the mouse is in exile. - (if (and (not executing-kbd-macro) - ;; Don't do anything if last event was a mouse event. - (not (and (consp last-input-event) - (symbolp (car last-input-event)) - (let ((modifiers (event-modifiers (car last-input-event)))) - (or (memq (car last-input-event) - '(mouse-movement scroll-bar-movement)) - (memq 'click modifiers) - (memq 'drag modifiers) - (memq 'down modifiers)))))) + (if (not (mouse-avoidance-ignore-p)) (let ((mp (mouse-position))) (cond ((and (not mouse-avoidance-state) (mouse-avoidance-too-close-p mp)) @@ -321,16 +328,7 @@ redefine this function to suit your own tastes." (defun mouse-avoidance-fancy-hook () ;; Used for the "fancy" modes, ie jump et al. - (if (and (not executing-kbd-macro) ; don't check inside macro - ;; Don't do anything if last event was a mouse event. - (not (and (consp last-input-event) - (symbolp (car last-input-event)) - (let ((modifiers (event-modifiers (car last-input-event)))) - (or (memq (car last-input-event) - '(mouse-movement scroll-bar-movement)) - (memq 'click modifiers) - (memq 'drag modifiers) - (memq 'down modifiers))))) + (if (and (not (mouse-avoidance-ignore-p)) (mouse-avoidance-too-close-p (mouse-position))) (let ((old-pos (mouse-position))) (mouse-avoidance-nudge-mouse) @@ -416,5 +414,5 @@ definition of \"random distance\".)" (if mouse-avoidance-mode (mouse-avoidance-mode mouse-avoidance-mode)) -;;; arch-tag: 64ad4ef8-a870-4183-8d96-3aa93b7a6800 +;; arch-tag: 64ad4ef8-a870-4183-8d96-3aa93b7a6800 ;;; avoid.el ends here From fcaf7de969a4e3556e184640911efb8e4a8dc874 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 20 Aug 2004 22:40:34 +0000 Subject: [PATCH 190/341] (normal-top-level-add-subdirs-to-load-path): Avoid unnecessarily checking system-type. (normal-top-level): Set TERM to "dumb". Simplify. --- lisp/startup.el | 57 ++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index 2f0ca4b2c19..c1b25b1867d 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -220,7 +220,7 @@ Setting `init-file-user' does not prevent Emacs from loading "File containing site-wide run-time initializations. This file is loaded at run-time before `~/.emacs'. It contains inits that need to be in place for the entire site, but which, due to their -higher incidence of change, don't make sense to load into emacs' +higher incidence of change, don't make sense to load into Emacs's dumped image. Thus, the run-time load order is: 1. file described in this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'. @@ -293,8 +293,8 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (let* ((this-dir (car dirs)) (contents (directory-files this-dir)) (default-directory this-dir) - (canonicalized (and (eq system-type 'windows-nt) - (untranslated-canonical-name this-dir)))) + (canonicalized (if (fboundp 'untranslated-canonical-name) + (untranslated-canonical-name this-dir)))) ;; The Windows version doesn't report meaningful inode ;; numbers, so use the canonicalized absolute file name of the ;; directory instead. @@ -343,12 +343,14 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." ;; Give *Messages* the same default-directory as *scratch*, ;; just to keep things predictable. (let ((dir default-directory)) - (save-excursion - (set-buffer (get-buffer "*Messages*")) + (with-current-buffer "*Messages*" (setq default-directory dir))) ;; `user-full-name' is now known; reset its standard-value here. (put 'user-full-name 'standard-value (list (default-value 'user-full-name))) + ;; Subprocesses of Emacs do not have direct access to the terminal, + ;; so unless told otherwise they should only assume a dumb terminal. + (setenv "TERM" "dumb") ;; For root, preserve owner and group when editing files. (if (equal (user-uid) 0) (setq backup-by-copying-when-mismatch t)) @@ -357,32 +359,25 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." ;; of that dir into load-path, ;; Look for a leim-list.el file too. Loading it will register ;; available input methods. - (let ((tail load-path) - new) - (while tail - (push (car tail) new) - (condition-case nil - (let ((default-directory (car tail))) - (load (expand-file-name "subdirs.el" (car tail)) t t t))) - (condition-case nil - (let ((default-directory (car tail))) - (load (expand-file-name "leim-list.el" (car tail)) t t t))) - (setq tail (cdr tail)))) - (if (not (eq system-type 'vax-vms)) - (progn - ;; If the PWD environment variable isn't accurate, delete it. - (let ((pwd (getenv "PWD"))) - (and (stringp pwd) - ;; Use FOO/., so that if FOO is a symlink, file-attributes - ;; describes the directory linked to, not FOO itself. - (or (equal (file-attributes - (concat (file-name-as-directory pwd) ".")) - (file-attributes - (concat (file-name-as-directory default-directory) - "."))) - (setq process-environment - (delete (concat "PWD=" pwd) - process-environment))))))) + (dolist (dir load-path) + (let ((default-directory dir)) + (load (expand-file-name "subdirs.el") t t t)) + (let ((default-directory dir)) + (load (expand-file-name "leim-list.el") t t t))) + (unless (eq system-type 'vax-vms) + ;; If the PWD environment variable isn't accurate, delete it. + (let ((pwd (getenv "PWD"))) + (and (stringp pwd) + ;; Use FOO/., so that if FOO is a symlink, file-attributes + ;; describes the directory linked to, not FOO itself. + (or (equal (file-attributes + (concat (file-name-as-directory pwd) ".")) + (file-attributes + (concat (file-name-as-directory default-directory) + "."))) + (setq process-environment + (delete (concat "PWD=" pwd) + process-environment)))))) (setq default-directory (abbreviate-file-name default-directory)) (let ((menubar-bindings-done nil)) (unwind-protect From 3f9be7ceca00ad51ff01468243f5f820bf767996 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 20 Aug 2004 23:01:33 +0000 Subject: [PATCH 191/341] (Backup Deletion): Correct description of `delete-old-versions'. (Time Stamps): `time-stamp' needs to be added to `before-save-hook'. (Auto Save Files): Recommend `auto-save-mode' to reenable auto-saving, rather than the abbreviation `auto-save'. --- man/ChangeLog | 8 ++++++++ man/files.texi | 19 ++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 3ff412eb881..85996a57030 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,11 @@ +2004-08-20 Luc Teirlinck + + * files.texi (Backup Deletion): Correct description of + `delete-old-versions'. + (Time Stamps): `time-stamp' needs to be added to `before-save-hook'. + (Auto Save Files): Recommend `auto-save-mode' to reenable + auto-saving, rather than the abbreviation `auto-save'. + 2004-08-17 Luc Teirlinck * emacs.texi (Top): Mention "cutting" and "pasting" as synonyms diff --git a/man/files.texi b/man/files.texi index 476c3c7b461..b5ebf7cf820 100644 --- a/man/files.texi +++ b/man/files.texi @@ -1,5 +1,5 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985,86,87,93,94,95,97,99, 2000, 2001 +@c Copyright (C) 1985,86,87,93,94,95,97,99, 2000, 2001, 2004 @c Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @node Files, Buffers, Keyboard Macros, Top @@ -625,9 +625,10 @@ made backup is included in the count in @code{kept-new-versions}. By default, both variables are 2. @vindex delete-old-versions - If @code{delete-old-versions} is non-@code{nil}, Emacs deletes the -excess backup files silently. If it is @code{nil}, the default, Emacs -asks you whether it should delete the excess backup versions. + If @code{delete-old-versions} is @code{t}, Emacs deletes the excess +backup files silently. If it is @code{nil}, the default, Emacs asks +you whether it should delete the excess backup versions. If it has +any other value, then Emacs never automatically deletes backups. Dired's @kbd{.} (Period) command can also be used to delete old versions. @xref{Dired Deletion}. @@ -836,7 +837,7 @@ Time-stamp: " " @end example Then add the hook function @code{time-stamp} to the hook -@code{write-file-functions}; that hook function will automatically update +@code{before-save-hook}; that hook function will automatically update the time stamp, inserting the current date and time when you save the file. You can also use the command @kbd{M-x time-stamp} to update the time stamp manually. For other customizations, see the Custom group @@ -942,7 +943,7 @@ when they are auto-saved, the auto-save file name is made by appending @samp{#} to the front and rear of buffer name, then adding digits and letters at the end for uniqueness. For example, the @samp{*mail*} buffer in which you compose messages to be -sent might auto-saved in a file named @file{#*mail*#704juu}. Auto-save file +sent might be auto-saved in a file named @file{#*mail*#704juu}. Auto-save file names are made this way unless you reprogram parts of Emacs to do something different (the functions @code{make-auto-save-file-name} and @code{auto-save-file-name-p}). The file name to be used for auto-saving @@ -962,7 +963,7 @@ save turns off temporarily in that buffer. This is because if you deleted the text unintentionally, you might find the auto-save file more useful if it contains the deleted text. To reenable auto-saving after this happens, save the buffer with @kbd{C-x C-s}, or use @kbd{C-u 1 M-x -auto-save}. +auto-save-mode}. @vindex auto-save-visited-file-name If you want auto-saving to be done in the visited file rather than @@ -1567,7 +1568,7 @@ the revision denoted on the current line was committed. @item Pressing @kbd{L} shows the log of the revision at line. This is -useful to see the author's description of the changes that occured +useful to see the author's description of the changes that occurred when the revision denoted on the current line was committed. @item @@ -1585,7 +1586,7 @@ use once a day. @menu * Registering:: Putting a file under version control. * VC Status:: Viewing the VC status of files. -* VC Undo:: Cancelling changes before or after check-in. +* VC Undo:: Canceling changes before or after check-in. * VC Dired Mode:: Listing files managed by version control. * VC Dired Commands:: Commands to use in a VC Dired buffer. @end menu From 9dc15871b2848d55dcf29d9c1ed0f0e5d3e18d27 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 Aug 2004 11:31:45 +0000 Subject: [PATCH 192/341] Massively rearranged by category, to make environment features and symptoms easier to find. Bugs relating to 20th-century systems moved to the end. Most problem headers changed to "object: variation" format. --- etc/PROBLEMS | 5842 +++++++++++++++++++++++++------------------------- 1 file changed, 2951 insertions(+), 2891 deletions(-) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index a72d6f14e31..0152dad9dd9 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1,45 +1,808 @@ This file describes various problems that have been encountered -in compiling, installing and running GNU Emacs. +in compiling, installing and running GNU Emacs. Try doing Ctl t +and browsing through the outline headers. -* Environment Variables from dotfiles are ignored with Mac OS X (Carbon). +* Emacs startup failures -When starting Emacs from the Dock or the Finder on Mac OS X, the -environment variables that are set up in dotfiles, such as .cshrc or -.profile, are ignored. This is because the Finder and Dock are not -started from a shell, but instead from the Window Manager itself. +** Emacs fails to start, complaining about missing fonts. -The workaround for this is to create a .MacOSX/environment.plist file to -setup these environment variables. These environment variables will -apply to all processes regardless of where they are started. -For me information, see http://developer.apple.com/qa/qa2001/qa1067.html. +A typical error message might be something like -* Segfault on GNU/Linux using certain recent versions of the Linux kernel. + No fonts match `-*-fixed-medium-r-*--6-*-*-*-*-*-iso8859-1' -With certain recent Linux kernels (like the one of Redhat Fedora Core -1), the new "Exec-shield" functionality is enabled by default, which -creates a different memory layout that breaks the emacs dumper. +This happens because some X resource specifies a bad font family for +Emacs to use. The possible places where this specification might be +are: -You can check the Exec-shield state like this: + - in your ~/.Xdefaults file - cat /proc/sys/kernel/exec-shield + - client-side X resource file, such as ~/Emacs or + /usr/X11R6/lib/app-defaults/Emacs or + /usr/X11R6/lib/X11/app-defaults/Emacs -It returns 1 or 2 when Exec-shield is enabled, 0 otherwise. Please -read your system documentation for more details on Exec-shield and -associated commands. +One of these files might have bad or malformed specification of a +fontset that Emacs should use. To fix the problem, you need to find +the problematic line(s) and correct them. -When Exec-shield is enabled, building Emacs will segfault during the -execution of this command: +** Emacs aborts while starting up, only when run without X. -temacs --batch --load loadup [dump|bootstrap] +This problem often results from compiling Emacs with GCC when GCC was +installed incorrectly. The usual error in installing GCC is to +specify --includedir=/usr/include. Installation of GCC makes +corrected copies of the system header files. GCC is supposed to use +the corrected copies in preference to the original system headers. +Specifying --includedir=/usr/include causes the original system header +files to be used. On some systems, the definition of ioctl in the +original system header files is invalid for ANSI C and causes Emacs +not to work. -To work around this problem, it is necessary to temporarily disable -Exec-shield while building Emacs, using the `setarch' command like -this: +The fix is to reinstall GCC, and this time do not specify --includedir +when you configure it. Then recompile Emacs. Specifying --includedir +is appropriate only in very special cases and it should *never* be the +same directory where system header files are kept. - setarch i386 ./configure - setarch i386 make +** Emacs does not start, complaining that it cannot open termcap database file. -* Characters are displayed as empty boxes or with wrong font under X. +If your system uses Terminfo rather than termcap (most modern +systems do), this could happen if the proper version of +ncurses is not visible to the Emacs configure script (i.e. it +cannot be found along the usual path the linker looks for +libraries). It can happen because your version of ncurses is +obsolete, or is available only in form of binaries. + +The solution is to install an up-to-date version of ncurses in +the developer's form (header files, static libraries and +symbolic links); in some GNU/Linux distributions (e.g. Debian) +it constitutes a separate package. + +** Emacs 20 and later fails to load Lisp files at startup. + +The typical error message might be like this: + + "Cannot open load file: fontset" + +This could happen if you compress the file lisp/subdirs.el. That file +tells Emacs what are the directories where it should look for Lisp +files. Emacs cannot work with subdirs.el compressed, since the +Auto-compress mode it needs for this will not be loaded until later, +when your .emacs file is processed. (The package `fontset.el' is +required to set up fonts used to display text on window systems, and +it's loaded very early in the startup procedure.) + +Similarly, any other .el file for which there's no corresponding .elc +file could fail to load if it is compressed. + +The solution is to uncompress all .el files which don't have a .elc +file. + +Another possible reason for such failures is stale *.elc files +lurking somewhere on your load-path. The following command will +print any duplicate Lisp files that are present in load-path: + + emacs -q -batch -f list-load-path-shadows + +If this command prints any file names, some of these files are stale, +and should be deleted or their directories removed from your +load-path. + +** Emacs prints an error at startup after upgrading from an earlier version. + +An example of such an error is: + + x-complement-fontset-spec: "Wrong type argument: stringp, nil" + +This can be another symptom of stale *.elc files in your load-path. +The following command will print any duplicate Lisp files that are +present in load-path: + + emacs -q -batch -f list-load-path-shadows + +If this command prints any file names, some of these files are stale, +and should be deleted or their directories removed from your +load-path. + +** With X11R6.4, public-patch-3, Emacs crashes at startup. + +Reportedly this patch in X fixes the problem. + + --- xc/lib/X11/imInt.c~ Wed Jun 30 13:31:56 1999 + +++ xc/lib/X11/imInt.c Thu Jul 1 15:10:27 1999 + @@ -1,4 +1,4 @@ + -/* $TOG: imInt.c /main/5 1998/05/30 21:11:16 kaleb $ */ + +/* $TOG: imInt.c /main/5 1998/05/30 21:11:16 kaleb $ */ + /****************************************************************** + + Copyright 1992, 1993, 1994 by FUJITSU LIMITED + @@ -166,8 +166,8 @@ + _XimMakeImName(lcd) + XLCd lcd; + { + - char* begin; + - char* end; + + char* begin = NULL; + + char* end = NULL; + char* ret; + int i = 0; + char* ximmodifier = XIMMODIFIER; + @@ -182,7 +182,11 @@ + } + ret = Xmalloc(end - begin + 2); + if (ret != NULL) { + - (void)strncpy(ret, begin, end - begin + 1); + + if (begin != NULL) { + + (void)strncpy(ret, begin, end - begin + 1); + + } else { + + ret[0] = '\0'; + + } + ret[end - begin + 1] = '\0'; + } + return ret; + +* Crash bugs + +** Emacs crashes in x-popup-dialog. + +This can happen if the dialog widget cannot find the font it wants to +use. You can work around the problem by specifying another font with +an X resource--for example, `Emacs.dialog*.font: 9x15' (or any font that +happens to exist on your X server). + +** Emacs crashes when you use Bibtex mode. + +This happens if your system puts a small limit on stack size. You can +prevent the problem by using a suitable shell command (often `ulimit') +to raise the stack size limit before you run Emacs. + +Patches to raise the stack size limit automatically in `main' +(src/emacs.c) on various systems would be greatly appreciated. + +** Emacs crashes with SIGBUS or SIGSEGV on HPUX 9 after you delete a frame. + +We think this is due to a bug in the X libraries provided by HP. With +the alternative X libraries in /usr/contrib/mitX11R5/lib, the problem +does not happen. + +** Emacs crashes with SIGBUS or SIGSEGV on Solaris after you delete a frame. + +We suspect that this is a similar bug in the X libraries provided by +Sun. There is a report that one of these patches fixes the bug and +makes the problem stop: + +105216-01 105393-01 105518-01 105621-01 105665-01 105615-02 105216-02 +105667-01 105401-08 105615-03 105621-02 105686-02 105736-01 105755-03 +106033-01 105379-01 105786-01 105181-04 105379-03 105786-04 105845-01 +105284-05 105669-02 105837-01 105837-02 105558-01 106125-02 105407-01 + +Another person using a newer system (kernel patch level Generic_105181-06) +suspects that the bug was fixed by one of these more recent patches: + +106040-07 SunOS 5.6: X Input & Output Method patch +106222-01 OpenWindows 3.6: filemgr (ff.core) fixes +105284-12 Motif 1.2.7: sparc Runtime library patch + +** Error message `Symbol's value as variable is void: x', followed by +a segmentation fault and core dump. + +This has been tracked to a bug in tar! People report that tar erroneously +added a line like this at the beginning of files of Lisp code: + + x FILENAME, N bytes, B tape blocks + +If your tar has this problem, install GNU tar--if you can manage to +untar it :-). + +** Crashes when displaying GIF images in Emacs built with version +libungif-4.1.0 are resolved by using version libungif-4.1.0b1. +Configure checks for the correct version, but this problem could occur +if a binary built against a shared libungif is run on a system with an +older version. + +** Emacs aborts inside the function `tparam1'. + +This can happen if Emacs was built without terminfo support, but the +terminal's capabilities use format that is only supported by terminfo. +If your system has ncurses installed, this might happen if your +version of ncurses is broken; upgrading to a newer version of ncurses +and reconfiguring and rebuilding Emacs should solve this. + +All modern systems support terminfo, so even if ncurses is not the +problem, you should look for a way to configure Emacs so that it uses +terminfo when built. + +** Emacs crashes when using the Exceed 6.0 X server. + +If you are using Exceed 6.1, upgrade to a later version. This was +reported to prevent the crashes. + +** Emacs crashes with SIGSEGV in XtInitializeWidgetClass. + +It crashes on X, but runs fine when called with option "-nw". + +This has been observed when Emacs is linked with GNU ld but without passing +the -z nocombreloc flag. Emacs normally knows to pass the -z nocombreloc +flag when needed, so if you come across a situation where the flag is +necessary but missing, please report it via M-x report-emacs-bug. + +On platforms such as Solaris, you can also work around this problem by +configuring your compiler to use the native linker instead of GNU ld. + +* General runtime problems + +** Lisp problems + +*** Changes made to .el files do not take effect. + +You may have forgotten to recompile them into .elc files. +Then the old .elc files will be loaded, and your changes +will not be seen. To fix this, do M-x byte-recompile-directory +and specify the directory that contains the Lisp files. + +Emacs should print a warning when loading a .elc file which is older +than the corresponding .el file. + +*** Watch out for .emacs files and EMACSLOADPATH environment vars. + +These control the actions of Emacs. +~/.emacs is your Emacs init file. +EMACSLOADPATH overrides which directories the function +"load" will search. + +If you observe strange problems, check for these and get rid +of them, then try again. + +*** Using epop3.el package causes Emacs to signal an error. + +The error message might be something like this: + + "Lisp nesting exceeds max-lisp-eval-depth" + +This happens because epop3 redefines the function gethash, which is a +built-in primitive beginning with Emacs 21.1. We don't have a patch +for epop3 that fixes this, but perhaps a newer version of epop3 +corrects that. + +*** Buffers from `with-output-to-temp-buffer' get set up in Help mode. + +Changes in Emacs 20.4 to the hooks used by that function cause +problems for some packages, specifically BBDB. See the function's +documentation for the hooks involved. BBDB 2.00.06 fixes the problem. + +*** The Hyperbole package causes *Help* buffers not to be displayed in +Help mode due to setting `temp-buffer-show-hook' rather than using +`add-hook'. Using `(add-hook 'temp-buffer-show-hook +'help-mode-maybe)' after loading Hyperbole should fix this. + +** Keyboard problems + +*** "Compose Character" key does strange things when used as a Meta key. + +If you define one key to serve as both Meta and Compose Character, you +will get strange results. In previous Emacs versions, this "worked" +in that the key acted as Meta--that's because the older Emacs versions +did not try to support Compose Character. Now Emacs tries to do +character composition in the standard X way. This means that you +must pick one meaning or the other for any given key. + +You can use both functions (Meta, and Compose Character) if you assign +them to two different keys. + +*** C-z just refreshes the screen instead of suspending Emacs. + +You are probably using a shell that doesn't support job control, even +though the system itself is capable of it. Either use a different shell, +or set the variable `cannot-suspend' to a non-nil value. + +*** With M-x enable-flow-control, you need to type C-\ twice +to do incremental search--a single C-\ gets no response. + +This has been traced to communicating with your machine via kermit, +with C-\ as the kermit escape character. One solution is to use +another escape character in kermit. One user did + + set escape-character 17 + +in his .kermrc file, to make C-q the kermit escape character. + +** Mailers and other helper programs + +*** movemail compiled with POP support can't connect to the POP server. + +Make sure that the `pop' entry in /etc/services, or in the services +NIS map if your machine uses NIS, has the same port number as the +entry on the POP server. A common error is for the POP server to be +listening on port 110, the assigned port for the POP3 protocol, while +the client is trying to connect on port 109, the assigned port for the +old POP protocol. + +*** RMAIL gets error getting new mail. + +RMAIL gets new mail from /usr/spool/mail/$USER using a program +called `movemail'. This program interlocks with /bin/mail using +the protocol defined by /bin/mail. + +There are two different protocols in general use. One of them uses +the `flock' system call. The other involves creating a lock file; +`movemail' must be able to write in /usr/spool/mail in order to do +this. You control which one is used by defining, or not defining, +the macro MAIL_USE_FLOCK in config.h or the m- or s- file it includes. +IF YOU DON'T USE THE FORM OF INTERLOCKING THAT IS NORMAL ON YOUR +SYSTEM, YOU CAN LOSE MAIL! + +If your system uses the lock file protocol, and fascist restrictions +prevent ordinary users from writing the lock files in /usr/spool/mail, +you may need to make `movemail' setgid to a suitable group such as +`mail'. You can use these commands (as root): + + chgrp mail movemail + chmod 2755 movemail + +If your system uses the lock file protocol, and fascist restrictions +prevent ordinary users from writing the lock files in /usr/spool/mail, +you may need to make `movemail' setgid to a suitable group such as +`mail'. To do this, use the following commands (as root) after doing the +make install. + + chgrp mail movemail + chmod 2755 movemail + +Installation normally copies movemail from the build directory to an +installation directory which is usually under /usr/local/lib. The +installed copy of movemail is usually in the directory +/usr/local/lib/emacs/VERSION/TARGET. You must change the group and +mode of the installed copy; changing the group and mode of the build +directory copy is ineffective. + +*** rcs2log gives you the awk error message "too many fields". + +This is due to an arbitrary limit in certain versions of awk. +The solution is to use gawk (GNU awk). + +** Problems with hostname resolution + +*** Emacs fails to understand most Internet host names, even though +the names work properly with other programs on the same system. +*** Emacs won't work with X-windows if the value of DISPLAY is HOSTNAME:0. +*** GNUs can't make contact with the specified host for nntp. + +This typically happens on Suns and other systems that use shared +libraries. The cause is that the site has installed a version of the +shared library which uses a name server--but has not installed a +similar version of the unshared library which Emacs uses. + +The result is that most programs, using the shared library, work with +the nameserver, but Emacs does not. + +The fix is to install an unshared library that corresponds to what you +installed in the shared library, and then relink Emacs. + +On SunOS 4.1, simply define HAVE_RES_INIT. + +If you have already installed the name resolver in the file libresolv.a, +then you need to compile Emacs to use that library. The easiest way to +do this is to add to config.h a definition of LIBS_SYSTEM, LIBS_MACHINE +or LIB_STANDARD which uses -lresolv. Watch out! If you redefine a macro +that is already in use in your configuration to supply some other libraries, +be careful not to lose the others. + +Thus, you could start by adding this to config.h: + +#define LIBS_SYSTEM -lresolv + +Then if this gives you an error for redefining a macro, and you see that +the s- file defines LIBS_SYSTEM as -lfoo -lbar, you could change config.h +again to say this: + +#define LIBS_SYSTEM -lresolv -lfoo -lbar + +*** Emacs does not know your host's fully-qualified domain name. + +You need to configure your machine with a fully qualified domain name, +either in /etc/hosts, /etc/hostname, the NIS, or wherever your system +calls for specifying this. + +If you cannot fix the configuration, you can set the Lisp variable +mail-host-address to the value you want. + +** NFS and RFS + +*** Emacs says it has saved a file, but the file does not actually +appear on disk. + +This can happen on certain systems when you are using NFS, if the +remote disk is full. It is due to a bug in NFS (or certain NFS +implementations), and there is apparently nothing Emacs can do to +detect the problem. Emacs checks the failure codes of all the system +calls involved in writing a file, including `close'; but in the case +where the problem occurs, none of those system calls fails. + +*** Editing files through RFS gives spurious "file has changed" warnings. +It is possible that a change in Emacs 18.37 gets around this problem, +but in case not, here is a description of how to fix the RFS bug that +causes it. + + There was a serious pair of bugs in the handling of the fsync() system + call in the RFS server. + + The first is that the fsync() call is handled as another name for the + close() system call (!!). It appears that fsync() is not used by very + many programs; Emacs version 18 does an fsync() before closing files + to make sure that the bits are on the disk. + + This is fixed by the enclosed patch to the RFS server. + + The second, more serious problem, is that fsync() is treated as a + non-blocking system call (i.e., it's implemented as a message that + gets sent to the remote system without waiting for a reply). Fsync is + a useful tool for building atomic file transactions. Implementing it + as a non-blocking RPC call (when the local call blocks until the sync + is done) is a bad idea; unfortunately, changing it will break the RFS + protocol. No fix was supplied for this problem. + + (as always, your line numbers may vary) + + % rcsdiff -c -r1.2 serversyscall.c + RCS file: RCS/serversyscall.c,v + retrieving revision 1.2 + diff -c -r1.2 serversyscall.c + *** /tmp/,RCSt1003677 Wed Jan 28 15:15:02 1987 + --- serversyscall.c Wed Jan 28 15:14:48 1987 + *************** + *** 163,169 **** + /* + * No return sent for close or fsync! + */ + ! if (syscall == RSYS_close || syscall == RSYS_fsync) + proc->p_returnval = deallocate_fd(proc, msg->m_args[0]); + else + { + --- 166,172 ---- + /* + * No return sent for close or fsync! + */ + ! if (syscall == RSYS_close) + proc->p_returnval = deallocate_fd(proc, msg->m_args[0]); + else + { + +** PSGML + +*** Old versions of the PSGML package use the obsolete variables +`before-change-function' and `after-change-function', which are no +longer used by Emacs. Please use PSGML 1.2.3 or later. + +*** PSGML conflicts with sgml-mode. + +PSGML package uses the same names of some variables (like keymap) +as built-in sgml-mode.el because it was created as a replacement +of that package. The conflict will be shown if you load +sgml-mode.el before psgml.el. E.g. this could happen if you edit +HTML page and then start to work with SGML or XML file. html-mode +(from sgml-mode.el) is used for HTML file and loading of psgml.el +(for sgml-mode or xml-mode) will cause an error. + +*** Versions of the PSGML package earlier than 1.0.3 (stable) or 1.1.2 +(alpha) fail to parse DTD files correctly in Emacs 20.3 and later. +Here is a patch for psgml-parse.el from PSGML 1.0.1 and, probably, +earlier versions. + +--- psgml-parse.el 1998/08/21 19:18:18 1.1 ++++ psgml-parse.el 1998/08/21 19:20:00 +@@ -2383,7 +2383,7 @@ (defun sgml-push-to-entity (entity &opti + (setq sgml-buffer-parse-state nil)) + (cond + ((stringp entity) ; a file name +- (save-excursion (insert-file-contents entity)) ++ (insert-file-contents entity) + (setq default-directory (file-name-directory entity))) + ((consp (sgml-entity-text entity)) ; external id? + (let* ((extid (sgml-entity-text entity)) + +** AUC TeX + +*** Emacs 21 freezes when visiting a TeX file with AUC TeX installed. + +Emacs 21 needs version 10 or later of AUC TeX; upgrading should solve +these problems. + +*** No colors in AUC TeX with Emacs 21. + +Upgrade to AUC TeX version 10 or later, and make sure it is +byte-compiled with Emacs 21. + +*** Running TeX from AUC TeX package with Emacs 20.3 gives a Lisp error +about a read-only tex output buffer. + +This problem appeared for AUC TeX version 9.9j and some earlier +versions. Here is a patch for the file tex-buf.el in the AUC TeX +package. + +diff -c auctex/tex-buf.el~ auctex/tex-buf.el +*** auctex/tex-buf.el~ Wed Jul 29 18:35:32 1998 +--- auctex/tex-buf.el Sat Sep 5 15:20:38 1998 +*************** +*** 545,551 **** + (dir (TeX-master-directory))) + (TeX-process-check file) ; Check that no process is running + (setq TeX-command-buffer (current-buffer)) +! (with-output-to-temp-buffer buffer) + (set-buffer buffer) + (if dir (cd dir)) + (insert "Running `" name "' on `" file "' with ``" command "''\n") +- --- 545,552 ---- + (dir (TeX-master-directory))) + (TeX-process-check file) ; Check that no process is running + (setq TeX-command-buffer (current-buffer)) +! (let (temp-buffer-show-function temp-buffer-show-hook) +! (with-output-to-temp-buffer buffer)) + (set-buffer buffer) + (if dir (cd dir)) + (insert "Running `" name "' on `" file "' with ``" command "''\n") + +** Miscellaneous problems + +*** Self-documentation messages are garbled. + +This means that the file `etc/DOC-...' doesn't properly correspond +with the Emacs executable. Redumping Emacs and then installing the +corresponding pair of files should fix the problem. + +*** Programs running under terminal emulator do not recognize `emacs' +terminal type. + +The cause of this is a shell startup file that sets the TERMCAP +environment variable. The terminal emulator uses that variable to +provide the information on the special terminal type that Emacs +emulates. + +Rewrite your shell startup file so that it does not change TERMCAP +in such a case. You could use the following conditional which sets +it only if it is undefined. + + if ( ! ${?TERMCAP} ) setenv TERMCAP ~/my-termcap-file + +Or you could set TERMCAP only when you set TERM--which should not +happen in a non-login shell. + +*** In Shell mode, you get a ^M at the end of every line. + +This happens to people who use tcsh, because it is trying to be too +smart. It sees that the Shell uses terminal type `unknown' and turns +on the flag to output ^M at the end of each line. You can fix the +problem by adding this to your .cshrc file: + + if ($?EMACS) then + if ($EMACS == "t") then + unset edit + stty -icrnl -onlcr -echo susp ^Z + endif + endif + +*** Emacs startup on GNU/Linux systems (and possibly other systems) is slow. + +This can happen if the system is misconfigured and Emacs can't get the +full qualified domain name, FQDN. You should have your FQDN in the +/etc/hosts file, something like this: + +127.0.0.1 localhost +129.187.137.82 nuc04.t30.physik.tu-muenchen.de nuc04 + +The way to set this up may vary on non-GNU systems. + +*** Attempting to visit remote files via ange-ftp fails. + +If the error message is "ange-ftp-file-modtime: Specified time is not +representable", then this could happen when `lukemftp' is used as the +ftp client. This was reported to happen on Debian GNU/Linux, kernel +version 2.4.3, with `lukemftp' 1.5-5, but might happen on other +systems as well. To avoid this problem, switch to using the standard +ftp client. On a Debian system, type + + update-alternatives --config ftp + +and then choose /usr/bin/netkit-ftp. + +*** JPEG images aren't displayed. + +This has been reported when Emacs is built with jpeg-6a library. +Upgrading to jpeg-6b solves the problem. Configure checks for the +correct version, but this problem could occur if a binary built +against a shared libjpeg is run on a system with an older version. + +*** Dired is very slow. + +This could happen if invocation of the `df' program takes a long +time. Possible reasons for this include: + + - ClearCase mounted filesystems (VOBs) that sometimes make `df' + response time extremely slow (dozens of seconds); + + - slow automounters on some old versions of Unix; + + - slow operation of some versions of `df'. + +To work around the problem, you could either (a) set the variable +`directory-free-space-program' to nil, and thus prevent Emacs from +invoking `df'; (b) use `df' from the GNU Fileutils package; or +(c) use CVS, which is Free Software, instead of ClearCase. + +*** Versions of the W3 package released before Emacs 21.1 don't run +under Emacs 21. This fixed in W3 version 4.0pre.47. + +*** The LDAP support rely on ldapsearch program from OpenLDAP version 2. + +It can fail to work with ldapsearch program from OpenLDAP version 1. +Version 1 of OpenLDAP is now deprecated. If you are still using it, +please upgrade to version 2. As a temporary workaround, remove +argument "-x" from the variable `ldap-ldapsearch-args'. + +*** ps-print commands fail to find prologue files ps-prin*.ps. + +This can happen if you use an old version of X-Symbol package: it +defines compatibility functions which trick ps-print into thinking it +runs in XEmacs, and look for the prologue files in a wrong directory. + +The solution is to upgrade X-Symbol to a later version. + +*** On systems with shared libraries you might encounter run-time errors +from the dynamic linker telling you that it is unable to find some +shared libraries, for instance those for Xaw3d or image support. +These errors mean Emacs has been linked with a library whose shared +library is not in the default search path of the dynamic linker. + +Similar problems could prevent Emacs from building, since the build +process invokes Emacs several times. + +On many systems, it is possible to set LD_LIBRARY_PATH in your +environment to specify additional directories where shared libraries +can be found. + +Other systems allow to set LD_RUN_PATH in a similar way, but before +Emacs is linked. With LD_RUN_PATH set, the linker will include a +specified run-time search path in the executable. + +On some systems, Emacs can crash due to problems with dynamic +linking. Specifically, on SGI Irix 6.5, crashes were reported with +backtraces like this: + + (dbx) where + 0 strcmp(0xf49239d, 0x4031184, 0x40302b4, 0x12, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2) ["/xlv22/ficus-jan23/work/irix/lib/libc/libc_n32_M3_ns/strings/strcmp.s":35, 0xfb7e480] + 1 general_find_symbol(0xf49239d, 0x0, 0x0, 0x0, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2) + ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":2140, 0xfb65a98] + 2 resolve_symbol(0xf49239d, 0x4031184, 0x0, 0xfbdd438, 0x0, 0xf4923aa, 0x0, 0x492ddb2) + ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":1947, 0xfb657e4] + 3 lazy_text_resolve(0xd18, 0x1a3, 0x40302b4, 0x12, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2) + ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":997, 0xfb64d44] + 4 _rld_text_resolve(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) + ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld_bridge.s":175, 0xfb6032c] + +(`rld' is the dynamic linker.) We don't know yet why this +happens, but setting the environment variable LD_BIND_NOW to 1 (which +forces the dynamic linker to bind all shared objects early on) seems +to work around the problem. + +Please refer to the documentation of your dynamic linker for details. + +*** You request inverse video, and the first Emacs frame is in inverse +video, but later frames are not in inverse video. + +This can happen if you have an old version of the custom library in +your search path for Lisp packages. Use M-x list-load-path-shadows to +check whether this is true. If it is, delete the old custom library. + +*** When you run Ispell from Emacs, it reports a "misalignment" error. + +This can happen if you compiled the Ispell program to use ASCII +characters only and then try to use it from Emacs with non-ASCII +characters, like Latin-1. The solution is to recompile Ispell with +support for 8-bit characters. + +To see whether your Ispell program supports 8-bit characters, type +this at your shell's prompt: + + ispell -vv + +and look in the output for the string "NO8BIT". If Ispell says +"!NO8BIT (8BIT)", your speller supports 8-bit characters; otherwise it +does not. + +To rebuild Ispell with 8-bit character support, edit the local.h file +in the Ispell distribution and make sure it does _not_ define NO8BIT. +Then rebuild the speller. + +Another possible cause for "misalignment" error messages is that the +version of Ispell installed on your machine is old. Upgrade. + +Yet another possibility is that you are trying to spell-check a word +in a language that doesn't fit the dictionary you choose for use by +Ispell. (Ispell can only spell-check one language at a time, because +it uses a single dictionary.) Make sure that the text you are +spelling and the dictionary used by Ispell conform to each other. + +If your spell-checking program is Aspell, it has been reported that if +you have a personal configuration file (normally ~/.aspell.conf), it +can cause this error. Remove that file, execute `ispell-kill-ispell' +in Emacs, and then try spell-checking again. + +* Runtime problems related to font handling + +** Under X11, some characters appear as hollow boxes. + +Each X11 font covers just a fraction of the characters that Emacs +supports. To display the whole range of Emacs characters requires +many different fonts, collected into a fontset. + +If some of the fonts called for in your fontset do not exist on your X +server, then the characters that have no font appear as hollow boxes. +You can remedy the problem by installing additional fonts. + +The intlfonts distribution includes a full spectrum of fonts that can +display all the characters Emacs supports. + +Another cause of this for specific characters is fonts which have a +missing glyph and no default character. This is known to occur for +character number 160 (no-break space) in some fonts, such as Lucida +but Emacs sets the display table for the unibyte and Latin-1 version +of this character to display a space. + +** Under X11, some characters appear improperly aligned in their lines. + +You may have bad X11 fonts; try installing the intlfonts distribution. + +** Certain fonts make each line take one pixel more than it "should". + +This is because these fonts contain characters a little taller +than the font's nominal height. Emacs needs to make sure that +lines do not overlap. + +** Loading fonts is very slow. + +You might be getting scalable fonts instead of precomputed bitmaps. +Known scalable font directories are "Type1" and "Speedo". A font +directory contains scalable fonts if it contains the file +"fonts.scale". + +If this is so, re-order your X windows font path to put the scalable +font directories last. See the documentation of `xset' for details. + +With some X servers, it may be necessary to take the scalable font +directories out of your path entirely, at least for Emacs 19.26. +Changes in the future may make this unnecessary. + +** Font Lock displays portions of the buffer in incorrect faces. + +By far the most frequent cause of this is a parenthesis `(' or a brace +`{' in column zero. Font Lock assumes that such a paren is outside of +any comment or string. This is of course not true in general, but the +vast majority of well-formatted program source files don't have such +parens, and therefore this assumption is used to allow optimizations +in Font Lock's syntactical analysis. These optimizations avoid some +pathological cases where jit-lock, the Just-in-Time fontification +introduced with Emacs 21.1, could significantly slow down scrolling +through the buffer, especially scrolling backwards, and also jumping +to the end of a very large buffer. + +Beginning with version 21.4, a parenthesis or a brace in column zero +is highlighted in bold-red face if it is inside a string or a comment, +to indicate that it could interfere with Font Lock (and also with +indentation) and should be moved or escaped with a backslash. + +If you don't use large buffers, or have a very fast machine which +makes the delays insignificant, you can avoid the incorrect +fontification by setting the variable +`font-lock-beginning-of-syntax-function' to a nil value. (This must +be done _after_ turning on Font Lock.) + +Another alternative is to avoid a paren in column zero. For example, +in a Lisp string you could precede the paren with a backslash. + +** With certain fonts, when the cursor appears on a character, the +character doesn't appear--you get a solid box instead. + +One user on a Linux-based GNU system reported that this problem went +away with installation of a new X server. The failing server was +XFree86 3.1.1. XFree86 3.1.2 works. + +** Characters are displayed as empty boxes or with wrong font under X. This can occur when two different versions of FontConfig are used. For example, XFree86 4.3.0 has one version and Gnome usually comes @@ -53,25 +816,50 @@ application with problem must be recompiled with the same version of FontConfig as the rest of the system uses. For KDE, it is sufficient to recompile Qt. -* Process output truncated on Mac OS X (Carbon) when using pty's. +** Emacs pauses for several seconds when changing the default font. -There appears to be a problem with the implementation of pty's on the -Mac OS X that causes process output to be truncated. To avoid this, -leave process-connection-type set to its default value of nil. +This has been reported for fvwm 2.2.5 and the window manager of KDE +2.1. The reason for the pause is Xt waiting for a ConfigureNotify +event from the window manager, which the window manager doesn't send. +Xt stops waiting after a default timeout of usually 5 seconds. -* Emacs crashes with SIGSEGV in XtInitializeWidgetClass +A workaround for this is to add something like -It crashes on X, but runs fine when called with option "-nw". +emacs.waitForWM: false -This has been observed when Emacs is linked with GNU ld but without passing -the -z nocombreloc flag. Emacs normally knows to pass the -z nocombreloc -flag when needed, so if you come across a situation where the flag is -necessary but missing, please report it via M-x report-emacs-bug. +to your X resources. Alternatively, add `(wait-for-wm . nil)' to a +frame's parameter list, like this: -On platforms such as Solaris, you can also work around this problem by -configuring your compiler to use the native linker instead of GNU ld. - -* Characters from the mule-unicode charsets aren't displayed under X. + (modify-frame-parameters nil '((wait-for-wm . nil))) + +(this should go into your `.emacs' file). + +** Underlines appear at the wrong position. + +This is caused by fonts having a wrong UNDERLINE_POSITION property. +Examples are the font 7x13 on XFree prior to version 4.1, or the jmk +neep font from the Debian xfonts-jmk package. To circumvent this +problem, set x-use-underline-position-properties to nil in your +`.emacs'. + +To see what is the value of UNDERLINE_POSITION defined by the font, +type `xlsfonts -lll FONT' and look at the font's UNDERLINE_POSITION +property. + +** When using Exceed, fonts sometimes appear too tall. + +When the display is set to an Exceed X-server and fonts are specified +(either explicitly with the -fn option or implicitly with X resources) +then the fonts may appear "too tall". The actual character sizes are +correct but there is too much vertical spacing between rows, which +gives the appearance of "double spacing". + +To prevent this, turn off the Exceed's "automatic font substitution" +feature (in the font part of the configuration window). + +* Internationalization problems + +** Characters from the mule-unicode charsets aren't displayed under X. XFree86 4 contains many fonts in iso10646-1 encoding which have minimal character repertoires (whereas the encoding part of the font @@ -87,7 +875,7 @@ mule-unicode-2500-33ff:-gnu-unifont-*-iso10646-1,\ mule-unicode-e000-ffff:-gnu-unifont-*-iso10646-1,\ mule-unicode-0100-24ff:-gnu-unifont-*-iso10646-1 -* The UTF-8/16/7 coding systems don't encode CJK (Far Eastern) characters. +** The UTF-8/16/7 coding systems don't encode CJK (Far Eastern) characters. Emacs by default only supports the parts of the Unicode BMP whose code points are in the ranges 0000-33ff and e000-ffff. This excludes: most @@ -108,26 +896,7 @@ save as UTF buffers containing characters decoded by the chinese-, japanese- and korean- coding systems, e.g. cut and pasted from elsewhere. -* Problems with file dialogs in Emacs built with Open Motif. - -When Emacs 21 is built with Open Motif 2.1, it can happen that the -graphical file dialog boxes do not work properly. The "OK", "Filter" -and "Cancel" buttons do not respond to mouse clicks. Dragging the -file dialog window usually causes the buttons to work again. - -The solution is to use LessTif instead. LessTif is a free replacement -for Motif. See the file INSTALL for information on how to do this. - -Another workaround is not to use the mouse to trigger file prompts, -but to use the keyboard. This way, you will be prompted for a file in -the minibuffer instead of a graphical file dialog. - -* Emacs reports a BadAtom error (from X) running on Solaris 7 or 8. - -This happens when Emacs was built on some other version of Solaris. -Rebuild it on Solaris 8. - -* Mule-UCS loads very slowly. +** Mule-UCS loads very slowly. Changes to Emacs internals interact badly with Mule-UCS's `un-define' library, which is the usual interface to Mule-UCS. Apply the @@ -170,488 +939,7 @@ distributions, such as Debian, may already have applied such a patch.) Note that Emacs has native support for Unicode, roughly equivalent to Mule-UCS's, so you may not need it. -* Building Emacs with GCC 2.9x fails in the `src' directory. - -This may happen if you use a development version of GNU `cpp' from one -of the GCC snapshots between Oct 2000 and Feb 2001, or from a released -version of GCC newer than 2.95.2 which was prepared around those -dates; similar problems were reported with some snapshots of GCC 3.1 -around Sep 30 2001. The preprocessor in those versions is -incompatible with a traditional Unix cpp (e.g., it expands ".." into -". .", which breaks relative file names that reference the parent -directory; or inserts TAB characters before lines that set Make -variables). - -The solution is to make sure the preprocessor is run with the -`-traditional' option. The `configure' script does that automatically -when it detects the known problems in your cpp, but you might hit some -unknown ones. To force the `configure' script to use `-traditional', -run the script like this: - - CPP='gcc -E -traditional' ./configure ... - -(replace the ellipsis "..." with any additional arguments you pass to -the script). - -Note that this problem does not pertain to the MS-Windows port of -Emacs, since it doesn't use the preprocessor to generate Makefiles. - -* Building Emacs with a system compiler fails to link because of an -undefined symbol such as __eprintf which does not appear in Emacs. - -This can happen if some of the libraries linked into Emacs were built -with GCC, but Emacs itself is being linked with a compiler other than -GCC. Object files compiled with GCC might need some helper functions -from libgcc.a, the library which comes with GCC, but the system -compiler does not instruct the linker to search libgcc.a during the -link stage. - -A solution is to link with GCC, like this: - - make CC=gcc - -Since the .o object files already exist, this will not recompile Emacs -with GCC, but just restart by trying again to link temacs. - -* Building the MS-Windows port with Cygwin GCC can fail. - -Emacs may not build using recent Cygwin builds of GCC, such as Cygwin -version 1.1.8, using the default configure settings. It appears to be -necessary to specify the -mwin32 flag when compiling, and define -__MSVCRT__, like so: - - configure --with-gcc --cflags -mwin32 --cflags -D__MSVCRT__ - -* Building the MS-Windows port fails with a CreateProcess failure. - -Some versions of mingw32 make on some versions of Windows do not seem -to detect the shell correctly. Try "make SHELL=cmd.exe", or if that -fails, try running make from Cygwin bash instead. - -* Building the MS-Windows port with Leim fails in the `leim' directory. - -The error message might be something like this: - - Converting d:/emacs-21.3/leim/CXTERM-DIC/4Corner.tit to quail-package... - Invalid ENCODE: value in TIT dictionary - NMAKE : fatal error U1077: '"../src/obj-spd/i386/emacs.exe"' : return code - '0xffffffff' - Stop. - -This can happen if the Leim distribution is unpacked with a program -which converts the `*.tit' files to DOS-style CR-LF text format. The -`*.tit' files in the leim/CXTERM-DIC directory require Unix-style line -endings to compile properly, because Emacs reads them without any code -or EOL conversions. - -The solution is to make sure the program used to unpack Leim does not -change the files' line endings behind your back. The GNU FTP site has -in the `/gnu/emacs/windows' directory a program called `djtarnt.exe' -which can be used to unpack `.tar.gz' and `.zip' archives without -mangling them. - -* Emacs crashes when dumping itself on Mac PPC running Yellow Dog GNU/Linux. - -The crashes happen inside the function Fmake_symbol; here's a typical -C backtrace printed by GDB: - - 0x190c0c0 in Fmake_symbol () - (gdb) where - #0 0x190c0c0 in Fmake_symbol () - #1 0x1942ca4 in init_obarray () - #2 0x18b3500 in main () - #3 0x114371c in __libc_start_main (argc=5, argv=0x7ffff5b4, envp=0x7ffff5cc, - -This could happen because GCC version 2.95 and later changed the base -of the load address to 0x10000000. Emacs needs to be told about this, -but we currently cannot do that automatically, because that breaks -other versions of GNU/Linux on the MacPPC. Until we find a way to -distinguish between the Yellow Dog and the other varieties of -GNU/Linux systems on the PPC, you will have to manually uncomment the -following section near the end of the file src/m/macppc.h in the Emacs -distribution: - - #if 0 /* This breaks things on PPC GNU/Linux except for Yellowdog, - even with identical GCC, as, ld. Let's take it out until we - know what's really going on here. */ - /* GCC 2.95 and newer on GNU/Linux PPC changed the load address to - 0x10000000. */ - #if defined __linux__ - #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) - #define DATA_SEG_BITS 0x10000000 - #endif - #endif - #endif /* 0 */ - -Remove the "#if 0" and "#endif" directives which surround this, save -the file, and then reconfigure and rebuild Emacs. The dumping process -should now succeed. - -* JPEG images aren't displayed. - -This has been reported when Emacs is built with jpeg-6a library. -Upgrading to jpeg-6b solves the problem. Configure checks for the -correct version, but this problem could occur if a binary built -against a shared libjpeg is run on a system with an older version. - -* Building `ctags' for MS-Windows with the MinGW port of GCC fails. - -This might happen due to a bug in the MinGW header assert.h, which -defines the `assert' macro with a trailing semi-colon. The following -patch to assert.h should solve this: - -*** include/assert.h.orig Sun Nov 7 02:41:36 1999 ---- include/assert.h Mon Jan 29 11:49:10 2001 -*************** -*** 41,47 **** - /* - * If not debugging, assert does nothing. - */ -! #define assert(x) ((void)0); - - #else /* debugging enabled */ - ---- 41,47 ---- - /* - * If not debugging, assert does nothing. - */ -! #define assert(x) ((void)0) - - #else /* debugging enabled */ - - - -* Improving performance with slow X connections - -There are several ways to improve this performance, any subset of which can -be carried out at the same time: - -1) If you don't need X Input Methods (XIM) for entering text in some - language you use, you can improve performance on WAN links by using - the X resource useXIM to turn off use of XIM. This does not affect - the use of Emacs' own input methods, which are part of the Leim - package. - -2) If the connection is very slow, you might also want to consider - switching off scroll bars, menu bar, and tool bar. - -3) Use ssh to forward the X connection, and enable compression on this - forwarded X connection (ssh -XC remotehostname emacs ...). - -4) Use lbxproxy on the remote end of the connection. This is an interface - to the low bandwidth X extension in most modern X servers, which - improves performance dramatically, at the slight expense of correctness - of the X protocol. lbxproxy acheives the performance gain by grouping - several X requests in one TCP packet and sending them off together, - instead of requiring a round-trip for each X request in a seperate - packet. The switches that seem to work best for emacs are: - -noatomsfile -nowinattr -cheaterrors -cheatevents - Note that the -nograbcmap option is known to cause problems. - For more about lbxproxy, see: - http://www.xfree86.org/4.3.0/lbxproxy.1.html - -* Getting a Meta key on the FreeBSD console - -By default, neither Alt nor any other key acts as a Meta key on -FreeBSD, but this can be changed using kbdcontrol(1). Dump the -current keymap to a file with the command - - $ kbdcontrol -d >emacs.kbd - -Edit emacs.kbd, and give the key you want to be the Meta key the -definition `meta'. For instance, if your keyboard has a ``Windows'' -key with scan code 105, change the line for scan code 105 in emacs.kbd -to look like this - - 105 meta meta meta meta meta meta meta meta O - -to make the Windows key the Meta key. Load the new keymap with - - $ kbdcontrol -l emacs.kbd - -* Emacs' xterm-mouse-mode doesn't work on the Gnome terminal. - -A symptom of this bug is that double-clicks insert a control sequence -into the buffer. The reason this happens is an apparent -incompatibility of the Gnome terminal with Xterm, which also affects -other programs using the Xterm mouse interface. A problem report has -been filed. - -* Emacs pauses for several seconds when changing the default font - -This has been reported for fvwm 2.2.5 and the window manager of KDE -2.1. The reason for the pause is Xt waiting for a ConfigureNotify -event from the window manager, which the window manager doesn't send. -Xt stops waiting after a default timeout of usually 5 seconds. - -A workaround for this is to add something like - -emacs.waitForWM: false - -to your X resources. Alternatively, add `(wait-for-wm . nil)' to a -frame's parameter list, like this: - - (modify-frame-parameters nil '((wait-for-wm . nil))) - -(this should go into your `.emacs' file). - -* Underlines appear at the wrong position. - -This is caused by fonts having a wrong UNDERLINE_POSITION property. -Examples are the font 7x13 on XFree prior to version 4.1, or the jmk -neep font from the Debian xfonts-jmk package. To circumvent this -problem, set x-use-underline-position-properties to nil in your -`.emacs'. - -To see what is the value of UNDERLINE_POSITION defined by the font, -type `xlsfonts -lll FONT' and look at the font's UNDERLINE_POSITION -property. - -* When using Xaw3d scroll bars without arrows, the very first mouse -click in a scroll bar might be ignored by the scroll bar widget. This -is probably a bug in Xaw3d; when Xaw3d is compiled with arrows, the -problem disappears. - -* There are known binary incompatibilities between Xaw, Xaw3d, neXtaw, -XawM and the few other derivatives of Xaw. So when you compile with -one of these, it may not work to dynamically link with another one. -For example, strange problems, such as Emacs exiting when you type -"C-x 1", were reported when Emacs compiled with Xaw3d and libXaw was -used with neXtaw at run time. - -The solution is to rebuild Emacs with the toolkit version you actually -want to use, or set LD_PRELOAD to preload the same toolkit version you -built Emacs with. - -* Clicking C-mouse-2 in the scroll bar doesn't split the window. - -This currently doesn't work with scroll-bar widgets (and we don't know -a good way of implementing it with widgets). If Emacs is configured ---without-toolkit-scroll-bars, C-mouse-2 on the scroll bar does work. - -* Emacs aborts inside the function `tparam1'. - -This can happen if Emacs was built without terminfo support, but the -terminal's capabilities use format that is only supported by terminfo. -If your system has ncurses installed, this might happen if your -version of ncurses is broken; upgrading to a newer version of ncurses -and reconfiguring and rebuilding Emacs should solve this. - -All modern systems support terminfo, so even if ncurses is not the -problem, you should look for a way to configure Emacs so that it uses -terminfo when built. - -* Error messages about undefined colors on X. - -The messages might say something like this: - - Unable to load color "grey95" - -(typically, in the `*Messages*' buffer), or something like this: - - Error while displaying tooltip: (error Undefined color lightyellow) - -These problems could happen if some other X program has used up too -many colors of the X palette, leaving Emacs with insufficient system -resources to load all the colors it needs. - -A solution is to exit the offending X programs before starting Emacs. - -* Colors are not available on a tty or in xterm. - -Emacs 21 supports colors on character terminals and terminal -emulators, but this support relies on the terminfo or termcap database -entry to specify that the display supports color. Emacs looks at the -"Co" capability for the terminal to find out how many colors are -supported; it should be non-zero to activate the color support within -Emacs. (Most color terminals support 8 or 16 colors.) If your system -uses terminfo, the name of the capability equivalent to "Co" is -"colors". - -In addition to the "Co" capability, Emacs needs the "op" (for -``original pair'') capability, which tells how to switch the terminal -back to the default foreground and background colors. Emacs will not -use colors if this capability is not defined. If your terminal entry -doesn't provide such a capability, try using the ANSI standard escape -sequence \E[00m (that is, define a new termcap/terminfo entry and make -it use your current terminal's entry plus \E[00m for the "op" -capability). - -Finally, the "NC" capability (terminfo name: "ncv") tells Emacs which -attributes cannot be used with colors. Setting this capability -incorrectly might have the effect of disabling colors; try setting -this capability to `0' (zero) and see if that helps. - -Emacs uses the database entry for the terminal whose name is the value -of the environment variable TERM. With `xterm', a common terminal -entry that supports color is `xterm-color', so setting TERM's value to -`xterm-color' might activate the color support on an xterm-compatible -emulator. - -Beginning with version 21.4, Emacs supports the --color command-line -option which may be used to force Emacs to use one of a few popular -modes for getting colors on a tty. For example, --color=ansi8 sets up -for using the ANSI-standard escape sequences that support 8 colors. - -Some modes do not use colors unless you turn on the Font-lock mode. -Some people have long ago set their `~/.emacs' files to turn on -Font-lock on X only, so they won't see colors on a tty. The -recommended way of turning on Font-lock is by typing "M-x -global-font-lock-mode RET" or by customizing the variable -`global-font-lock-mode'. - -* Emacs on a tty switches the cursor to large blinking block. - -This was reported to happen on some GNU/Linux systems which use -ncurses version 5.0, but could be relevant for other versions as well. -These versions of ncurses come with a `linux' terminfo entry, where -the "cvvis" capability (termcap "vs") is defined as "\E[?25h\E[?8c" -(show cursor, change size). This escape sequence switches on a -blinking hardware text-mode cursor whose size is a full character -cell. This blinking cannot be stopped, since a hardware cursor -always blinks. - -A work-around is to redefine the "cvvis" capability so that it -enables a *software* cursor. The software cursor works by inverting -the colors of the character at point, so what you see is a block -cursor that doesn't blink. For this to work, you need to redefine -the "cnorm" capability as well, so that it operates on the software -cursor instead of the hardware cursor. - -To this end, run "infocmp linux > linux-term", edit the file -`linux-term' to make both the "cnorm" and "cvvis" capabilities send -the sequence "\E[?25h\E[?17;0;64c", and then run "tic linux-term" to -produce a modified terminfo entry. - -Alternatively, if you want a blinking underscore as your Emacs cursor, -change the "cvvis" capability to send the "\E[?25h\E[?0c" command. - -* Problems in Emacs built with LessTif. - -The problems seem to depend on the version of LessTif and the Motif -emulation for which it is set up. - -Only the Motif 1.2 emulation seems to be stable enough in LessTif. -Lesstif 0.92-17's Motif 1.2 emulation seems to work okay on FreeBSD. -On GNU/Linux systems, lesstif-0.92.6 configured with "./configure ---enable-build-12 --enable-default-12" is reported to be the most -successful. The binary GNU/Linux package -lesstif-devel-0.92.0-1.i386.rpm was reported to have problems with -menu placement. - -On some systems, even with Motif 1.2 emulation, Emacs occasionally -locks up, grabbing all mouse and keyboard events. We still don't know -what causes these problems; they are not reproducible by Emacs -developers. - -* Known problems with the MS-Windows port of Emacs 21.2. - -Frames are not refreshed while the File or Font dialog or a pop-up menu -is displayed. This also means help text for pop-up menus is not -displayed at all. This is because message handling under Windows is -synchronous, so we cannot handle repaint (or any other) messages while -waiting for a system function to return the result of the dialog or -pop-up menu interaction. - -Windows 95 and Windows NT up to version 4.0 do not support help text -for menus. Help text is only available in later versions of Windows. - -There are problems with display if mouse-tracking is enabled and the -mouse is moved off a frame, over another frame then back over the first -frame. A workaround is to click the left mouse button inside the frame -after moving back into it. - -Some minor flickering still persists during mouse-tracking, although -not as severely as in 21.1. - -Emacs can sometimes abort when non-ASCII text, possibly with null -characters, is copied and pasted into a buffer. - -An inactive cursor remains in an active window after the Windows -Manager driven switch of the focus, until a key is pressed. - -Windows input methods are not recognized by Emacs (as of v21.2). Some -of these input methods cause the keyboard to send characters encoded -in the appropriate coding system (e.g., ISO 8859-1 for Latin-1 -characters, ISO 8859-8 for Hebrew characters, etc.). To make this -work, set the keyboard coding system to the appropriate value after -you activate the Windows input method. For example, if you activate -the Hebrew input method, type "C-x RET k iso-8859-8 RET". (Emacs -ought to recognize the Windows language-change event and set up the -appropriate keyboard encoding automatically, but it doesn't do that -yet.) - -The %b specifier for format-time-string does not produce abbreviated -month names with consistent widths for some locales on some versions -of Windows. This is caused by a deficiency in the underlying system -library function. - -* The `configure' script doesn't find the jpeg library. - -There are reports that this happens on some systems because the linker -by default only looks for shared libraries, but jpeg distribution by -default only installs a nonshared version of the library, `libjpeg.a'. - -If this is the problem, you can configure the jpeg library with the -`--enable-shared' option and then rebuild libjpeg. This produces a -shared version of libjpeg, which you need to install. Finally, rerun -the Emacs configure script, which should now find the jpeg library. -Alternatively, modify the generated src/Makefile to link the .a file -explicitly, and edit src/config.h to define HAVE_JPEG. - -* Building Emacs over NFS fails with ``Text file busy''. - -This was reported to happen when building Emacs on a GNU/Linux system -(RedHat Linux 6.2) using a build directory automounted from Solaris -(SunOS 5.6) file server, but it might not be limited to that -configuration alone. Presumably, the NFS server doesn't commit the -files' data to disk quickly enough, and the Emacs executable file is -left ``busy'' for several seconds after Emacs has finished dumping -itself. This causes the subsequent commands which invoke the dumped -Emacs executable to fail with the above message. - -In some of these cases, a time skew between the NFS server and the -machine where Emacs is built is detected and reported by GNU Make -(it says that some of the files have modification time in the future). -This might be a symptom of NFS-related problems. - -If the NFS server runs on Solaris, apply the Solaris patch 105379-05 -(Sunos 5.6: /kernel/misc/nfssrv patch). If that doesn't work, or if -you have a different version of the OS or the NFS server, you can -force the NFS server to use 1KB blocks, which was reported to fix the -problem albeit at a price of slowing down file I/O. You can force 1KB -blocks by specifying the "-o rsize=1024,wsize=1024" options to the -`mount' command, or by adding ",rsize=1024,wsize=1024" to the mount -options in the appropriate system configuration file, such as -`/etc/auto.home'. - -Alternatively, when Make fails due to this problem, you could wait for -a few seconds and then invoke Make again. In one particular case, -waiting for 10 or more seconds between the two Make invocations seemed -to work around the problem. - -Similar problems can happen if your machine NFS-mounts a directory -onto itself. Suppose the Emacs sources live in `/usr/local/src' and -you are working on the host called `marvin'. Then an entry in the -`/etc/fstab' file like the following is asking for trouble: - - marvin:/usr/local/src /usr/local/src ...options.omitted... - -The solution is to remove this line from `etc/fstab'. - -* Emacs binary is not in executable format, and cannot be run. - -This was reported to happen when Emacs is built in a directory mounted -via NFS, for some combinations of NFS client and NFS server. -Usually, the file `emacs' produced in these cases is full of -binary null characters, and the `file' utility says: - - emacs: ASCII text, with no line terminators - -We don't know what exactly causes this failure. A work-around is to -build Emacs in a directory on a local disk. - -* Accented ISO-8859-1 characters are displayed as | or _. +** Accented ISO-8859-1 characters are displayed as | or _. Try other font set sizes (S-mouse-1). If the problem persists with other sizes as well, your text is corrupted, probably through software @@ -671,152 +959,7 @@ The solution is to remove the corresponding lines from the appropriate `fonts.alias' file, then run `mkfontdir' in that directory, and then run `xset fp rehash'. -* Large file support is disabled on HP-UX. See the comments in -src/s/hpux10.h. - -* Crashes when displaying GIF images in Emacs built with version -libungif-4.1.0 are resolved by using version libungif-4.1.0b1. -Configure checks for the correct version, but this problem could occur -if a binary built against a shared libungif is run on a system with an -older version. - -* Font Lock displays portions of the buffer in incorrect faces. - -By far the most frequent cause of this is a parenthesis `(' or a brace -`{' in column zero. Font Lock assumes that such a paren is outside of -any comment or string. This is of course not true in general, but the -vast majority of well-formatted program source files don't have such -parens, and therefore this assumption is used to allow optimizations -in Font Lock's syntactical analysis. These optimizations avoid some -pathological cases where jit-lock, the Just-in-Time fontification -introduced with Emacs 21.1, could significantly slow down scrolling -through the buffer, especially scrolling backwards, and also jumping -to the end of a very large buffer. - -Beginning with version 21.4, a parenthesis or a brace in column zero -is highlighted in bold-red face if it is inside a string or a comment, -to indicate that it could interfere with Font Lock (and also with -indentation) and should be moved or escaped with a backslash. - -If you don't use large buffers, or have a very fast machine which -makes the delays insignificant, you can avoid the incorrect -fontification by setting the variable -`font-lock-beginning-of-syntax-function' to a nil value. (This must -be done _after_ turning on Font Lock.) - -Another alternative is to avoid a paren in column zero. For example, -in a Lisp string you could precede the paren with a backslash. - -* When running on KDE, colors or fonts are not as specified for Emacs, -or messed up. - -For example, you could see background you set for Emacs only in the -empty portions of the Emacs display, while characters have some other -background. - -This happens because KDE's defaults apply its color and font -definitions even to applications that weren't compiled for KDE. The -solution is to uncheck the "Apply fonts and colors to non-KDE apps" -option in Preferences->Look&Feel->Style (KDE 2). In KDE 3, this option -is in the "Colors" section, rather than "Style". - -Alternatively, if you do want the KDE defaults to apply to other -applications, but not to Emacs, you could modify the file `Emacs.ad' -(should be in the `/usr/share/apps/kdisplay/app-defaults/' directory) -so that it doesn't set the default background and foreground only for -Emacs. For example, make sure the following resources are either not -present or commented out: - - Emacs.default.attributeForeground - Emacs.default.attributeBackground - Emacs*Foreground - Emacs*Background - -* Interrupting Cygwin port of Bash from Emacs doesn't work. - -Cygwin 1.x builds of the ported Bash cannot be interrupted from the -MS-Windows version of Emacs. This is due to some change in the Bash -port or in the Cygwin library which apparently make Bash ignore the -keyboard interrupt event sent by Emacs to Bash. (Older Cygwin ports -of Bash, up to b20.1, did receive SIGINT from Emacs.) - -* Dired is very slow. - -This could happen if invocation of the `df' program takes a long -time. Possible reasons for this include: - - - ClearCase mounted filesystems (VOBs) that sometimes make `df' - response time extremely slow (dozens of seconds); - - - slow automounters on some old versions of Unix; - - - slow operation of some versions of `df'. - -To work around the problem, you could either (a) set the variable -`directory-free-space-program' to nil, and thus prevent Emacs from -invoking `df'; (b) use `df' from the GNU Fileutils package; or -(c) use CVS, which is Free Software, instead of ClearCase. - -* Accessing remote files with ange-ftp hangs the MS-Windows version of Emacs. - -If the FTP client is the Cygwin port of GNU `ftp', this appears to be -due to some bug in the Cygwin DLL or some incompatibility between it -and the implementation of asynchronous subprocesses in the Windows -port of Emacs. Specifically, some parts of the FTP server responses -are not flushed out, apparently due to buffering issues, which -confuses ange-ftp. - -The solution is to downgrade to an older version of the Cygwin DLL -(version 1.3.2 was reported to solve the problem), or use the stock -Windows FTP client, usually found in the `C:\WINDOWS' or 'C:\WINNT' -directory. To force ange-ftp use the stock Windows client, set the -variable `ange-ftp-ftp-program-name' to the absolute file name of the -client's executable. For example: - - (setq ange-ftp-ftp-program-name "c:/windows/ftp.exe") - -If you want to stick with the Cygwin FTP client, you can work around -this problem by putting this in your `.emacs' file: - - (setq ange-ftp-ftp-program-args '("-i" "-n" "-g" "-v" "--prompt" "") - -* Versions of the W3 package released before Emacs 21.1 don't run -under Emacs 21. This fixed in W3 version 4.0pre.47. - -* On AIX, if linking fails because libXbsd isn't found, check if you -are compiling with the system's `cc' and CFLAGS containing `-O5'. If -so, you have hit a compiler bug. Please make sure to re-configure -Emacs so that it isn't compiled with `-O5'. - -* Compiling on AIX 4.3.x or 4.4 fails. - -This could happen if you use /bin/c89 as your compiler, instead of -the default `cc'. /bin/c89 treats certain warnings, such as benign -redefinitions of macros, as errors, and fails the build. A solution -is to use the default compiler `cc'. - -* Old versions of the PSGML package use the obsolete variables -`before-change-function' and `after-change-function', which are no -longer used by Emacs. Please use PSGML 1.2.3 or later. - -* PSGML conflicts with sgml-mode. - -PSGML package uses the same names of some variables (like keymap) -as built-in sgml-mode.el because it was created as a replacement -of that package. The conflict will be shown if you load -sgml-mode.el before psgml.el. E.g. this could happen if you edit -HTML page and then start to work with SGML or XML file. html-mode -(from sgml-mode.el) is used for HTML file and loading of psgml.el -(for sgml-mode or xml-mode) will cause an error. - -* The LDAP support rely on ldapsearch program from OpenLDAP version 2. - -It can fail to work with ldapsearch program from OpenLDAP version 1. -Version 1 of OpenLDAP is now deprecated. If you are still using it, -please upgrade to version 2. As a temporary workaround, remove -argument "-x" from the variable `ldap-ldapsearch-args'. - -* The `oc-unicode' package doesn't work with Emacs 21. +** The `oc-unicode' package doesn't work with Emacs 21. This package tries to define more private charsets than there are free slots now. The current built-in Unicode support is actually more @@ -824,1805 +967,18 @@ flexible. (Use option `utf-translate-cjk-mode' if you need CJK support.) Files encoded as emacs-mule using oc-unicode aren't generally read correctly by Emacs 21. -* Using epop3.el package causes Emacs to signal an error. - -The error message might be something like this: - - "Lisp nesting exceeds max-lisp-eval-depth" - -This happens because epop3 redefines the function gethash, which is a -built-in primitive beginning with Emacs 21.1. We don't have a patch -for epop3 that fixes this, but perhaps a newer version of epop3 -corrects that. - -* ps-print commands fail to find prologue files ps-prin*.ps. - -This can happen if you use an old version of X-Symbol package: it -defines compatibility functions which trick ps-print into thinking it -runs in XEmacs, and look for the prologue files in a wrong directory. - -The solution is to upgrade X-Symbol to a later version. - -* lpr commands don't work on MS-Windows with some cheap printers. - -This problem may also strike other platforms, but the solution is -likely to be a global one, and not Emacs specific. - -Many cheap inkjet, and even some cheap laser printers, do not -print plain text anymore, they will only print through graphical -printer drivers. A workaround on MS-Windows is to use Windows' basic -built in editor to print (this is possibly the only useful purpose it -has): - -(setq printer-name "") ;; notepad takes the default -(setq lpr-command "notepad") ;; notepad -(setq lpr-switches nil) ;; not needed -(setq lpr-printer-switch "/P") ;; run notepad as batch printer - -* On systems with shared libraries you might encounter run-time errors -from the dynamic linker telling you that it is unable to find some -shared libraries, for instance those for Xaw3d or image support. -These errors mean Emacs has been linked with a library whose shared -library is not in the default search path of the dynamic linker. - -Similar problems could prevent Emacs from building, since the build -process invokes Emacs several times. - -On many systems, it is possible to set LD_LIBRARY_PATH in your -environment to specify additional directories where shared libraries -can be found. - -Other systems allow to set LD_RUN_PATH in a similar way, but before -Emacs is linked. With LD_RUN_PATH set, the linker will include a -specified run-time search path in the executable. - -On some systems, Emacs can crash due to problems with dynamic -linking. Specifically, on SGI Irix 6.5, crashes were reported with -backtraces like this: - - (dbx) where - 0 strcmp(0xf49239d, 0x4031184, 0x40302b4, 0x12, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2) ["/xlv22/ficus-jan23/work/irix/lib/libc/libc_n32_M3_ns/strings/strcmp.s":35, 0xfb7e480] - 1 general_find_symbol(0xf49239d, 0x0, 0x0, 0x0, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2) - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":2140, 0xfb65a98] - 2 resolve_symbol(0xf49239d, 0x4031184, 0x0, 0xfbdd438, 0x0, 0xf4923aa, 0x0, 0x492ddb2) - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":1947, 0xfb657e4] - 3 lazy_text_resolve(0xd18, 0x1a3, 0x40302b4, 0x12, 0xf0000000, 0xf4923aa, 0x0, 0x492ddb2) - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld.c":997, 0xfb64d44] - 4 _rld_text_resolve(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) - ["/comp2/mtibuild/v73/workarea/v7.3/rld/rld_bridge.s":175, 0xfb6032c] - -(`rld' is the dynamic linker.) We don't know yet why this -happens, but setting the environment variable LD_BIND_NOW to 1 (which -forces the dynamic linker to bind all shared objects early on) seems -to work around the problem. - -Please refer to the documentation of your dynamic linker for details. - -* On Solaris 2.7, building Emacs with WorkShop Compilers 5.0 98/12/15 -C 5.0 failed, apparently with non-default CFLAGS, most probably due to -compiler bugs. Using Sun Solaris 2.7 Sun WorkShop 6 update 1 C -release was reported to work without problems. It worked OK on -another system with Solaris 8 using apparently the same 5.0 compiler -and the default CFLAGS. - -* Compiling syntax.c with the OPENSTEP 4.2 compiler gcc 2.7.2.1 fails. - -The compiler was reported to crash while compiling syntax.c with the -following message: - - cc: Internal compiler error: program cc1obj got fatal signal 11 - -To work around this, replace the macros UPDATE_SYNTAX_TABLE_FORWARD, -INC_BOTH, and INC_FROM with functions. To this end, first define 3 -functions, one each for every macro. Here's an example: - - static int update_syntax_table_forward(int from) - { - return(UPDATE_SYNTAX_TABLE_FORWARD(from)); - }/*update_syntax_table_forward*/ - -Then replace all references to UPDATE_SYNTAX_TABLE_FORWARD in syntax.c -with a call to the function update_syntax_table_forward. - -* Emacs fails to start, complaining about missing fonts. - -A typical error message might be something like - - No fonts match `-*-fixed-medium-r-*--6-*-*-*-*-*-iso8859-1' - -This happens because some X resource specifies a bad font family for -Emacs to use. The possible places where this specification might be -are: - - - in your ~/.Xdefaults file - - - client-side X resource file, such as ~/Emacs or - /usr/X11R6/lib/app-defaults/Emacs or - /usr/X11R6/lib/X11/app-defaults/Emacs - -One of these files might have bad or malformed specification of a -fontset that Emacs should use. To fix the problem, you need to find -the problematic line(s) and correct them. - -* Emacs 20 and later fails to load Lisp files at startup. - -The typical error message might be like this: - - "Cannot open load file: fontset" - -This could happen if you compress the file lisp/subdirs.el. That file -tells Emacs what are the directories where it should look for Lisp -files. Emacs cannot work with subdirs.el compressed, since the -Auto-compress mode it needs for this will not be loaded until later, -when your .emacs file is processed. (The package `fontset.el' is -required to set up fonts used to display text on window systems, and -it's loaded very early in the startup procedure.) - -Similarly, any other .el file for which there's no corresponding .elc -file could fail to load if it is compressed. - -The solution is to uncompress all .el files which don't have a .elc -file. - -Another possible reason for such failures is stale *.elc files -lurking somewhere on your load-path. The following command will -print any duplicate Lisp files that are present in load-path: - - emacs -q -batch -f list-load-path-shadows - -If this command prints any file names, some of these files are stale, -and should be deleted or their directories removed from your -load-path. - -* Emacs prints an error at startup after upgrading from an earlier version. - -An example of such an error is: - - x-complement-fontset-spec: "Wrong type argument: stringp, nil" - -This can be another symptom of stale *.elc files in your load-path. -The following command will print any duplicate Lisp files that are -present in load-path: - - emacs -q -batch -f list-load-path-shadows - -If this command prints any file names, some of these files are stale, -and should be deleted or their directories removed from your -load-path. - -* Attempting to visit remote files via ange-ftp fails. - -If the error message is "ange-ftp-file-modtime: Specified time is not -representable", then this could happen when `lukemftp' is used as the -ftp client. This was reported to happen on Debian GNU/Linux, kernel -version 2.4.3, with `lukemftp' 1.5-5, but might happen on other -systems as well. To avoid this problem, switch to using the standard -ftp client. On a Debian system, type - - update-alternatives --config ftp - -and then choose /usr/bin/netkit-ftp. - -* Antivirus software interacts badly with the MS-Windows version of Emacs. - -The usual manifestation of these problems is that subprocesses don't -work or even wedge the entire system. In particular, "M-x shell RET" -was reported to fail to work. But other commands also sometimes don't -work when an antivirus package is installed. - -The solution is to switch the antivirus software to a less aggressive -mode (e.g., disable the ``auto-protect'' feature), or even uninstall -or disable it entirely. - -* On MS-Windows 95/98/ME, subprocesses do not terminate properly. - -This is a limitation of the Operating System, and can cause problems -when shutting down Windows. Ensure that all subprocesses are exited -cleanly before exiting Emacs. For more details, see the FAQ at -http://www.gnu.org/software/emacs/windows/. - -* MS-Windows 95/98/ME crashes when Emacs invokes non-existent programs. - -When a program you are trying to run is not found on the PATH, -Windows might respond by crashing or locking up your system. In -particular, this has been reported when trying to compile a Java -program in JDEE when javac.exe is installed, but not on the system -PATH. - -* Pressing the mouse button on MS-Windows does not give a mouse-2 event. - -This is usually a problem with the mouse driver. Because most Windows -programs do not do anything useful with the middle mouse button, many -mouse drivers allow you to define the wheel press to do something -different. Some drivers do not even have the option to generate a -middle button press. In such cases, setting the wheel press to -"scroll" sometimes works if you press the button twice. Trying a -generic mouse driver might help. - -* Scrolling the mouse wheel on MS-Windows always scrolls the top window. - -This is another common problem with mouse drivers. Instead of -generating scroll events, some mouse drivers try to fake scroll bar -movement. But they are not intelligent enough to handle multiple -scroll bars within a frame. Trying a generic mouse driver might help. - -* Mail sent through Microsoft Exchange in some encodings appears to be -mangled and is not seen correctly in Rmail or Gnus. We don't know -exactly what happens, but it isn't an Emacs problem in cases we've -seen. - -* After upgrading to a newer version of Emacs, the Meta key stops working. - -This was reported to happen on a GNU/Linux system distributed by -Mandrake. The reason is that the previous version of Emacs was -modified by Mandrake to make the Alt key act as the Meta key, on a -keyboard where the Windows key is the one which produces the Meta -modifier. A user who started using a newer version of Emacs, which -was not hacked by Mandrake, expected the Alt key to continue to act as -Meta, and was astonished when that didn't happen. - -The solution is to find out what key on your keyboard produces the Meta -modifier, and use that key instead. Try all of the keys to the left -and to the right of the space bar, together with the `x' key, and see -which combination produces "M-x" in the echo area. You can also use -the `xmodmap' utility to show all the keys which produce a Meta -modifier: - - xmodmap -pk | egrep -i "meta|alt" - -A more convenient way of finding out which keys produce a Meta modifier -is to use the `xkbprint' utility, if it's available on your system: - - xkbprint 0:0 /tmp/k.ps - -This produces a PostScript file `/tmp/k.ps' with a picture of your -keyboard; printing that file on a PostScript printer will show what -keys can serve as Meta. - -The `xkeycaps' also shows a visual representation of the current -keyboard settings. It also allows to modify them. - -* On OSF/Dec Unix/Tru64/ under X locally or -remotely, M-SPC acts as a `compose' key with strange results. See -keyboard(5). - -Changing Alt_L to Meta_L fixes it: -% xmodmap -e 'keysym Alt_L = Meta_L Alt_L' -% xmodmap -e 'keysym Alt_R = Meta_R Alt_R' - -* Error "conflicting types for `initstate'" compiling with GCC on Irix 6. - -Install GCC 2.95 or a newer version, and this problem should go away. -It is possible that this problem results from upgrading the operating -system without reinstalling GCC; so you could also try reinstalling -the same version of GCC, and telling us whether that fixes the problem. - -* Emacs dumps core on Solaris in function IMCheckWindow. - -This was reported to happen when Emacs runs with more than one frame, -and one of them is closed, either with "C-x 5 0" or from the window -manager. - -This bug was reported to Sun as - - Gtk apps dump core in ximlocal.so.2:IMCheckIMWindow() - Bug Reports: 4463537 - -Installing Solaris 8 patch 108773-12 for Sparc and 108774-12 for x86 -reportedly fixes the bug, which appears to be inside the shared -library xiiimp.so. - -Alternatively, you can configure Emacs with `--with-xim=no' to prevent -the core dump, but will loose X input method support, of course. (You -can use Emacs's own input methods instead, if you install Leim.) - -* On Solaris 7, Emacs gets a segmentation fault when starting up using X. - -This results from Sun patch 107058-01 (SunOS 5.7: Patch for -assembler) if you use GCC version 2.7 or later. -To work around it, either install patch 106950-03 or later, -or uninstall patch 107058-01, or install the GNU Binutils. -Then recompile Emacs, and it should work. - -* With X11R6.4, public-patch-3, Emacs crashes at startup. - -Reportedly this patch in X fixes the problem. - - --- xc/lib/X11/imInt.c~ Wed Jun 30 13:31:56 1999 - +++ xc/lib/X11/imInt.c Thu Jul 1 15:10:27 1999 - @@ -1,4 +1,4 @@ - -/* $TOG: imInt.c /main/5 1998/05/30 21:11:16 kaleb $ */ - +/* $TOG: imInt.c /main/5 1998/05/30 21:11:16 kaleb $ */ - /****************************************************************** - - Copyright 1992, 1993, 1994 by FUJITSU LIMITED - @@ -166,8 +166,8 @@ - _XimMakeImName(lcd) - XLCd lcd; - { - - char* begin; - - char* end; - + char* begin = NULL; - + char* end = NULL; - char* ret; - int i = 0; - char* ximmodifier = XIMMODIFIER; - @@ -182,7 +182,11 @@ - } - ret = Xmalloc(end - begin + 2); - if (ret != NULL) { - - (void)strncpy(ret, begin, end - begin + 1); - + if (begin != NULL) { - + (void)strncpy(ret, begin, end - begin + 1); - + } else { - + ret[0] = '\0'; - + } - ret[end - begin + 1] = '\0'; - } - return ret; - - -* Emacs crashes on Irix 6.5 on the SGI R10K, when compiled with GCC. - -This seems to be fixed in GCC 2.95. - -* Emacs crashes in utmpname on Irix 5.3. - -This problem is fixed in Patch 3175 for Irix 5.3. -It is also fixed in Irix versions 6.2 and up. - -* The S-C-t key combination doesn't get passed to Emacs on X. - -This happens because some X configurations assign the Ctrl-Shift-t -combination the same meaning as the Multi_key. The offending -definition is in the file `...lib/X11/locale/iso8859-1/Compose'; there -might be other similar combinations which are grabbed by X for similar -purposes. - -We think that this can be countermanded with the `xmodmap' utility, if -you want to be able to bind one of these key sequences within Emacs. - -* On Solaris, CTRL-t is ignored by Emacs when you use -the fr.ISO-8859-15 locale (and maybe other related locales). - -You can fix this by editing the file: - - /usr/openwin/lib/locale/iso8859-15/Compose - -Near the bottom there is a line that reads: - - Ctrl : "\276" threequarters - -that should read: - - Ctrl : "\276" threequarters - -Note the lower case . Changing this line should make C-t work. - -* Emacs on Digital Unix 4.0 fails to build, giving error message - Invalid dimension for the charset-ID 160 - -This is due to a bug or an installation problem in GCC 2.8.0. -Installing a more recent version of GCC fixes the problem. - -* Buffers from `with-output-to-temp-buffer' get set up in Help mode. - -Changes in Emacs 20.4 to the hooks used by that function cause -problems for some packages, specifically BBDB. See the function's -documentation for the hooks involved. BBDB 2.00.06 fixes the problem. - -* Under X, C-v and/or other keys don't work. - -These may have been intercepted by your window manager. In -particular, AfterStep 1.6 is reported to steal C-v in its default -configuration. Various Meta keys are also likely to be taken by the -configuration of the `feel'. See the WM's documentation for how to -change this. - -* When using Exceed, fonts sometimes appear too tall. - -When the display is set to an Exceed X-server and fonts are specified -(either explicitly with the -fn option or implicitly with X resources) -then the fonts may appear "too tall". The actual character sizes are -correct but there is too much vertical spacing between rows, which -gives the appearance of "double spacing". - -To prevent this, turn off the Exceed's "automatic font substitution" -feature (in the font part of the configuration window). - -* Failure in unexec while dumping emacs on Digital Unix 4.0 - -This problem manifests itself as an error message - - unexec: Bad address, writing data section to ... - -The user suspects that this happened because his X libraries -were built for an older system version, - - ./configure --x-includes=/usr/include --x-libraries=/usr/shlib - -made the problem go away. - -* No visible display on mips-sgi-irix6.2 when compiling with GCC 2.8.1. - -This problem went away after installing the latest IRIX patches -as of 8 Dec 1998. - -The same problem has been reported on Irix 6.3. - -* As of version 20.4, Emacs doesn't work properly if configured for -the Motif toolkit and linked against the free LessTif library. The -next Emacs release is expected to work with LessTif. - -* Emacs gives the error, Couldn't find per display information. - -This can result if the X server runs out of memory because Emacs uses -a large number of fonts. On systems where this happens, C-h h is -likely to cause it. - -We do not know of a way to prevent the problem. - -* Emacs makes HPUX 11.0 crash. - -This is a bug in HPUX; HPUX patch PHKL_16260 is said to fix it. - -* Emacs crashes during dumping on the HPPA machine (HPUX 10.20). - -This seems to be due to a GCC bug; it is fixed in GCC 2.8.1. - -* The Hyperbole package causes *Help* buffers not to be displayed in -Help mode due to setting `temp-buffer-show-hook' rather than using -`add-hook'. Using `(add-hook 'temp-buffer-show-hook -'help-mode-maybe)' after loading Hyperbole should fix this. - -* Versions of the PSGML package earlier than 1.0.3 (stable) or 1.1.2 -(alpha) fail to parse DTD files correctly in Emacs 20.3 and later. -Here is a patch for psgml-parse.el from PSGML 1.0.1 and, probably, -earlier versions. - ---- psgml-parse.el 1998/08/21 19:18:18 1.1 -+++ psgml-parse.el 1998/08/21 19:20:00 -@@ -2383,7 +2383,7 @@ (defun sgml-push-to-entity (entity &opti - (setq sgml-buffer-parse-state nil)) - (cond - ((stringp entity) ; a file name -- (save-excursion (insert-file-contents entity)) -+ (insert-file-contents entity) - (setq default-directory (file-name-directory entity))) - ((consp (sgml-entity-text entity)) ; external id? - (let* ((extid (sgml-entity-text entity)) - -* Emacs 21 freezes when visiting a TeX file with AUC TeX installed. - -Emacs 21 needs version 10 or later of AUC TeX; upgrading should solve -these problems. - -* No colors in AUC TeX with Emacs 21. - -Upgrade to AUC TeX version 10 or later, and make sure it is -byte-compiled with Emacs 21. - -* Running TeX from AUC TeX package with Emacs 20.3 gives a Lisp error -about a read-only tex output buffer. - -This problem appeared for AUC TeX version 9.9j and some earlier -versions. Here is a patch for the file tex-buf.el in the AUC TeX -package. - -diff -c auctex/tex-buf.el~ auctex/tex-buf.el -*** auctex/tex-buf.el~ Wed Jul 29 18:35:32 1998 ---- auctex/tex-buf.el Sat Sep 5 15:20:38 1998 -*************** -*** 545,551 **** - (dir (TeX-master-directory))) - (TeX-process-check file) ; Check that no process is running - (setq TeX-command-buffer (current-buffer)) -! (with-output-to-temp-buffer buffer) - (set-buffer buffer) - (if dir (cd dir)) - (insert "Running `" name "' on `" file "' with ``" command "''\n") -- --- 545,552 ---- - (dir (TeX-master-directory))) - (TeX-process-check file) ; Check that no process is running - (setq TeX-command-buffer (current-buffer)) -! (let (temp-buffer-show-function temp-buffer-show-hook) -! (with-output-to-temp-buffer buffer)) - (set-buffer buffer) - (if dir (cd dir)) - (insert "Running `" name "' on `" file "' with ``" command "''\n") - -* On Irix 6.3, substituting environment variables in file names -in the minibuffer gives peculiar error messages such as - - Substituting nonexistent environment variable "" - -This is not an Emacs bug; it is caused by something in SGI patch -003082 August 11, 1998. - -* After a while, Emacs slips into unibyte mode. +** After a while, Emacs slips into unibyte mode. The VM mail package, which is not part of Emacs, sometimes does (standard-display-european t) That should be changed to (standard-display-european 1 t) -* Installing Emacs gets an error running `install-info'. +* X runtime problems -You need to install a recent version of Texinfo; that package -supplies the `install-info' command. +** X keyboard problems -* Emacs does not recognize the AltGr key, on HPUX. - -To fix this, set up a file ~/.dt/sessions/sessionetc with executable -rights, containing this text: - --------------------------------- -xmodmap 2> /dev/null - << EOF -keysym Alt_L = Meta_L -keysym Alt_R = Meta_R -EOF - -xmodmap - << EOF -clear mod1 -keysym Mode_switch = NoSymbol -add mod1 = Meta_L -keysym Meta_R = Mode_switch -add mod2 = Mode_switch -EOF --------------------------------- - -* Emacs hangs on KDE when a large portion of text is killed. - -This is caused by a bug in the KDE applet `klipper' which periodically -requests the X clipboard contents from applications. Early versions -of klipper don't implement the ICCM protocol for large selections, -which leads to Emacs being flooded with selection requests. After a -while, Emacs will print a message: - - Timed out waiting for property-notify event - -A workaround is to not use `klipper'. - -* Emacs compiled with DJGPP for MS-DOS/MS-Windows cannot access files -in the directory with the special name `dev' under the root of any -drive, e.g. `c:/dev'. - -This is an unfortunate side-effect of the support for Unix-style -device names such as /dev/null in the DJGPP runtime library. A -work-around is to rename the problem directory to another name. - -* M-SPC seems to be ignored as input. - -See if your X server is set up to use this as a command -for character composition. - -* Emacs startup on GNU/Linux systems (and possibly other systems) is slow. - -This can happen if the system is misconfigured and Emacs can't get the -full qualified domain name, FQDN. You should have your FQDN in the -/etc/hosts file, something like this: - -127.0.0.1 localhost -129.187.137.82 nuc04.t30.physik.tu-muenchen.de nuc04 - -The way to set this up may vary on non-GNU systems. - -* Garbled display on non-X terminals when Emacs runs on Digital Unix 4.0. - -So far it appears that running `tset' triggers this problem (when TERM -is vt100, at least). If you do not run `tset', then Emacs displays -properly. If someone can tell us precisely which effect of running -`tset' actually causes the problem, we may be able to implement a fix -in Emacs. - -* When you run Ispell from Emacs, it reports a "misalignment" error. - -This can happen if you compiled the Ispell program to use ASCII -characters only and then try to use it from Emacs with non-ASCII -characters, like Latin-1. The solution is to recompile Ispell with -support for 8-bit characters. - -To see whether your Ispell program supports 8-bit characters, type -this at your shell's prompt: - - ispell -vv - -and look in the output for the string "NO8BIT". If Ispell says -"!NO8BIT (8BIT)", your speller supports 8-bit characters; otherwise it -does not. - -To rebuild Ispell with 8-bit character support, edit the local.h file -in the Ispell distribution and make sure it does _not_ define NO8BIT. -Then rebuild the speller. - -Another possible cause for "misalignment" error messages is that the -version of Ispell installed on your machine is old. Upgrade. - -Yet another possibility is that you are trying to spell-check a word -in a language that doesn't fit the dictionary you choose for use by -Ispell. (Ispell can only spell-check one language at a time, because -it uses a single dictionary.) Make sure that the text you are -spelling and the dictionary used by Ispell conform to each other. - -If your spell-checking program is Aspell, it has been reported that if -you have a personal configuration file (normally ~/.aspell.conf), it -can cause this error. Remove that file, execute `ispell-kill-ispell' -in Emacs, and then try spell-checking again. - -* On Linux-based GNU systems using libc versions 5.4.19 through -5.4.22, Emacs crashes at startup with a segmentation fault. - -This problem happens if libc defines the symbol __malloc_initialized. -One known solution is to upgrade to a newer libc version. 5.4.33 is -known to work. - -* On MS-Windows, you cannot use the right-hand ALT key and the left-hand -CTRL key together to type a Control-Meta character. - -This is a consequence of a misfeature beyond Emacs's control. - -Under Windows, the AltGr key on international keyboards generates key -events with the modifiers Right-Alt and Left-Ctrl. Since Emacs cannot -distinguish AltGr from an explicit Right-Alt and Left-Ctrl -combination, whenever it sees Right-Alt and Left-Ctrl it assumes that -AltGr has been pressed. The variable `w32-recognize-altgr' can be set -to nil to tell Emacs that AltGr is really Ctrl and Alt. - -* Emacs crashes when using the Exceed 6.0 X server - -If you are using Exceed 6.1, upgrade to a later version. This was -reported to prevent the crashes. - -* Under some X-servers running on MS-Windows, Emacs' display is incorrect - -The symptoms are that Emacs does not completely erase blank areas of the -screen during scrolling or some other screen operations (e.g., selective -display or when killing a region). M-x recenter will cause the screen -to be completely redisplayed and the "extra" characters will disappear. - -This is known to occur under Exceed 6, and possibly earlier versions -as well; it is reportedly solved in version 6.2.0.16 and later. The -problem lies in the X-server settings. - -There are reports that you can solve the problem with Exceed by -running `Xconfig' from within NT, choosing "X selection", then -un-checking the boxes "auto-copy X selection" and "auto-paste to X -selection". - -Of this does not work, please inform bug-gnu-emacs@gnu.org. Then -please call support for your X-server and see if you can get a fix. -If you do, please send it to bug-gnu-emacs@gnu.org so we can list it -here. - -* On Solaris 2, Emacs dumps core when built with Motif. - -The Solaris Motif libraries are buggy, at least up through Solaris 2.5.1. -Install the current Motif runtime library patch appropriate for your host. -(Make sure the patch is current; some older patch versions still have the bug.) -You should install the other patches recommended by Sun for your host, too. -You can obtain Sun patches from ftp://sunsolve.sun.com/pub/patches/; -look for files with names ending in `.PatchReport' to see which patches -are currently recommended for your host. - -On Solaris 2.6, Emacs is said to work with Motif when Solaris patch -105284-12 is installed, but fail when 105284-15 is installed. -105284-18 might fix it again. - -* On Solaris 2.6 and 7, the Compose key does not work. - -This is a bug in Motif in Solaris. Supposedly it has been fixed for -the next major release of Solaris. However, if someone with Sun -support complains to Sun about the bug, they may release a patch. -If you do this, mention Sun bug #4188711. - -One workaround is to use a locale that allows non-ASCII characters. -For example, before invoking emacs, set the LC_ALL environment -variable to "en_US" (American English). The directory /usr/lib/locale -lists the supported locales; any locale other than "C" or "POSIX" -should do. - -pen@lysator.liu.se says (Feb 1998) that the Compose key does work -if you link with the MIT X11 libraries instead of the Solaris X11 -libraries. - -* Frames may cover dialogs they created when using CDE. - -This can happen if you have "Allow Primary Windows On Top" enabled which -seems to be the default in the Common Desktop Environment. -To change, go in to "Desktop Controls" -> "Window Style Manager" -and uncheck "Allow Primary Windows On Top". - -* Emacs does not know your host's fully-qualified domain name. - -You need to configure your machine with a fully qualified domain name, -either in /etc/hosts, /etc/hostname, the NIS, or wherever your system -calls for specifying this. - -If you cannot fix the configuration, you can set the Lisp variable -mail-host-address to the value you want. - -* Error 12 (virtual memory exceeded) when dumping Emacs, on UnixWare 2.1 - -Paul Abrahams (abrahams@acm.org) reports that with the installed -virtual memory settings for UnixWare 2.1.2, an Error 12 occurs during -the "make" that builds Emacs, when running temacs to dump emacs. That -error indicates that the per-process virtual memory limit has been -exceeded. The default limit is probably 32MB. Raising the virtual -memory limit to 40MB should make it possible to finish building Emacs. - -You can do this with the command `ulimit' (sh) or `limit' (csh). -But you have to be root to do it. - -According to Martin Sohnius, you can also retune this in the kernel: - - # /etc/conf/bin/idtune SDATLIM 33554432 ## soft data size limit - # /etc/conf/bin/idtune HDATLIM 33554432 ## hard " - # /etc/conf/bin/idtune SVMMSIZE unlimited ## soft process size limit - # /etc/conf/bin/idtune HVMMSIZE unlimited ## hard " - # /etc/conf/bin/idbuild -B - -(He recommends you not change the stack limit, though.) -These changes take effect when you reboot. - -* Redisplay using X11 is much slower than previous Emacs versions. - -We've noticed that certain X servers draw the text much slower when -scroll bars are on the left. We don't know why this happens. If this -happens to you, you can work around it by putting the scroll bars -on the right (as they were in Emacs 19). - -Here's how to do this: - - (set-scroll-bar-mode 'right) - -If you're not sure whether (or how much) this problem affects you, -try that and see how much difference it makes. To set things back -to normal, do - - (set-scroll-bar-mode 'left) - -* Under X11, some characters appear as hollow boxes. - -Each X11 font covers just a fraction of the characters that Emacs -supports. To display the whole range of Emacs characters requires -many different fonts, collected into a fontset. - -If some of the fonts called for in your fontset do not exist on your X -server, then the characters that have no font appear as hollow boxes. -You can remedy the problem by installing additional fonts. - -The intlfonts distribution includes a full spectrum of fonts that can -display all the characters Emacs supports. - -Another cause of this for specific characters is fonts which have a -missing glyph and no default character. This is known ot occur for -character number 160 (no-break space) in some fonts, such as Lucida -but Emacs sets the display table for the unibyte and Latin-1 version -of this character to display a space. - -* Under X11, some characters appear improperly aligned in their lines. - -You may have bad X11 fonts; try installing the intlfonts distribution. - -* Certain fonts make each line take one pixel more than it "should". - -This is because these fonts contain characters a little taller -than the font's nominal height. Emacs needs to make sure that -lines do not overlap. - -* You request inverse video, and the first Emacs frame is in inverse -video, but later frames are not in inverse video. - -This can happen if you have an old version of the custom library in -your search path for Lisp packages. Use M-x list-load-path-shadows to -check whether this is true. If it is, delete the old custom library. - -* In FreeBSD 2.1.5, useless symbolic links remain in /tmp or other -directories that have the +t bit. - -This is because of a kernel bug in FreeBSD 2.1.5 (fixed in 2.2). -Emacs uses symbolic links to implement file locks. In a directory -with +t bit, the directory owner becomes the owner of the symbolic -link, so that it cannot be removed by anyone else. - -If you don't like those useless links, you can let Emacs not to using -file lock by adding #undef CLASH_DETECTION to config.h. - -* When using M-x dbx with the SparcWorks debugger, the `up' and `down' -commands do not move the arrow in Emacs. - -You can fix this by adding the following line to `~/.dbxinit': - - dbxenv output_short_file_name off - -* Emacs says it has saved a file, but the file does not actually -appear on disk. - -This can happen on certain systems when you are using NFS, if the -remote disk is full. It is due to a bug in NFS (or certain NFS -implementations), and there is apparently nothing Emacs can do to -detect the problem. Emacs checks the failure codes of all the system -calls involved in writing a file, including `close'; but in the case -where the problem occurs, none of those system calls fails. - -* "Compose Character" key does strange things when used as a Meta key. - -If you define one key to serve as both Meta and Compose Character, you -will get strange results. In previous Emacs versions, this "worked" -in that the key acted as Meta--that's because the older Emacs versions -did not try to support Compose Character. Now Emacs tries to do -character composition in the standard X way. This means that you -must pick one meaning or the other for any given key. - -You can use both functions (Meta, and Compose Character) if you assign -them to two different keys. - -* Emacs gets a segmentation fault at startup, on AIX4.2. - -If you are using IBM's xlc compiler, compile emacs.c -without optimization; that should avoid the problem. - -* movemail compiled with POP support can't connect to the POP server. - -Make sure that the `pop' entry in /etc/services, or in the services -NIS map if your machine uses NIS, has the same port number as the -entry on the POP server. A common error is for the POP server to be -listening on port 110, the assigned port for the POP3 protocol, while -the client is trying to connect on port 109, the assigned port for the -old POP protocol. - -* Emacs crashes in x-popup-dialog. - -This can happen if the dialog widget cannot find the font it wants to -use. You can work around the problem by specifying another font with -an X resource--for example, `Emacs.dialog*.font: 9x15' (or any font that -happens to exist on your X server). - -* Emacs crashes when you use Bibtex mode. - -This happens if your system puts a small limit on stack size. You can -prevent the problem by using a suitable shell command (often `ulimit') -to raise the stack size limit before you run Emacs. - -Patches to raise the stack size limit automatically in `main' -(src/emacs.c) on various systems would be greatly appreciated. - -* Emacs crashes with SIGBUS or SIGSEGV on HPUX 9 after you delete a frame. - -We think this is due to a bug in the X libraries provided by HP. With -the alternative X libraries in /usr/contrib/mitX11R5/lib, the problem -does not happen. - -* Emacs crashes with SIGBUS or SIGSEGV on Solaris after you delete a frame. - -We suspect that this is a similar bug in the X libraries provided by -Sun. There is a report that one of these patches fixes the bug and -makes the problem stop: - -105216-01 105393-01 105518-01 105621-01 105665-01 105615-02 105216-02 -105667-01 105401-08 105615-03 105621-02 105686-02 105736-01 105755-03 -106033-01 105379-01 105786-01 105181-04 105379-03 105786-04 105845-01 -105284-05 105669-02 105837-01 105837-02 105558-01 106125-02 105407-01 - -Another person using a newer system (kernel patch level Generic_105181-06) -suspects that the bug was fixed by one of these more recent patches: - -106040-07 SunOS 5.6: X Input & Output Method patch -106222-01 OpenWindows 3.6: filemgr (ff.core) fixes -105284-12 Motif 1.2.7: sparc Runtime library patch - -* Problems running Perl under Emacs on MS-Windows NT/95. - -`perl -de 0' just hangs when executed in an Emacs subshell. -The fault lies with Perl (indirectly with Windows NT/95). - -The problem is that the Perl debugger explicitly opens a connection to -"CON", which is the DOS/NT equivalent of "/dev/tty", for interacting -with the user. - -On Unix, this is okay, because Emacs (or the shell?) creates a -pseudo-tty so that /dev/tty is really the pipe Emacs is using to -communicate with the subprocess. - -On NT, this fails because CON always refers to the handle for the -relevant console (approximately equivalent to a tty), and cannot be -redirected to refer to the pipe Emacs assigned to the subprocess as -stdin. - -A workaround is to modify perldb.pl to use STDIN/STDOUT instead of CON. - -For Perl 4: - - *** PERL/LIB/PERLDB.PL.orig Wed May 26 08:24:18 1993 - --- PERL/LIB/PERLDB.PL Mon Jul 01 15:28:16 1996 - *************** - *** 68,74 **** - $rcfile=".perldb"; - } - else { - ! $console = "con"; - $rcfile="perldb.ini"; - } - - --- 68,74 ---- - $rcfile=".perldb"; - } - else { - ! $console = ""; - $rcfile="perldb.ini"; - } - - - For Perl 5: - *** perl/5.001/lib/perl5db.pl.orig Sun Jun 04 21:13:40 1995 - --- perl/5.001/lib/perl5db.pl Mon Jul 01 17:00:08 1996 - *************** - *** 22,28 **** - $rcfile=".perldb"; - } - elsif (-e "con") { - ! $console = "con"; - $rcfile="perldb.ini"; - } - else { - --- 22,28 ---- - $rcfile=".perldb"; - } - elsif (-e "con") { - ! $console = ""; - $rcfile="perldb.ini"; - } - else { - -* Problems on MS-DOG if DJGPP v2.0 is used to compile Emacs: - -There are two DJGPP library bugs which cause problems: - - * Running `shell-command' (or `compile', or `grep') you get - `Searching for program: permission denied (EACCES), c:/command.com'; - * After you shell to DOS, Ctrl-Break kills Emacs. - -To work around these bugs, you can use two files in the msdos -subdirectory: `is_exec.c' and `sigaction.c'. Compile them and link -them into the Emacs executable `temacs'; then they will replace the -incorrect library functions. - -* When compiling with DJGPP on MS-Windows NT, "config msdos" fails. - -If the error message is "VDM has been already loaded", this is because -Windows has a program called `redir.exe' that is incompatible with a -program by the same name supplied with DJGPP, which is used by -config.bat. To resolve this, move the DJGPP's `bin' subdirectory to -the front of your PATH environment variable. - -* When compiling with DJGPP on MS-Windows 95, Make fails for some targets -like make-docfile. - -This can happen if long file name support (the setting of environment -variable LFN) when Emacs distribution was unpacked and during -compilation are not the same. See the MSDOG section of INSTALL for -the explanation of how to avoid this problem. - -* Emacs compiled for MSDOS cannot find some Lisp files, or other -run-time support files, when long filename support is enabled. - -Usually, this problem will manifest itself when Emacs exits -immediately after flashing the startup screen, because it cannot find -the Lisp files it needs to load at startup. Redirect Emacs stdout -and stderr to a file to see the error message printed by Emacs. - -Another manifestation of this problem is that Emacs is unable to load -the support for editing program sources in languages such as C and -Lisp. - -This can happen if the Emacs distribution was unzipped without LFN -support, thus causing long filenames to be truncated to the first 6 -characters and a numeric tail that Windows 95 normally attaches to it. -You should unzip the files again with a utility that supports long -filenames (such as djtar from DJGPP or InfoZip's UnZip program -compiled with DJGPP v2). The MSDOG section of the file INSTALL -explains this issue in more detail. - -Another possible reason for such failures is that Emacs compiled for -MSDOS is used on Windows NT, where long file names are not supported -by this version of Emacs, but the distribution was unpacked by an -unzip program that preserved the long file names instead of truncating -them to DOS 8+3 limits. To be useful on NT, the MSDOS port of Emacs -must be unzipped by a DOS utility, so that long file names are -properly truncated. - -* Emacs compiled with DJGPP complains at startup: - - "Wrong type of argument: internal-facep, msdos-menu-active-face" - -This can happen if you define an environment variable `TERM'. Emacs -on MSDOS uses an internal terminal emulator which is disabled if the -value of `TERM' is anything but the string "internal". Emacs then -works as if its terminal were a dumb glass teletype that doesn't -support faces. To work around this, arrange for `TERM' to be -undefined when Emacs runs. The best way to do that is to add an -[emacs] section to the DJGPP.ENV file which defines an empty value for -`TERM'; this way, only Emacs gets the empty value, while the rest of -your system works as before. - -* On MS-Windows 95, Alt-f6 does not get through to Emacs. - -This character seems to be trapped by the kernel in Windows 95. -You can enter M-f6 by typing ESC f6. - -* Typing Alt-Shift has strange effects on MS-Windows. - -This combination of keys is a command to change keyboard layout. If -you proceed to type another non-modifier key before you let go of Alt -and Shift, the Alt and Shift act as modifiers in the usual way. A -more permanent work around is to change it to another key combination, -or disable it in the keyboard control panel. - -* `tparam' reported as a multiply-defined symbol when linking with ncurses. - -This problem results from an incompatible change in ncurses, in -version 1.9.9e approximately. This version is unable to provide a -definition of tparm without also defining tparam. This is also -incompatible with Terminfo; as a result, the Emacs Terminfo support -does not work with this version of ncurses. - -The fix is to install a newer version of ncurses, such as version 4.2. - -* Emacs does not start, complaining that it cannot open termcap database file. - -If your system uses Terminfo rather than termcap (most modern -systems do), this could happen if the proper version of -ncurses is not visible to the Emacs configure script (i.e. it -cannot be found along the usual path the linker looks for -libraries). It can happen because your version of ncurses is -obsolete, or is available only in form of binaries. - -The solution is to install an up-to-date version of ncurses in -the developer's form (header files, static libraries and -symbolic links); in some GNU/Linux distributions (e.g. Debian) -it constitutes a separate package. - -* Strange results from format %d in a few cases, on a Sun. - -Sun compiler version SC3.0 has been found to miscompile part of -editfns.c. The workaround is to compile with some other compiler such -as GCC. - -* Output from subprocess (such as man or diff) is randomly truncated -on GNU/Linux systems. - -This is due to a kernel bug which seems to be fixed in Linux version -1.3.75. - -* Error messages `internal facep []' happen on GNU/Linux systems. - -There is a report that replacing libc.so.5.0.9 with libc.so.5.2.16 -caused this to start happening. People are not sure why, but the -problem seems unlikely to be in Emacs itself. Some suspect that it -is actually Xlib which won't work with libc.so.5.2.16. - -Using the old library version is a workaround. - -* On Solaris, Emacs crashes if you use (display-time). - -This can happen if you configure Emacs without specifying the precise -version of Solaris that you are using. - -* Emacs dumps core on startup, on Solaris. - -Bill Sebok says that the cause of this is Solaris 2.4 vendor patch -102303-05, which extends the Solaris linker to deal with the Solaris -Common Desktop Environment's linking needs. You can fix the problem -by removing this patch and installing patch 102049-02 instead. -However, that linker version won't work with CDE. - -Solaris 2.5 comes with a linker that has this bug. It is reported that if -you install all the latest patches (as of June 1996), the bug is fixed. -We suspect the crucial patch is one of these, but we don't know -for certain. - - 103093-03: [README] SunOS 5.5: kernel patch (2140557 bytes) - 102832-01: [README] OpenWindows 3.5: Xview Jumbo Patch (4181613 bytes) - 103242-04: [README] SunOS 5.5: linker patch (595363 bytes) - -(One user reports that the bug was fixed by those patches together -with patches 102980-04, 103279-01, 103300-02, and 103468-01.) - -If you can determine which patch does fix the bug, please tell -bug-gnu-emacs@gnu.org. - -Meanwhile, the GNU linker links Emacs properly on both Solaris 2.4 and -Solaris 2.5. - -* Emacs dumps core if lisp-complete-symbol is called, on Solaris. - -If you compile Emacs with the -fast or -xO4 option with version 3.0.2 -of the Sun C compiler, Emacs dumps core when lisp-complete-symbol is -called. The problem does not happen if you compile with GCC. - -* "Cannot find callback list" messages from dialog boxes on HPUX, in -Emacs built with Motif. - -This problem resulted from a bug in GCC 2.4.5. Newer GCC versions -such as 2.7.0 fix the problem. - -* On Irix 6.0, make tries (and fails) to build a program named unexelfsgi - -A compiler bug inserts spaces into the string "unexelfsgi . o" -in src/Makefile. Edit src/Makefile, after configure is run, -find that string, and take out the spaces. - -Compiler fixes in Irix 6.0.1 should eliminate this problem. - -* "out of virtual swap space" on Irix 5.3 - -This message occurs when the system runs out of swap space due to too -many large programs running. The solution is either to provide more -swap space or to reduce the number of large programs being run. You -can check the current status of the swap space by executing the -command `swap -l'. - -You can increase swap space by changing the file /etc/fstab. Adding a -line like this: - -/usr/swap/swap.more swap swap pri=3 0 0 - -where /usr/swap/swap.more is a file previously created (for instance -by using /etc/mkfile), will increase the swap space by the size of -that file. Execute `swap -m' or reboot the machine to activate the -new swap area. See the manpages for `swap' and `fstab' for further -information. - -The objectserver daemon can use up lots of memory because it can be -swamped with NIS information. It collects information about all users -on the network that can log on to the host. - -If you want to disable the objectserver completely, you can execute -the command `chkconfig objectserver off' and reboot. That may disable -some of the window system functionality, such as responding CDROM -icons. - -You can also remove NIS support from the objectserver. The SGI `admin' -FAQ has a detailed description on how to do that; see question 35 -("Why isn't the objectserver working?"). The admin FAQ can be found at -ftp://viz.tamu.edu/pub/sgi/faq/. - -* With certain fonts, when the cursor appears on a character, the -character doesn't appear--you get a solid box instead. - -One user on a Linux-based GNU system reported that this problem went -away with installation of a new X server. The failing server was -XFree86 3.1.1. XFree86 3.1.2 works. - -* On SunOS 4.1.3, Emacs unpredictably crashes in _yp_dobind_soft. - -This happens if you configure Emacs specifying just `sparc-sun-sunos4' -on a system that is version 4.1.3. You must specify the precise -version number (or let configure figure out the configuration, which -it can do perfectly well for SunOS). - -* On SunOS 4, Emacs processes keep going after you kill the X server -(or log out, if you logged in using X). - -Someone reported that recompiling with GCC 2.7.0 fixed this problem. - -* On AIX 4, some programs fail when run in a Shell buffer -with an error message like No terminfo entry for "unknown". - -On AIX, many terminal type definitions are not installed by default. -`unknown' is one of them. Install the "Special Generic Terminal -Definitions" to make them defined. - -* On SunOS, you get linker errors - ld: Undefined symbol - _get_wmShellWidgetClass - _get_applicationShellWidgetClass - -The fix to this is to install patch 100573 for OpenWindows 3.0 -or link libXmu statically. - -* On AIX 4.1.2, linker error messages such as - ld: 0711-212 SEVERE ERROR: Symbol .__quous, found in the global symbol table - of archive /usr/lib/libIM.a, was not defined in archive member shr.o. - -This is a problem in libIM.a. You can work around it by executing -these shell commands in the src subdirectory of the directory where -you build Emacs: - - cp /usr/lib/libIM.a . - chmod 664 libIM.a - ranlib libIM.a - -Then change -lIM to ./libIM.a in the command to link temacs (in -Makefile). - -* Unpredictable segmentation faults on Solaris 2.3 and 2.4. - -A user reported that this happened in 19.29 when it was compiled with -the Sun compiler, but not when he recompiled with GCC 2.7.0. - -We do not know whether something in Emacs is partly to blame for this. - -* Emacs exits with "X protocol error" when run with an X server for -MS-Windows. - -A certain X server for Windows had a bug which caused this. -Supposedly the newer 32-bit version of this server doesn't have the -problem. - -* Emacs crashes at startup on MSDOS. - -Some users report that Emacs 19.29 requires dpmi memory management, -and crashes on startup if the system does not have it. We don't yet -know why this happens--perhaps these machines don't have enough real -memory, or perhaps something is wrong in Emacs or the compiler. -However, arranging to use dpmi support is a workaround. - -You can find out if you have a dpmi host by running go32 without -arguments; it will tell you if it uses dpmi memory. For more -information about dpmi memory, consult the djgpp FAQ. (djgpp -is the GNU C compiler as packaged for MSDOS.) - -Compiling Emacs under MSDOS is extremely sensitive for proper memory -configuration. If you experience problems during compilation, consider -removing some or all memory resident programs (notably disk caches) -and make sure that your memory managers are properly configured. See -the djgpp faq for configuration hints. - -* A position you specified in .Xdefaults is ignored, using twm. - -twm normally ignores "program-specified" positions. -You can tell it to obey them with this command in your `.twmrc' file: - - UsePPosition "on" #allow clients to request a position - -* Compiling lib-src says there is no rule to make test-distrib.c. - -This results from a bug in a VERY old version of GNU Sed. To solve -the problem, install the current version of GNU Sed, then rerun -Emacs's configure script. - -* Compiling wakeup, in lib-src, says it can't make wakeup.c. - -This results from a bug in GNU Sed version 2.03. To solve the -problem, install the current version of GNU Sed, then rerun Emacs's -configure script. - -* On Sunos 4.1.1, there are errors compiling sysdep.c. - -If you get errors such as - - "sysdep.c", line 2017: undefined structure or union - "sysdep.c", line 2017: undefined structure or union - "sysdep.c", line 2019: nodename undefined - -This can result from defining LD_LIBRARY_PATH. It is very tricky -to use that environment variable with Emacs. The Emacs configure -script links many test programs with the system libraries; you must -make sure that the libraries available to configure are the same -ones available when you build Emacs. - -* The right Alt key works wrong on German HP keyboards (and perhaps -other non-English HP keyboards too). - -This is because HPUX defines the modifiers wrong in X. Here is a -shell script to fix the problem; be sure that it is run after VUE -configures the X server. - - xmodmap 2> /dev/null - << EOF - keysym Alt_L = Meta_L - keysym Alt_R = Meta_R - EOF - - xmodmap - << EOF - clear mod1 - keysym Mode_switch = NoSymbol - add mod1 = Meta_L - keysym Meta_R = Mode_switch - add mod2 = Mode_switch - EOF - -* The Emacs window disappears when you type M-q. - -Some versions of the Open Look window manager interpret M-q as a quit -command for whatever window you are typing at. If you want to use -Emacs with that window manager, you should try to configure the window -manager to use some other command. You can disable the -shortcut keys entirely by adding this line to ~/.OWdefaults: - - OpenWindows.WindowMenuAccelerators: False - -* Emacs does not notice when you release the mouse. - -There are reports that this happened with (some) Microsoft mice and -that replacing the mouse made it stop. - -* Trouble using ptys on IRIX, or running out of ptys. - -The program mkpts (which may be in `/usr/adm' or `/usr/sbin') needs to -be set-UID to root, or non-root programs like Emacs will not be able -to allocate ptys reliably. - -* On Irix 5.2, unexelfsgi.c can't find cmplrs/stsupport.h. - -The file cmplrs/stsupport.h was included in the wrong file set in the -Irix 5.2 distribution. You can find it in the optional fileset -compiler_dev, or copy it from some other Irix 5.2 system. A kludgy -workaround is to change unexelfsgi.c to include sym.h instead of -syms.h. - -* Slow startup on Linux-based GNU systems. - -People using systems based on the Linux kernel sometimes report that -startup takes 10 to 15 seconds longer than `usual'. - -This is because Emacs looks up the host name when it starts. -Normally, this takes negligible time; the extra delay is due to -improper system configuration. This problem can occur for both -networked and non-networked machines. - -Here is how to fix the configuration. It requires being root. - -** Networked Case - -First, make sure the files `/etc/hosts' and `/etc/host.conf' both -exist. The first line in the `/etc/hosts' file should look like this -(replace HOSTNAME with your host name): - - 127.0.0.1 HOSTNAME - -Also make sure that the `/etc/host.conf' files contains the following -lines: - - order hosts, bind - multi on - -Any changes, permanent and temporary, to the host name should be -indicated in the `/etc/hosts' file, since it acts a limited local -database of addresses and names (e.g., some SLIP connections -dynamically allocate ip addresses). - -** Non-Networked Case - -The solution described in the networked case applies here as well. -However, if you never intend to network your machine, you can use a -simpler solution: create an empty `/etc/host.conf' file. The command -`touch /etc/host.conf' suffices to create the file. The `/etc/hosts' -file is not necessary with this approach. - -* On Solaris 2.4, Dired hangs and C-g does not work. Or Emacs hangs -forever waiting for termination of a subprocess that is a zombie. - -casper@fwi.uva.nl says the problem is in X11R6. Rebuild libX11.so -after changing the file xc/config/cf/sunLib.tmpl. Change the lines - - #if ThreadedX - #define SharedX11Reqs -lthread - #endif - -to: - - #if OSMinorVersion < 4 - #if ThreadedX - #define SharedX11Reqs -lthread - #endif - #endif - -Be sure also to edit x/config/cf/sun.cf so that OSMinorVersion is 4 -(as it should be for Solaris 2.4). The file has three definitions for -OSMinorVersion: the first is for x86, the second for SPARC under -Solaris, and the third for SunOS 4. Make sure to update the -definition for your type of machine and system. - -Then do `make Everything' in the top directory of X11R6, to rebuild -the makefiles and rebuild X. The X built this way work only on -Solaris 2.4, not on 2.3. - -For multithreaded X to work it is necessary to install patch -101925-02 to fix problems in header files [2.4]. You need -to reinstall gcc or re-run just-fixinc after installing that -patch. - -However, Frank Rust used a simpler solution: -he changed - #define ThreadedX YES -to - #define ThreadedX NO -in sun.cf and did `make World' to rebuild X11R6. Removing all -`-DXTHREAD*' flags and `-lthread' entries from lib/X11/Makefile and -typing 'make install' in that directory also seemed to work. - -* With M-x enable-flow-control, you need to type C-\ twice - to do incremental search--a single C-\ gets no response. - -This has been traced to communicating with your machine via kermit, -with C-\ as the kermit escape character. One solution is to use -another escape character in kermit. One user did - - set escape-character 17 - -in his .kermrc file, to make C-q the kermit escape character. - -* The Motif version of Emacs paints the screen a solid color. - -This has been observed to result from the following X resource: - - Emacs*default.attributeFont: -*-courier-medium-r-*-*-*-140-*-*-*-*-iso8859-* - -That the resource has this effect indicates a bug in something, but we -do not yet know what. If it is an Emacs bug, we hope someone can -explain what the bug is so we can fix it. In the mean time, removing -the resource prevents the problem. - -* Emacs gets hung shortly after startup, on Sunos 4.1.3. - -We think this is due to a bug in Sunos. The word is that -one of these Sunos patches fixes the bug: - -100075-11 100224-06 100347-03 100482-05 100557-02 100623-03 100804-03 101080-01 -100103-12 100249-09 100496-02 100564-07 100630-02 100891-10 101134-01 -100170-09 100296-04 100377-09 100507-04 100567-04 100650-02 101070-01 101145-01 -100173-10 100305-15 100383-06 100513-04 100570-05 100689-01 101071-03 101200-02 -100178-09 100338-05 100421-03 100536-02 100584-05 100784-01 101072-01 101207-01 - -We don't know which of these patches really matter. If you find out -which ones, please inform bug-gnu-emacs@gnu.org. - -* Emacs aborts while starting up, only when run without X. - -This problem often results from compiling Emacs with GCC when GCC was -installed incorrectly. The usual error in installing GCC is to -specify --includedir=/usr/include. Installation of GCC makes -corrected copies of the system header files. GCC is supposed to use -the corrected copies in preference to the original system headers. -Specifying --includedir=/usr/include causes the original system header -files to be used. On some systems, the definition of ioctl in the -original system header files is invalid for ANSI C and causes Emacs -not to work. - -The fix is to reinstall GCC, and this time do not specify --includedir -when you configure it. Then recompile Emacs. Specifying --includedir -is appropriate only in very special cases and it should *never* be the -same directory where system header files are kept. - -* On Solaris 2.x, GCC complains "64 bit integer types not supported" - -This suggests that GCC is not installed correctly. Most likely you -are using GCC 2.7.2.3 (or earlier) on Solaris 2.6 (or later); this -does not work without patching. To run GCC 2.7.2.3 on Solaris 2.6 or -later, you must patch fixinc.svr4 and reinstall GCC from scratch as -described in the Solaris FAQ -. A better fix is -to upgrade to GCC 2.8.1 or later. - -* The Compose key on a DEC keyboard does not work as Meta key. - -This shell command should fix it: - - xmodmap -e 'keycode 0xb1 = Meta_L' - -* Regular expressions matching bugs on SCO systems. - -On SCO, there are problems in regexp matching when Emacs is compiled -with the system compiler. The compiler version is "Microsoft C -version 6", SCO 4.2.0h Dev Sys Maintenance Supplement 01/06/93; Quick -C Compiler Version 1.00.46 (Beta). The solution is to compile with -GCC. - -* On Sunos 4, you get the error ld: Undefined symbol __lib_version. - -This is the result of using cc or gcc with the shared library meant -for acc (the Sunpro compiler). Check your LD_LIBRARY_PATH and delete -/usr/lang/SC2.0.1 or some similar directory. - -* You can't select from submenus (in the X toolkit version). - -On certain systems, mouse-tracking and selection in top-level menus -works properly with the X toolkit, but neither of them works when you -bring up a submenu (such as Bookmarks or Compare or Apply Patch, in -the Files menu). - -This works on most systems. There is speculation that the failure is -due to bugs in old versions of X toolkit libraries, but no one really -knows. If someone debugs this and finds the precise cause, perhaps a -workaround can be found. - -* Unusable default font on SCO 3.2v4. - -The Open Desktop environment comes with default X resource settings -that tell Emacs to use a variable-width font. Emacs cannot use such -fonts, so it does not work. - -This is caused by the file /usr/lib/X11/app-defaults/ScoTerm, which is -the application-specific resource file for the `scoterm' terminal -emulator program. It contains several extremely general X resources -that affect other programs besides `scoterm'. In particular, these -resources affect Emacs also: - - *Font: -*-helvetica-medium-r-*--12-*-p-* - *Background: scoBackground - *Foreground: scoForeground - -The best solution is to create an application-specific resource file for -Emacs, /usr/lib/X11/sco/startup/Emacs, with the following contents: - - Emacs*Font: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1 - Emacs*Background: white - Emacs*Foreground: black - -(These settings mimic the Emacs defaults, but you can change them to -suit your needs.) This resource file is only read when the X server -starts up, so you should restart it by logging out of the Open Desktop -environment or by running `scologin stop; scologin start` from the shell -as root. Alternatively, you can put these settings in the -/usr/lib/X11/app-defaults/Emacs resource file and simply restart Emacs, -but then they will not affect remote invocations of Emacs that use the -Open Desktop display. - -These resource files are not normally shared across a network of SCO -machines; you must create the file on each machine individually. - -* rcs2log gives you the awk error message "too many fields". - -This is due to an arbitrary limit in certain versions of awk. -The solution is to use gawk (GNU awk). - -* Emacs is slow using X11R5 on HP/UX. - -This happens if you use the MIT versions of the X libraries--it -doesn't run as fast as HP's version. People sometimes use the version -because they see the HP version doesn't have the libraries libXaw.a, -libXmu.a, libXext.a and others. HP/UX normally doesn't come with -those libraries installed. To get good performance, you need to -install them and rebuild Emacs. - -* Loading fonts is very slow. - -You might be getting scalable fonts instead of precomputed bitmaps. -Known scalable font directories are "Type1" and "Speedo". A font -directory contains scalable fonts if it contains the file -"fonts.scale". - -If this is so, re-order your X windows font path to put the scalable -font directories last. See the documentation of `xset' for details. - -With some X servers, it may be necessary to take the scalable font -directories out of your path entirely, at least for Emacs 19.26. -Changes in the future may make this unnecessary. - -* On AIX 3.2.4, releasing Ctrl/Act key has no effect, if Shift is down. - -Due to a feature of AIX, pressing or releasing the Ctrl/Act key is -ignored when the Shift, Alt or AltGr keys are held down. This can -lead to the keyboard being "control-locked"--ordinary letters are -treated as control characters. - -You can get out of this "control-locked" state by pressing and -releasing Ctrl/Act while not pressing or holding any other keys. - -* display-time causes kernel problems on ISC systems. - -Under Interactive Unix versions 3.0.1 and 4.0 (and probably other -versions), display-time causes the loss of large numbers of STREVENT -cells. Eventually the kernel's supply of these cells is exhausted. -This makes emacs and the whole system run slow, and can make other -processes die, in particular pcnfsd. - -Other emacs functions that communicate with remote processes may have -the same problem. Display-time seems to be far the worst. - -The only known fix: Don't run display-time. - -* On Solaris, C-x doesn't get through to Emacs when you use the console. - -This is a Solaris feature (at least on Intel x86 cpus). Type C-r -C-r C-t, to toggle whether C-x gets through to Emacs. - -* Error message `Symbol's value as variable is void: x', followed by - segmentation fault and core dump. - -This has been tracked to a bug in tar! People report that tar erroneously -added a line like this at the beginning of files of Lisp code: - - x FILENAME, N bytes, B tape blocks - -If your tar has this problem, install GNU tar--if you can manage to -untar it :-). - -* Link failure when using acc on a Sun. - -To use acc, you need additional options just before the libraries, such as - - /usr/lang/SC2.0.1/values-Xt.o -L/usr/lang/SC2.0.1/cg87 -L/usr/lang/SC2.0.1 - -and you need to add -lansi just before -lc. - -The precise file names depend on the compiler version, so we -cannot easily arrange to supply them. - -* Link failure on IBM AIX 1.3 ptf 0013. - -There is a real duplicate definition of the function `_slibc_free' in -the library /lib/libc_s.a (just do nm on it to verify). The -workaround/fix is: - - cd /lib - ar xv libc_s.a NLtmtime.o - ar dv libc_s.a NLtmtime.o - -* Undefined symbols _dlopen, _dlsym and/or _dlclose on a Sun. - -If you see undefined symbols _dlopen, _dlsym, or _dlclose when linking -with -lX11, compile and link against the file mit/util/misc/dlsym.c in -the MIT X11R5 distribution. Alternatively, link temacs using shared -libraries with s/sunos4shr.h. (This doesn't work if you use the X -toolkit.) - -If you get the additional error that the linker could not find -lib_version.o, try extracting it from X11/usr/lib/X11/libvim.a in -X11R4, then use it in the link. - -* Error messages `Wrong number of arguments: #, 5' - -This typically results from having the powerkey library loaded. -Powerkey was designed for Emacs 19.22. It is obsolete now because -Emacs 19 now has this feature built in; and powerkey also calls -where-is-internal in an obsolete way. - -So the fix is to arrange not to load powerkey. - -* In Shell mode, you get a ^M at the end of every line. - -This happens to people who use tcsh, because it is trying to be too -smart. It sees that the Shell uses terminal type `unknown' and turns -on the flag to output ^M at the end of each line. You can fix the -problem by adding this to your .cshrc file: - - if ($?EMACS) then - if ($EMACS == "t") then - unset edit - stty -icrnl -onlcr -echo susp ^Z - endif - endif - -* An error message such as `X protocol error: BadMatch (invalid -parameter attributes) on protocol request 93'. - -This comes from having an invalid X resource, such as - emacs*Cursor: black -(which is invalid because it specifies a color name for something -that isn't a color.) - -The fix is to correct your X resources. - -* Undefined symbols when linking on Sunos 4.1 using --with-x-toolkit. - -If you get the undefined symbols _atowc _wcslen, _iswprint, _iswspace, -_iswcntrl, _wcscpy, and _wcsncpy, then you need to add -lXwchar after --lXaw in the command that links temacs. - -This problem seems to arise only when the international language -extensions to X11R5 are installed. - -* Typing C-c C-c in Shell mode kills your X server. - -This happens with Linux kernel 1.0 thru 1.04, approximately. The workaround is -to define SIGNALS_VIA_CHARACTERS in config.h and recompile Emacs. -Newer Linux kernel versions don't have this problem. - -* src/Makefile and lib-src/Makefile are truncated--most of the file missing. - -This can happen if configure uses GNU sed version 2.03. That version -had a bug. GNU sed version 2.05 works properly. - -* Slow startup on X11R6 with X windows. - -If Emacs takes two minutes to start up on X11R6, see if your X -resources specify any Adobe fonts. That causes the type-1 font -renderer to start up, even if the font you asked for is not a type-1 -font. - -One way to avoid this problem is to eliminate the type-1 fonts from -your font path, like this: - - xset -fp /usr/X11R6/lib/X11/fonts/Type1/ - -* Pull-down menus appear in the wrong place, in the toolkit version of Emacs. - -An X resource of this form can cause the problem: - - Emacs*geometry: 80x55+0+0 - -This resource is supposed to apply, and does apply, to the menus -individually as well as to Emacs frames. If that is not what you -want, rewrite the resource. - -To check thoroughly for such resource specifications, use `xrdb --query' to see what resources the X server records, and also look at -the user's ~/.Xdefaults and ~/.Xdefaults-* files. - -* --with-x-toolkit version crashes when used with shared libraries. - -On some systems, including Sunos 4 and DGUX 5.4.2 and perhaps others, -unexec doesn't work properly with the shared library for the X -toolkit. You might be able to work around this by using a nonshared -libXt.a library. The real fix is to upgrade the various versions of -unexec and/or ralloc. We think this has been fixed on Sunos 4 -and Solaris in version 19.29. - -* `make install' fails on install-doc with `Error 141'. - -This happens on Ultrix 4.2 due to failure of a pipeline of tar -commands. We don't know why they fail, but the bug seems not to be in -Emacs. The workaround is to run the shell command in install-doc by -hand. - -* --with-x-toolkit option configures wrong on BSD/386. - -This problem is due to bugs in the shell in version 1.0 of BSD/386. -The workaround is to edit the configure file to use some other shell, -such as bash. - -* Subprocesses remain, hanging but not zombies, on Sunos 5.3. - -A bug in Sunos 5.3 causes Emacs subprocesses to remain after Emacs -exits. Sun patch # 101415-02 is part of the fix for this, but it only -applies to ptys, and doesn't fix the problem with subprocesses -communicating through pipes. - -* Mail is lost when sent to local aliases. - -Many emacs mail user agents (VM and rmail, for instance) use the -sendmail.el library. This library can arrange for mail to be -delivered by passing messages to the /usr/lib/sendmail (usually) -program . In doing so, it passes the '-t' flag to sendmail, which -means that the name of the recipient of the message is not on the -command line and, therefore, that sendmail must parse the message to -obtain the destination address. - -There is a bug in the SunOS4.1.1 and SunOS4.1.3 versions of sendmail. -In short, when given the -t flag, the SunOS sendmail won't recognize -non-local (i.e. NIS) aliases. It has been reported that the Solaris -2.x versions of sendmail do not have this bug. For those using SunOS -4.1, the best fix is to install sendmail V8 or IDA sendmail (which -have other advantages over the regular sendmail as well). At the time -of this writing, these official versions are available: - - Sendmail V8 on ftp.cs.berkeley.edu in /ucb/sendmail: - sendmail.8.6.9.base.tar.Z (the base system source & documentation) - sendmail.8.6.9.cf.tar.Z (configuration files) - sendmail.8.6.9.misc.tar.Z (miscellaneous support programs) - sendmail.8.6.9.xdoc.tar.Z (extended documentation, with postscript) - - IDA sendmail on vixen.cso.uiuc.edu in /pub: - sendmail-5.67b+IDA-1.5.tar.gz - -* On AIX, you get this message when running Emacs: - - Could not load program emacs - Symbol smtcheckinit in csh is undefined - Error was: Exec format error - -or this one: - - Could not load program .emacs - Symbol _system_con in csh is undefined - Symbol _fp_trapsta in csh is undefined - Error was: Exec format error - -These can happen when you try to run on AIX 3.2.5 a program that was -compiled with 3.2.4. The fix is to recompile. - -* On AIX, you get this compiler error message: - - Processing include file ./XMenuInt.h - 1501-106: (S) Include file X11/Xlib.h not found. - -This means your system was installed with only the X11 runtime i.d -libraries. You have to find your sipo (bootable tape) and install -X11Dev... with smit. - -* You "lose characters" after typing Compose Character key. +*** You "lose characters" after typing Compose Character key. This is because the Compose Character key is defined as the keysym Multi_key, and Emacs (seeing that) does the proper X11 @@ -2637,37 +993,41 @@ If all users at your site of a particular keyboard prefer Meta to Compose, you can make the remapping happen automatically by adding the xmodmap command to the xdm setup script for that display. -* C-z just refreshes the screen instead of suspending Emacs. +*** Using X Windows, control-shift-leftbutton makes Emacs hang. -You are probably using a shell that doesn't support job control, even -though the system itself is capable of it. Either use a different shell, -or set the variable `cannot-suspend' to a non-nil value. +Use the shell command `xset bc' to make the old X Menu package work. -* Watch out for .emacs files and EMACSLOADPATH environment vars +*** M-SPC seems to be ignored as input. -These control the actions of Emacs. -~/.emacs is your Emacs init file. -EMACSLOADPATH overrides which directories the function -"load" will search. +See if your X server is set up to use this as a command +for character composition. -If you observe strange problems, check for these and get rid -of them, then try again. +*** The S-C-t key combination doesn't get passed to Emacs on X. -* After running emacs once, subsequent invocations crash. +This happens because some X configurations assign the Ctrl-Shift-t +combination the same meaning as the Multi_key. The offending +definition is in the file `...lib/X11/locale/iso8859-1/Compose'; there +might be other similar combinations which are grabbed by X for similar +purposes. -Some versions of SVR4 have a serious bug in the implementation of the -mmap () system call in the kernel; this causes emacs to run correctly -the first time, and then crash when run a second time. +We think that this can be countermanded with the `xmodmap' utility, if +you want to be able to bind one of these key sequences within Emacs. -Contact your vendor and ask for the mmap bug fix; in the mean time, -you may be able to work around the problem by adding a line to your -operating system description file (whose name is reported by the -configure script) that reads: -#define SYSTEM_MALLOC -This makes Emacs use memory less efficiently, but seems to work around -the kernel bug. +*** Under X, C-v and/or other keys don't work. -* Inability to send an Alt-modified key, when Emacs is communicating +These may have been intercepted by your window manager. In +particular, AfterStep 1.6 is reported to steal C-v in its default +configuration. Various Meta keys are also likely to be taken by the +configuration of the `feel'. See the WM's documentation for how to +change this. + +*** Clicking C-mouse-2 in the scroll bar doesn't split the window. + +This currently doesn't work with scroll-bar widgets (and we don't know +a good way of implementing it with widgets). If Emacs is configured +--without-toolkit-scroll-bars, C-mouse-2 on the scroll bar does work. + +*** Inability to send an Alt-modified key, when Emacs is communicating directly with an X server. If you have tried to bind an Alt-modified key as a command, and it @@ -2700,139 +1060,261 @@ commands show above to make them modifier keys. Note that if you have Alt keys but no Meta keys, Emacs translates Alt into Meta. This is because of the great importance of Meta in Emacs. -* `Pid xxx killed due to text modification or page I/O error' +** Window-manager and toolkit-related problems -On HP/UX, you can get that error when the Emacs executable is on an NFS -file system. HP/UX responds this way if it tries to swap in a page and -does not get a response from the server within a timeout whose default -value is just ten seconds. +*** Gnome: Emacs' xterm-mouse-mode doesn't work on the Gnome terminal. -If this happens to you, extend the timeout period. +A symptom of this bug is that double-clicks insert a control sequence +into the buffer. The reason this happens is an apparent +incompatibility of the Gnome terminal with Xterm, which also affects +other programs using the Xterm mouse interface. A problem report has +been filed. -* `expand-file-name' fails to work on any but the machine you dumped Emacs on. +*** KDE: When running on KDE, colors or fonts are not as specified for Emacs, +or messed up. -On Ultrix, if you use any of the functions which look up information -in the passwd database before dumping Emacs (say, by using -expand-file-name in site-init.el), then those functions will not work -in the dumped Emacs on any host but the one Emacs was dumped on. +For example, you could see background you set for Emacs only in the +empty portions of the Emacs display, while characters have some other +background. -The solution? Don't use expand-file-name in site-init.el, or in -anything it loads. Yuck - some solution. +This happens because KDE's defaults apply its color and font +definitions even to applications that weren't compiled for KDE. The +solution is to uncheck the "Apply fonts and colors to non-KDE apps" +option in Preferences->Look&Feel->Style (KDE 2). In KDE 3, this option +is in the "Colors" section, rather than "Style". -I'm not sure why this happens; if you can find out exactly what is -going on, and perhaps find a fix or a workaround, please let us know. -Perhaps the YP functions cache some information, the cache is included -in the dumped Emacs, and is then inaccurate on any other host. +Alternatively, if you do want the KDE defaults to apply to other +applications, but not to Emacs, you could modify the file `Emacs.ad' +(should be in the `/usr/share/apps/kdisplay/app-defaults/' directory) +so that it doesn't set the default background and foreground only for +Emacs. For example, make sure the following resources are either not +present or commented out: -* On some variants of SVR4, Emacs does not work at all with X. + Emacs.default.attributeForeground + Emacs.default.attributeBackground + Emacs*Foreground + Emacs*Background -Try defining BROKEN_FIONREAD in your config.h file. If this solves -the problem, please send a bug report to tell us this is needed; be -sure to say exactly what type of machine and system you are using. +*** KDE: Emacs hangs on KDE when a large portion of text is killed. -* Linking says that the functions insque and remque are undefined. +This is caused by a bug in the KDE applet `klipper' which periodically +requests the X clipboard contents from applications. Early versions +of klipper don't implement the ICCM protocol for large selections, +which leads to Emacs being flooded with selection requests. After a +while, Emacs will print a message: -Change oldXMenu/Makefile by adding insque.o to the variable OBJS. + Timed out waiting for property-notify event -* Emacs fails to understand most Internet host names, even though -the names work properly with other programs on the same system. -* Emacs won't work with X-windows if the value of DISPLAY is HOSTNAME:0. -* GNUs can't make contact with the specified host for nntp. +A workaround is to not use `klipper'. -This typically happens on Suns and other systems that use shared -libraries. The cause is that the site has installed a version of the -shared library which uses a name server--but has not installed a -similar version of the unshared library which Emacs uses. +*** CDE: Frames may cover dialogs they created when using CDE. -The result is that most programs, using the shared library, work with -the nameserver, but Emacs does not. +This can happen if you have "Allow Primary Windows On Top" enabled which +seems to be the default in the Common Desktop Environment. +To change, go in to "Desktop Controls" -> "Window Style Manager" +and uncheck "Allow Primary Windows On Top". -The fix is to install an unshared library that corresponds to what you -installed in the shared library, and then relink Emacs. +*** Xaw3d : When using Xaw3d scroll bars without arrows, the very first mouse +click in a scroll bar might be ignored by the scroll bar widget. This +is probably a bug in Xaw3d; when Xaw3d is compiled with arrows, the +problem disappears. -On SunOS 4.1, simply define HAVE_RES_INIT. +*** Xaw: There are known binary incompatibilities between Xaw, Xaw3d, neXtaw, +XawM and the few other derivatives of Xaw. So when you compile with +one of these, it may not work to dynamically link with another one. +For example, strange problems, such as Emacs exiting when you type +"C-x 1", were reported when Emacs compiled with Xaw3d and libXaw was +used with neXtaw at run time. -If you have already installed the name resolver in the file libresolv.a, -then you need to compile Emacs to use that library. The easiest way to -do this is to add to config.h a definition of LIBS_SYSTEM, LIBS_MACHINE -or LIB_STANDARD which uses -lresolv. Watch out! If you redefine a macro -that is already in use in your configuration to supply some other libraries, -be careful not to lose the others. +The solution is to rebuild Emacs with the toolkit version you actually +want to use, or set LD_PRELOAD to preload the same toolkit version you +built Emacs with. -Thus, you could start by adding this to config.h: +*** Open Motif: Problems with file dialogs in Emacs built with Open Motif. -#define LIBS_SYSTEM -lresolv +When Emacs 21 is built with Open Motif 2.1, it can happen that the +graphical file dialog boxes do not work properly. The "OK", "Filter" +and "Cancel" buttons do not respond to mouse clicks. Dragging the +file dialog window usually causes the buttons to work again. -Then if this gives you an error for redefining a macro, and you see that -the s- file defines LIBS_SYSTEM as -lfoo -lbar, you could change config.h -again to say this: +The solution is to use LessTif instead. LessTif is a free replacement +for Motif. See the file INSTALL for information on how to do this. -#define LIBS_SYSTEM -lresolv -lfoo -lbar +Another workaround is not to use the mouse to trigger file prompts, +but to use the keyboard. This way, you will be prompted for a file in +the minibuffer instead of a graphical file dialog. -* On a Sun running SunOS 4.1.1, you get this error message from GNU ld: +*** LessTif: Problems in Emacs built with LessTif. - /lib/libc.a(_Q_sub.o): Undefined symbol __Q_get_rp_rd referenced from text segment +The problems seem to depend on the version of LessTif and the Motif +emulation for which it is set up. -The problem is in the Sun shared C library, not in GNU ld. +Only the Motif 1.2 emulation seems to be stable enough in LessTif. +Lesstif 0.92-17's Motif 1.2 emulation seems to work okay on FreeBSD. +On GNU/Linux systems, lesstif-0.92.6 configured with "./configure +--enable-build-12 --enable-default-12" is reported to be the most +successful. The binary GNU/Linux package +lesstif-devel-0.92.0-1.i386.rpm was reported to have problems with +menu placement. -The solution is to install Patch-ID# 100267-03 from Sun. +On some systems, even with Motif 1.2 emulation, Emacs occasionally +locks up, grabbing all mouse and keyboard events. We still don't know +what causes these problems; they are not reproducible by Emacs +developers. -* Self documentation messages are garbled. +*** Motif: The Motif version of Emacs paints the screen a solid color. -This means that the file `etc/DOC-...' doesn't properly correspond -with the Emacs executable. Redumping Emacs and then installing the -corresponding pair of files should fix the problem. +This has been observed to result from the following X resource: -* Trouble using ptys on AIX. + Emacs*default.attributeFont: -*-courier-medium-r-*-*-*-140-*-*-*-*-iso8859-* -People often install the pty devices on AIX incorrectly. -Use `smit pty' to reinstall them properly. +That the resource has this effect indicates a bug in something, but we +do not yet know what. If it is an Emacs bug, we hope someone can +explain what the bug is so we can fix it. In the mean time, removing +the resource prevents the problem. -* Shell mode on HP/UX gives the message, "`tty`: Ambiguous". +** General X problems -christos@theory.tn.cornell.edu says: +*** Redisplay using X11 is much slower than previous Emacs versions. -The problem is that in your .cshrc you have something that tries to -execute `tty`. If you are not running the shell on a real tty then -tty will print "not a tty". Csh expects one word in some places, -but tty is giving it back 3. +We've noticed that certain X servers draw the text much slower when +scroll bars are on the left. We don't know why this happens. If this +happens to you, you can work around it by putting the scroll bars +on the right (as they were in Emacs 19). -The solution is to add a pair of quotes around `tty` to make it a single -word: +Here's how to do this: -if (`tty` == "/dev/console") + (set-scroll-bar-mode 'right) -should be changed to: +If you're not sure whether (or how much) this problem affects you, +try that and see how much difference it makes. To set things back +to normal, do -if ("`tty`" == "/dev/console") + (set-scroll-bar-mode 'left) -Even better, move things that set up terminal sections out of .cshrc -and into .login. +*** Error messages about undefined colors on X. -* Using X Windows, control-shift-leftbutton makes Emacs hang. +The messages might say something like this: -Use the shell command `xset bc' to make the old X Menu package work. + Unable to load color "grey95" -* Emacs running under X Windows does not handle mouse clicks. -* `emacs -geometry 80x20' finds a file named `80x20'. +(typically, in the `*Messages*' buffer), or something like this: + + Error while displaying tooltip: (error Undefined color lightyellow) + +These problems could happen if some other X program has used up too +many colors of the X palette, leaving Emacs with insufficient system +resources to load all the colors it needs. + +A solution is to exit the offending X programs before starting Emacs. + +*** Improving performance with slow X connections. + +There are several ways to improve this performance, any subset of which can +be carried out at the same time: + +1) If you don't need X Input Methods (XIM) for entering text in some + language you use, you can improve performance on WAN links by using + the X resource useXIM to turn off use of XIM. This does not affect + the use of Emacs' own input methods, which are part of the Leim + package. + +2) If the connection is very slow, you might also want to consider + switching off scroll bars, menu bar, and tool bar. + +3) Use ssh to forward the X connection, and enable compression on this + forwarded X connection (ssh -XC remotehostname emacs ...). + +4) Use lbxproxy on the remote end of the connection. This is an interface + to the low bandwidth X extension in most modern X servers, which + improves performance dramatically, at the slight expense of correctness + of the X protocol. lbxproxy acheives the performance gain by grouping + several X requests in one TCP packet and sending them off together, + instead of requiring a round-trip for each X request in a seperate + packet. The switches that seem to work best for emacs are: + -noatomsfile -nowinattr -cheaterrors -cheatevents + Note that the -nograbcmap option is known to cause problems. + For more about lbxproxy, see: + http://www.xfree86.org/4.3.0/lbxproxy.1.html + +*** Emacs gives the error, Couldn't find per display information. + +This can result if the X server runs out of memory because Emacs uses +a large number of fonts. On systems where this happens, C-h h is +likely to cause it. + +We do not know of a way to prevent the problem. + +*** Emacs does not notice when you release the mouse. + +There are reports that this happened with (some) Microsoft mice and +that replacing the mouse made it stop. + +*** You can't select from submenus (in the X toolkit version). + +On certain systems, mouse-tracking and selection in top-level menus +works properly with the X toolkit, but neither of them works when you +bring up a submenu (such as Bookmarks or Compare or Apply Patch, in +the Files menu). + +This works on most systems. There is speculation that the failure is +due to bugs in old versions of X toolkit libraries, but no one really +knows. If someone debugs this and finds the precise cause, perhaps a +workaround can be found. + +*** An error message such as `X protocol error: BadMatch (invalid +parameter attributes) on protocol request 93'. + +This comes from having an invalid X resource, such as + emacs*Cursor: black +(which is invalid because it specifies a color name for something +that isn't a color.) + +The fix is to correct your X resources. + +*** Slow startup on X11R6 with X windows. + +If Emacs takes two minutes to start up on X11R6, see if your X +resources specify any Adobe fonts. That causes the type-1 font +renderer to start up, even if the font you asked for is not a type-1 +font. + +One way to avoid this problem is to eliminate the type-1 fonts from +your font path, like this: + + xset -fp /usr/X11R6/lib/X11/fonts/Type1/ + +*** Pull-down menus appear in the wrong place, in the toolkit version of Emacs. + +An X resource of this form can cause the problem: + + Emacs*geometry: 80x55+0+0 + +This resource is supposed to apply, and does apply, to the menus +individually as well as to Emacs frames. If that is not what you +want, rewrite the resource. + +To check thoroughly for such resource specifications, use `xrdb +-query' to see what resources the X server records, and also look at +the user's ~/.Xdefaults and ~/.Xdefaults-* files. + +*** --with-x-toolkit version crashes when used with shared libraries. + +On some systems, including Sunos 4 and DGUX 5.4.2 and perhaps others, +unexec doesn't work properly with the shared library for the X +toolkit. You might be able to work around this by using a nonshared +libXt.a library. The real fix is to upgrade the various versions of +unexec and/or ralloc. We think this has been fixed on Sunos 4 +and Solaris in version 19.29. + +*** Emacs running under X Windows does not handle mouse clicks. +*** `emacs -geometry 80x20' finds a file named `80x20'. One cause of such problems is having (setq term-file-prefix nil) in your .emacs file. Another cause is a bad value of EMACSLOADPATH in the environment. -* Emacs gets error message from linker on Sun. - -If the error message says that a symbol such as `f68881_used' or -`ffpa_used' or `start_float' is undefined, this probably indicates -that you have compiled some libraries, such as the X libraries, -with a floating point option other than the default. - -It's not terribly hard to make this work with small changes in -crt0.c together with linking with Fcrt1.o, Wcrt1.o or Mcrt1.o. -However, the easiest approach is to build Xlib with the default -floating point option: -fsoft. - -* Emacs fails to get default settings from X Windows server. +*** Emacs fails to get default settings from X Windows server. The X library in X11R4 has a bug; it interchanges the 2nd and 3rd arguments to XGetDefaults. Define the macro XBACKWARDS in config.h to @@ -2841,35 +1323,7 @@ tell Emacs to compensate for this. I don't believe there is any way Emacs can determine for itself whether this problem is present on a given system. -* Keyboard input gets confused after a beep when using a DECserver - as a concentrator. - -This problem seems to be a matter of configuring the DECserver to use -7 bit characters rather than 8 bit characters. - -* M-x shell persistently reports "Process shell exited abnormally with code 1". - -This happened on Suns as a result of what is said to be a bug in Sunos -version 4.0.x. The only fix was to reboot the machine. - -* Programs running under terminal emulator do not recognize `emacs' - terminal type. - -The cause of this is a shell startup file that sets the TERMCAP -environment variable. The terminal emulator uses that variable to -provide the information on the special terminal type that Emacs -emulates. - -Rewrite your shell startup file so that it does not change TERMCAP -in such a case. You could use the following conditional which sets -it only if it is undefined. - - if ( ! ${?TERMCAP} ) setenv TERMCAP ~/my-termcap-file - -Or you could set TERMCAP only when you set TERM--which should not -happen in a non-login shell. - -* X Windows doesn't work if DISPLAY uses a hostname. +*** X Windows doesn't work if DISPLAY uses a hostname. People have reported kernel bugs in certain systems that cause Emacs not to work with X Windows if DISPLAY is set using a host name. But @@ -2886,188 +1340,9 @@ The easy way to do this is to put in your site-init.el file. -* Problem with remote X server on Suns. +* Runtime problems on character termunals -On a Sun, running Emacs on one machine with the X server on another -may not work if you have used the unshared system libraries. This -is because the unshared libraries fail to use YP for host name lookup. -As a result, the host name you specify may not be recognized. - -* Shell mode ignores interrupts on Apollo Domain - -You may find that M-x shell prints the following message: - - Warning: no access to tty; thus no job control in this shell... - -This can happen if there are not enough ptys on your system. -Here is how to make more of them. - - % cd /dev - % ls pty* - # shows how many pty's you have. I had 8, named pty0 to pty7) - % /etc/crpty 8 - # creates eight new pty's - -* Fatal signal in the command temacs -l loadup inc dump - -This command is the final stage of building Emacs. It is run by the -Makefile in the src subdirectory, or by build.com on VMS. - -It has been known to get fatal errors due to insufficient swapping -space available on the machine. - -On 68000's, it has also happened because of bugs in the -subroutine `alloca'. Verify that `alloca' works right, even -for large blocks (many pages). - -* test-distrib says that the distribution has been clobbered -* or, temacs prints "Command key out of range 0-127" -* or, temacs runs and dumps emacs, but emacs totally fails to work. -* or, temacs gets errors dumping emacs - -This can be because the .elc files have been garbled. Do not be -fooled by the fact that most of a .elc file is text: these are -binary files and can contain all 256 byte values. - -In particular `shar' cannot be used for transmitting GNU Emacs. -It typically truncates "lines". What appear to be "lines" in -a binary file can of course be of any length. Even once `shar' -itself is made to work correctly, `sh' discards null characters -when unpacking the shell archive. - -I have also seen character \177 changed into \377. I do not know -what transfer means caused this problem. Various network -file transfer programs are suspected of clobbering the high bit. - -If you have a copy of Emacs that has been damaged in its -nonprinting characters, you can fix them: - - 1) Record the names of all the .elc files. - 2) Delete all the .elc files. - 3) Recompile alloc.c with a value of PURESIZE twice as large. - (See puresize.h.) You might as well save the old alloc.o. - 4) Remake emacs. It should work now. - 5) Running emacs, do Meta-x byte-compile-file repeatedly - to recreate all the .elc files that used to exist. - You may need to increase the value of the variable - max-lisp-eval-depth to succeed in running the compiler interpreted - on certain .el files. 400 was sufficient as of last report. - 6) Reinstall the old alloc.o (undoing changes to alloc.c if any) - and remake temacs. - 7) Remake emacs. It should work now, with valid .elc files. - -* temacs prints "Pure Lisp storage exhausted" - -This means that the Lisp code loaded from the .elc and .el -files during temacs -l loadup inc dump took up more -space than was allocated. - -This could be caused by - 1) adding code to the preloaded Lisp files - 2) adding more preloaded files in loadup.el - 3) having a site-init.el or site-load.el which loads files. - Note that ANY site-init.el or site-load.el is nonstandard; - if you have received Emacs from some other site - and it contains a site-init.el or site-load.el file, consider - deleting that file. - 4) getting the wrong .el or .elc files - (not from the directory you expected). - 5) deleting some .elc files that are supposed to exist. - This would cause the source files (.el files) to be - loaded instead. They take up more room, so you lose. - 6) a bug in the Emacs distribution which underestimates - the space required. - -If the need for more space is legitimate, change the definition -of PURESIZE in puresize.h. - -But in some of the cases listed above, this problem is a consequence -of something else that is wrong. Be sure to check and fix the real -problem. - -* Changes made to .el files do not take effect. - -You may have forgotten to recompile them into .elc files. -Then the old .elc files will be loaded, and your changes -will not be seen. To fix this, do M-x byte-recompile-directory -and specify the directory that contains the Lisp files. - -Emacs should print a warning when loading a .elc file which is older -than the corresponding .el file. - -* The dumped Emacs crashes when run, trying to write pure data. - -Two causes have been seen for such problems. - -1) On a system where getpagesize is not a system call, it is defined -as a macro. If the definition (in both unexec.c and malloc.c) is wrong, -it can cause problems like this. You might be able to find the correct -value in the man page for a.out (5). - -2) Some systems allocate variables declared static among the -initialized variables. Emacs makes all initialized variables in most -of its files pure after dumping, but the variables declared static and -not initialized are not supposed to be pure. On these systems you -may need to add "#define static" to the m- or the s- file. - -* Compilation errors on VMS. - -You will get warnings when compiling on VMS because there are -variable names longer than 32 (or whatever it is) characters. -This is not an error. Ignore it. - -VAX C does not support #if defined(foo). Uses of this construct -were removed, but some may have crept back in. They must be rewritten. - -There is a bug in the C compiler which fails to sign extend characters -in conditional expressions. The bug is: - char c = -1, d = 1; - int i; - - i = d ? c : d; -The result is i == 255; the fix is to typecast the char in the -conditional expression as an (int). Known occurrences of such -constructs in Emacs have been fixed. - -* rmail gets error getting new mail - -rmail gets new mail from /usr/spool/mail/$USER using a program -called `movemail'. This program interlocks with /bin/mail using -the protocol defined by /bin/mail. - -There are two different protocols in general use. One of them uses -the `flock' system call. The other involves creating a lock file; -`movemail' must be able to write in /usr/spool/mail in order to do -this. You control which one is used by defining, or not defining, -the macro MAIL_USE_FLOCK in config.h or the m- or s- file it includes. -IF YOU DON'T USE THE FORM OF INTERLOCKING THAT IS NORMAL ON YOUR -SYSTEM, YOU CAN LOSE MAIL! - -If your system uses the lock file protocol, and fascist restrictions -prevent ordinary users from writing the lock files in /usr/spool/mail, -you may need to make `movemail' setgid to a suitable group such as -`mail'. You can use these commands (as root): - - chgrp mail movemail - chmod 2755 movemail - -If your system uses the lock file protocol, and fascist restrictions -prevent ordinary users from writing the lock files in /usr/spool/mail, -you may need to make `movemail' setgid to a suitable group such as -`mail'. To do this, use the following commands (as root) after doing the -make install. - - chgrp mail movemail - chmod 2755 movemail - -Installation normally copies movemail from the build directory to an -installation directory which is usually under /usr/local/lib. The -installed copy of movemail is usually in the directory -/usr/local/lib/emacs/VERSION/TARGET. You must change the group and -mode of the installed copy; changing the group and mode of the build -directory copy is ineffective. - -* Emacs spontaneously displays "I-search: " at the bottom of the screen. +** Emacs spontaneously displays "I-search: " at the bottom of the screen. This means that Control-S/Control-Q (XON/XOFF) "flow control" is being used. C-s/C-q flow control is bad for Emacs editors because it takes @@ -3151,7 +1426,7 @@ use out of GNU Emacs on inferior terminals, more power to you, but I will not make Emacs worse for properly designed systems for the sake of inferior systems. -* Control-S and Control-Q commands are ignored completely. +** Control-S and Control-Q commands are ignored completely. For some reason, your system is using brain-damaged C-s/C-q flow control despite Emacs's attempts to turn it off. Perhaps your @@ -3166,33 +1441,7 @@ If that line of approach is not successful, map some other characters into C-s and C-q using keyboard-translate-table. The example above shows how to do this with C-^ and C-\. -* Control-S and Control-Q commands are ignored completely on a net connection. - -Some versions of rlogin (and possibly telnet) do not pass flow -control characters to the remote system to which they connect. -On such systems, emacs on the remote system cannot disable flow -control on the local system. - -One way to cure this is to disable flow control on the local host -(the one running rlogin, not the one running rlogind) using the -stty command, before starting the rlogin process. On many systems, -"stty start u stop u" will do this. - -Some versions of tcsh will prevent even this from working. One way -around this is to start another shell before starting rlogin, and -issue the stty command to disable flow control from that shell. - -If none of these methods work, the best solution is to type -M-x enable-flow-control at the beginning of your emacs session, or -if you expect the problem to continue, add a line such as the -following to your .emacs (on the host running rlogind): - -(enable-flow-control-on "vt200" "vt300" "vt101" "vt131") - -See the entry about spontaneous display of I-search (above) for more -info. - -* Screen is updated wrong, but only on one kind of terminal. +** Screen is updated wrong, but only on one kind of terminal. This could mean that the termcap entry you are using for that terminal is wrong, or it could mean that Emacs has a bug handing @@ -3234,7 +1483,33 @@ for certain terminals. This is unambiguously an Emacs bug, and can probably be fixed in termcap.c, tparam.c, term.c, scroll.c, cm.c or dispnew.c. -* Output from Control-V is slow. +** Control-S and Control-Q commands are ignored completely on a net connection. + +Some versions of rlogin (and possibly telnet) do not pass flow +control characters to the remote system to which they connect. +On such systems, emacs on the remote system cannot disable flow +control on the local system. + +One way to cure this is to disable flow control on the local host +(the one running rlogin, not the one running rlogind) using the +stty command, before starting the rlogin process. On many systems, +"stty start u stop u" will do this. + +Some versions of tcsh will prevent even this from working. One way +around this is to start another shell before starting rlogin, and +issue the stty command to disable flow control from that shell. + +If none of these methods work, the best solution is to type +M-x enable-flow-control at the beginning of your emacs session, or +if you expect the problem to continue, add a line such as the +following to your .emacs (on the host running rlogind): + +(enable-flow-control-on "vt200" "vt300" "vt101" "vt131") + +See the entry about spontaneous display of I-search (above) for more +info. + +** Output from Control-V is slow. On many bit-map terminals, scrolling operations are fairly slow. Often the termcap entry for the type of terminal in use fails @@ -3277,16 +1552,7 @@ take the number of positions to insert or delete as an argument. A `cs' string to set the scrolling region will reduce the amount of motion you see on the screen when part of the screen is scrolled. -* Your Delete key sends a Backspace to the terminal, using an AIXterm. - -The solution is to include in your .Xdefaults the lines: - - *aixterm.Translations: #override BackSpace: string(0x7f) - aixterm*ttyModes: erase ^? - -This makes your Backspace key send DEL (ASCII 127). - -* You type Control-H (Backspace) expecting to delete characters. +** You type Control-H (Backspace) expecting to delete characters. Put `stty dec' in your .login file and your problems will disappear after a day or two. @@ -3310,56 +1576,1850 @@ you can redefine Backspace in your .emacs file: (global-set-key "\b" 'delete-backward-char) You can probably access help-command via f1. -* Editing files through RFS gives spurious "file has changed" warnings. -It is possible that a change in Emacs 18.37 gets around this problem, -but in case not, here is a description of how to fix the RFS bug that -causes it. +** Colors are not available on a tty or in xterm. - There was a serious pair of bugs in the handling of the fsync() system - call in the RFS server. +Emacs 21 supports colors on character terminals and terminal +emulators, but this support relies on the terminfo or termcap database +entry to specify that the display supports color. Emacs looks at the +"Co" capability for the terminal to find out how many colors are +supported; it should be non-zero to activate the color support within +Emacs. (Most color terminals support 8 or 16 colors.) If your system +uses terminfo, the name of the capability equivalent to "Co" is +"colors". - The first is that the fsync() call is handled as another name for the - close() system call (!!). It appears that fsync() is not used by very - many programs; Emacs version 18 does an fsync() before closing files - to make sure that the bits are on the disk. +In addition to the "Co" capability, Emacs needs the "op" (for +``original pair'') capability, which tells how to switch the terminal +back to the default foreground and background colors. Emacs will not +use colors if this capability is not defined. If your terminal entry +doesn't provide such a capability, try using the ANSI standard escape +sequence \E[00m (that is, define a new termcap/terminfo entry and make +it use your current terminal's entry plus \E[00m for the "op" +capability). - This is fixed by the enclosed patch to the RFS server. +Finally, the "NC" capability (terminfo name: "ncv") tells Emacs which +attributes cannot be used with colors. Setting this capability +incorrectly might have the effect of disabling colors; try setting +this capability to `0' (zero) and see if that helps. - The second, more serious problem, is that fsync() is treated as a - non-blocking system call (i.e., it's implemented as a message that - gets sent to the remote system without waiting for a reply). Fsync is - a useful tool for building atomic file transactions. Implementing it - as a non-blocking RPC call (when the local call blocks until the sync - is done) is a bad idea; unfortunately, changing it will break the RFS - protocol. No fix was supplied for this problem. +Emacs uses the database entry for the terminal whose name is the value +of the environment variable TERM. With `xterm', a common terminal +entry that supports color is `xterm-color', so setting TERM's value to +`xterm-color' might activate the color support on an xterm-compatible +emulator. - (as always, your line numbers may vary) +Beginning with version 21.4, Emacs supports the --color command-line +option which may be used to force Emacs to use one of a few popular +modes for getting colors on a tty. For example, --color=ansi8 sets up +for using the ANSI-standard escape sequences that support 8 colors. - % rcsdiff -c -r1.2 serversyscall.c - RCS file: RCS/serversyscall.c,v - retrieving revision 1.2 - diff -c -r1.2 serversyscall.c - *** /tmp/,RCSt1003677 Wed Jan 28 15:15:02 1987 - --- serversyscall.c Wed Jan 28 15:14:48 1987 +Some modes do not use colors unless you turn on the Font-lock mode. +Some people have long ago set their `~/.emacs' files to turn on +Font-lock on X only, so they won't see colors on a tty. The +recommended way of turning on Font-lock is by typing "M-x +global-font-lock-mode RET" or by customizing the variable +`global-font-lock-mode'. + +* Runtime problems specific to individual Unix variants + +** GNU/Linux + +*** GNU/Linux: On Linux-based GNU systems using libc versions 5.4.19 through +5.4.22, Emacs crashes at startup with a segmentation fault. + +This problem happens if libc defines the symbol __malloc_initialized. +One known solution is to upgrade to a newer libc version. 5.4.33 is +known to work. + +*** GNU/Linux: After upgrading to a newer version of Emacs, +the Meta key stops working. + +This was reported to happen on a GNU/Linux system distributed by +Mandrake. The reason is that the previous version of Emacs was +modified by Mandrake to make the Alt key act as the Meta key, on a +keyboard where the Windows key is the one which produces the Meta +modifier. A user who started using a newer version of Emacs, which +was not hacked by Mandrake, expected the Alt key to continue to act as +Meta, and was astonished when that didn't happen. + +The solution is to find out what key on your keyboard produces the Meta +modifier, and use that key instead. Try all of the keys to the left +and to the right of the space bar, together with the `x' key, and see +which combination produces "M-x" in the echo area. You can also use +the `xmodmap' utility to show all the keys which produce a Meta +modifier: + + xmodmap -pk | egrep -i "meta|alt" + +A more convenient way of finding out which keys produce a Meta modifier +is to use the `xkbprint' utility, if it's available on your system: + + xkbprint 0:0 /tmp/k.ps + +This produces a PostScript file `/tmp/k.ps' with a picture of your +keyboard; printing that file on a PostScript printer will show what +keys can serve as Meta. + +The `xkeycaps' also shows a visual representation of the current +keyboard settings. It also allows to modify them. + +*** GNU/Linux: low startup on Linux-based GNU systems. + +People using systems based on the Linux kernel sometimes report that +startup takes 10 to 15 seconds longer than `usual'. + +This is because Emacs looks up the host name when it starts. +Normally, this takes negligible time; the extra delay is due to +improper system configuration. This problem can occur for both +networked and non-networked machines. + +Here is how to fix the configuration. It requires being root. + +**** Networked Case. + +First, make sure the files `/etc/hosts' and `/etc/host.conf' both +exist. The first line in the `/etc/hosts' file should look like this +(replace HOSTNAME with your host name): + + 127.0.0.1 HOSTNAME + +Also make sure that the `/etc/host.conf' files contains the following +lines: + + order hosts, bind + multi on + +Any changes, permanent and temporary, to the host name should be +indicated in the `/etc/hosts' file, since it acts a limited local +database of addresses and names (e.g., some SLIP connections +dynamically allocate ip addresses). + +**** Non-Networked Case. + +The solution described in the networked case applies here as well. +However, if you never intend to network your machine, you can use a +simpler solution: create an empty `/etc/host.conf' file. The command +`touch /etc/host.conf' suffices to create the file. The `/etc/hosts' +file is not necessary with this approach. + +*** GNU/Linux: Emacs on a tty switches the cursor to large blinking block. + +This was reported to happen on some GNU/Linux systems which use +ncurses version 5.0, but could be relevant for other versions as well. +These versions of ncurses come with a `linux' terminfo entry, where +the "cvvis" capability (termcap "vs") is defined as "\E[?25h\E[?8c" +(show cursor, change size). This escape sequence switches on a +blinking hardware text-mode cursor whose size is a full character +cell. This blinking cannot be stopped, since a hardware cursor +always blinks. + +A work-around is to redefine the "cvvis" capability so that it +enables a *software* cursor. The software cursor works by inverting +the colors of the character at point, so what you see is a block +cursor that doesn't blink. For this to work, you need to redefine +the "cnorm" capability as well, so that it operates on the software +cursor instead of the hardware cursor. + +To this end, run "infocmp linux > linux-term", edit the file +`linux-term' to make both the "cnorm" and "cvvis" capabilities send +the sequence "\E[?25h\E[?17;0;64c", and then run "tic linux-term" to +produce a modified terminfo entry. + +Alternatively, if you want a blinking underscore as your Emacs cursor, +change the "cvvis" capability to send the "\E[?25h\E[?0c" command. + +*** GNU/Linux: Error messages `internal facep []' happen on GNU/Linux systems. + +There is a report that replacing libc.so.5.0.9 with libc.so.5.2.16 +caused this to start happening. People are not sure why, but the +problem seems unlikely to be in Emacs itself. Some suspect that it +is actually Xlib which won't work with libc.so.5.2.16. + +Using the old library version is a workaround. + +** Mac OS X + +*** Mac OS X (Carbon): Environment Variables from dotfiles are ignored. + +When starting Emacs from the Dock or the Finder on Mac OS X, the +environment variables that are set up in dotfiles, such as .cshrc or +.profile, are ignored. This is because the Finder and Dock are not +started from a shell, but instead from the Window Manager itself. + +The workaround for this is to create a .MacOSX/environment.plist file to +setup these environment variables. These environment variables will +apply to all processes regardless of where they are started. +For me information, see http://developer.apple.com/qa/qa2001/qa1067.html. + +*** Mac OS X (Carbon): Process output truncated when using ptys. + +There appears to be a problem with the implementation of pty's on the +Mac OS X that causes process output to be truncated. To avoid this, +leave process-connection-type set to its default value of nil. + +** FreeBSD + +*** FreeBSD 2.1.5: useless symbolic links remain in /tmp or other +directories that have the +t bit. + +This is because of a kernel bug in FreeBSD 2.1.5 (fixed in 2.2). +Emacs uses symbolic links to implement file locks. In a directory +with +t bit, the directory owner becomes the owner of the symbolic +link, so that it cannot be removed by anyone else. + +If you don't like those useless links, you can let Emacs not to using +file lock by adding #undef CLASH_DETECTION to config.h. + +*** FreeBSD: Getting a Meta key on the console. + +By default, neither Alt nor any other key acts as a Meta key on +FreeBSD, but this can be changed using kbdcontrol(1). Dump the +current keymap to a file with the command + + $ kbdcontrol -d >emacs.kbd + +Edit emacs.kbd, and give the key you want to be the Meta key the +definition `meta'. For instance, if your keyboard has a ``Windows'' +key with scan code 105, change the line for scan code 105 in emacs.kbd +to look like this + + 105 meta meta meta meta meta meta meta meta O + +to make the Windows key the Meta key. Load the new keymap with + + $ kbdcontrol -l emacs.kbd + +** HP-UX + +*** HP/UX : Shell mode gives the message, "`tty`: Ambiguous". + +christos@theory.tn.cornell.edu says: + +The problem is that in your .cshrc you have something that tries to +execute `tty`. If you are not running the shell on a real tty then +tty will print "not a tty". Csh expects one word in some places, +but tty is giving it back 3. + +The solution is to add a pair of quotes around `tty` to make it a single +word: + +if (`tty` == "/dev/console") + +should be changed to: + +if ("`tty`" == "/dev/console") + +Even better, move things that set up terminal sections out of .cshrc +and into .login. + +*** HP/UX: `Pid xxx killed due to text modification or page I/O error'. + +On HP/UX, you can get that error when the Emacs executable is on an NFS +file system. HP/UX responds this way if it tries to swap in a page and +does not get a response from the server within a timeout whose default +value is just ten seconds. + +If this happens to you, extend the timeout period. + +*** HP/UX: Emacs is slow using X11R5. + +This happens if you use the MIT versions of the X libraries--it +doesn't run as fast as HP's version. People sometimes use the version +because they see the HP version doesn't have the libraries libXaw.a, +libXmu.a, libXext.a and others. HP/UX normally doesn't come with +those libraries installed. To get good performance, you need to +install them and rebuild Emacs. + +*** HP/UX: The right Alt key works wrong on German HP keyboards (and perhaps +other non-English HP keyboards too). + +This is because HP-UX defines the modifiers wrong in X. Here is a +shell script to fix the problem; be sure that it is run after VUE +configures the X server. + + xmodmap 2> /dev/null - << EOF + keysym Alt_L = Meta_L + keysym Alt_R = Meta_R + EOF + + xmodmap - << EOF + clear mod1 + keysym Mode_switch = NoSymbol + add mod1 = Meta_L + keysym Meta_R = Mode_switch + add mod2 = Mode_switch + EOF + +*** HP/UX: "Cannot find callback list" messages from dialog boxes in +Emacs built with Motif. + +This problem resulted from a bug in GCC 2.4.5. Newer GCC versions +such as 2.7.0 fix the problem. + +*** HP/UX: Emacs does not recognize the AltGr key. + +To fix this, set up a file ~/.dt/sessions/sessionetc with executable +rights, containing this text: + +-------------------------------- +xmodmap 2> /dev/null - << EOF +keysym Alt_L = Meta_L +keysym Alt_R = Meta_R +EOF + +xmodmap - << EOF +clear mod1 +keysym Mode_switch = NoSymbol +add mod1 = Meta_L +keysym Meta_R = Mode_switch +add mod2 = Mode_switch +EOF +-------------------------------- + +*** HP/UX: Large file support is disabled. + +See the comments in src/s/hpux10.h. + +*** HP/UX 11.0: Emacs makes HP/UX 11.0 crash. + +This is a bug in HPUX; HPUX patch PHKL_16260 is said to fix it. + +** AIX + +*** AIX: Trouble using ptys. + +People often install the pty devices on AIX incorrectly. +Use `smit pty' to reinstall them properly. + +*** AIXterm: Your Delete key sends a Backspace to the terminal. + +The solution is to include in your .Xdefaults the lines: + + *aixterm.Translations: #override BackSpace: string(0x7f) + aixterm*ttyModes: erase ^? + +This makes your Backspace key send DEL (ASCII 127). + +*** AIX: You get this message when running Emacs: + + Could not load program emacs + Symbol smtcheckinit in csh is undefined + Error was: Exec format error + +or this one: + + Could not load program .emacs + Symbol _system_con in csh is undefined + Symbol _fp_trapsta in csh is undefined + Error was: Exec format error + +These can happen when you try to run on AIX 3.2.5 a program that was +compiled with 3.2.4. The fix is to recompile. + +*** AIX 3.2.4: Releasing Ctrl/Act key has no effect, if Shift is down. + +Due to a feature of AIX, pressing or releasing the Ctrl/Act key is +ignored when the Shift, Alt or AltGr keys are held down. This can +lead to the keyboard being "control-locked"--ordinary letters are +treated as control characters. + +You can get out of this "control-locked" state by pressing and +releasing Ctrl/Act while not pressing or holding any other keys. + +*** AIX 4.2: Emacs gets a segmentation fault at startup. + +If you are using IBM's xlc compiler, compile emacs.c +without optimization; that should avoid the problem. + +*** AIX: If linking fails because libXbsd isn't found, check if you +are compiling with the system's `cc' and CFLAGS containing `-O5'. If +so, you have hit a compiler bug. Please make sure to re-configure +Emacs so that it isn't compiled with `-O5'. + +*** AIX 4.3.x or 4.4: Compiling fails. + +This could happen if you use /bin/c89 as your compiler, instead of +the default `cc'. /bin/c89 treats certain warnings, such as benign +redefinitions of macros, as errors, and fails the build. A solution +is to use the default compiler `cc'. + +*** AIX 4: Some programs fail when run in a Shell buffer +with an error message like No terminfo entry for "unknown". + +On AIX, many terminal type definitions are not installed by default. +`unknown' is one of them. Install the "Special Generic Terminal +Definitions" to make them defined. + +** Solaris + +We list bugs in current versions here. Solaris 2.x and 4.x are covered in the +section on legacy systems. + +*** On Solaris, C-x doesn't get through to Emacs when you use the console. + +This is a Solaris feature (at least on Intel x86 cpus). Type C-r +C-r C-t, to toggle whether C-x gets through to Emacs. + +*** Problem with remote X server on Suns. + +On a Sun, running Emacs on one machine with the X server on another +may not work if you have used the unshared system libraries. This +is because the unshared libraries fail to use YP for host name lookup. +As a result, the host name you specify may not be recognized. + +*** Emacs reports a BadAtom error (from X) running on Solaris 7 or 8. + +This happens when Emacs was built on some other version of Solaris. +Rebuild it on Solaris 8. + +*** On Solaris, CTRL-t is ignored by Emacs when you use +the fr.ISO-8859-15 locale (and maybe other related locales). + +You can fix this by editing the file: + + /usr/openwin/lib/locale/iso8859-15/Compose + +Near the bottom there is a line that reads: + + Ctrl : "\276" threequarters + +that should read: + + Ctrl : "\276" threequarters + +Note the lower case . Changing this line should make C-t work. + +*** When using M-x dbx with the SparcWorks debugger, the `up' and `down' +commands do not move the arrow in Emacs. + +You can fix this by adding the following line to `~/.dbxinit': + + dbxenv output_short_file_name off + +** Irix + +*** Irix 5.2: unexelfsgi.c can't find cmplrs/stsupport.h. + +The file cmplrs/stsupport.h was included in the wrong file set in the +Irix 5.2 distribution. You can find it in the optional fileset +compiler_dev, or copy it from some other Irix 5.2 system. A kludgy +workaround is to change unexelfsgi.c to include sym.h instead of +syms.h. + +*** Irix 5.3: "out of virtual swap space". + +This message occurs when the system runs out of swap space due to too +many large programs running. The solution is either to provide more +swap space or to reduce the number of large programs being run. You +can check the current status of the swap space by executing the +command `swap -l'. + +You can increase swap space by changing the file /etc/fstab. Adding a +line like this: + +/usr/swap/swap.more swap swap pri=3 0 0 + +where /usr/swap/swap.more is a file previously created (for instance +by using /etc/mkfile), will increase the swap space by the size of +that file. Execute `swap -m' or reboot the machine to activate the +new swap area. See the manpages for `swap' and `fstab' for further +information. + +The objectserver daemon can use up lots of memory because it can be +swamped with NIS information. It collects information about all users +on the network that can log on to the host. + +If you want to disable the objectserver completely, you can execute +the command `chkconfig objectserver off' and reboot. That may disable +some of the window system functionality, such as responding CDROM +icons. + +You can also remove NIS support from the objectserver. The SGI `admin' +FAQ has a detailed description on how to do that; see question 35 +("Why isn't the objectserver working?"). The admin FAQ can be found at +ftp://viz.tamu.edu/pub/sgi/faq/. + +*** Irix 5.3: Emacs crashes in utmpname. + +This problem is fixed in Patch 3175 for Irix 5.3. +It is also fixed in Irix versions 6.2 and up. + +*** Irix 6.0: Make tries (and fails) to build a program named unexelfsgi. + +A compiler bug inserts spaces into the string "unexelfsgi . o" +in src/Makefile. Edit src/Makefile, after configure is run, +find that string, and take out the spaces. + +Compiler fixes in Irix 6.0.1 should eliminate this problem. + +*** Irix 6.5: Emacs crashes on the SGI R10K, when compiled with GCC. + +This seems to be fixed in GCC 2.95. + +*** Trouble using ptys on IRIX, or running out of ptys. + +The program mkpts (which may be in `/usr/adm' or `/usr/sbin') needs to +be set-UID to root, or non-root programs like Emacs will not be able +to allocate ptys reliably. + +** SCO Unix and UnixWare + +*** SCO 3.2v4: Unusable default font. + +The Open Desktop environment comes with default X resource settings +that tell Emacs to use a variable-width font. Emacs cannot use such +fonts, so it does not work. + +This is caused by the file /usr/lib/X11/app-defaults/ScoTerm, which is +the application-specific resource file for the `scoterm' terminal +emulator program. It contains several extremely general X resources +that affect other programs besides `scoterm'. In particular, these +resources affect Emacs also: + + *Font: -*-helvetica-medium-r-*--12-*-p-* + *Background: scoBackground + *Foreground: scoForeground + +The best solution is to create an application-specific resource file for +Emacs, /usr/lib/X11/sco/startup/Emacs, with the following contents: + + Emacs*Font: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1 + Emacs*Background: white + Emacs*Foreground: black + +(These settings mimic the Emacs defaults, but you can change them to +suit your needs.) This resource file is only read when the X server +starts up, so you should restart it by logging out of the Open Desktop +environment or by running `scologin stop; scologin start` from the shell +as root. Alternatively, you can put these settings in the +/usr/lib/X11/app-defaults/Emacs resource file and simply restart Emacs, +but then they will not affect remote invocations of Emacs that use the +Open Desktop display. + +These resource files are not normally shared across a network of SCO +machines; you must create the file on each machine individually. + +*** Regular expressions matching bugs on SCO systems. + +On SCO, there are problems in regexp matching when Emacs is compiled +with the system compiler. The compiler version is "Microsoft C +version 6", SCO 4.2.0h Dev Sys Maintenance Supplement 01/06/93; Quick +C Compiler Version 1.00.46 (Beta). The solution is to compile with +GCC. + +*** UnixWare 2.1: Error 12 (virtual memory exceeded) when dumping Emacs. + +Paul Abrahams (abrahams@acm.org) reports that with the installed +virtual memory settings for UnixWare 2.1.2, an Error 12 occurs during +the "make" that builds Emacs, when running temacs to dump emacs. That +error indicates that the per-process virtual memory limit has been +exceeded. The default limit is probably 32MB. Raising the virtual +memory limit to 40MB should make it possible to finish building Emacs. + +You can do this with the command `ulimit' (sh) or `limit' (csh). +But you have to be root to do it. + +According to Martin Sohnius, you can also retune this in the kernel: + + # /etc/conf/bin/idtune SDATLIM 33554432 ## soft data size limit + # /etc/conf/bin/idtune HDATLIM 33554432 ## hard " + # /etc/conf/bin/idtune SVMMSIZE unlimited ## soft process size limit + # /etc/conf/bin/idtune HVMMSIZE unlimited ## hard " + # /etc/conf/bin/idbuild -B + +(He recommends you not change the stack limit, though.) +These changes take effect when you reboot. + +* Runtime problems specific to MS-Windows + +** Emacs exits with "X protocol error" when run with an X server for MS-Windows. + +A certain X server for Windows had a bug which caused this. +Supposedly the newer 32-bit version of this server doesn't have the +problem. + +** Known problems with the MS-Windows port of Emacs 21.2. + +Frames are not refreshed while the File or Font dialog or a pop-up menu +is displayed. This also means help text for pop-up menus is not +displayed at all. This is because message handling under Windows is +synchronous, so we cannot handle repaint (or any other) messages while +waiting for a system function to return the result of the dialog or +pop-up menu interaction. + +Windows 95 and Windows NT up to version 4.0 do not support help text +for menus. Help text is only available in later versions of Windows. + +There are problems with display if mouse-tracking is enabled and the +mouse is moved off a frame, over another frame then back over the first +frame. A workaround is to click the left mouse button inside the frame +after moving back into it. + +Some minor flickering still persists during mouse-tracking, although +not as severely as in 21.1. + +Emacs can sometimes abort when non-ASCII text, possibly with null +characters, is copied and pasted into a buffer. + +An inactive cursor remains in an active window after the Windows +Manager driven switch of the focus, until a key is pressed. + +Windows input methods are not recognized by Emacs (as of v21.2). Some +of these input methods cause the keyboard to send characters encoded +in the appropriate coding system (e.g., ISO 8859-1 for Latin-1 +characters, ISO 8859-8 for Hebrew characters, etc.). To make this +work, set the keyboard coding system to the appropriate value after +you activate the Windows input method. For example, if you activate +the Hebrew input method, type "C-x RET k iso-8859-8 RET". (Emacs +ought to recognize the Windows language-change event and set up the +appropriate keyboard encoding automatically, but it doesn't do that +yet.) + +The %b specifier for format-time-string does not produce abbreviated +month names with consistent widths for some locales on some versions +of Windows. This is caused by a deficiency in the underlying system +library function. + +** Problems running Perl under Emacs on MS-Windows NT/95. + +`perl -de 0' just hangs when executed in an Emacs subshell. +The fault lies with Perl (indirectly with Windows NT/95). + +The problem is that the Perl debugger explicitly opens a connection to +"CON", which is the DOS/NT equivalent of "/dev/tty", for interacting +with the user. + +On Unix, this is okay, because Emacs (or the shell?) creates a +pseudo-tty so that /dev/tty is really the pipe Emacs is using to +communicate with the subprocess. + +On NT, this fails because CON always refers to the handle for the +relevant console (approximately equivalent to a tty), and cannot be +redirected to refer to the pipe Emacs assigned to the subprocess as +stdin. + +A workaround is to modify perldb.pl to use STDIN/STDOUT instead of CON. + +For Perl 4: + + *** PERL/LIB/PERLDB.PL.orig Wed May 26 08:24:18 1993 + --- PERL/LIB/PERLDB.PL Mon Jul 01 15:28:16 1996 *************** - *** 163,169 **** - /* - * No return sent for close or fsync! - */ - ! if (syscall == RSYS_close || syscall == RSYS_fsync) - proc->p_returnval = deallocate_fd(proc, msg->m_args[0]); - else - { - --- 166,172 ---- - /* - * No return sent for close or fsync! - */ - ! if (syscall == RSYS_close) - proc->p_returnval = deallocate_fd(proc, msg->m_args[0]); - else - { + *** 68,74 **** + $rcfile=".perldb"; + } + else { + ! $console = "con"; + $rcfile="perldb.ini"; + } -* Vax C compiler bugs affecting Emacs. + --- 68,74 ---- + $rcfile=".perldb"; + } + else { + ! $console = ""; + $rcfile="perldb.ini"; + } + + + For Perl 5: + *** perl/5.001/lib/perl5db.pl.orig Sun Jun 04 21:13:40 1995 + --- perl/5.001/lib/perl5db.pl Mon Jul 01 17:00:08 1996 + *************** + *** 22,28 **** + $rcfile=".perldb"; + } + elsif (-e "con") { + ! $console = "con"; + $rcfile="perldb.ini"; + } + else { + --- 22,28 ---- + $rcfile=".perldb"; + } + elsif (-e "con") { + ! $console = ""; + $rcfile="perldb.ini"; + } + else { + +** On MS-Windows 95, Alt-f6 does not get through to Emacs. + +This character seems to be trapped by the kernel in Windows 95. +You can enter M-f6 by typing ESC f6. + +** Typing Alt-Shift has strange effects on MS-Windows. + +This combination of keys is a command to change keyboard layout. If +you proceed to type another non-modifier key before you let go of Alt +and Shift, the Alt and Shift act as modifiers in the usual way. A +more permanent work around is to change it to another key combination, +or disable it in the keyboard control panel. + +** Interrupting Cygwin port of Bash from Emacs doesn't work. + +Cygwin 1.x builds of the ported Bash cannot be interrupted from the +MS-Windows version of Emacs. This is due to some change in the Bash +port or in the Cygwin library which apparently make Bash ignore the +keyboard interrupt event sent by Emacs to Bash. (Older Cygwin ports +of Bash, up to b20.1, did receive SIGINT from Emacs.) + +** Accessing remote files with ange-ftp hangs the MS-Windows version of Emacs. + +If the FTP client is the Cygwin port of GNU `ftp', this appears to be +due to some bug in the Cygwin DLL or some incompatibility between it +and the implementation of asynchronous subprocesses in the Windows +port of Emacs. Specifically, some parts of the FTP server responses +are not flushed out, apparently due to buffering issues, which +confuses ange-ftp. + +The solution is to downgrade to an older version of the Cygwin DLL +(version 1.3.2 was reported to solve the problem), or use the stock +Windows FTP client, usually found in the `C:\WINDOWS' or 'C:\WINNT' +directory. To force ange-ftp use the stock Windows client, set the +variable `ange-ftp-ftp-program-name' to the absolute file name of the +client's executable. For example: + + (setq ange-ftp-ftp-program-name "c:/windows/ftp.exe") + +If you want to stick with the Cygwin FTP client, you can work around +this problem by putting this in your `.emacs' file: + + (setq ange-ftp-ftp-program-args '("-i" "-n" "-g" "-v" "--prompt" "") + +** lpr commands don't work on MS-Windows with some cheap printers. + +This problem may also strike other platforms, but the solution is +likely to be a global one, and not Emacs specific. + +Many cheap inkjet, and even some cheap laser printers, do not +print plain text anymore, they will only print through graphical +printer drivers. A workaround on MS-Windows is to use Windows' basic +built in editor to print (this is possibly the only useful purpose it +has): + +(setq printer-name "") ;; notepad takes the default +(setq lpr-command "notepad") ;; notepad +(setq lpr-switches nil) ;; not needed +(setq lpr-printer-switch "/P") ;; run notepad as batch printer + +** Antivirus software interacts badly with the MS-Windows version of Emacs. + +The usual manifestation of these problems is that subprocesses don't +work or even wedge the entire system. In particular, "M-x shell RET" +was reported to fail to work. But other commands also sometimes don't +work when an antivirus package is installed. + +The solution is to switch the antivirus software to a less aggressive +mode (e.g., disable the ``auto-protect'' feature), or even uninstall +or disable it entirely. + +** On MS-Windows 95/98/ME, subprocesses do not terminate properly. + +This is a limitation of the Operating System, and can cause problems +when shutting down Windows. Ensure that all subprocesses are exited +cleanly before exiting Emacs. For more details, see the FAQ at +http://www.gnu.org/software/emacs/windows/. + +** MS-Windows 95/98/ME crashes when Emacs invokes non-existent programs. + +When a program you are trying to run is not found on the PATH, +Windows might respond by crashing or locking up your system. In +particular, this has been reported when trying to compile a Java +program in JDEE when javac.exe is installed, but not on the system +PATH. + +** Pressing the mouse button on MS-Windows does not give a mouse-2 event. + +This is usually a problem with the mouse driver. Because most Windows +programs do not do anything useful with the middle mouse button, many +mouse drivers allow you to define the wheel press to do something +different. Some drivers do not even have the option to generate a +middle button press. In such cases, setting the wheel press to +"scroll" sometimes works if you press the button twice. Trying a +generic mouse driver might help. + +** Scrolling the mouse wheel on MS-Windows always scrolls the top window. + +This is another common problem with mouse drivers. Instead of +generating scroll events, some mouse drivers try to fake scroll bar +movement. But they are not intelligent enough to handle multiple +scroll bars within a frame. Trying a generic mouse driver might help. + +** Mail sent through Microsoft Exchange in some encodings appears to be +mangled and is not seen correctly in Rmail or Gnus. We don't know +exactly what happens, but it isn't an Emacs problem in cases we've +seen. + +** On MS-Windows, you cannot use the right-hand ALT key and the left-hand +CTRL key together to type a Control-Meta character. + +This is a consequence of a misfeature beyond Emacs's control. + +Under Windows, the AltGr key on international keyboards generates key +events with the modifiers Right-Alt and Left-Ctrl. Since Emacs cannot +distinguish AltGr from an explicit Right-Alt and Left-Ctrl +combination, whenever it sees Right-Alt and Left-Ctrl it assumes that +AltGr has been pressed. The variable `w32-recognize-altgr' can be set +to nil to tell Emacs that AltGr is really Ctrl and Alt. + +** Under some X-servers running on MS-Windows, Emacs' display is incorrect. + +The symptoms are that Emacs does not completely erase blank areas of the +screen during scrolling or some other screen operations (e.g., selective +display or when killing a region). M-x recenter will cause the screen +to be completely redisplayed and the "extra" characters will disappear. + +This is known to occur under Exceed 6, and possibly earlier versions +as well; it is reportedly solved in version 6.2.0.16 and later. The +problem lies in the X-server settings. + +There are reports that you can solve the problem with Exceed by +running `Xconfig' from within NT, choosing "X selection", then +un-checking the boxes "auto-copy X selection" and "auto-paste to X +selection". + +Of this does not work, please inform bug-gnu-emacs@gnu.org. Then +please call support for your X-server and see if you can get a fix. +If you do, please send it to bug-gnu-emacs@gnu.org so we can list it +here. + +* Build-time problems + +** Configuration + +*** The `configure' script doesn't find the jpeg library. + +There are reports that this happens on some systems because the linker +by default only looks for shared libraries, but jpeg distribution by +default only installs a nonshared version of the library, `libjpeg.a'. + +If this is the problem, you can configure the jpeg library with the +`--enable-shared' option and then rebuild libjpeg. This produces a +shared version of libjpeg, which you need to install. Finally, rerun +the Emacs configure script, which should now find the jpeg library. +Alternatively, modify the generated src/Makefile to link the .a file +explicitly, and edit src/config.h to define HAVE_JPEG. + +*** AIX: You get this compiler error message: + + Processing include file ./XMenuInt.h + 1501-106: (S) Include file X11/Xlib.h not found. + +This means your system was installed with only the X11 runtime i.d +libraries. You have to find your sipo (bootable tape) and install +X11Dev... with smit. + +** Compilation + +*** Building Emacs over NFS fails with ``Text file busy''. + +This was reported to happen when building Emacs on a GNU/Linux system +(RedHat Linux 6.2) using a build directory automounted from Solaris +(SunOS 5.6) file server, but it might not be limited to that +configuration alone. Presumably, the NFS server doesn't commit the +files' data to disk quickly enough, and the Emacs executable file is +left ``busy'' for several seconds after Emacs has finished dumping +itself. This causes the subsequent commands which invoke the dumped +Emacs executable to fail with the above message. + +In some of these cases, a time skew between the NFS server and the +machine where Emacs is built is detected and reported by GNU Make +(it says that some of the files have modification time in the future). +This might be a symptom of NFS-related problems. + +If the NFS server runs on Solaris, apply the Solaris patch 105379-05 +(Sunos 5.6: /kernel/misc/nfssrv patch). If that doesn't work, or if +you have a different version of the OS or the NFS server, you can +force the NFS server to use 1KB blocks, which was reported to fix the +problem albeit at a price of slowing down file I/O. You can force 1KB +blocks by specifying the "-o rsize=1024,wsize=1024" options to the +`mount' command, or by adding ",rsize=1024,wsize=1024" to the mount +options in the appropriate system configuration file, such as +`/etc/auto.home'. + +Alternatively, when Make fails due to this problem, you could wait for +a few seconds and then invoke Make again. In one particular case, +waiting for 10 or more seconds between the two Make invocations seemed +to work around the problem. + +Similar problems can happen if your machine NFS-mounts a directory +onto itself. Suppose the Emacs sources live in `/usr/local/src' and +you are working on the host called `marvin'. Then an entry in the +`/etc/fstab' file like the following is asking for trouble: + + marvin:/usr/local/src /usr/local/src ...options.omitted... + +The solution is to remove this line from `etc/fstab'. + +*** Building Emacs with GCC 2.9x fails in the `src' directory. + +This may happen if you use a development version of GNU `cpp' from one +of the GCC snapshots between Oct 2000 and Feb 2001, or from a released +version of GCC newer than 2.95.2 which was prepared around those +dates; similar problems were reported with some snapshots of GCC 3.1 +around Sep 30 2001. The preprocessor in those versions is +incompatible with a traditional Unix cpp (e.g., it expands ".." into +". .", which breaks relative file names that reference the parent +directory; or inserts TAB characters before lines that set Make +variables). + +The solution is to make sure the preprocessor is run with the +`-traditional' option. The `configure' script does that automatically +when it detects the known problems in your cpp, but you might hit some +unknown ones. To force the `configure' script to use `-traditional', +run the script like this: + + CPP='gcc -E -traditional' ./configure ... + +(replace the ellipsis "..." with any additional arguments you pass to +the script). + +Note that this problem does not pertain to the MS-Windows port of +Emacs, since it doesn't use the preprocessor to generate Makefiles. + +*** src/Makefile and lib-src/Makefile are truncated--most of the file missing. +*** Compiling wakeup, in lib-src, says it can't make wakeup.c. + +This can happen if configure uses GNU sed version 2.03. That version +had a bug. GNU sed version 2.05 works properly.To solve the +problem, install the current version of GNU Sed, then rerun Emacs's +configure script. + +*** Compiling lib-src says there is no rule to make test-distrib.c. + +This results from a bug in a VERY old version of GNU Sed. To solve +the problem, install the current version of GNU Sed, then rerun +Emacs's configure script. + +*** Building the MS-Windows port with Cygwin GCC can fail. + +Emacs may not build using recent Cygwin builds of GCC, such as Cygwin +version 1.1.8, using the default configure settings. It appears to be +necessary to specify the -mwin32 flag when compiling, and define +__MSVCRT__, like so: + + configure --with-gcc --cflags -mwin32 --cflags -D__MSVCRT__ + +*** Building the MS-Windows port fails with a CreateProcess failure. + +Some versions of mingw32 make on some versions of Windows do not seem +to detect the shell correctly. Try "make SHELL=cmd.exe", or if that +fails, try running make from Cygwin bash instead. + +*** Building the MS-Windows port with Leim fails in the `leim' directory. + +The error message might be something like this: + + Converting d:/emacs-21.3/leim/CXTERM-DIC/4Corner.tit to quail-package... + Invalid ENCODE: value in TIT dictionary + NMAKE : fatal error U1077: '"../src/obj-spd/i386/emacs.exe"' : return code + '0xffffffff' + Stop. + +This can happen if the Leim distribution is unpacked with a program +which converts the `*.tit' files to DOS-style CR-LF text format. The +`*.tit' files in the leim/CXTERM-DIC directory require Unix-style line +endings to compile properly, because Emacs reads them without any code +or EOL conversions. + +The solution is to make sure the program used to unpack Leim does not +change the files' line endings behind your back. The GNU FTP site has +in the `/gnu/emacs/windows' directory a program called `djtarnt.exe' +which can be used to unpack `.tar.gz' and `.zip' archives without +mangling them. + +*** Building `ctags' for MS-Windows with the MinGW port of GCC fails. + +This might happen due to a bug in the MinGW header assert.h, which +defines the `assert' macro with a trailing semi-colon. The following +patch to assert.h should solve this: + +*** include/assert.h.orig Sun Nov 7 02:41:36 1999 +--- include/assert.h Mon Jan 29 11:49:10 2001 +*************** +*** 41,47 **** + /* + * If not debugging, assert does nothing. + */ +! #define assert(x) ((void)0); + + #else /* debugging enabled */ + +--- 41,47 ---- + /* + * If not debugging, assert does nothing. + */ +! #define assert(x) ((void)0) + + #else /* debugging enabled */ + + +** Linking + +*** Building Emacs with a system compiler fails to link because of an +undefined symbol such as __eprintf which does not appear in Emacs. + +This can happen if some of the libraries linked into Emacs were built +with GCC, but Emacs itself is being linked with a compiler other than +GCC. Object files compiled with GCC might need some helper functions +from libgcc.a, the library which comes with GCC, but the system +compiler does not instruct the linker to search libgcc.a during the +link stage. + +A solution is to link with GCC, like this: + + make CC=gcc + +Since the .o object files already exist, this will not recompile Emacs +with GCC, but just restart by trying again to link temacs. + +*** AIX 1.3 ptf 0013: Link failure. + +There is a real duplicate definition of the function `_slibc_free' in +the library /lib/libc_s.a (just do nm on it to verify). The +workaround/fix is: + + cd /lib + ar xv libc_s.a NLtmtime.o + ar dv libc_s.a NLtmtime.o + +*** AIX 4.1.2: Linker error messages such as + ld: 0711-212 SEVERE ERROR: Symbol .__quous, found in the global symbol table + of archive /usr/lib/libIM.a, was not defined in archive member shr.o. + +This is a problem in libIM.a. You can work around it by executing +these shell commands in the src subdirectory of the directory where +you build Emacs: + + cp /usr/lib/libIM.a . + chmod 664 libIM.a + ranlib libIM.a + +Then change -lIM to ./libIM.a in the command to link temacs (in +Makefile). + +*** Sun with acc: Link failure when using acc on a Sun. + +To use acc, you need additional options just before the libraries, such as + + /usr/lang/SC2.0.1/values-Xt.o -L/usr/lang/SC2.0.1/cg87 -L/usr/lang/SC2.0.1 + +and you need to add -lansi just before -lc. + +The precise file names depend on the compiler version, so we +cannot easily arrange to supply them. + +*** Linking says that the functions insque and remque are undefined. + +Change oldXMenu/Makefile by adding insque.o to the variable OBJS. + +*** `tparam' reported as a multiply-defined symbol when linking with ncurses. + +This problem results from an incompatible change in ncurses, in +version 1.9.9e approximately. This version is unable to provide a +definition of tparm without also defining tparam. This is also +incompatible with Terminfo; as a result, the Emacs Terminfo support +does not work with this version of ncurses. + +The fix is to install a newer version of ncurses, such as version 4.2. + +** Dumping + +*** Linux: Segfault during `make bootstrap' under certain recent versions of the Linux kernel. + +With certain recent Linux kernels (like the one of Redhat Fedora Core +1), the new "Exec-shield" functionality is enabled by default, which +creates a different memory layout that breaks the emacs dumper. + +You can check the Exec-shield state like this: + + cat /proc/sys/kernel/exec-shield + +It returns 1 or 2 when Exec-shield is enabled, 0 otherwise. Please +read your system documentation for more details on Exec-shield and +associated commands. + +When Exec-shield is enabled, building Emacs will segfault during the +execution of this command: + +temacs --batch --load loadup [dump|bootstrap] + +To work around this problem, it is necessary to temporarily disable +Exec-shield while building Emacs, using the `setarch' command like +this: + + setarch i386 ./configure + setarch i386 make + +*** Fatal signal in the command temacs -l loadup inc dump. + +This command is the final stage of building Emacs. It is run by the +Makefile in the src subdirectory, or by build.com on VMS. + +It has been known to get fatal errors due to insufficient swapping +space available on the machine. + +On 68000s, it has also happened because of bugs in the +subroutine `alloca'. Verify that `alloca' works right, even +for large blocks (many pages). + +*** test-distrib says that the distribution has been clobbered. +*** or, temacs prints "Command key out of range 0-127". +*** or, temacs runs and dumps emacs, but emacs totally fails to work. +*** or, temacs gets errors dumping emacs. + +This can be because the .elc files have been garbled. Do not be +fooled by the fact that most of a .elc file is text: these are +binary files and can contain all 256 byte values. + +In particular `shar' cannot be used for transmitting GNU Emacs. +It typically truncates "lines". What appear to be "lines" in +a binary file can of course be of any length. Even once `shar' +itself is made to work correctly, `sh' discards null characters +when unpacking the shell archive. + +I have also seen character \177 changed into \377. I do not know +what transfer means caused this problem. Various network +file transfer programs are suspected of clobbering the high bit. + +If you have a copy of Emacs that has been damaged in its +nonprinting characters, you can fix them: + + 1) Record the names of all the .elc files. + 2) Delete all the .elc files. + 3) Recompile alloc.c with a value of PURESIZE twice as large. + (See puresize.h.) You might as well save the old alloc.o. + 4) Remake emacs. It should work now. + 5) Running emacs, do Meta-x byte-compile-file repeatedly + to recreate all the .elc files that used to exist. + You may need to increase the value of the variable + max-lisp-eval-depth to succeed in running the compiler interpreted + on certain .el files. 400 was sufficient as of last report. + 6) Reinstall the old alloc.o (undoing changes to alloc.c if any) + and remake temacs. + 7) Remake emacs. It should work now, with valid .elc files. + +*** temacs prints "Pure Lisp storage exhausted". + +This means that the Lisp code loaded from the .elc and .el +files during temacs -l loadup inc dump took up more +space than was allocated. + +This could be caused by + 1) adding code to the preloaded Lisp files + 2) adding more preloaded files in loadup.el + 3) having a site-init.el or site-load.el which loads files. + Note that ANY site-init.el or site-load.el is nonstandard; + if you have received Emacs from some other site + and it contains a site-init.el or site-load.el file, consider + deleting that file. + 4) getting the wrong .el or .elc files + (not from the directory you expected). + 5) deleting some .elc files that are supposed to exist. + This would cause the source files (.el files) to be + loaded instead. They take up more room, so you lose. + 6) a bug in the Emacs distribution which underestimates + the space required. + +If the need for more space is legitimate, change the definition +of PURESIZE in puresize.h. + +But in some of the cases listed above, this problem is a consequence +of something else that is wrong. Be sure to check and fix the real +problem. + +*** Linux: Emacs crashes when dumping itself on Mac PPC running Yellow Dog GNU/Linux. + +The crashes happen inside the function Fmake_symbol; here's a typical +C backtrace printed by GDB: + + 0x190c0c0 in Fmake_symbol () + (gdb) where + #0 0x190c0c0 in Fmake_symbol () + #1 0x1942ca4 in init_obarray () + #2 0x18b3500 in main () + #3 0x114371c in __libc_start_main (argc=5, argv=0x7ffff5b4, envp=0x7ffff5cc, + +This could happen because GCC version 2.95 and later changed the base +of the load address to 0x10000000. Emacs needs to be told about this, +but we currently cannot do that automatically, because that breaks +other versions of GNU/Linux on the MacPPC. Until we find a way to +distinguish between the Yellow Dog and the other varieties of +GNU/Linux systems on the PPC, you will have to manually uncomment the +following section near the end of the file src/m/macppc.h in the Emacs +distribution: + + #if 0 /* This breaks things on PPC GNU/Linux except for Yellowdog, + even with identical GCC, as, ld. Let's take it out until we + know what's really going on here. */ + /* GCC 2.95 and newer on GNU/Linux PPC changed the load address to + 0x10000000. */ + #if defined __linux__ + #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) + #define DATA_SEG_BITS 0x10000000 + #endif + #endif + #endif /* 0 */ + +Remove the "#if 0" and "#endif" directives which surround this, save +the file, and then reconfigure and rebuild Emacs. The dumping process +should now succeed. + +*** HPUX 10.20: Emacs crashes during dumping on the HPPA machine. + +This seems to be due to a GCC bug; it is fixed in GCC 2.8.1. + +** Installation + +*** Installing Emacs gets an error running `install-info'. + +You need to install a recent version of Texinfo; that package +supplies the `install-info' command. + +** First execution + +*** Emacs binary is not in executable format, and cannot be run. + +This was reported to happen when Emacs is built in a directory mounted +via NFS, for some combinations of NFS client and NFS server. +Usually, the file `emacs' produced in these cases is full of +binary null characters, and the `file' utility says: + + emacs: ASCII text, with no line terminators + +We don't know what exactly causes this failure. A work-around is to +build Emacs in a directory on a local disk. + +*** The dumped Emacs crashes when run, trying to write pure data. + +Two causes have been seen for such problems. + +1) On a system where getpagesize is not a system call, it is defined +as a macro. If the definition (in both unexec.c and malloc.c) is wrong, +it can cause problems like this. You might be able to find the correct +value in the man page for a.out (5). + +2) Some systems allocate variables declared static among the +initialized variables. Emacs makes all initialized variables in most +of its files pure after dumping, but the variables declared static and +not initialized are not supposed to be pure. On these systems you +may need to add "#define static" to the m- or the s- file. + +* Emacs 19 problems + +** Error messages `Wrong number of arguments: #, 5'. + +This typically results from having the powerkey library loaded. +Powerkey was designed for Emacs 19.22. It is obsolete now because +Emacs 19 now has this feature built in; and powerkey also calls +where-is-internal in an obsolete way. + +So the fix is to arrange not to load powerkey. + +* Runtime problems on legacy systems + +This section covers bugs reported on very old hardware or software. +If you are using hardware and an operating system shipped after 2000, +it is unlikely you will see any of these. + +** Ancient operating systems + +*** ISC Unix + +**** ISC: display-time causes kernel problems on ISC systems. + +Under Interactive Unix versions 3.0.1 and 4.0 (and probably other +versions), display-time causes the loss of large numbers of STREVENT +cells. Eventually the kernel's supply of these cells is exhausted. +This makes emacs and the whole system run slow, and can make other +processes die, in particular pcnfsd. + +Other emacs functions that communicate with remote processes may have +the same problem. Display-time seems to be far the worst. + +The only known fix: Don't run display-time. + +*** SunOS + +**** Sun 4.0.x: M-x shell persistently reports "Process shell exited abnormally with code 1". + +This happened on Suns as a result of what is said to be a bug in Sunos +version 4.0.x. The only fix was to reboot the machine. + +**** SunOS4.1.1 and SunOS4.1.3: Mail is lost when sent to local aliases. + +Many emacs mail user agents (VM and rmail, for instance) use the +sendmail.el library. This library can arrange for mail to be +delivered by passing messages to the /usr/lib/sendmail (usually) +program . In doing so, it passes the '-t' flag to sendmail, which +means that the name of the recipient of the message is not on the +command line and, therefore, that sendmail must parse the message to +obtain the destination address. + +There is a bug in the SunOS4.1.1 and SunOS4.1.3 versions of sendmail. +In short, when given the -t flag, the SunOS sendmail won't recognize +non-local (i.e. NIS) aliases. It has been reported that the Solaris +2.x versions of sendmail do not have this bug. For those using SunOS +4.1, the best fix is to install sendmail V8 or IDA sendmail (which +have other advantages over the regular sendmail as well). At the time +of this writing, these official versions are available: + + Sendmail V8 on ftp.cs.berkeley.edu in /ucb/sendmail: + sendmail.8.6.9.base.tar.Z (the base system source & documentation) + sendmail.8.6.9.cf.tar.Z (configuration files) + sendmail.8.6.9.misc.tar.Z (miscellaneous support programs) + sendmail.8.6.9.xdoc.tar.Z (extended documentation, with postscript) + + IDA sendmail on vixen.cso.uiuc.edu in /pub: + sendmail-5.67b+IDA-1.5.tar.gz + +**** Sunos 5.3: Subprocesses remain, hanging but not zombies. + +A bug in Sunos 5.3 causes Emacs subprocesses to remain after Emacs +exits. Sun patch # 101415-02 is part of the fix for this, but it only +applies to ptys, and doesn't fix the problem with subprocesses +communicating through pipes. + +**** Sunos 4: You get the error ld: Undefined symbol __lib_version. + +This is the result of using cc or gcc with the shared library meant +for acc (the Sunpro compiler). Check your LD_LIBRARY_PATH and delete +/usr/lang/SC2.0.1 or some similar directory. + +**** SunOS 4.1.3: Emacs unpredictably crashes in _yp_dobind_soft. + +This happens if you configure Emacs specifying just `sparc-sun-sunos4' +on a system that is version 4.1.3. You must specify the precise +version number (or let configure figure out the configuration, which +it can do perfectly well for SunOS). + +**** Sunos 4.1.3: Emacs gets hung shortly after startup. + +We think this is due to a bug in Sunos. The word is that +one of these Sunos patches fixes the bug: + +100075-11 100224-06 100347-03 100482-05 100557-02 100623-03 100804-03 101080-01 +100103-12 100249-09 100496-02 100564-07 100630-02 100891-10 101134-01 +100170-09 100296-04 100377-09 100507-04 100567-04 100650-02 101070-01 101145-01 +100173-10 100305-15 100383-06 100513-04 100570-05 100689-01 101071-03 101200-02 +100178-09 100338-05 100421-03 100536-02 100584-05 100784-01 101072-01 101207-01 + +We don't know which of these patches really matter. If you find out +which ones, please inform bug-gnu-emacs@gnu.org. + +**** SunOS 4: Emacs processes keep going after you kill the X server +(or log out, if you logged in using X). + +Someone reported that recompiling with GCC 2.7.0 fixed this problem. + +**** SunOS: You get linker errors + ld: Undefined symbol + _get_wmShellWidgetClass + _get_applicationShellWidgetClass + +The fix to this is to install patch 100573 for OpenWindows 3.0 +or link libXmu statically. + +*** Apollo Domain + +**** Shell mode ignores interrupts on Apollo Domain. + +You may find that M-x shell prints the following message: + + Warning: no access to tty; thus no job control in this shell... + +This can happen if there are not enough ptys on your system. +Here is how to make more of them. + + % cd /dev + % ls pty* + # shows how many pty's you have. I had 8, named pty0 to pty7) + % /etc/crpty 8 + # creates eight new pty's + +*** Irix + +*** Irix 6.2: No visible display on mips-sgi-irix6.2 when compiling with GCC 2.8.1. + +This problem went away after installing the latest IRIX patches +as of 8 Dec 1998. + +The same problem has been reported on Irix 6.3. + +*** Irix 6.3: substituting environment variables in file names +in the minibuffer gives peculiar error messages such as + + Substituting nonexistent environment variable "" + +This is not an Emacs bug; it is caused by something in SGI patch +003082 August 11, 1998. + +*** OPENSTEP + +**** OPENSTEP 4.2: Compiling syntax.c with gcc 2.7.2.1 fails. + +The compiler was reported to crash while compiling syntax.c with the +following message: + + cc: Internal compiler error: program cc1obj got fatal signal 11 + +To work around this, replace the macros UPDATE_SYNTAX_TABLE_FORWARD, +INC_BOTH, and INC_FROM with functions. To this end, first define 3 +functions, one each for every macro. Here's an example: + + static int update_syntax_table_forward(int from) + { + return(UPDATE_SYNTAX_TABLE_FORWARD(from)); + }/*update_syntax_table_forward*/ + +Then replace all references to UPDATE_SYNTAX_TABLE_FORWARD in syntax.c +with a call to the function update_syntax_table_forward. + +*** Solaris 2.x + +**** Strange results from format %d in a few cases, on a Sun. + +Sun compiler version SC3.0 has been found to miscompile part of +editfns.c. The workaround is to compile with some other compiler such +as GCC. + +**** On Solaris, Emacs dumps core if lisp-complete-symbol is called. + +If you compile Emacs with the -fast or -xO4 option with version 3.0.2 +of the Sun C compiler, Emacs dumps core when lisp-complete-symbol is +called. The problem does not happen if you compile with GCC. + +**** On Solaris, Emacs crashes if you use (display-time). + +This can happen if you configure Emacs without specifying the precise +version of Solaris that you are using. + +**** Solaris 2.3 and 2.4: Unpredictable segmentation faults. + +A user reported that this happened in 19.29 when it was compiled with +the Sun compiler, but not when he recompiled with GCC 2.7.0. + +We do not know whether something in Emacs is partly to blame for this. + +**** Solaris 2.4: Emacs dumps core on startup. + +Bill Sebok says that the cause of this is Solaris 2.4 vendor patch +102303-05, which extends the Solaris linker to deal with the Solaris +Common Desktop Environment's linking needs. You can fix the problem +by removing this patch and installing patch 102049-02 instead. +However, that linker version won't work with CDE. + +Solaris 2.5 comes with a linker that has this bug. It is reported that if +you install all the latest patches (as of June 1996), the bug is fixed. +We suspect the crucial patch is one of these, but we don't know +for certain. + + 103093-03: [README] SunOS 5.5: kernel patch (2140557 bytes) + 102832-01: [README] OpenWindows 3.5: Xview Jumbo Patch (4181613 bytes) + 103242-04: [README] SunOS 5.5: linker patch (595363 bytes) + +(One user reports that the bug was fixed by those patches together +with patches 102980-04, 103279-01, 103300-02, and 103468-01.) + +If you can determine which patch does fix the bug, please tell +bug-gnu-emacs@gnu.org. + +Meanwhile, the GNU linker links Emacs properly on both Solaris 2.4 and +Solaris 2.5. + +**** Solaris 2.4: Dired hangs and C-g does not work. Or Emacs hangs +forever waiting for termination of a subprocess that is a zombie. + +casper@fwi.uva.nl says the problem is in X11R6. Rebuild libX11.so +after changing the file xc/config/cf/sunLib.tmpl. Change the lines + + #if ThreadedX + #define SharedX11Reqs -lthread + #endif + +to: + + #if OSMinorVersion < 4 + #if ThreadedX + #define SharedX11Reqs -lthread + #endif + #endif + +Be sure also to edit x/config/cf/sun.cf so that OSMinorVersion is 4 +(as it should be for Solaris 2.4). The file has three definitions for +OSMinorVersion: the first is for x86, the second for SPARC under +Solaris, and the third for SunOS 4. Make sure to update the +definition for your type of machine and system. + +Then do `make Everything' in the top directory of X11R6, to rebuild +the makefiles and rebuild X. The X built this way work only on +Solaris 2.4, not on 2.3. + +For multithreaded X to work it is necessary to install patch +101925-02 to fix problems in header files [2.4]. You need +to reinstall gcc or re-run just-fixinc after installing that +patch. + +However, Frank Rust used a simpler solution: +he changed + #define ThreadedX YES +to + #define ThreadedX NO +in sun.cf and did `make World' to rebuild X11R6. Removing all +`-DXTHREAD*' flags and `-lthread' entries from lib/X11/Makefile and +typing 'make install' in that directory also seemed to work. + +**** Solaris 2.x: GCC complains "64 bit integer types not supported". + +This suggests that GCC is not installed correctly. Most likely you +are using GCC 2.7.2.3 (or earlier) on Solaris 2.6 (or later); this +does not work without patching. To run GCC 2.7.2.3 on Solaris 2.6 or +later, you must patch fixinc.svr4 and reinstall GCC from scratch as +described in the Solaris FAQ +. A better fix is +to upgrade to GCC 2.8.1 or later. + +**** Solaris 2.7: Building Emacs with WorkShop Compilers 5.0 98/12/15 +C 5.0 failed, apparently with non-default CFLAGS, most probably due to +compiler bugs. Using Sun Solaris 2.7 Sun WorkShop 6 update 1 C +release was reported to work without problems. It worked OK on +another system with Solaris 8 using apparently the same 5.0 compiler +and the default CFLAGS. + +**** Solaris 2.x: Emacs dumps core when built with Motif. + +The Solaris Motif libraries are buggy, at least up through Solaris 2.5.1. +Install the current Motif runtime library patch appropriate for your host. +(Make sure the patch is current; some older patch versions still have the bug.) +You should install the other patches recommended by Sun for your host, too. +You can obtain Sun patches from ftp://sunsolve.sun.com/pub/patches/; +look for files with names ending in `.PatchReport' to see which patches +are currently recommended for your host. + +On Solaris 2.6, Emacs is said to work with Motif when Solaris patch +105284-12 is installed, but fail when 105284-15 is installed. +105284-18 might fix it again. + +*** Solaris 2.6 and 7: the Compose key does not work. + +This is a bug in Motif in Solaris. Supposedly it has been fixed for +the next major release of Solaris. However, if someone with Sun +support complains to Sun about the bug, they may release a patch. +If you do this, mention Sun bug #4188711. + +One workaround is to use a locale that allows non-ASCII characters. +For example, before invoking emacs, set the LC_ALL environment +variable to "en_US" (American English). The directory /usr/lib/locale +lists the supported locales; any locale other than "C" or "POSIX" +should do. + +pen@lysator.liu.se says (Feb 1998) that the Compose key does work +if you link with the MIT X11 libraries instead of the Solaris X11 +libraries. + +*** Ultrix and Digital Unix + +**** Ultrix 4.2: `make install' fails on install-doc with `Error 141'. + +This happens on Ultrix 4.2 due to failure of a pipeline of tar +commands. We don't know why they fail, but the bug seems not to be in +Emacs. The workaround is to run the shell command in install-doc by +hand. + +**** Digital Unix 4.0: Garbled display on non-X terminals when Emacs runs. + +So far it appears that running `tset' triggers this problem (when TERM +is vt100, at least). If you do not run `tset', then Emacs displays +properly. If someone can tell us precisely which effect of running +`tset' actually causes the problem, we may be able to implement a fix +in Emacs. + +**** Ultrix: `expand-file-name' fails to work on any but the machine you dumped Emacs on. + +On Ultrix, if you use any of the functions which look up information +in the passwd database before dumping Emacs (say, by using +expand-file-name in site-init.el), then those functions will not work +in the dumped Emacs on any host but the one Emacs was dumped on. + +The solution? Don't use expand-file-name in site-init.el, or in +anything it loads. Yuck - some solution. + +I'm not sure why this happens; if you can find out exactly what is +going on, and perhaps find a fix or a workaround, please let us know. +Perhaps the YP functions cache some information, the cache is included +in the dumped Emacs, and is then inaccurate on any other host. + +*** SVr4 + +**** SVr4: On some variants of SVR4, Emacs does not work at all with X. + +Try defining BROKEN_FIONREAD in your config.h file. If this solves +the problem, please send a bug report to tell us this is needed; be +sure to say exactly what type of machine and system you are using. + +**** SVr4: After running emacs once, subsequent invocations crash. + +Some versions of SVR4 have a serious bug in the implementation of the +mmap () system call in the kernel; this causes emacs to run correctly +the first time, and then crash when run a second time. + +Contact your vendor and ask for the mmap bug fix; in the mean time, +you may be able to work around the problem by adding a line to your +operating system description file (whose name is reported by the +configure script) that reads: +#define SYSTEM_MALLOC +This makes Emacs use memory less efficiently, but seems to work around +the kernel bug. + +*** Linux 1.x + +**** Linux 1.0-1.04: Typing C-c C-c in Shell mode kills your X server. + +This happens with Linux kernel 1.0 thru 1.04, approximately. The workaround is +to define SIGNALS_VIA_CHARACTERS in config.h and recompile Emacs. +Newer Linux kernel versions don't have this problem. + +**** Linux 1.3: Output from subprocess (such as man or diff) is randomly +truncated on GNU/Linux systems. + +This is due to a kernel bug which seems to be fixed in Linux version +1.3.75. + +** MS-DOS + +*** When compiling with DJGPP on MS-Windows NT, "config msdos" fails. + +If the error message is "VDM has been already loaded", this is because +Windows has a program called `redir.exe' that is incompatible with a +program by the same name supplied with DJGPP, which is used by +config.bat. To resolve this, move the DJGPP's `bin' subdirectory to +the front of your PATH environment variable. + +*** When compiling with DJGPP on MS-Windows 95, Make fails for some targets +like make-docfile. + +This can happen if long file name support (the setting of environment +variable LFN) when Emacs distribution was unpacked and during +compilation are not the same. See the MSDOG section of INSTALL for +the explanation of how to avoid this problem. + +*** Emacs compiled with DJGPP complains at startup: + + "Wrong type of argument: internal-facep, msdos-menu-active-face" + +This can happen if you define an environment variable `TERM'. Emacs +on MSDOS uses an internal terminal emulator which is disabled if the +value of `TERM' is anything but the string "internal". Emacs then +works as if its terminal were a dumb glass teletype that doesn't +support faces. To work around this, arrange for `TERM' to be +undefined when Emacs runs. The best way to do that is to add an +[emacs] section to the DJGPP.ENV file which defines an empty value for +`TERM'; this way, only Emacs gets the empty value, while the rest of +your system works as before. + +*** MS-DOS: Emacs crashes at startup. + +Some users report that Emacs 19.29 requires dpmi memory management, +and crashes on startup if the system does not have it. We don't yet +know why this happens--perhaps these machines don't have enough real +memory, or perhaps something is wrong in Emacs or the compiler. +However, arranging to use dpmi support is a workaround. + +You can find out if you have a dpmi host by running go32 without +arguments; it will tell you if it uses dpmi memory. For more +information about dpmi memory, consult the djgpp FAQ. (djgpp +is the GNU C compiler as packaged for MSDOS.) + +Compiling Emacs under MSDOS is extremely sensitive for proper memory +configuration. If you experience problems during compilation, consider +removing some or all memory resident programs (notably disk caches) +and make sure that your memory managers are properly configured. See +the djgpp faq for configuration hints. + +*** Emacs compiled with DJGPP for MS-DOS/MS-Windows cannot access files +in the directory with the special name `dev' under the root of any +drive, e.g. `c:/dev'. + +This is an unfortunate side-effect of the support for Unix-style +device names such as /dev/null in the DJGPP runtime library. A +work-around is to rename the problem directory to another name. + +*** MS-DOS+DJGPP: Problems on MS-DOG if DJGPP v2.0 is used to compile Emacs. + +There are two DJGPP library bugs which cause problems: + + * Running `shell-command' (or `compile', or `grep') you get + `Searching for program: permission denied (EACCES), c:/command.com'; + * After you shell to DOS, Ctrl-Break kills Emacs. + +To work around these bugs, you can use two files in the msdos +subdirectory: `is_exec.c' and `sigaction.c'. Compile them and link +them into the Emacs executable `temacs'; then they will replace the +incorrect library functions. + +*** MS-DOS: Emacs compiled for MSDOS cannot find some Lisp files, or other +run-time support files, when long filename support is enabled. + +Usually, this problem will manifest itself when Emacs exits +immediately after flashing the startup screen, because it cannot find +the Lisp files it needs to load at startup. Redirect Emacs stdout +and stderr to a file to see the error message printed by Emacs. + +Another manifestation of this problem is that Emacs is unable to load +the support for editing program sources in languages such as C and +Lisp. + +This can happen if the Emacs distribution was unzipped without LFN +support, thus causing long filenames to be truncated to the first 6 +characters and a numeric tail that Windows 95 normally attaches to it. +You should unzip the files again with a utility that supports long +filenames (such as djtar from DJGPP or InfoZip's UnZip program +compiled with DJGPP v2). The MSDOG section of the file INSTALL +explains this issue in more detail. + +Another possible reason for such failures is that Emacs compiled for +MSDOS is used on Windows NT, where long file names are not supported +by this version of Emacs, but the distribution was unpacked by an +unzip program that preserved the long file names instead of truncating +them to DOS 8+3 limits. To be useful on NT, the MSDOS port of Emacs +must be unzipped by a DOS utility, so that long file names are +properly truncated. + +** Archaic window managers and toolkits + +*** OpenLook: Under OpenLook, the Emacs window disappears when you type M-q. + +Some versions of the Open Look window manager interpret M-q as a quit +command for whatever window you are typing at. If you want to use +Emacs with that window manager, you should try to configure the window +manager to use some other command. You can disable the +shortcut keys entirely by adding this line to ~/.OWdefaults: + + OpenWindows.WindowMenuAccelerators: False + +**** twm: A position you specified in .Xdefaults is ignored, using twm. + +twm normally ignores "program-specified" positions. +You can tell it to obey them with this command in your `.twmrc' file: + + UsePPosition "on" #allow clients to request a position + +** Bugs related to old DEC hardware + +*** The Compose key on a DEC keyboard does not work as Meta key. + +This shell command should fix it: + + xmodmap -e 'keycode 0xb1 = Meta_L' + +*** Keyboard input gets confused after a beep when using a DECserver +as a concentrator. + +This problem seems to be a matter of configuring the DECserver to use +7 bit characters rather than 8 bit characters. + +* Build problems on legacy systems + +** BSD/386 1.0: --with-x-toolkit option configures wrong. + +This problem is due to bugs in the shell in version 1.0 of BSD/386. +The workaround is to edit the configure file to use some other shell, +such as bash. + +** Digital Unix 4.0: Emacs fails to build, giving error message + Invalid dimension for the charset-ID 160 + +This is due to a bug or an installation problem in GCC 2.8.0. +Installing a more recent version of GCC fixes the problem. + +** Digital Unix 4.0: Failure in unexec while dumping emacs. + +This problem manifests itself as an error message + + unexec: Bad address, writing data section to ... + +The user suspects that this happened because his X libraries +were built for an older system version, + + ./configure --x-includes=/usr/include --x-libraries=/usr/shlib + +made the problem go away. + +** Sunos 4.1.1: there are errors compiling sysdep.c. + +If you get errors such as + + "sysdep.c", line 2017: undefined structure or union + "sysdep.c", line 2017: undefined structure or union + "sysdep.c", line 2019: nodename undefined + +This can result from defining LD_LIBRARY_PATH. It is very tricky +to use that environment variable with Emacs. The Emacs configure +script links many test programs with the system libraries; you must +make sure that the libraries available to configure are the same +ones available when you build Emacs. + +** SunOS 4.1.1: You get this error message from GNU ld: + + /lib/libc.a(_Q_sub.o): Undefined symbol __Q_get_rp_rd referenced from text segment + +The problem is in the Sun shared C library, not in GNU ld. + +The solution is to install Patch-ID# 100267-03 from Sun. + +** Sunos 4.1: Undefined symbols when linking using --with-x-toolkit. + +If you get the undefined symbols _atowc _wcslen, _iswprint, _iswspace, +_iswcntrl, _wcscpy, and _wcsncpy, then you need to add -lXwchar after +-lXaw in the command that links temacs. + +This problem seems to arise only when the international language +extensions to X11R5 are installed. + +** SunOS: Emacs gets error message from linker on Sun. + +If the error message says that a symbol such as `f68881_used' or +`ffpa_used' or `start_float' is undefined, this probably indicates +that you have compiled some libraries, such as the X libraries, +with a floating point option other than the default. + +It's not terribly hard to make this work with small changes in +crt0.c together with linking with Fcrt1.o, Wcrt1.o or Mcrt1.o. +However, the easiest approach is to build Xlib with the default +floating point option: -fsoft. + +** SunOS: Undefined symbols _dlopen, _dlsym and/or _dlclose. + +If you see undefined symbols _dlopen, _dlsym, or _dlclose when linking +with -lX11, compile and link against the file mit/util/misc/dlsym.c in +the MIT X11R5 distribution. Alternatively, link temacs using shared +libraries with s/sunos4shr.h. (This doesn't work if you use the X +toolkit.) + +If you get the additional error that the linker could not find +lib_version.o, try extracting it from X11/usr/lib/X11/libvim.a in +X11R4, then use it in the link. + +** VMS: Compilation errors on VMS. + +You will get warnings when compiling on VMS because there are +variable names longer than 32 (or whatever it is) characters. +This is not an error. Ignore it. + +VAX C does not support #if defined(foo). Uses of this construct +were removed, but some may have crept back in. They must be rewritten. + +There is a bug in the C compiler which fails to sign extend characters +in conditional expressions. The bug is: + char c = -1, d = 1; + int i; + + i = d ? c : d; +The result is i == 255; the fix is to typecast the char in the +conditional expression as an (int). Known occurrences of such +constructs in Emacs have been fixed. + +** Vax C compiler bugs affecting Emacs. You may get one of these problems compiling Emacs: @@ -3392,22 +3452,22 @@ causes the problem to go away. The `contents' field of a Lisp vector is an array of Lisp_Objects, so you may see the problem happening with indexed references to that. -* 68000 C compiler problems +** 68000 C compiler problems Various 68000 compilers have different problems. These are some that have been observed. -** Using value of assignment expression on union type loses. +*** Using value of assignment expression on union type loses. This means that x = y = z; or foo (x = z); does not work if x is of type Lisp_Object. -** "cannot reclaim" error. +*** "cannot reclaim" error. This means that an expression is too complicated. You get the correct line number in the error message. The code must be rewritten with simpler expressions. -** XCONS, XSTRING, etc macros produce incorrect code. +*** XCONS, XSTRING, etc macros produce incorrect code. If temacs fails to run at all, this may be the cause. Compile this test program and look at the assembler code: @@ -3427,7 +3487,7 @@ In the XCONS, etc., macros in lisp.h you must replace (a).u.val with This problem will not happen if the m-...h file for your type of machine defines NO_UNION_TYPE. That is the recommended setting now. -* C compilers lose on returning unions +*** C compilers lose on returning unions. I hear that some C compilers cannot handle returning a union type. Most of the functions in GNU Emacs return type Lisp_Object, which is @@ -3437,7 +3497,7 @@ This problem will not happen if the m-...h file for your type of machine defines NO_UNION_TYPE. -Copyright 1987,88,89,93,94,95,96,97,98,1999,2001,2002 +Copyright 1987,88,89,93,94,95,96,97,98,1999,2001,2002,2004 Free Software Foundation, Inc. Copying and redistribution of this file with or without modification From ba86d34d9036e2cee5278a1bbf9bb683109ace46 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 Aug 2004 11:58:30 +0000 Subject: [PATCH 193/341] (Misc Help): Add an index entry for finding an Info manual by its file name. --- man/help.texi | 1 + 1 file changed, 1 insertion(+) diff --git a/man/help.texi b/man/help.texi index 3f7419981d2..a3c307e5d3b 100644 --- a/man/help.texi +++ b/man/help.texi @@ -455,6 +455,7 @@ is available within Info. Eventually all the documentation of the GNU system will be available. Type @kbd{h} after entering Info to run a tutorial on using Info. +@cindex find Info manual by its file name If you specify a numeric argument, @kbd{C-h i} prompts for the name of a documentation file. This way, you can browse a file which doesn't have an entry in the top-level Info menu. It is also handy when you From 3166fce661d1e6881cb50c93549b97e579888aa4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 Aug 2004 12:24:13 +0000 Subject: [PATCH 194/341] (lisp-indent-defmethod): Correct indentation of DEFMETHODS with non-standard method combinations (e.g., PROGN, MIN, MAX). --- lisp/emacs-lisp/cl-indent.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index c5e13a4c00f..a203155673c 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -458,7 +458,7 @@ If nil, indent backquoted lists as data, i.e., like quoted lists." (forward-char 1) (forward-sexp 3) (backward-sexp) - (looking-at ":"))) + (looking-at ":\\|\\sw+"))) '(4 4 (&whole 4 &rest 4) &body) (get 'defun 'common-lisp-indent-function)) path state indent-point sexp-column normal-indent)) From 29bbca9e01c623b995acb0521c9b7e8b588a0f68 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 Aug 2004 12:25:07 +0000 Subject: [PATCH 195/341] *** empty log message *** --- etc/ChangeLog | 7 +++++++ lisp/ChangeLog | 6 ++++++ man/ChangeLog | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index 3c6ac1e165b..f764ae908d5 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,10 @@ +2004-08-21 Eric S. Raymond + + * PROBLEMS: Massively rearranged by category, to make environment + features and symptoms easier to find. Bugs relating to + 20th-century systems moved to the end. Most problem headers + changed to "object: variation" format. + 2004-08-15 Bill Wohler * NEWS, MH-E-NEWS: Upgraded to MH-E version 7.4.80. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 93fca8e4f71..e14623d9675 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-08-21 Peter Seibel (tiny patch) + + * emacs-lisp/cl-indent.el (lisp-indent-defmethod): Correct + indentation of DEFMETHODS with non-standard method + combinations (e.g., PROGN, MIN, MAX). + 2004-08-19 Stefan Monnier * pcvs-parse.el (cvs-parse-table, cvs-parse-commit): Try to adapt to diff --git a/man/ChangeLog b/man/ChangeLog index 85996a57030..03069fa86ac 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2004-08-21 Eli Zaretskii + + * help.texi (Misc Help): Add an index entry for finding an Info + manual by its file name. + 2004-08-20 Luc Teirlinck * files.texi (Backup Deletion): Correct description of From 845aa1ef9e764189ec130f4684cd16517a62e127 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 21 Aug 2004 14:53:22 +0000 Subject: [PATCH 196/341] (process-kill-without-query): Made obsolete in version 21.4, not 21.5. --- lisp/subr.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/subr.el b/lisp/subr.el index 53aef00f899..4eb1f691ff4 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1196,7 +1196,7 @@ Optional args SENTINEL and FILTER specify the sentinel and filter (make-obsolete 'process-kill-without-query "use `process-query-on-exit-flag' or `set-process-query-on-exit-flag'." - "21.5") + "21.4") (defun process-kill-without-query (process &optional flag) "Say no query needed if PROCESS is running when Emacs is exited. Optional second argument if non-nil says to require a query. From 285e8acc98f3e3c70416508386c20c9cad976c85 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 21 Aug 2004 14:55:18 +0000 Subject: [PATCH 197/341] (vc-comment-ring, vc-comment-ring-index) (vc-previous-comment, vc-next-comment) (vc-comment-search-reverse, vc-comment-search-forward) (vc-comment-to-change-log): Made obsolete in version 21.4, not 21.5. --- lisp/log-edit.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/log-edit.el b/lisp/log-edit.el index 9a4521bbde9..e2d3762ff77 100644 --- a/lisp/log-edit.el +++ b/lisp/log-edit.el @@ -281,19 +281,19 @@ automatically." ;; Compatibility with old names. (defvaralias 'vc-comment-ring 'log-edit-comment-ring) -(make-obsolete-variable 'vc-comment-ring 'log-edit-comment-ring "21.5") +(make-obsolete-variable 'vc-comment-ring 'log-edit-comment-ring "21.4") (defvaralias 'vc-comment-ring-index 'log-edit-comment-ring-index) -(make-obsolete-variable 'vc-comment-ring-index 'log-edit-comment-ring-index "21.5") +(make-obsolete-variable 'vc-comment-ring-index 'log-edit-comment-ring-index "21.4") (defalias 'vc-previous-comment 'log-edit-previous-comment) -(make-obsolete 'vc-previous-comment 'log-edit-previous-comment "21.5") +(make-obsolete 'vc-previous-comment 'log-edit-previous-comment "21.4") (defalias 'vc-next-comment 'log-edit-next-comment) -(make-obsolete 'vc-next-comment 'log-edit-next-comment "21.5") +(make-obsolete 'vc-next-comment 'log-edit-next-comment "21.4") (defalias 'vc-comment-search-reverse 'log-edit-comment-search-backward) -(make-obsolete 'vc-comment-search-reverse 'log-edit-comment-search-backward "21.5") +(make-obsolete 'vc-comment-search-reverse 'log-edit-comment-search-backward "21.4") (defalias 'vc-comment-search-forward 'log-edit-comment-search-forward) -(make-obsolete 'vc-comment-search-forward 'log-edit-comment-search-forward "21.5") +(make-obsolete 'vc-comment-search-forward 'log-edit-comment-search-forward "21.4") (defalias 'vc-comment-to-change-log 'log-edit-comment-to-change-log) -(make-obsolete 'vc-comment-to-change-log 'log-edit-comment-to-change-log "21.5") +(make-obsolete 'vc-comment-to-change-log 'log-edit-comment-to-change-log "21.4") ;;; ;;; Actual code From 3829aa6f66645cc3cc43658242f4a8c2427a3f07 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sat, 21 Aug 2004 15:00:26 +0000 Subject: [PATCH 198/341] (latin1-char-displayable-p): Made obsolete in version 21.4, not 21.5. --- lisp/ChangeLog | 12 ++++++++++++ lisp/international/latin1-disp.el | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e14623d9675..5928601f7a3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2004-08-21 John Paul Wallington + + * subr.el (process-kill-without-query): Made obsolete in + version 21.4, not 21.5. + + * log-edit.el (vc-comment-ring, vc-comment-ring-index) + (vc-previous-comment, vc-next-comment) + (vc-comment-search-reverse, vc-comment-search-forward) + (vc-comment-to-change-log): Likewise. + + * international/latin1-disp.el (latin1-char-displayable-p): Likewise. + 2004-08-21 Peter Seibel (tiny patch) * emacs-lisp/cl-indent.el (lisp-indent-defmethod): Correct diff --git a/lisp/international/latin1-disp.el b/lisp/international/latin1-disp.el index a0be6db3d2f..132f11d485b 100644 --- a/lisp/international/latin1-disp.el +++ b/lisp/international/latin1-disp.el @@ -225,7 +225,7 @@ character set: `latin-2', `hebrew' etc." ;; Backwards compatibility. (defalias 'latin1-char-displayable-p 'char-displayable-p) -(make-obsolete 'latin1-char-displayable-p 'char-displayable-p "21.5") +(make-obsolete 'latin1-char-displayable-p 'char-displayable-p "21.4") (defun latin1-display-setup (set &optional force) "Set up Latin-1 display for characters in the given SET. From 311f32fe0f3eed80d81cead7b935b8f32552df05 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sat, 21 Aug 2004 21:50:06 +0000 Subject: [PATCH 199/341] (ange-ftp-hash-entry-exists-p) (ange-ftp-file-entry-p, ange-ftp-file-symlink-p): Since the code has been converted to use hashtables, the relation `nil=none' is no longer valid, as `nil' is not a hashtable. This patch tries to reduce the number of resulting errors. --- lisp/ChangeLog | 8 ++++++++ lisp/net/ange-ftp.el | 19 ++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5928601f7a3..73a098dd197 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2004-08-21 David Kastrup + + * net/ange-ftp.el (ange-ftp-hash-entry-exists-p) + (ange-ftp-file-entry-p, ange-ftp-file-symlink-p): Since the code + has been converted to use hashtables, the relation `nil=none' is + no longer valid, as `nil' is not a hashtable. This patch tries to + reduce the number of resulting errors. + 2004-08-21 John Paul Wallington * subr.el (process-kill-without-query): Made obsolete in diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 8e9d0bda5af..b9a7fc46148 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1014,7 +1014,7 @@ or nil meaning don't change it." (defun ange-ftp-hash-entry-exists-p (key tbl) "Return whether there is an association for KEY in TABLE." - (not (eq (gethash key tbl 'unknown) 'unknown))) + (and tbl (not (eq (gethash key tbl 'unknown) 'unknown)))) (defun ange-ftp-hash-table-keys (tbl) "Return a sorted list of all the active keys in TABLE, as strings." @@ -2919,11 +2919,8 @@ NO-ERROR, if a listing for DIRECTORY cannot be obtained." ;; error message. (gethash "." ent)) ;; Child lookup failed, so try the parent. - (let ((table (ange-ftp-get-files dir 'no-error))) - ;; If the dir doesn't exist, don't use it as a hash table. - (and table - (ange-ftp-hash-entry-exists-p file - table))))))) + (ange-ftp-hash-entry-exists-p + file (ange-ftp-get-files dir 'no-error)))))) (defun ange-ftp-get-file-entry (name) "Given NAME, return the given file entry. @@ -3374,11 +3371,11 @@ system TYPE.") (setq file (ange-ftp-expand-file-name file)) (if (ange-ftp-ftp-name file) (condition-case nil - (let ((file-ent - (gethash - (ange-ftp-get-file-part file) - (ange-ftp-get-files (file-name-directory file))))) - (and (stringp file-ent) file-ent)) + (let ((ent (ange-ftp-get-files (file-name-directory file)))) + (and ent + (stringp (setq ent + (gethash (ange-ftp-get-file-part file) ent))) + ent)) ;; If we can't read the parent directory, just assume ;; this file is not a symlink. ;; This makes it possible to access a directory that From 15203bb79fc6f8de4ae25c220b9e28cf5093ccfb Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sat, 21 Aug 2004 21:55:00 +0000 Subject: [PATCH 200/341] ("greek-babel"): Add accent/breathing/uppercase combinations. --- leim/ChangeLog | 9 +++- leim/quail/greek.el | 104 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 2 deletions(-) diff --git a/leim/ChangeLog b/leim/ChangeLog index 3074b183f6b..19ffc23dc3a 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog @@ -1,3 +1,8 @@ +2004-08-21 David Kastrup + + * quail/greek.el ("greek-babel"): Add accent/breathing/uppercase + combinations. + 2004-08-16 Kenichi Handa * quail/georgian.el ("georgian"): Call quail-define-package with @@ -104,7 +109,7 @@ (clean, mostlyclean): Don't delete *.elc distributed with tarball. (maintainer-clean): Delete files that are not in CVS repository. -2004-02-16 J,bi(Br,bt(Bme Marant (tiny change) +2004-02-16 J,Ai(Br,At(Bme Marant (tiny change) * Makefile.in (distclean maintainer-clean): Depend on clean. @@ -242,7 +247,7 @@ ("cyrillic-ukrainian"): Fix `q', `Q', `W', `w' bindings. ("ukrainian-computer", "belarusian", "bulgarian-bds") ("russian-computer"): New. - ("bulgarian-phonetic"): Rename from bulgarian-pho. Add ,A'(B, $,1uV(B, ,LN(B. + ("bulgarian-phonetic"): Rename from bulgarian-pho. Add ,A'(B, $,1uV(B, $,1(N(B. ("russian-typewriter"): Rename from cyrillic-jcuken. 2002-06-20 Dave Love diff --git a/leim/quail/greek.el b/leim/quail/greek.el index 2055962c722..1b269307950 100644 --- a/leim/quail/greek.el +++ b/leim/quail/greek.el @@ -489,12 +489,14 @@ nil t t nil nil nil nil nil nil nil t) ("))" ?,A;(B) ; #x00bb ("A" ?$,1&q(B) + ("A|" ?$,1q|(B) ("B" ?$,1&r(B) ("D" ?$,1&t(B) ("E" ?$,1&u(B) ("F" ?$,1'&(B) ("G" ?$,1&s(B) ("H" ?$,1&w(B) + ("H|" ?$,1r,(B) ("I" ?$,1&y(B) ("J" ?$,1&x(B) ("K" ?$,1&z(B) @@ -509,6 +511,7 @@ nil t t nil nil nil nil nil nil nil t) ("T" ?$,1'$(B) ("U" ?$,1'%(B) ("W" ?$,1')(B) + ("W|" ?$,1r\(B) ("X" ?$,1&~(B) ("Y" ?$,1'((B) ("Z" ?$,1&v(B) @@ -560,6 +563,18 @@ nil t t nil nil nil nil nil nil nil t) ("\"'i" ?$,1r3(B) ("\"`i" ?$,1r2(B) + ("I" ?$,1pX(B) + ("'I" ?$,1r;(B) + ("<'I" ?$,1p](B) + (">'I" ?$,1p\(B) + ("`I" ?$,1r:(B) + ("<`I" ?$,1p[(B) + (">`I" ?$,1pZ(B) + ("<~I" ?$,1p_(B) + (">~I" ?$,1p^(B) + ("\"I" ?$,1'*(B) + ("<~" ?$,1r?(B) (">~" ?$,1r/(B) ("<'" ?$,1r>(B) @@ -578,6 +593,15 @@ nil t t nil nil nil nil nil nil nil t) ("<`e" ?$,1p3(B) (">`e" ?$,1p2(B) + ("E" ?$,1p8(B) + ("'E" ?$,1r)(B) + ("<'E" ?$,1p=(B) + (">'E" ?$,1p<(B) + ("`E" ?$,1r((B) + ("<`E" ?$,1p;(B) + (">`E" ?$,1p:(B) + ("a" ?$,1p (B) ("'a" ?$,1q1(B) @@ -590,6 +614,17 @@ nil t t nil nil nil nil nil nil nil t) ("<~a" ?$,1p'(B) (">~a" ?$,1p&(B) + ("A" ?$,1p((B) + ("'A" ?$,1q{(B) + ("<'A" ?$,1p-(B) + (">'A" ?$,1p,(B) + ("`A" ?$,1qz(B) + ("<`A" ?$,1p+(B) + (">`A" ?$,1p*(B) + ("<~A" ?$,1p/(B) + (">~A" ?$,1p.(B) + ("a|" ?$,1q@(B) ("'a|" ?$,1qt(B) @@ -602,9 +637,20 @@ nil t t nil nil nil nil nil nil nil t) ("<~a|" ?$,1qG(B) (">~a|" ?$,1qF(B) + ("A|" ?$,1qH(B) + ("<'A|" ?$,1qM(B) + (">'A|" ?$,1qL(B) + ("<`A|" ?$,1qK(B) + (">`A|" ?$,1qJ(B) + ("<~A|" ?$,1qO(B) + (">~A|" ?$,1qN(B) + ("r" ?$,1rD(B) + ("h" ?$,1p@(B) ("'h" ?$,1q5(B) @@ -617,6 +663,17 @@ nil t t nil nil nil nil nil nil nil t) ("<~h" ?$,1pG(B) (">~h" ?$,1pF(B) + ("H" ?$,1pH(B) + ("'H" ?$,1r+(B) + ("<'H" ?$,1pM(B) + (">'H" ?$,1pL(B) + ("`H" ?$,1r*(B) + ("<`H" ?$,1pK(B) + (">`H" ?$,1pJ(B) + ("<~H" ?$,1pO(B) + (">~H" ?$,1pN(B) + ("|" ?$,1&Z(B) ; ypogegrammeni ("~h|" ?$,1qV(B) + ("H|" ?$,1qX(B) + ("<'H|" ?$,1q](B) + (">'H|" ?$,1q\(B) + ("<`H|" ?$,1q[(B) + (">`H|" ?$,1qZ(B) + ("<~H|" ?$,1q_(B) + (">~H|" ?$,1q^(B) + ("o" ?$,1p`(B) ("'o" ?$,1q9(B) @@ -640,6 +706,15 @@ nil t t nil nil nil nil nil nil nil t) ("<`o" ?$,1pc(B) (">`o" ?$,1pb(B) + ("O" ?$,1ph(B) + ("'O" ?$,1rY(B) + ("<'O" ?$,1pm(B) + (">'O" ?$,1pl(B) + ("`O" ?$,1rX(B) + ("<`O" ?$,1pk(B) + (">`O" ?$,1pj(B) + ("u" ?$,1pp(B) ("'u" ?$,1q;(B) @@ -655,6 +730,14 @@ nil t t nil nil nil nil nil nil nil t) ("\"'u" ?$,1rC(B) ("`\"u" ?$,1rB(B) + ("w" ?$,1q (B) ("'w" ?$,1q=(B) @@ -667,6 +750,17 @@ nil t t nil nil nil nil nil nil nil t) ("<~w" ?$,1q'(B) (">~w" ?$,1q&(B) + ("W" ?$,1q((B) + ("'W" ?$,1r[(B) + ("<'W" ?$,1q-(B) + (">'W" ?$,1q,(B) + ("`W" ?$,1rZ(B) + ("<`W" ?$,1q+(B) + (">`W" ?$,1q*(B) + ("<~W" ?$,1q/(B) + (">~W" ?$,1q.(B) + ("w|" ?$,1q`(B) ("'w|" ?$,1rT(B) @@ -678,6 +772,16 @@ nil t t nil nil nil nil nil nil nil t) ("~w|" ?$,1rW(B) ("<~w|" ?$,1qg(B) (">~w|" ?$,1qf(B) + + ("W|" ?$,1qh(B) + ("'W|" ?$,1rT(B) + ("<'W|" ?$,1qm(B) + (">'W|" ?$,1ql(B) + ("<`W|" ?$,1qk(B) + (">`W|" ?$,1qj(B) + ("<~W|" ?$,1qo(B) + (">~W|" ?$,1qn(B) ) ;; From 041aabd8a55136bf308b93feb55319231fd58cd5 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 21 Aug 2004 23:39:38 +0000 Subject: [PATCH 201/341] (Buffers): Maximum buffer size is now 256M on 32-bit machines. (Several Buffers): Clarify which buffer is selected if `2' is pressed in the Buffer Menu. (Several Buffers): Auto Revert mode can be used to update the Buffer Menu automatically. --- man/ChangeLog | 9 +++++++++ man/buffers.texi | 19 +++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 03069fa86ac..eead2deac38 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,12 @@ +2004-08-21 Luc Teirlinck + + * buffers.texi (Buffers): Maximum buffer size is now 256M on + 32-bit machines. + (Several Buffers): Clarify which buffer is selected if `2' is + pressed in the Buffer Menu. + Auto Revert mode can be used to update the Buffer Menu + automatically. + 2004-08-21 Eli Zaretskii * help.texi (Misc Help): Add an index entry for finding an Info diff --git a/man/buffers.texi b/man/buffers.texi index c2d2a3f76e3..558b636de60 100644 --- a/man/buffers.texi +++ b/man/buffers.texi @@ -1,5 +1,5 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000, 2001 +@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000, 2001, 2004 @c Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @node Buffers, Windows, Files, Top @@ -44,7 +44,7 @@ the value in other buffers. @xref{Locals}. A buffer's size cannot be larger than some maximum, which is defined by the largest buffer position representable by the @dfn{Emacs integer} data type. This is because Emacs tracks buffer positions using that -data type. For 32-bit machines, the largest buffer size is 128 +data type. For 32-bit machines, the largest buffer size is 256 megabytes. @menu @@ -395,9 +395,9 @@ select the window. @item 1 Immediately select this line's buffer in a full-screen window. @item 2 -Immediately set up two windows, with this line's buffer in one, and the -previously current buffer (aside from the buffer @samp{*Buffer List*}) -in the other. +Immediately set up two windows, with this line's buffer selected in +one, and the previously current buffer (aside from the buffer +@samp{*Buffer List*}) displayed in the other. @item b Bury the buffer listed on this line. @item m @@ -427,12 +427,19 @@ window. If you run @code{list-buffers} (that is, type @kbd{C-x C-b}) and select the buffer list manually, you can use all of the commands described here. - The buffer @samp{*Buffer List*} is not updated automatically when + Normally, the buffer @samp{*Buffer List*} is not updated automatically when buffers are created and killed; its contents are just text. If you have created, deleted or renamed buffers, the way to update @samp{*Buffer List*} to show what you have done is to type @kbd{g} (@code{revert-buffer}) or repeat the @code{buffer-menu} command. + The @samp{*Buffer List*} buffer does automatically update every +@code{auto-revert-interval} seconds if you enable Auto Revert mode in +it. (As long as it is not marked modified.) Global Auto Revert mode +does not update the @samp{*Buffer List*} buffer by default, but it +does if @code{global-auto-revert-non-file-buffers} is non-@code{nil}. +@inforef{Autorevert,, emacs-xtra}, for details. + The command @code{buffer-menu-other-window} works the same as @code{buffer-menu}, except that it displays the buffers list in another window. From aca16f78753587b4dc2904ac2d319b7496fdc4b9 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 21 Aug 2004 23:51:42 +0000 Subject: [PATCH 202/341] *** empty log message *** --- lisp/ChangeLog | 76 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 73a098dd197..3f6a8ced5c4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -20,10 +20,27 @@ 2004-08-21 Peter Seibel (tiny patch) - * emacs-lisp/cl-indent.el (lisp-indent-defmethod): Correct - indentation of DEFMETHODS with non-standard method + * emacs-lisp/cl-indent.el (lisp-indent-defmethod): + Correct indentation of DEFMETHODS with non-standard method combinations (e.g., PROGN, MIN, MAX). +2004-08-20 Stefan Monnier + + * startup.el (normal-top-level-add-subdirs-to-load-path): + Avoid unnecessarily checking system-type. + (normal-top-level): Set TERM to "dumb". Simplify. + + * avoid.el (mouse-avoidance-ignore-p): New fun. + Also ignore switch-frame, select-window, double, and triple clicks. + (mouse-avoidance-banish-hook, mouse-avoidance-exile-hook) + (mouse-avoidance-fancy-hook): Use it. + +2004-08-20 Zoran Milojevic (tiny change) + + * avoid.el (mouse-avoidance-nudge-mouse) + (mouse-avoidance-banish-destination): Stay within the current window + to avoid problems with mouse-autoselect-window. + 2004-08-19 Stefan Monnier * pcvs-parse.el (cvs-parse-table, cvs-parse-commit): Try to adapt to @@ -33,7 +50,7 @@ * emacs-lisp/elp.el (elp-results-symname-map): New keymap. (elp-results-jump-to-definition-by-mouse) - (elp-results-jump-to-definition, elp-output-insert-symname): New Functions. + (elp-results-jump-to-definition, elp-output-insert-symname): New funs. (elp-output-result): Use elp-output-insert-symname. 2004-08-18 Kenichi Handa @@ -141,35 +158,35 @@ CC Mode update to 5.30.9: * progmodes/cc-defs.el, progmodes/cc-vars.el (c-emacs-features): - Moved from cc-vars to cc-defs for dependency reasons. Fixed the + Move from cc-vars to cc-defs for dependency reasons. Fix the POSIX char class test to check that it works in `skip-chars-(forward|backward)' too. - * progmodes/cc-align.el (c-lineup-arglist): Fixed bug when the + * progmodes/cc-align.el (c-lineup-arglist): Fix bug when the first argument starts with a special brace list. - * progmodes/cc-engine.el (c-forward-type): Fixed promotion bug + * progmodes/cc-engine.el (c-forward-type): Fix promotion bug when `c-opt-type-concat-key' is used (i.e. in Pike). - * progmodes/cc-engine.el (c-looking-at-special-brace-list): Fixed - bug when the inner char pair doesn't have paren syntax, i.e. "(< + * progmodes/cc-engine.el (c-looking-at-special-brace-list): + Fix bug when the inner char pair doesn't have paren syntax, i.e. "(< >)". * progmodes/cc-align.el (c-lineup-multi-inher): Made it syntactic whitespace safe. - * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed anchor + * progmodes/cc-engine.el (c-guess-basic-syntax): Fix anchor position for `arglist-intro', `arglist-cont-nonempty' and `arglist-close' when there are two arglist open parens on the same line and there's nothing in front of the first. - * progmodes/cc-fonts.el (c-basic-matchers-before): Fixed font + * progmodes/cc-fonts.el (c-basic-matchers-before): Fix font locking of qualified names in Java, which previously could fontify common indexing expressions in many cases. The standard Java naming conventions are used to tell them apart. - * progmodes/cc-align.el (c-lineup-whitesmith-in-block): Fixed - inconsistency wrt opening parens on the first line inside a paren + * progmodes/cc-align.el (c-lineup-whitesmith-in-block): + Fix inconsistency wrt opening parens on the first line inside a paren block. * progmodes/cc-defs.el (c-langs-are-parametric): Must be known at @@ -179,29 +196,29 @@ `c-major-mode-is' in the event that this is used inside a `c-lang-defconst'. - * progmodes/cc-defs.el (c-major-mode-is): Fixed expansion inside + * progmodes/cc-defs.el (c-major-mode-is): Fix expansion inside `c-lang-defconst' so that it works better with fallback languages. - * progmodes/cc-defs.el (c-add-language): Fixed a typo that caused + * progmodes/cc-defs.el (c-add-language): Fix a typo that caused it to fail to record the base mode. - * progmodes/cc-engine.el (c-syntactic-re-search-forward): Fixed - bug so that it doesn't go past the closing paren when PAREN-LEVEL + * progmodes/cc-engine.el (c-syntactic-re-search-forward): + Fix bug so that it doesn't go past the closing paren when PAREN-LEVEL is used. Reordered the syntax checks to get more efficient skipping in some situations. * progmodes/cc-cmds.el (c-electric-brace): Don't trip up on a line continuation which might precede the newly inserted '{'. - * progmodes/cc-engine.el (c-syntactic-re-search-forward): Fixed - cases where it could loop indefinitely. + * progmodes/cc-engine.el (c-syntactic-re-search-forward): + Fix cases where it could loop indefinitely. * progmodes/cc-fonts.el (c-font-lock-declarators): Handle array size specs correctly. Only fontify identifiers in front of '(' with as functions - don't accept any paren char. Tightened up initializer skipping to stop before function and class blocks. - * progmodes/cc-engine.el (c-beginning-of-decl-1): Fixed bug where + * progmodes/cc-engine.el (c-beginning-of-decl-1): Fix bug where the point could be left directly after an open paren when finding the beginning of the first decl in the block. @@ -210,13 +227,13 @@ This could cause cache inconsistencies when e.g. `c++-template-syntax-table' was temporarily in use. - * progmodes/cc-engine.el (c-on-identifier, - c-simple-skip-symbol-backward): Small fix for handling "-" + * progmodes/cc-engine.el (c-on-identifier) + (c-simple-skip-symbol-backward): Small fix for handling "-" correctly in `skip-chars-backward'. Affected the operator lfun syntax in Pike. - * progmodes/cc-engine.el (c-invalidate-sws-region-after): Fixed - bug that could cause an error from `after-change-functions' when + * progmodes/cc-engine.el (c-invalidate-sws-region-after): + Fix bug that could cause an error from `after-change-functions' when the changed region is at bob. 2004-08-11 Alan Mackenzie @@ -233,7 +250,7 @@ string. (2) Check that settings to `c-offsets-alist' are not spuriously quoted. - * progmodes/cc-cmds.el: (c-electric-brace): don't delete a comment + * progmodes/cc-cmds.el: (c-electric-brace): Don't delete a comment which precedes the newly inserted `{'. 2004-08-10 Michael Albinus @@ -277,8 +294,7 @@ 2004-08-08 Lars Hansen - * wid-edit.el (widget-sexp-validate): Allow whitespace after - expression. + * wid-edit.el (widget-sexp-validate): Allow whitespace after expression. 2004-08-08 Luc Teirlinck @@ -310,8 +326,8 @@ 2004-08-04 Kenichi Handa - * international/encoded-kb.el (encoded-kbd-setup-keymap): Fix - previous change. + * international/encoded-kb.el (encoded-kbd-setup-keymap): + Fix previous change. 2004-08-03 Kenichi Handa @@ -345,8 +361,8 @@ 2004-08-01 David Kastrup - * replace.el (query-replace-read-from): Use - `query-replace-compile-replacement'. + * replace.el (query-replace-read-from): + Use `query-replace-compile-replacement'. (query-replace-compile-replacement): New function. (query-replace-read-to): Use `query-replace-compile-replacement' for repeating the last command. From 2935e78878ef7868882c2dd3fe54fa61d4643122 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 22 Aug 2004 02:25:16 +0000 Subject: [PATCH 203/341] (Keyboard Macro Ring): Rename section. Emacs treats the head of the macro ring as the `last keyboard macro'. (Keyboard Macro Counter): Minor change. (Save Keyboard Macro): Some clarifications. (Edit Keyboard Macro): Rename section. --- man/ChangeLog | 6 ++++++ man/kmacro.texi | 38 ++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index eead2deac38..e40f2317d2a 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,5 +1,11 @@ 2004-08-21 Luc Teirlinck + * kmacro.texi (Keyboard Macro Ring): Rename section. + Emacs treats the head of the macro ring as the `last keyboard macro'. + (Keyboard Macro Counter): Minor change. + (Save Keyboard Macro): Some clarifications. + (Edit Keyboard Macro): Rename section. + * buffers.texi (Buffers): Maximum buffer size is now 256M on 32-bit machines. (Several Buffers): Clarify which buffer is selected if `2' is diff --git a/man/kmacro.texi b/man/kmacro.texi index 8965c4f2167..a0b3a249bbd 100644 --- a/man/kmacro.texi +++ b/man/kmacro.texi @@ -1,5 +1,5 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2002,2003 +@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2002,2003,2004 @c Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @node Keyboard Macros, Files, Fixit, Top @@ -179,7 +179,7 @@ the current region. It does this line by line, by moving point to the beginning of the line and then executing the macro. @node Keyboard Macro Ring -@section Where previous keyboard macros are saved +@section The Keyboard Macro Ring All defined keyboard macros are recorded in the ``keyboard macro ring'', a list of sequences of keys. There is only one keyboard macro ring, @@ -220,6 +220,10 @@ immediately by repeating just @kbd{C-n} and @kbd{C-p} until the desired macro is at the head of the ring. To execute the new macro ring head immediately, just type @kbd{C-k}. + Note that Emacs treats the head of the macro ring as the ``last +defined keyboard macro''. For instance, it is the keyboard macro that +@kbd{C-x e} will execute. + @findex kmacro-view-macro-repeat @kindex C-x C-k C-v @@ -264,8 +268,7 @@ incremented on every repetition of the keyboard macro. Normally, the macro counter is initialized to 0 when you start defining the macro, and incremented by 1 after each insertion of the counter value; that is, if you insert the macro counter twice while defining the -macro, it will be incremented by 2 time for each repetition of the -macro. +macro, the counter will increase by 2 on each repetition of the macro. @findex kmacro-insert-counter @kindex C-x C-k C-i @@ -362,18 +365,21 @@ register as a counter, incrementing it on each repetition of the macro. @kindex C-x C-k n If you wish to save a keyboard macro for later use, you can give it a name using @kbd{C-x C-k n} (@code{name-last-kbd-macro}). -This reads a name as an argument using the minibuffer and defines that name -to execute the macro. The macro name is a Lisp symbol, and defining it in -this way makes it a valid command name for calling with @kbd{M-x} or for -binding a key to with @code{global-set-key} (@pxref{Keymaps}). If you -specify a name that has a prior definition other than another keyboard -macro, an error message is shown and nothing is changed. +This reads a name as an argument using the minibuffer and defines that +name to execute the last keyboard macro, in its current form. (If you +later add to the definition of this macro, that does not alter the +name's definition as a macro.) The macro name is a Lisp symbol, and +defining it in this way makes it a valid command name for calling with +@kbd{M-x} or for binding a key to with @code{global-set-key} +(@pxref{Keymaps}). If you specify a name that has a prior definition +other than a keyboard macro, an error message is shown and nothing is +changed. @cindex binding keyboard macros @findex kmacro-bind-to-key @kindex C-x C-k b - Rather than giving a keyboard macro a name, you can bind it to a -key using @kbd{C-x C-k b} (@code{kmacro-bind-to-key}) followed by the + You can also bind the last keyboard macro to a key, using +@kbd{C-x C-k b} (@code{kmacro-bind-to-key}) followed by the key sequence you want the keyboard macro to be bound to. You can bind to any key sequence in the global keymap, but since most key sequences already have other bindings, you should select the key @@ -414,12 +420,12 @@ save in is your init file @file{~/.emacs} (@pxref{Init File}) then the macro will be defined each time you run Emacs. If you give @code{insert-kbd-macro} a numeric argument, it makes -additional Lisp code to record the keys (if any) that you have bound to the -keyboard macro, so that the macro will be reassigned the same keys when you -load the file. +additional Lisp code to record the keys (if any) that you have bound +to @var{macroname}, so that the macro will be reassigned the same keys +when you load the file. @node Edit Keyboard Macro -@section Interactively executing and editing a keyboard macro +@section Editing a Keyboard Macro @findex kmacro-edit-macro @kindex C-x C-k C-e From 44feddcfb1ce96226b9942dda5ff1bfcbbe8ec89 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Sun, 22 Aug 2004 04:37:44 +0000 Subject: [PATCH 204/341] (cvs-status-checkout): New function. (cvs-status-mode-map): Add a key definition for `cvs-status-checkout'. --- lisp/ChangeLog | 5 +++++ lisp/cvs-status.el | 22 +++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3f6a8ced5c4..b149e64c024 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-22 Masatake YAMATO + + * cvs-status.el (cvs-status-checkout): New function. + (cvs-status-mode-map): Add a key definition for `cvs-status-checkout'. + 2004-08-21 David Kastrup * net/ange-ftp.el (ange-ftp-hash-entry-exists-p) diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el index b03182d87e4..b00984b60f1 100644 --- a/lisp/cvs-status.el +++ b/lisp/cvs-status.el @@ -48,7 +48,8 @@ ("\M-n" . cvs-status-next) ("\M-p" . cvs-status-prev) ("t" . cvs-status-cvstrees) - ("T" . cvs-status-trees)) + ("T" . cvs-status-trees) + (">" . cvs-status-checkout)) "CVS-Status' keymap." :group 'cvs-status :inherit 'cvs-mode-map) @@ -464,6 +465,25 @@ Optional prefix ARG chooses between two representations." ;;(sit-for 0) )))))) +(defun-cvs-mode (cvs-status-checkout . NOARGS) (dir) + "Run cvs-checkout against the tag under the point. +The files are stored to DIR." + (interactive + (let* ((module (cvs-get-module)) + (branch (cvs-prefix-get 'cvs-branch-prefix)) + (prompt (format "CVS Checkout Directory for `%s%s': " + module + (if branch (format "(branch: %s)" branch) + "")))) + (list + (read-directory-name prompt + nil default-directory nil)))) + (let ((modules (cvs-string->strings (cvs-get-module))) + (flags (cvs-add-branch-prefix + (cvs-flags-query 'cvs-checkout-flags "cvs checkout flags"))) + (cvs-cvsroot (cvs-get-cvsroot))) + (cvs-checkout modules dir flags))) + (defun cvs-tree-tags-insert (tags prev) (when tags (let* ((tag (car tags)) From d103d8b3885c6f32aae4abc6604b5fa9b14e33b7 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Sun, 22 Aug 2004 05:11:27 +0000 Subject: [PATCH 205/341] Upgraded to MH-E version 7.81. See etc/MH-E-NEWS and lisp/mh-e/ChangeLog for details. --- etc/ChangeLog | 4 ++++ etc/MH-E-NEWS | 11 +++++++++++ etc/NEWS | 2 +- lisp/mh-e/ChangeLog | 37 +++++++++++++++++++++++++++++++++++++ lisp/mh-e/mh-acros.el | 6 +++--- lisp/mh-e/mh-customize.el | 7 +++---- lisp/mh-e/mh-e.el | 8 +++++--- lisp/mh-e/mh-identity.el | 2 +- lisp/mh-e/mh-loaddefs.el | 26 +++++++++++++++----------- lisp/mh-e/mh-mime.el | 8 ++++++++ 10 files changed, 88 insertions(+), 23 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index f764ae908d5..4f7395fba57 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2004-08-21 Bill Wohler + + * NEWS, MH-E-NEWS: Upgraded to MH-E version 7.81. + 2004-08-21 Eric S. Raymond * PROBLEMS: Massively rearranged by category, to make environment diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS index 264acf8ead1..32b71b1d98c 100644 --- a/etc/MH-E-NEWS +++ b/etc/MH-E-NEWS @@ -6,6 +6,17 @@ Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +* Changes in MH-E 7.81 + +Version 7.81 fixes a `wrong-type-argument' argument error that +sometimes occurred when processing the Message-ID, adds the "; +(mh-toggle-mh-decode-mime-flag)" command, and uses ":default" instead +of "default" in `mh-identity-handlers' to avoid problems with +"Default:" as a user defined field. If you have modified +`mh-identity-handlers' in your .emacs, you'll need to rename "default" +to ":default". This release also corrects the release numbering; the +previous version number was intended to be 7.80. + * Changes in MH-E 7.4.80 Version 7.4.80 now supports GNU mailutils, S/MIME, picons, diff --git a/etc/NEWS b/etc/NEWS index e966270f4bb..feccd6589a5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -658,7 +658,7 @@ You can now put the init files .emacs and .emacs_SHELL under ** MH-E changes. -Upgraded to MH-E version 7.4.80. There have been major changes since +Upgraded to MH-E version 7.81. There have been major changes since version 5.0.2; see MH-E-NEWS for details. +++ diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 645e9a1bd6d..990291caead 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,40 @@ +2004-08-21 Bill Wohler + + * Released MH-E version 7.81. + + * MH-E-NEWS, README: Updated for release 7.81. + + * mh-e.el (Version, mh-version): Updated for release 7.81. + +2004-08-21 Bill Wohler + + * release-utils (variable_changes): Check for checked-out + directory before proceeding. Remove temporary files. Renamed + --variable-update flag to --variable-changes. + +2004-08-16 Mark D. Baushke + + * mh-mime.el (mh-toggle-mh-decode-mime-flag: New function. + * mh-e.el (mh-help-messages): Add [;] help string for it. + (mh-folder-mode-map): Add ";" key binding for it. + +2004-08-15 Satyaki Das + + * mh-acros.el (mh-defstruct): Distinguishing structures created + by mh-defstruct just based on the number of fields is not + sufficient, since both the mh-thread-message and + mh-thread-container structures have the same length. + +2004-08-15 Mark D. Baushke + + * mh-customize.el (mh-identity-handlers): Use ":default" instead of + "default" to avoid problems with "Default:" as a user defined field. + * mh-identity.el (mh-identity-field-handler): Ditto. + +2004-08-15 Bill Wohler + + * mh-e.el (Version, mh-version): Added +cvs to release number. + 2004-08-15 Bill Wohler * Released MH-E version 7.4.80. diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el index c409cf8d36e..dd8660a8ce3 100644 --- a/lisp/mh-e/mh-acros.el +++ b/lisp/mh-e/mh-acros.el @@ -121,10 +121,10 @@ various structure fields. Lookup `defstruct' for more details." `(progn (defun* ,constructor (&key ,@(mapcar* #'(lambda (x y) (list x y)) field-names field-init-forms)) - (list ,@field-names)) + (list (quote ,struct-name) ,@field-names)) (defun ,predicate (arg) - (and (consp arg) (eql (length arg) ,(length fields)))) - ,@(loop for x from 0 + (and (consp arg) (eq (car arg) (quote ,struct-name)))) + ,@(loop for x from 1 for y in field-names collect `(defmacro ,(intern (format "%s%s" conc-name y)) (z) (list 'nth ,x z))) diff --git a/lisp/mh-e/mh-customize.el b/lisp/mh-e/mh-customize.el index 0cf35b3c0d9..67a126a8327 100644 --- a/lisp/mh-e/mh-customize.el +++ b/lisp/mh-e/mh-customize.el @@ -527,7 +527,7 @@ See `mh-auto-fields-list'." :group 'mh-identity) (defcustom mh-identity-handlers - '(("default" . mh-identity-handler-bottom) + '((":default" . mh-identity-handler-bottom) ("from" . mh-identity-handler-top) (":attribution-verb" . mh-identity-handler-attribution-verb) (":signature" . mh-identity-handler-signature) @@ -535,9 +535,8 @@ See `mh-auto-fields-list'." "Handler functions for fields in `mh-identity-list'. This is an alist of fields (strings) and handlers (functions). Strings are lowercase. Use \":signature\" for Signature and \":pgg-default-user-id\" for -GPG Key ID. The function associated with the string \"default\" is used if no -other functions are appropriate. For this reason, don't name a header field -\"Default\"." +GPG Key ID. The function associated with the string \":default\" is used if no +other functions are appropriate." :type '(repeat (cons (string :tag "Field") function)) :group 'mh-identity) diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 5cb7f90f1e3..5cbb97b72d0 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -5,7 +5,7 @@ ;; Author: Bill Wohler ;; Maintainer: Bill Wohler -;; Version: 7.4.80 +;; Version: 7.81 ;; Keywords: mail ;; This file is part of GNU Emacs. @@ -96,7 +96,7 @@ (defvar font-lock-auto-fontify) (defvar font-lock-defaults) -(defconst mh-version "7.4.80" "Version number of MH-E.") +(defconst mh-version "7.81" "Version number of MH-E.") ;;; Autoloads (autoload 'Info-goto-node "info") @@ -2347,6 +2347,7 @@ If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences in list." "'" mh-toggle-tick "," mh-header-display "." mh-alt-show + ";" mh-toggle-mh-decode-mime-flag ">" mh-write-msg-to-file "?" mh-help "E" mh-extract-rejected-mail @@ -2496,7 +2497,8 @@ If INCLUDE-INTERNAL-FLAG non-nil, include MH-E internal sequences in list." (defvar mh-help-messages '((nil "[i]nc, [.]show, [,]show all, [n]ext, [p]revious,\n" "[d]elete, [o]refile, e[x]ecute,\n" - "[s]end, [r]eply.\n" + "[s]end, [r]eply,\n" + "[;]toggle MIME decoding.\n" "Prefix characters:\n [F]older, [S]equence, [J]unk, MIME [K]eys," "\n [T]hread, [/]limit, e[X]tract, [D]igest, [I]nc spools.") diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el index 2b430a52fe1..be385ad09e6 100644 --- a/lisp/mh-e/mh-identity.el +++ b/lisp/mh-e/mh-identity.el @@ -127,7 +127,7 @@ message header." (or (cdr (assoc (downcase field) mh-identity-handlers)) (and (eq (aref field 0) ?:) (error (format "Field %s - unknown mh-identity-handler" field))) - (cdr (assoc "default" mh-identity-handlers)) + (cdr (assoc ":default" mh-identity-handlers)) 'mh-identity-handler-default)) ;;;###mh-autoload diff --git a/lisp/mh-e/mh-loaddefs.el b/lisp/mh-e/mh-loaddefs.el index 43119b62be0..6a88278a847 100644 --- a/lisp/mh-e/mh-loaddefs.el +++ b/lisp/mh-e/mh-loaddefs.el @@ -261,7 +261,7 @@ Display cheat sheet for the commands of the current prefix in minibuffer." t nil ;;;;;; mh-identity-insert-attribution-verb mh-identity-handler-attribution-verb ;;;;;; mh-identity-handler-signature mh-identity-handler-gpg-identity ;;;;;; mh-insert-identity mh-identity-list-set mh-identity-make-menu) -;;;;;; "mh-identity" "mh-identity.el" (16665 55172)) +;;;;;; "mh-identity" "mh-identity.el" (16680 7172)) ;;; Generated autoloads from mh-identity.el (autoload (quote mh-identity-make-menu) "mh-identity" "\ @@ -582,7 +582,7 @@ system." nil nil) ;;;*** ;;;### (autoloads (mh-variants mh-variant-p mh-variant-set) "mh-init" -;;;;;; "mh-init.el" (16671 49652)) +;;;;;; "mh-init.el" (16680 9361)) ;;; Generated autoloads from mh-init.el (autoload (quote mh-variant-set) "mh-init" "\ @@ -633,17 +633,18 @@ The `mh-junk-program' option specifies the spam program in use." t nil) ;;;### (autoloads (mh-display-with-external-viewer mh-mime-inline-part ;;;;;; mh-mime-save-part mh-push-button mh-press-button mh-mime-display -;;;;;; mh-decode-message-header mh-mime-save-parts mh-display-emphasis -;;;;;; mh-display-smileys mh-add-missing-mime-version-header mh-destroy-postponed-handles -;;;;;; mh-mime-cleanup mh-mml-directive-present-p mh-mml-secure-message-signencrypt -;;;;;; mh-mml-secure-message-encrypt mh-mml-secure-message-sign -;;;;;; mh-mml-unsecure-message mh-mml-attach-file mh-mml-query-cryptographic-method -;;;;;; mh-mml-forward-message mh-mml-to-mime mh-mhn-directive-present-p -;;;;;; mh-revert-mhn-edit mh-edit-mhn mh-mhn-compose-forw mh-mhn-compose-external-type +;;;;;; mh-decode-message-header mh-toggle-mh-decode-mime-flag mh-mime-save-parts +;;;;;; mh-display-emphasis mh-display-smileys mh-add-missing-mime-version-header +;;;;;; mh-destroy-postponed-handles mh-mime-cleanup mh-mml-directive-present-p +;;;;;; mh-mml-secure-message-signencrypt mh-mml-secure-message-encrypt +;;;;;; mh-mml-secure-message-sign mh-mml-unsecure-message mh-mml-attach-file +;;;;;; mh-mml-query-cryptographic-method mh-mml-forward-message +;;;;;; mh-mml-to-mime mh-mhn-directive-present-p mh-revert-mhn-edit +;;;;;; mh-edit-mhn mh-mhn-compose-forw mh-mhn-compose-external-type ;;;;;; mh-mhn-compose-external-compressed-tar mh-mhn-compose-anon-ftp ;;;;;; mh-mhn-compose-insertion mh-file-mime-type mh-have-file-command ;;;;;; mh-compose-forward mh-compose-insertion) "mh-mime" "mh-mime.el" -;;;;;; (16665 55171)) +;;;;;; (16680 7172)) ;;; Generated autoloads from mh-mime.el (autoload (quote mh-compose-insertion) "mh-mime" "\ @@ -821,6 +822,9 @@ If ARG, prompt for directory, else use that specified by the variable mh_profile directives, since this function calls on mhstore or mhn to do the actual storing." t nil) +(autoload (quote mh-toggle-mh-decode-mime-flag) "mh-mime" "\ +Toggle whether MH-E should decode MIME or not." t nil) + (autoload (quote mh-decode-message-header) "mh-mime" "\ Decode RFC2047 encoded message header fields." nil nil) @@ -878,7 +882,7 @@ indexing program specified in `mh-index-program' is used." t nil) ;;;### (autoloads (mh-print-msg mh-ps-print-toggle-mime mh-ps-print-toggle-color ;;;;;; mh-ps-print-toggle-faces mh-ps-print-msg-show mh-ps-print-msg-file -;;;;;; mh-ps-print-msg) "mh-print" "mh-print.el" (16671 49652)) +;;;;;; mh-ps-print-msg) "mh-print" "mh-print.el" (16680 9361)) ;;; Generated autoloads from mh-print.el (autoload (quote mh-ps-print-msg) "mh-print" "\ diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index 6b3c5793be5..f952f8b80fb 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -849,6 +849,14 @@ If message has been encoded for transfer take that into account." (gnus-strip-whitespace cte)))) (car ct)))))) +;;;###mh-autoload +(defun mh-toggle-mh-decode-mime-flag () + "Toggle whether MH-E should decode MIME or not." + (interactive) + (setq mh-decode-mime-flag (not mh-decode-mime-flag)) + (mh-show nil t) + (message (format "(setq mh-decode-mime-flag %s)" mh-decode-mime-flag))) + ;;;###mh-autoload (defun mh-decode-message-header () "Decode RFC2047 encoded message header fields." From 69331413e8d1260a241cb2d575d6bd6b709da064 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 22 Aug 2004 09:49:37 +0000 Subject: [PATCH 206/341] Require pcvs during byte-compiling for defun-cvs-mode. --- lisp/cvs-status.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el index b00984b60f1..419f8567a90 100644 --- a/lisp/cvs-status.el +++ b/lisp/cvs-status.el @@ -31,6 +31,7 @@ ;;; Code: (eval-when-compile (require 'cl)) +(eval-when-compile (require 'pcvs)) (require 'pcvs-util) ;;; From 2b54cb7b3029b191946fecab43d17eabfc9f0e06 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 22 Aug 2004 09:50:18 +0000 Subject: [PATCH 207/341] . --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b149e64c024..bb211cbc8b9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-22 Andreas Schwab + + * cvs-status.el: Require pcvs during byte-compiling for + defun-cvs-mode. + 2004-08-22 Masatake YAMATO * cvs-status.el (cvs-status-checkout): New function. From 90a02640b4be96f3ac5546f74c63397c31894471 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 22 Aug 2004 10:58:41 +0000 Subject: [PATCH 208/341] Update AUCTeX information. --- etc/ChangeLog | 4 ++++ etc/MAILINGLISTS | 9 +++++---- etc/PROBLEMS | 40 +++++++--------------------------------- lisp/ChangeLog | 4 ++++ lisp/ido.el | 2 +- lisp/iswitchb.el | 2 +- lisp/speedbar.el | 2 +- 7 files changed, 23 insertions(+), 40 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 4f7395fba57..cd7888b1a4a 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2004-08-22 David Kastrup + + * PROBLEMS, MAILINGLISTS: Update AUCTeX information. + 2004-08-21 Bill Wohler * NEWS, MH-E-NEWS: Upgraded to MH-E version 7.81. diff --git a/etc/MAILINGLISTS b/etc/MAILINGLISTS index 6c22e668340..7c5558eabf6 100644 --- a/etc/MAILINGLISTS +++ b/etc/MAILINGLISTS @@ -1224,13 +1224,14 @@ rmail mode. The supercite mailing list covers issues related to the advanced mail/news citation package called Supercite for GNU Emacs. -* auc-tex-request@iesd.auc.dk to subscribe +* auc-tex-request@sunsite.dk to subscribe ** USENET newsgroup: NONE YET -** Send contributions to: auc-tex@iesd.auc.dk +** Send contributions to: auc-tex@sunsite.dk -The list is intended to exchange information about AUC TeX, such as +The list is intended to exchange information about AUCTeX, such as bug reports, request for help, and information on current -developments. AUC TeX is a much enhanced LaTeX mode for GNU Emacs. +developments. AUCTeX is a much enhanced TeX/LaTeX/ConTeXt/Texinfo mode +for GNU Emacs. The list is unmoderated. diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 0152dad9dd9..b126d710cd8 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -497,47 +497,21 @@ earlier versions. ((consp (sgml-entity-text entity)) ; external id? (let* ((extid (sgml-entity-text entity)) -** AUC TeX +** AUCTeX -*** Emacs 21 freezes when visiting a TeX file with AUC TeX installed. +You should not be using a version older than 11.52 if you can avoid +it. -Emacs 21 needs version 10 or later of AUC TeX; upgrading should solve +*** Emacs 21 freezes when visiting a TeX file with AUCTeX installed. + +Emacs 21 needs version 10 or later of AUCTeX; upgrading should solve these problems. -*** No colors in AUC TeX with Emacs 21. +*** No colors in AUCTeX with Emacs 21. Upgrade to AUC TeX version 10 or later, and make sure it is byte-compiled with Emacs 21. -*** Running TeX from AUC TeX package with Emacs 20.3 gives a Lisp error -about a read-only tex output buffer. - -This problem appeared for AUC TeX version 9.9j and some earlier -versions. Here is a patch for the file tex-buf.el in the AUC TeX -package. - -diff -c auctex/tex-buf.el~ auctex/tex-buf.el -*** auctex/tex-buf.el~ Wed Jul 29 18:35:32 1998 ---- auctex/tex-buf.el Sat Sep 5 15:20:38 1998 -*************** -*** 545,551 **** - (dir (TeX-master-directory))) - (TeX-process-check file) ; Check that no process is running - (setq TeX-command-buffer (current-buffer)) -! (with-output-to-temp-buffer buffer) - (set-buffer buffer) - (if dir (cd dir)) - (insert "Running `" name "' on `" file "' with ``" command "''\n") -- --- 545,552 ---- - (dir (TeX-master-directory))) - (TeX-process-check file) ; Check that no process is running - (setq TeX-command-buffer (current-buffer)) -! (let (temp-buffer-show-function temp-buffer-show-hook) -! (with-output-to-temp-buffer buffer)) - (set-buffer buffer) - (if dir (cd dir)) - (insert "Running `" name "' on `" file "' with ``" command "''\n") - ** Miscellaneous problems *** Self-documentation messages are garbled. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bb211cbc8b9..278f92da4ca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-08-22 David Kastrup + + * speedbar.el, iswitchb.el, ido.el: Update AUCTeX information. + 2004-08-22 Andreas Schwab * cvs-status.el: Require pcvs during byte-compiling for diff --git a/lisp/ido.el b/lisp/ido.el index 4cbc88cf037..ae376741f1b 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -291,7 +291,7 @@ ;; then all files matching "Summary" are moved to the end of the ;; list. (I find this handy for keeping the INBOX Summary and so on ;; out of the way.) It also moves files matching "output\*$" to the -;; end of the list (these are created by AUC TeX when compiling.) +;; end of the list (these are created by AUCTeX when compiling.) ;; Other functions could be made available which alter the list of ;; matching files (either deleting or rearranging elements.) diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index bda0ce4fddc..52915c46950 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el @@ -159,7 +159,7 @@ ;; then all buffers matching "Summary" are moved to the end of the ;; list. (I find this handy for keeping the INBOX Summary and so on ;; out of the way.) It also moves buffers matching "output\*$" to the -;; end of the list (these are created by AUC TeX when compiling.) +;; end of the list (these are created by AUCTeX when compiling.) ;; Other functions could be made available which alter the list of ;; matching buffers (either deleting or rearranging elements.) diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 0556af489ef..63ff1818b3d 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -92,7 +92,7 @@ ;; into sub-lists. A long flat list can be used instead if needed. ;; Other filters can be easily added. ;; -;; AUC-TEX users: The imenu tags for AUC-TEX mode doesn't work very +;; AUCTEX users: The imenu tags for AUCTEX mode doesn't work very ;; well. Use the imenu keywords from tex-mode.el for better results. ;; ;; This file requires the library package assoc (association lists) From 818226ac7eafb08656e40657c51b87ddcddfe0a5 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 22 Aug 2004 11:03:22 +0000 Subject: [PATCH 209/341] Update AUCTeX information. --- lisp/ChangeLog | 3 +++ lisp/progmodes/meta-mode.el | 2 +- lisp/textmodes/reftex-auc.el | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 278f92da4ca..bd9c9cd7d2f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2004-08-22 David Kastrup + * textmodes/reftex-auc.el, progmodes/meta-mode.el: Update AUCTeX + information. + * speedbar.el, iswitchb.el, ido.el: Update AUCTeX information. 2004-08-22 Andreas Schwab diff --git a/lisp/progmodes/meta-mode.el b/lisp/progmodes/meta-mode.el index 7bf9e935710..ecf8da2e509 100644 --- a/lisp/progmodes/meta-mode.el +++ b/lisp/progmodes/meta-mode.el @@ -32,7 +32,7 @@ ;; a major mode including an approriate syntax table, keymap, and a ;; mode-specific pull-down menu. It also provides a sophisticated set ;; of font-lock patterns, a fancy indentation function adapted from -;; AUC-TeX's latex.el, and some basic mode-specific editing functions +;; AUCTeX's latex.el, and some basic mode-specific editing functions ;; such as functions to move to the beginning or end of the enclosing ;; environment, or to mark, re-indent, or comment-out environments. ;; On the other hand, it doesn't yet provide any functionality for diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el index 7b9ad8348ca..534e4e7b27b 100644 --- a/lisp/textmodes/reftex-auc.el +++ b/lisp/textmodes/reftex-auc.el @@ -1,4 +1,4 @@ -;;; reftex-auc.el --- RefTeX's interface to AUC TeX +;;; reftex-auc.el --- RefTeX's interface to AUCTeX ;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. ;; Author: Carsten Dominik From 2dd718b66b14bdf0a7438856bbdc32289953bb75 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 22 Aug 2004 11:51:19 +0000 Subject: [PATCH 210/341] * reftex.texi (AUCTeX): Update links, section name. * faq.texi (Calc): Update availability (included in 21.4). (AUCTeX): Update availability, information, versions, description. --- man/ChangeLog | 7 +++++++ man/faq.texi | 28 ++++++++++++++++++---------- man/reftex.texi | 4 ++-- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index e40f2317d2a..5c0926de48a 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,10 @@ +2004-08-22 David Kastrup + + * reftex.texi (AUCTeX): Update links, section name. + + * faq.texi (Calc): Update availability (included in 21.4). + (AUCTeX): Update availability, information, versions, description. + 2004-08-21 Luc Teirlinck * kmacro.texi (Keyboard Macro Ring): Rename section. diff --git a/man/faq.texi b/man/faq.texi index fc0afd85620..c887739ca8f 100644 --- a/man/faq.texi +++ b/man/faq.texi @@ -3953,10 +3953,11 @@ Superyank is an old version of Supercite. @email{daveg@@csvax.cs.caltech.edu, Dave Gillespie} @item Latest version -2.02f +2.02g (part of Emacs since version 21.4) @item Distribution -@uref{ftp://ftp.gnu.org/pub/gnu/calc/calc-2.02f.tar.gz} +No separate distribution outside of Emacs. Older versions +are available at @uref{ftp://ftp.gnu.org/pub/gnu/calc/}. @end table @@ -3996,34 +3997,41 @@ better than the one distributed with Emacs: @end table @node AUCTeX, BBDB, VIPER, Major packages and programs -@section AUCTeX --- enhanced LaTeX mode with debugging facilities +@section AUC@TeX{} --- enhanced @TeX{} modes with debugging facilities @cindex Mode for @TeX{} @cindex @TeX{} mode -@cindex AUCTeX mode for editing @TeX{} +@cindex AUC@TeX{} mode for editing @TeX{} @cindex Writing and debugging @TeX{} +AUC@TeX{} is a set of sophisticated major modes for @TeX{}, LaTeX, +ConTeXt, and Texinfo offering context-sensitive syntax highlighting, +indentation, formatting and folding, macro completion, @TeX{} shell +functionality, and debugging. Some important supplemental packages are +described in @ref{Introduction, RefTeX, Introduction, reftex, Ref@TeX{} +User Manual}, and +@uref{http://preview-latex.sourceforge.net,preview-latex}. + @table @b @item Authors -@email{krab@@iesd.auc.dk, Kresten Krab Thorup} and@* -@email{abraham@@dina.kvl.dk, Per Abrahamsen} +@email{krab@@iesd.auc.dk, Kresten Krab Thorup}, @* +@email{abraham@@dina.kvl.dk, Per Abrahamsen}, @* and others. @item Maintainer @email{dak@@gnu.org, David Kastrup} @item Latest version -11.13 +11.52 @item Distribution -@uref{http://savannah.gnu.org/download/auctex/stable.pkg/11.13/auctex-11.13.tar.gz} +@uref{ftp://ftp.gnu.org/pub/gnu/auctex/} @item Web site @uref{http://www.gnu.org/software/auctex/} @item Mailing list: Subscription requests to @email{auc-tex-subscribe@@sunsite.dk}@* -Submissions to @email{auc-tex@@sunsite.dk}@* -Development team is at @email{auc-tex_mgr@@sunsite.dk} +Submissions to @email{auc-tex@@sunsite.dk} @end table diff --git a/man/reftex.texi b/man/reftex.texi index b1c4ae561ba..9108747af4f 100644 --- a/man/reftex.texi +++ b/man/reftex.texi @@ -2976,7 +2976,7 @@ with the @kbd{g} key. To get this behavior, use instead@refill @end lisp @node AUCTeX, Multifile Documents, Faces, Top -@section @w{AUC @TeX{}} +@section AUC@TeX{} @cindex @code{AUCTeX}, Emacs package @cindex Emacs packages, @code{AUCTeX} @@ -2985,7 +2985,7 @@ files with Emacs (@pxref{Top,AUCTeX,,auctex, The AUCTeX User Manual}). If AUCTeX is not part of your Emacs distribution, you can get it@footnote{XEmacs 21.x users may want to install the corresponding XEmacs package.} by ftp from the -@uref{http://www.sunsite.auc.dk/auctex/,AUCTeX distribution site}. +@uref{ftp://ftp.gnu.org/pub/gnu/auctex,AUCTeX distribution site}. @menu * AUCTeX-RefTeX Interface:: How both packages work together From 7ea820e9850de8cf9d66bed4e7e2915a3937472e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 16:53:44 +0000 Subject: [PATCH 211/341] (font-lock-set-defaults): Use with-no-warnings. --- lisp/font-lock.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 8cb43bc0bd8..052e92391af 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1516,7 +1516,9 @@ Sets various variables using `font-lock-defaults' (or, if nil, using (make-local-variable 'font-lock-fontified) (make-local-variable 'font-lock-multiline) (let* ((defaults (or font-lock-defaults - (cdr (assq major-mode font-lock-defaults-alist)))) + (cdr (assq major-mode + (with-no-warnings + font-lock-defaults-alist))))) (keywords (font-lock-choose-keywords (nth 0 defaults) (font-lock-value-in-major-mode font-lock-maximum-decoration))) From 9fa5bb32b2a7d7544e03553e7388857343651afa Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 16:54:33 +0000 Subject: [PATCH 212/341] (display-mouse-p, display-selections-p): Use with-no-warnings. --- lisp/frame.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/frame.el b/lisp/frame.el index a364d7f491b..8d979cdaff4 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -987,7 +987,8 @@ frame's display)." ((eq frame-type 'pc) (msdos-mouse-p)) ((eq system-type 'windows-nt) - (> w32-num-mouse-buttons 0)) + (with-no-warnings + (> w32-num-mouse-buttons 0))) ((memq frame-type '(x mac)) t) ;; We assume X and Mac *always* have a pointing device (t @@ -1040,7 +1041,8 @@ frame's display)." ((eq frame-type 'pc) ;; MS-DOG frames support selections when Emacs runs inside ;; the Windows' DOS Box. - (not (null dos-windows-version))) + (with-no-warnings + (not (null dos-windows-version)))) ((memq frame-type '(x w32 mac)) t) ;; FIXME? (t From 3e621022a91423188937e5ddbacdd41054a75991 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 16:56:52 +0000 Subject: [PATCH 213/341] Delete compatibility code for old Emacses. (ps-mule-find-wrappoint): Don't use chars-in-region. --- lisp/ps-mule.el | 49 +------------------------------------------------ 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el index 4b41c41b69c..fe9d7350398 100644 --- a/lisp/ps-mule.el +++ b/lisp/ps-mule.el @@ -213,53 +213,6 @@ Any other value is treated as nil." (const bdf-font-except-latin) (const :tag "nil" nil)) :group 'ps-print-font) - -(eval-and-compile - ;; For Emacs 20.2 and the earlier version. - (if (and (boundp 'mule-version) - (not (string< (symbol-value 'mule-version) "4.0"))) - ;; mule package is loaded - (progn - (defalias 'ps-mule-next-point '1+) - (defalias 'ps-mule-chars-in-string 'length) - (defalias 'ps-mule-string-char 'aref) - (defsubst ps-mule-next-index (str i) (1+ i))) - ;; mule package isn't loaded or mule version lesser than 4.0 - (defun ps-mule-next-point (arg) - (save-excursion (goto-char arg) (forward-char 1) (point))) - (defun ps-mule-chars-in-string (string) - (/ (length string) - (charset-bytes (char-charset (string-to-char string))))) - (defun ps-mule-string-char (string idx) - (string-to-char (substring string idx))) - (defun ps-mule-next-index (string i) - (+ i (charset-bytes (char-charset (string-to-char string))))) - ) - ;; For Emacs 20.4 and the earlier version. - (if (and (boundp 'mule-version) - (string< (symbol-value 'mule-version) "5.0")) - ;; mule package is loaded and mule version is lesser than 5.0 - (progn - (defun encode-composition-rule (rule) - (if (= (car rule) 4) (setcar rule 10)) - (if (= (cdr rule) 4) (setcdr rule 10)) - (+ (* (car rule) 12) (cdr rule))) - (defun find-composition (pos &rest ignore) - (let ((ch (char-after pos))) - (and ch (eq (char-charset ch) 'composition) - (let ((components (decompose-composite-char ch 'vector t))) - (list pos (ps-mule-next-point pos) components - (integerp (aref components 1)) nil - (char-width ch))))))) - ;; mule package isn't loaded - (or (fboundp 'encode-composition-rule) - (defun encode-composition-rule (rule) - 130)) - (or (fboundp 'find-composition) - (defun find-composition (pos &rest ignore) - nil)) - )) - (defvar ps-mule-font-info-database nil "Alist of charsets with the corresponding font information. @@ -847,7 +800,7 @@ the sequence." run-width))) ;; We assume that all characters in this range have the same width. (setq char-width (* char-width (charset-width ps-mule-current-charset))) - (let ((run-width (* (chars-in-region from to) char-width))) + (let ((run-width (* (abs (- from to)) char-width))) (if (> run-width ps-width-remaining) (cons (min to (save-excursion From 63619f423304d218c1299c85f52a9820528b5707 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 16:59:57 +0000 Subject: [PATCH 214/341] (shell-command-on-region): New arg DISPLAY-ERROR-BUFFER controls whether to display the error buffer. --- lisp/simple.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index b52220d542b..78ca8e63f2e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1628,7 +1628,7 @@ and only used if a buffer is displayed." (defun shell-command-on-region (start end command &optional output-buffer replace - error-buffer) + error-buffer display-error-buffer) "Execute string COMMAND in inferior shell with region as input. Normally display output (if any) in temp buffer `*Shell Command Output*'; Prefix arg means replace the region with it. Return the exit code of @@ -1641,10 +1641,10 @@ is encoded in the same coding system that will be used to save the file, `buffer-file-coding-system'. If the output is going to replace the region, then it is decoded from that same coding system. -The noninteractive arguments are START, END, COMMAND, OUTPUT-BUFFER, -REPLACE, ERROR-BUFFER. Noninteractive callers can specify coding -systems by binding `coding-system-for-read' and -`coding-system-for-write'. +The noninteractive arguments are START, END, COMMAND, +OUTPUT-BUFFER, REPLACE, ERROR-BUFFER, and DISPLAY-ERROR-BUFFER. +Noninteractive callers can specify coding systems by binding +`coding-system-for-read' and `coding-system-for-write'. If the command generates output, the output may be displayed in the echo area or in a buffer. @@ -1674,6 +1674,8 @@ around it. If optional sixth argument ERROR-BUFFER is non-nil, it is a buffer or buffer name to which to direct the command's standard error output. If it is nil, error output is mingled with regular output. +If DISPLAY-ERROR-BUFFER is non-nil, display the error buffer if there +were any errors. (This is always t, interactively.) In an interactive call, the variable `shell-command-default-error-buffer' specifies the value of ERROR-BUFFER." (interactive (let (string) @@ -1691,7 +1693,8 @@ specifies the value of ERROR-BUFFER." string current-prefix-arg current-prefix-arg - shell-command-default-error-buffer))) + shell-command-default-error-buffer + t))) (let ((error-file (if error-buffer (make-temp-file @@ -1800,7 +1803,8 @@ specifies the value of ERROR-BUFFER." (format-insert-file error-file nil) ;; Put point after the inserted errors. (goto-char (- (point-max) pos-from-end))) - (display-buffer (current-buffer)))) + (and display-error-buffer + (display-buffer (current-buffer))))) (delete-file error-file)) exit-status)) From 0ed9d54f71d440f4248c83d34ca5b9944f81749c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 17:03:42 +0000 Subject: [PATCH 215/341] (speedbar-file-regexp): Definition moved up. (speedbar-mode, speedbar-set-mode-line-format): Use with-no-warnings. (speedbar-emacs-popup-kludge): Delete Emacs 19 alternative. --- lisp/speedbar.el | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 63ff1818b3d..524a6d4f2f8 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -665,6 +665,13 @@ useful, such as version control." "*Regexp matching files we don't want displayed in a speedbar buffer. It is generated from the variable `completion-ignored-extensions'") +;; This can't be further down, since it is needed just after. +(defvar speedbar-file-regexp + (speedbar-extension-list-to-regex speedbar-supported-extension-expressions) + "Regular expression matching files we know how to expand. +Created from `speedbar-supported-extension-expression' with the +function `speedbar-extension-list-to-regex'") + ;; this is dangerous to customize, because the defaults will probably ;; change in the future. (defcustom speedbar-supported-extension-expressions @@ -700,12 +707,6 @@ proportionally to the number of subdirs." :type 'boolean :version 21.4) -(defvar speedbar-file-regexp - (speedbar-extension-list-to-regex speedbar-supported-extension-expressions) - "Regular expression matching files we know how to expand. -Created from `speedbar-supported-extension-expression' with the -function `speedbar-extension-list-to-regex'") - (defun speedbar-add-supported-extension (extension) "Add EXTENSION as a new supported extension for speedbar tagging. This should start with a `.' if it is not a complete file name, and @@ -1295,8 +1296,9 @@ in the selected file. (toggle-read-only 1) (speedbar-set-mode-line-format) (if speedbar-xemacsp - (set (make-local-variable 'mouse-motion-handler) - 'speedbar-track-mouse-xemacs) + (with-no-warnings + (set (make-local-variable 'mouse-motion-handler) + 'speedbar-track-mouse-xemacs)) (if speedbar-track-mouse-flag (set (make-local-variable 'track-mouse) t)) ;this could be messy. (setq auto-show-mode nil)) ;no auto-show for Emacs @@ -1345,7 +1347,8 @@ This gives visual indications of what is up. It EXPECTS the speedbar frame and window to be the currently active frame and window." (if (and (frame-live-p speedbar-frame) (or (not speedbar-xemacsp) - (specifier-instance has-modeline-p))) + (with-no-warnings + (specifier-instance has-modeline-p)))) (save-excursion (set-buffer speedbar-buffer) (let* ((w (or (speedbar-frame-width) 20)) @@ -1546,9 +1549,7 @@ Must be bound to event E." ;; This gets the cursor where the user can see it. (if (not (bolp)) (forward-char -1)) (sit-for 0) - (if (< emacs-major-version 20) - (mouse-major-mode-menu e) - (mouse-major-mode-menu e nil)))) + (mouse-major-mode-menu e nil))) (defun speedbar-hack-buffer-menu (e) "Control mouse 1 is buffer menu. From 35bf5a4e0728a9d17e9ec6adb809bb1abbd9d657 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 17:04:22 +0000 Subject: [PATCH 216/341] (global-whitespace-mode): New alias for whitespace-global-mode. --- lisp/whitespace.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/whitespace.el b/lisp/whitespace.el index e330febf938..40a234f02d6 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -819,6 +819,9 @@ If timer is not set, then set it to scan the files in (disable-timeout whitespace-rescan-timer) (setq whitespace-rescan-timer nil)))) +;;;###autoload +(defalias 'global-whitespace-mode 'whitespace-global-mode) + ;;;###autoload (define-minor-mode whitespace-global-mode "Toggle using Whitespace mode in new buffers. From 4d96f7e75bed46ef6ec86cc0824cfb0529994725 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 17:09:58 +0000 Subject: [PATCH 217/341] (mail-extr-all-top-level-domains): Add forward defvar. --- lisp/mail/mail-extr.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el index 7f2e6fef6b6..675444d7ba4 100644 --- a/lisp/mail/mail-extr.el +++ b/lisp/mail/mail-extr.el @@ -687,6 +687,7 @@ Unless NO-REPLACE is true, at each of the positions in LIST-SYMBOL (defvar disable-initial-guessing-flag) ; dynamic assignment (defvar cbeg) ; dynamic assignment (defvar cend) ; dynamic assignment +(defvar mail-extr-all-top-level-domains) ; Defined below. ;;;###autoload (defun mail-extract-address-components (address &optional all) From 260763dbb07b4fff981d090f9c3d3a28758849d9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 17:11:34 +0000 Subject: [PATCH 218/341] (ange-ftp-gwp-start, ange-ftp-nslookup-host) (ange-ftp-start-process): Use set-process-query-on-exit-flag. --- lisp/net/ange-ftp.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index b9a7fc46148..c1f3c0a8d52 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -1771,7 +1771,7 @@ good, skip, fatal, or unknown." ange-ftp-gateway-program ange-ftp-gateway-host))) (ftp (mapconcat 'identity args " "))) - (process-kill-without-query proc) + (set-process-query-on-exit-flag proc nil) (set-process-sentinel proc 'ange-ftp-gwp-sentinel) (set-process-filter proc 'ange-ftp-gwp-filter) (save-excursion @@ -1880,7 +1880,7 @@ been queued with no result. CONT will still be called, however." (start-process " *nslookup*" " *nslookup*" ange-ftp-nslookup-program host))) (res host)) - (process-kill-without-query proc) + (set-process-query-on-exit-flag proc nil) (save-excursion (set-buffer (process-buffer proc)) (while (memq (process-status proc) '(run open)) @@ -1938,7 +1938,7 @@ on the gateway machine to do the ftp instead." (set-buffer (process-buffer proc)) (goto-char (point-max)) (set-marker (process-mark proc) (point))) - (process-kill-without-query proc) + (set-process-query-on-exit-flag proc nil) (set-process-sentinel proc 'ange-ftp-process-sentinel) (set-process-filter proc 'ange-ftp-process-filter) ;; On Windows, the standard ftp client buffers its output (because From ced16f5d0b67f5792f2f99c2b2f0593e97f955ad Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 17:14:02 +0000 Subject: [PATCH 219/341] Many doc and style fixes. (ada-find-any-references): Use compilation-start. (ada-get-ali-file-name): Improve error msg. (ada-get-ada-file-name): Likewise. --- lisp/progmodes/ada-xref.el | 166 ++++++++++++++++++------------------- 1 file changed, 82 insertions(+), 84 deletions(-) diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el index c9bfbd76c23..fc1d2d46ab3 100644 --- a/lisp/progmodes/ada-xref.el +++ b/lisp/progmodes/ada-xref.el @@ -33,7 +33,7 @@ ;;; for lookup and completion in Ada mode. ;;; ;;; If a file *.`adp' exists in the ada-file directory, then it is -;;; read for configuration informations. It is read only the first +;;; read for configuration informations. It is read only the first ;;; time a cross-reference is asked for, and is not read later. ;;; You need Emacs >= 20.2 to run this package @@ -55,26 +55,25 @@ Otherwise create either a new buffer or a new frame." (defcustom ada-xref-create-ali nil "*If non-nil, run gcc whenever the cross-references are not up-to-date. -If nil, the cross-reference mode will never run gcc." +If nil, the cross-reference mode never runs gcc." :type 'boolean :group 'ada) (defcustom ada-xref-confirm-compile nil - "*If non-nil, always ask for user confirmation before compiling or running -the application." + "*If non-nil, ask for confirmation before compiling or running the application." :type 'boolean :group 'ada) (defcustom ada-krunch-args "0" - "*Maximum number of characters for filenames created by gnatkr. -Set to 0, if you don't use crunched filenames. This should be a string." + "*Maximum number of characters for filenames created by `gnatkr'. +Set to 0, if you don't use crunched filenames. This should be a string." :type 'string :group 'ada) (defcustom ada-gnatls-args '("-v") - "*Arguments to pass to gnatfind when the location of the runtime is searched. -Typical use is to pass --RTS=soft-floats on some systems that support it. + "*Arguments to pass to `gnatfind' to find location of the runtime. +Typical use is to pass `--RTS=soft-floats' on some systems that support it. -You can also add -I- if you do not want the current directory to be included. +You can also add `-I-' if you do not want the current directory to be included. Otherwise, going from specs to bodies and back will first look for files in the -current directory. This only has an impact if you are not using project files, +current directory. This only has an impact if you are not using project files, but only ADA_INCLUDE_PATH." :type '(repeat string) :group 'ada) @@ -91,14 +90,14 @@ but only ADA_INCLUDE_PATH." :type 'string :group 'ada) (defcustom ada-prj-default-gnatmake-opt "-g" - "Default options for gnatmake." + "Default options for `gnatmake'." :type 'string :group 'ada) (defcustom ada-prj-gnatfind-switches "-rf" - "Default switches to use for gnatfind. -You should modify this variable, for instance to add -a, if you are working + "Default switches to use for `gnatfind'. +You should modify this variable, for instance to add `-a', if you are working in an environment where most ALI files are write-protected. -The command gnatfind is used every time you choose the menu +The command `gnatfind' is used every time you choose the menu \"Show all references\"." :type 'string :group 'ada) @@ -106,12 +105,12 @@ The command gnatfind is used every time you choose the menu (concat "${cross_prefix}gnatmake -u -c ${gnatmake_opt} ${full_current} -cargs" " ${comp_opt}") "*Default command to be used to compile a single file. -Emacs will add the filename at the end of this command. This is the same +Emacs will add the filename at the end of this command. This is the same syntax as in the project file." :type 'string :group 'ada) (defcustom ada-prj-default-debugger "${cross_prefix}gdb" - "*Default name of the debugger. We recommend either `gdb', + "*Default name of the debugger. We recommend either `gdb', `gdb --emacs_gdbtk' or `ddd --tty -fullname'." :type 'string :group 'ada) @@ -129,7 +128,7 @@ this string is not empty." :type '(file :must-match t) :group 'ada) (defcustom ada-gnatstub-opts "-q -I${src_dir}" - "*List of the options to pass to gnatsub to generate the body of a package. + "*List of the options to pass to `gnatsub' to generate the body of a package. This has the same syntax as in the project file (with variable substitution)." :type 'string :group 'ada) @@ -139,7 +138,7 @@ Otherwise, ask the user for the name of the project file to use." :type 'boolean :group 'ada) (defconst is-windows (memq system-type (quote (windows-nt))) - "True if we are running on windows NT or windows 95.") + "True if we are running on Windows NT or Windows 95.") (defcustom ada-tight-gvd-integration nil "*If non-nil, a new Emacs frame will be swallowed in GVD when debugging. @@ -149,7 +148,7 @@ If GVD is not the debugger used, nothing happens." (defcustom ada-xref-search-with-egrep t "*If non-nil, use egrep to find the possible declarations for an entity. This alternate method is used when the exact location was not found in the -information provided by GNAT. However, it might be expensive if you have a lot +information provided by GNAT. However, it might be expensive if you have a lot of sources, since it will search in all the files in your project." :type 'boolean :group 'ada) @@ -161,8 +160,8 @@ This hook should be used to support new formats for the project files. If the function can load the file with the given filename, it should create a buffer that contains a conversion of the file to the standard format of the -project files, and return that buffer. (the usual \"src_dir=\" or \"obj_dir=\" -lines). It should return nil if it doesn't know how to convert that project +project files, and return that buffer. (The usual \"src_dir=\" or \"obj_dir=\" +lines.) It should return nil if it doesn't know how to convert that project file.") @@ -192,14 +191,13 @@ Used to go back to these positions.") (if (string-match "cmdproxy.exe" shell-file-name) "cd /d" "cd") - "Command to use to change to a specific directory. On windows systems -using cmdproxy.exe as the shell, we need to use /d or the drive is never -changed.") + "Command to use to change to a specific directory. +On Windows systems using `cmdproxy.exe' as the shell, +we need to use `/d' or the drive is never changed.") (defvar ada-command-separator (if is-windows " && " "\n") - "Separator to use when sending multiple commands to `compile' or -`start-process'. -cmdproxy.exe doesn't recognize multiple-line commands, so we have to use + "Separator to use between multiple commands to `compile' or `start-process'. +`cmdproxy.exe' doesn't recognize multiple-line commands, so we have to use \"&&\" for now.") (defconst ada-xref-pos-ring-max 16 @@ -247,12 +245,12 @@ As always, the values of the project file are defined through properties.") ;; ----------------------------------------------------------------------- (defun ada-quote-cmd (cmd) - "Duplicates all \\ characters in CMD so that it can be passed to `compile'" + "Duplicate all \\ characters in CMD so that it can be passed to `compile'." (mapconcat 'identity (split-string cmd "\\\\") "\\\\")) (defun ada-initialize-runtime-library (cross-prefix) - "Initializes the variables for the runtime library location. -CROSS-PREFIX is the prefix to use for the gnatls command" + "Initialize the variables for the runtime library location. +CROSS-PREFIX is the prefix to use for the gnatls command." (save-excursion (setq ada-xref-runtime-library-specs-path '() ada-xref-runtime-library-ali-path '()) @@ -591,7 +589,7 @@ This is overriden on VMS to convert from VMS filenames to Unix filenames." (defun ada-set-default-project-file (name &optional keep-existing) "Set the file whose name is NAME as the default project file. If KEEP-EXISTING is true and a project file has already been loaded, nothing -is done. This is meant to be used from ada-mode-hook, for instance to force +is done. This is meant to be used from `ada-mode-hook', for instance, to force a project file unless the user has already loaded one." (interactive "fProject file:") (if (or (not keep-existing) @@ -608,7 +606,7 @@ a project file unless the user has already loaded one." If NO-USER-QUESTION is non-nil, use a default file if not project file was found, and do not ask the user. If the buffer is not an Ada buffer, associate it with the default project -file. If none is set, return nil." +file. If none is set, return nil." (let (selected) @@ -711,7 +709,7 @@ The current buffer should be the ada-file buffer." (ada-xref-set-default-prj-values 'project (current-buffer)) ;; Do not use find-file below, since we don't want to show this - ;; buffer. If the file is open through speedbar, we can't use + ;; buffer. If the file is open through speedbar, we can't use ;; find-file anyway, since the speedbar frame is special and does not ;; allow the selection of a file in it. @@ -786,7 +784,7 @@ The current buffer should be the ada-file buffer." ;; Else the file wasn't readable (probably the default project). ;; We initialize it with the current environment variables. ;; We need to add the startup directory in front so that - ;; files locally redefined are properly found. We cannot + ;; files locally redefined are properly found. We cannot ;; add ".", which varies too much depending on what the ;; current buffer is. (set 'project @@ -836,7 +834,7 @@ The current buffer should be the ada-file buffer." ;; No prj file ? => Setup default values ;; Note that nil means that all compilation modes will first look in the - ;; current directory, and only then in the current file's directory. This + ;; current directory, and only then in the current file's directory. This ;; current file is assumed at this point to be in the common source ;; directory. (setq compilation-search-path (list nil default-directory)) @@ -846,10 +844,9 @@ The current buffer should be the ada-file buffer." (defun ada-find-references (&optional pos arg local-only) "Find all references to the entity under POS. Calls gnatfind to find the references. -if ARG is t, the contents of the old *gnatfind* buffer is preserved. -if LOCAL-ONLY is t, only the declarations in the current file are returned." - (interactive "d -P") +If ARG is t, the contents of the old *gnatfind* buffer is preserved. +If LOCAL-ONLY is t, only the declarations in the current file are returned." + (interactive "d\nP") (ada-require-project-file) (let* ((identlist (ada-read-identifier pos)) @@ -872,24 +869,23 @@ P") (defun ada-find-local-references (&optional pos arg) "Find all references to the entity under POS. -Calls gnatfind to find the references. -if ARG is t, the contents of the old *gnatfind* buffer is preserved." - (interactive "d -P") +Calls `gnatfind' to find the references. +If ARG is t, the contents of the old *gnatfind* buffer is preserved." + (interactive "d\nP") (ada-find-references pos arg t)) (defun ada-find-any-references (entity &optional file line column local-only append) "Search for references to any entity whose name is ENTITY. ENTITY was first found the location given by FILE, LINE and COLUMN. -If LOCAL-ONLY is t, then only the references in file will be listed, which +If LOCAL-ONLY is t, then list only the references in FILE, which is much faster. -If APPEND is t, then the output of the command will be append to the existing -buffer *gnatfind* if it exists." +If APPEND is t, then append the output of the command to the existing +buffer `*gnatfind*', if there is one." (interactive "sEntity name: ") (ada-require-project-file) - ;; Prepare the gnatfind command. Note that we must protect the quotes + ;; Prepare the gnatfind command. Note that we must protect the quotes ;; around operators, so that they are correctly handled and can be ;; processed (gnatfind \"+\":...). (let* ((quote-entity @@ -921,7 +917,8 @@ buffer *gnatfind* if it exists." (set-buffer "*gnatfind*") (setq old-contents (buffer-string)))) - (compile-internal command "No more references" "gnatfind") + (let ((compilation-error "reference")) + (compilation-start command)) ;; Hide the "Compilation" menu (save-excursion @@ -941,8 +938,8 @@ buffer *gnatfind* if it exists." ;; ----- Identifier Completion -------------------------------------------- (defun ada-complete-identifier (pos) "Tries to complete the identifier around POS. -The feature is only available if the files where compiled not using the -gnatx -option." +The feature is only available if the files where compiled without +the option `-gnatx'." (interactive "d") (ada-require-project-file) @@ -1026,12 +1023,12 @@ If OTHER-FRAME is non-nil, display the cross-reference in another frame." ;; entity, whose references are not given by GNAT (if (and (file-exists-p ali-file) (file-newer-than-file-p ali-file (ada-file-of identlist))) - (message "No cross-reference found. It might be a predefined entity.") + (message "No cross-reference found--may be a predefined entity.") ;; Else, look in every ALI file, except if the user doesn't want that (if ada-xref-search-with-egrep (ada-find-in-src-path identlist other-frame) - (message "Cross-referencing information is not up-to-date. Please recompile.") + (message "Cross-referencing information is not up-to-date; please recompile.") ))))))) (defun ada-goto-declaration-other-frame (pos) @@ -1052,12 +1049,13 @@ The declation is shown in another frame if `ada-xref-other-buffer' is non-nil." (defun ada-get-absolute-dir-list (dir-list root-dir) "Returns the list of absolute directories found in dir-list. -If a directory is a relative directory, the value of ROOT-DIR is added in -front." +If a directory is a relative directory, add the value of ROOT-DIR in front." (mapcar (lambda (x) (expand-file-name x root-dir)) dir-list)) (defun ada-set-environment () - "Return the new value for process-environment. + "Prepare an environment for Ada compilation. +This returns a new value to use for `process-environment', +but does not actually put it into use. It modifies the source path and object path with the values found in the project file." (let ((include (getenv "ADA_INCLUDE_PATH")) @@ -1082,7 +1080,7 @@ project file." process-environment)))) (defun ada-compile-application (&optional arg) - "Compiles the application, using the command found in the project file. + "Compile the application, using the command found in the project file. If ARG is not nil, ask for user confirmation." (interactive "P") (ada-require-project-file) @@ -1104,7 +1102,7 @@ If ARG is not nil, ask for user confirmation." (setq cmd (read-from-minibuffer "enter command to compile: " cmd))) ;; Insert newlines so as to separate the name of the commands to run - ;; and the output of the commands. this doesn't work with cmdproxy.exe, + ;; and the output of the commands. This doesn't work with cmdproxy.exe, ;; which gets confused by newline characters. (if (not (string-match ".exe" shell-file-name)) (setq cmd (concat cmd "\n\n"))) @@ -1137,7 +1135,7 @@ command, and should be either comp_cmd (default) or check_cmd." (setq cmd (read-from-minibuffer "enter command to compile: " cmd))) ;; Insert newlines so as to separate the name of the commands to run - ;; and the output of the commands. this doesn't work with cmdproxy.exe, + ;; and the output of the commands. This doesn't work with cmdproxy.exe, ;; which gets confused by newline characters. (if (not (string-match ".exe" shell-file-name)) (setq cmd (concat cmd "\n\n"))) @@ -1152,7 +1150,7 @@ If ARG is not nil, ask for user confirmation of the command." (defun ada-run-application (&optional arg) "Run the application. -if ARG is not-nil, asks for user confirmation." +if ARG is not-nil, ask for user confirmation." (interactive) (ada-require-project-file) @@ -1227,7 +1225,7 @@ If ARG is non-nil, ask the user to confirm the command." ;; We make sure that gvd swallows the new frame, not the one the ;; user has been using until now ;; The frame is made invisible initially, so that GtkPlug gets a - ;; chance to fully manage it. Then it works fine with Enlightenment + ;; chance to fully manage it. Then it works fine with Enlightenment ;; as well (let ((frame (make-frame '((visibility . nil))))) (set 'cmd (concat @@ -1297,7 +1295,7 @@ If ARG is non-nil, ask the user to confirm the command." (end-of-buffer) ;; Display both the source window and the debugger window (the former - ;; above the latter). No need to show the debugger window unless it + ;; above the latter). No need to show the debugger window unless it ;; is going to have some relevant information. (if (or (not (string-match "gvd" (comint-arguments cmd 0 0))) (string-match "--tty" cmd)) @@ -1328,8 +1326,8 @@ automatically modifies the setup for all the Ada buffer that use this file." "Update the cross-references for FILE. This in fact recompiles FILE to create ALI-FILE-NAME. This function returns the name of the file that was recompiled to generate -the cross-reference information. Note that the ali file can then be deduced by -replacing the file extension with .ali" +the cross-reference information. Note that the ali file can then be deduced by +replacing the file extension with `.ali'." ;; kill old buffer (if (and ali-file-name (get-file-buffer ali-file-name)) @@ -1338,7 +1336,7 @@ replacing the file extension with .ali" (let* ((name (ada-convert-file-name file)) (body-name (or (ada-get-body-name name) name))) - ;; Always recompile the body when we can. We thus temporarily switch to a + ;; Always recompile the body when we can. We thus temporarily switch to a ;; buffer than contains the body of the unit (save-excursion (let ((body-visible (find-buffer-visiting body-name)) @@ -1347,7 +1345,7 @@ replacing the file extension with .ali" (set-buffer body-visible) (find-file body-name)) - ;; Execute the compilation. Note that we must wait for the end of the + ;; Execute the compilation. Note that we must wait for the end of the ;; process, or the ALI file would still not be available. ;; Unfortunately, the underlying `compile' command that we use is ;; asynchronous. @@ -1377,13 +1375,13 @@ replacing the file extension with .ali" found)) (defun ada-find-ali-file-in-dir (file) - "Find an .ali file in obj_dir. The current buffer must be the Ada file. + "Find an .ali file in obj_dir. The current buffer must be the Ada file. Adds build_dir in front of the search path to conform to gnatmake's behavior, and the standard runtime location at the end." (ada-find-file-in-dir file (ada-xref-get-obj-dir-field))) (defun ada-find-src-file-in-dir (file) - "Find a source file in src_dir. The current buffer must be the Ada file. + "Find a source file in src_dir. The current buffer must be the Ada file. Adds src_dir in front of the search path to conform to gnatmake's behavior, and the standard runtime location at the end." (ada-find-file-in-dir file (ada-xref-get-src-dir-field))) @@ -1400,7 +1398,7 @@ the project file." ;; and look for this file ;; 2- If this file is found: ;; grep the "^U" lines, and make sure we are not reading the - ;; .ali file for a spec file. If we are, go to step 3. + ;; .ali file for a spec file. If we are, go to step 3. ;; 3- If the file is not found or step 2 failed: ;; find the name of the "other file", ie the body, and look ;; for its associated .ali file by subtituing the extension @@ -1408,9 +1406,9 @@ the project file." ;; We must also handle the case of separate packages and subprograms: ;; 4- If no ali file was found, we try to modify the file name by removing ;; everything after the last '-' or '.' character, so as to get the - ;; ali file for the parent unit. If we found an ali file, we check that + ;; ali file for the parent unit. If we found an ali file, we check that ;; it indeed contains the definition for the separate entity by checking - ;; the 'D' lines. This is done repeatedly, in case the direct parent is + ;; the 'D' lines. This is done repeatedly, in case the direct parent is ;; also a separate. (save-excursion @@ -1423,7 +1421,7 @@ the project file." ;; If we have a non-standard file name, and this is a spec, we first ;; look for the .ali file of the body, since this is the one that - ;; contains the most complete information. If not found, we will do what + ;; contains the most complete information. If not found, we will do what ;; we can with the .ali file for the spec... (if (not (string= (file-name-extension file) "ads")) @@ -1476,8 +1474,8 @@ the project file." ;; If still not found, try to recompile the file (if (not ali-file-name) - ;; recompile only if the user asked for this. and search the ali - ;; filename again. We avoid a possible infinite recursion by + ;; Recompile only if the user asked for this, and search the ali + ;; filename again. We avoid a possible infinite recursion by ;; temporarily disabling the automatic compilation. (if ada-xref-create-ali @@ -1485,7 +1483,7 @@ the project file." (concat (file-name-sans-extension (ada-xref-current file)) ".ali")) - (error "Ali file not found. Recompile your file")) + (error "`.ali' file not found; recompile your source file")) ;; same if the .ali file is too old and we must recompile it @@ -1499,7 +1497,7 @@ the project file." (defun ada-get-ada-file-name (file original-file) "Create the complete file name (+directory) for FILE. -The original file (where the user was) is ORIGINAL-FILE. Search in project +The original file (where the user was) is ORIGINAL-FILE. Search in project file for possible paths." (save-excursion @@ -1519,7 +1517,7 @@ file for possible paths." (expand-file-name filename) (error (concat (file-name-nondirectory file) - " not found in src_dir. Please check your project file"))) + " not found in src_dir; please check your project file"))) ))) @@ -1671,13 +1669,13 @@ from the ali file (definition file and places where it is referenced)." (set 'declaration-found nil)))) ;; Still no success ! The ali file must be too old, and we need to - ;; use a basic algorithm based on guesses. Note that this only happens + ;; use a basic algorithm based on guesses. Note that this only happens ;; if the user does not want us to automatically recompile files ;; automatically (unless declaration-found (if (ada-xref-find-in-modified-ali identlist) (set 'declaration-found t) - ;; no more idea to find the declaration. Give up + ;; No more idea to find the declaration. Give up (progn (kill-buffer ali-buffer) (error (concat "No declaration of " (ada-name-of identlist) @@ -1911,7 +1909,7 @@ is using." (save-excursion - ;; Do the grep in all the directories. We do multiple shell + ;; Do the grep in all the directories. We do multiple shell ;; commands instead of one in case there is no .ali file in one ;; of the directory and the shell stops because of that. @@ -2011,7 +2009,7 @@ is using." (file line column identlist &optional other-frame) "Select and display FILE, at LINE and COLUMN. If we do not end on the same identifier as IDENTLIST, find the closest -match. Kills the .ali buffer at the end. +match. Kills the .ali buffer at the end. If OTHER-FRAME is non-nil, creates a new frame to show the file." (let (declaration-buffer) @@ -2178,7 +2176,7 @@ This function typically is to be hooked into `ff-file-created-hooks'." (unless (buffer-file-name (car (buffer-list))) (set-buffer (cadr (buffer-list)))) - ;; Make sure we have a project file (for parameters to gnatstub). Note that + ;; Make sure we have a project file (for parameters to gnatstub). Note that ;; this might have already been done if we have been called from the hook, ;; but this is not an expensive call) (ada-require-project-file) @@ -2240,9 +2238,9 @@ find-file...." ;; Use gvd or ddd as the default debugger if it was found ;; On windows, do not use the --tty switch for GVD, since this is -;; not supported. Actually, we do not use this on Unix either, since otherwise -;; there is no console window left in GVD, and people have to use the -;; Emacs one. +;; not supported. Actually, we do not use this on Unix either, +;; since otherwise there is no console window left in GVD, +;; and people have to use the Emacs one. ;; This must be done before initializing the Ada menu. (if (ada-find-file-in-dir "gvd" exec-path) (set 'ada-prj-default-debugger "gvd ") From 5106fd70821119dec999a8215c36c670d3e15689 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 17:15:55 +0000 Subject: [PATCH 220/341] (flyspell-word): Use set-process-query-on-exit-flag. (flyspell-highlight-duplicate-region): Take POSS as arg. (flyspell-word): Pass POSS as arg. --- lisp/textmodes/flyspell.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 5238e131ab6..43671f0f725 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -1011,8 +1011,7 @@ Mostly we check word delimiters." (concat "^" word "\n")) ;; we mark the ispell process so it can be killed ;; when emacs is exited without query - (if (fboundp 'process-kill-without-query) - (process-kill-without-query ispell-process)) + (set-process-query-on-exit-flag ispell-process nil) ;; wait until ispell has processed word (while (progn (accept-process-output ispell-process) @@ -1065,7 +1064,7 @@ Mostly we check word delimiters." flyspell-duplicate-distance) t))))) (if flyspell-highlight-flag - (flyspell-highlight-duplicate-region start end) + (flyspell-highlight-duplicate-region start end poss) (message (format "duplicate `%s'" word)))) (t ;; incorrect highlight the location @@ -1540,8 +1539,9 @@ for the overlay." ;*---------------------------------------------------------------------*/ ;* flyspell-highlight-duplicate-region ... */ ;*---------------------------------------------------------------------*/ -(defun flyspell-highlight-duplicate-region (beg end) - "Set up an overlay on a duplicated word, in the buffer from BEG to END." +(defun flyspell-highlight-duplicate-region (beg end poss) + "Set up an overlay on a duplicated word, in the buffer from BEG to END. +??? What does POSS mean?" (let ((inhibit-read-only t)) (unless (run-hook-with-args-until-success 'flyspell-incorrect-hook beg end poss) @@ -1947,7 +1947,6 @@ The word checked is the word at the mouse position." mouse-pos (set-mouse-position (car mouse-pos) (/ (frame-width) 2) 2) - (unfocus-frame) (mouse-position)))) (setq event (list (list (car (cdr mouse-pos)) (1+ (cdr (cdr mouse-pos)))) From e0dbfecc414a5856e7855b2803f145ba5fe6c74a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 17:41:15 +0000 Subject: [PATCH 221/341] (Major Mode Conventions): Discuss rebinding of standard key bindings. --- lispref/modes.texi | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/lispref/modes.texi b/lispref/modes.texi index 040c229bb00..78b8fc440d7 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi @@ -188,16 +188,24 @@ The key sequences bound in a major mode keymap should usually start with characters are reserved for minor modes, and ordinary letters are reserved for users. -It is reasonable for a major mode to rebind a key sequence with a -standard meaning, if it implements a command that does ``the same job'' -in a way that fits the major mode better. For example, a major mode for -editing a programming language might redefine @kbd{C-M-a} to ``move to -the beginning of a function'' in a way that works better for that -language. +A major mode can also rebind the keys @kbd{M-n}, @kbd{M-p} and +@kbd{M-s}. The bindings for @kbd{M-n} and @kbd{M-p} should normally +be some kind of ``moving forward and backward,'' but this does not +necessarily mean cursor motion. -Major modes such as Dired or Rmail that do not allow self-insertion of -text can reasonably redefine letters and other printing characters as -editing commands. Dired and Rmail both do this. +It is legitimate for a major mode to rebind a standard key sequence if +it provides a command that does ``the same job'' in a way better +suited to the text this mode is used for. For example, a major mode +for editing a programming language might redefine @kbd{C-M-a} to +``move to the beginning of a function'' in a way that works better for +that language. + +It is also legitimate for a major mode to rebind a standard key +sequence whose standard meaning is rarely useful in that mode. For +instance, minibuffer modes rebind @kbd{M-r}, whose standard meaning is +rarely of any use in the minibuffer. Major modes such as Dired or +Rmail that do not allow self-insertion of text can reasonably redefine +letters and other printing characters as special commands. @item Major modes must not define @key{RET} to do anything other than insert From 6320244170e24dd3b1978d7e83f23db9c6071521 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 17:43:26 +0000 Subject: [PATCH 222/341] (Fbyte_code) : Cannot GC. --- src/bytecode.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/bytecode.c b/src/bytecode.c index a13ecc19770..0d3be49877c 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -855,10 +855,7 @@ If the third argument is incorrect, Emacs may crash. */) } case Bunwind_protect: - /* The function record_unwind_protect can GC. */ - BEFORE_POTENTIAL_GC (); record_unwind_protect (Fprogn, POP); - AFTER_POTENTIAL_GC (); break; case Bcondition_case: From f1c206fcfb5a6b1b63d469c7dcf385a5d08621a2 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 17:45:36 +0000 Subject: [PATCH 223/341] (process_send_signal) [SIGNALS_VIA_CHARACTERS, HAVE_TERMIOS]: If there's no char for this signal, drop through and use system calls. --- src/process.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/process.c b/src/process.c index 21ab46f0d85..d20290813e1 100644 --- a/src/process.c +++ b/src/process.c @@ -5578,8 +5578,12 @@ process_send_signal (process, signo, current_group, nomsg) } if (sig_char && *sig_char != CDISABLE) - send_process (proc, sig_char, 1, Qnil); - return; + { + send_process (proc, sig_char, 1, Qnil); + return; + } + /* If we can't send the signal with a character, + fall through and send it another way. */ #else /* ! HAVE_TERMIOS */ /* On Berkeley descendants, the following IOCTL's retrieve the @@ -5636,9 +5640,12 @@ process_send_signal (process, signo, current_group, nomsg) you'd better be using one of the alternatives above! */ #endif /* ! defined (TCGETA) */ #endif /* ! defined (TIOCGLTC) && defined (TIOCGETC) */ -#endif /* ! defined HAVE_TERMIOS */ + /* In this case, the code above should alway returns. */ abort (); - /* The code above always returns from the function. */ +#endif /* ! defined HAVE_TERMIOS */ + + /* The code above may fall through if it can't + handle the signal. */ #endif /* defined (SIGNALS_VIA_CHARACTERS) */ #ifdef TIOCGPGRP From 2ee3b79e47ac5afd833dd77decf3173748ca05ee Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 Aug 2004 17:46:31 +0000 Subject: [PATCH 224/341] *** empty log message *** --- etc/NEWS | 2 ++ lisp/ChangeLog | 37 +++++++++++++++++++++++++++++++++++++ lispref/ChangeLog | 5 +++++ src/ChangeLog | 8 ++++++++ 4 files changed, 52 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index feccd6589a5..932cf3d3fa8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -98,6 +98,8 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types. * Changes in Emacs 21.4 +** global-whitespace-mode is a new alias for whitespace-global-mode. + +++ ** There are now two new regular expression operators, \_< and \_>, for matching the beginning and end of a symbol. A symbol is a diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bd9c9cd7d2f..e70a3fd3fa3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,40 @@ +2004-08-22 Richard M. Stallman + + * textmodes/flyspell.el (flyspell-word): Use + set-process-query-on-exit-flag. + (flyspell-highlight-duplicate-region): Take POSS as arg. + (flyspell-word): Pass POSS as arg. + + * progmodes/ada-xref.el: Many doc and style fixes. + (ada-find-any-references): Use compilation-start. + (ada-get-ali-file-name): Improve error msg. + (ada-get-ada-file-name): Likewise. + + * net/ange-ftp.el (ange-ftp-gwp-start, ange-ftp-nslookup-host) + (ange-ftp-start-process): Use set-process-query-on-exit-flag. + + * mail/mail-extr.el (mail-extr-all-top-level-domains): + Add forward defvar. + + * whitespace.el (global-whitespace-mode): New alias + for whitespace-global-mode. + + * speedbar.el (speedbar-file-regexp): Definition moved up. + (speedbar-mode, speedbar-set-mode-line-format): + Use with-no-warnings. + (speedbar-emacs-popup-kludge): Delete Emacs 19 alternative. + + * simple.el (shell-command-on-region): New arg DISPLAY-ERROR-BUFFER + controls whether to display the error buffer. + + * ps-mule.el: Delete compatibility code for old Emacses. + (ps-mule-find-wrappoint): Don't use chars-in-region. + + * frame.el (display-mouse-p, display-selections-p): + Use with-no-warnings. + + * font-lock.el (font-lock-set-defaults): Use with-no-warnings. + 2004-08-22 David Kastrup * textmodes/reftex-auc.el, progmodes/meta-mode.el: Update AUCTeX diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 4a2314b58dd..894d78646d1 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +2004-08-22 Richard M. Stallman + + * modes.texi (Major Mode Conventions): Discuss rebinding of + standard key bindings. + 2004-08-18 Kim F. Storm * processes.texi (Accepting Output): Add `just-this-one' arg to diff --git a/src/ChangeLog b/src/ChangeLog index dcd16f17f07..cbf06bc480f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2004-08-22 Richard M. Stallman + + * process.c (process_send_signal) [SIGNALS_VIA_CHARACTERS, + HAVE_TERMIOS]: If there's no char for this signal, drop through + and use system calls. + + * bytecode.c (Fbyte_code) : Cannot GC. + 2004-08-20 Kim F. Storm * process.c (wait_reading_process_output): Rename from From 49eac10f921716d0cac034c977731fddd115388a Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 22 Aug 2004 21:11:43 +0000 Subject: [PATCH 225/341] (speedbar-file-regexp): Give it a phony defvar before and a real defvar after `speedbar-supported-extension-expressions'. This is to silence the compiler without breaking bootstrapping. --- lisp/ChangeLog | 11 +++++++++-- lisp/speedbar.el | 14 ++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e70a3fd3fa3..a0dcde78786 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2004-08-22 Luc Teirlinck + + * speedbar.el (speedbar-file-regexp): Give it a phony defvar + before and a real defvar after + `speedbar-supported-extension-expressions'. This is to silence + the compiler without breaking bootstrapping. + 2004-08-22 Richard M. Stallman * textmodes/flyspell.el (flyspell-word): Use @@ -30,9 +37,9 @@ * ps-mule.el: Delete compatibility code for old Emacses. (ps-mule-find-wrappoint): Don't use chars-in-region. - * frame.el (display-mouse-p, display-selections-p): + * frame.el (display-mouse-p, display-selections-p): Use with-no-warnings. - + * font-lock.el (font-lock-set-defaults): Use with-no-warnings. 2004-08-22 David Kastrup diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 524a6d4f2f8..1a222e6004e 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -665,12 +665,8 @@ useful, such as version control." "*Regexp matching files we don't want displayed in a speedbar buffer. It is generated from the variable `completion-ignored-extensions'") -;; This can't be further down, since it is needed just after. -(defvar speedbar-file-regexp - (speedbar-extension-list-to-regex speedbar-supported-extension-expressions) - "Regular expression matching files we know how to expand. -Created from `speedbar-supported-extension-expression' with the -function `speedbar-extension-list-to-regex'") +;; Ugly compiler silencing trick. The real defvar comes later in this file. +(defvar speedbar-file-regexp) ;; this is dangerous to customize, because the defaults will probably ;; change in the future. @@ -698,6 +694,12 @@ file." (setq speedbar-supported-extension-expressions val speedbar-file-regexp (speedbar-extension-list-to-regex val)))) +(defvar speedbar-file-regexp + (speedbar-extension-list-to-regex speedbar-supported-extension-expressions) + "Regular expression matching files we know how to expand. +Created from `speedbar-supported-extension-expression' with the +function `speedbar-extension-list-to-regex'") + (defcustom speedbar-scan-subdirs nil "*Non-nil means speedbar will check if subdirs are empty. That way you don't have to click on them to find out. But this From 1dec4064bba6f202c75f6740b51d6ff583ea89dc Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sun, 22 Aug 2004 23:57:14 +0000 Subject: [PATCH 226/341] (Keyboard Macro Counter, Keyboard Macro Step-Edit): Change section names. --- man/ChangeLog | 5 +++++ man/kmacro.texi | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 5c0926de48a..90106818d5c 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2004-08-22 Luc Teirlinck + + * kmacro.texi (Keyboard Macro Counter, Keyboard Macro Step-Edit): + Change section names. + 2004-08-22 David Kastrup * reftex.texi (AUCTeX): Update links, section name. diff --git a/man/kmacro.texi b/man/kmacro.texi index a0b3a249bbd..d3c24873cd0 100644 --- a/man/kmacro.texi +++ b/man/kmacro.texi @@ -261,7 +261,7 @@ the macro ring. executes the previous (rather than the head) element on the macro ring. @node Keyboard Macro Counter -@section Inserting incrementing numbers in macros +@section The Keyboard Macro Counter Each keyboard macro has an associated counter which is automatically incremented on every repetition of the keyboard macro. Normally, the @@ -449,7 +449,7 @@ keyboard input that you would use to invoke the macro---@kbd{C-x e} or @kbd{C-x C-k l} (@code{kmacro-edit-lossage}). @node Keyboard Macro Step-Edit -@section Interactively executing and editing a keyboard macro +@section Stepwise Editing a Keyboard Macro @findex kmacro-step-edit-macro @kindex C-x C-k SPC From b88892ef442f8950e9e069cd3265c247e2c63716 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 23 Aug 2004 13:13:19 +0000 Subject: [PATCH 227/341] Minor comment change. --- lisp/speedbar.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 1a222e6004e..db16f2f78f3 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -665,7 +665,7 @@ useful, such as version control." "*Regexp matching files we don't want displayed in a speedbar buffer. It is generated from the variable `completion-ignored-extensions'") -;; Ugly compiler silencing trick. The real defvar comes later in this file. +;; Compiler silencing trick. The real defvar comes later in this file. (defvar speedbar-file-regexp) ;; this is dangerous to customize, because the defaults will probably From f9d1f3be2fa27740b99e2237e2bec8860210e7c5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 23 Aug 2004 18:23:52 +0000 Subject: [PATCH 228/341] (vc-svn-diff): Treat options from vc-svn-diff-switches and vc-diff-switches differently. --- lisp/vc-svn.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index 82c09cbd435..fafb5eff7cd 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el @@ -1,6 +1,7 @@ ;;; vc-svn.el --- non-resident support for Subversion version-control -;; Copyright (C) 1995,98,99,2000,2001,02,2003 Free Software Foundation, Inc. +;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +;; Free Software Foundation, Inc. ;; Author: FSF (see vc.el for full credits) ;; Maintainer: Stefan Monnier @@ -363,7 +364,10 @@ The changes are between FIRST-VERSION and SECOND-VERSION." (append (vc-switches nil 'diff) '("/dev/null"))) ;; Even if it's empty, it's locally modified. 1) - (let* ((switches (vc-switches 'SVN 'diff)) + (let* ((switches + (if vc-svn-diff-switches + (vc-switches 'SVN 'diff) + (list "-x" (mapconcat 'identity (vc-switches nil 'diff) " ")))) (async (and (vc-stay-local-p file) (or oldvers newvers) ; Svn diffs those locally. (fboundp 'start-process)))) @@ -371,8 +375,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." (if async 'async 0) file "diff" (append - (when switches - (list "-x" (mapconcat 'identity switches " "))) + switches (when oldvers (list "-r" (if newvers (concat oldvers ":" newvers) oldvers))))) @@ -504,5 +507,5 @@ essential information." (provide 'vc-svn) -;;; arch-tag: 02f10c68-2b4d-453a-90fc-1eee6cfb268d +;; arch-tag: 02f10c68-2b4d-453a-90fc-1eee6cfb268d ;;; vc-svn.el ends here From 5485e3ecfb39b927f323e7cce5e9b52b48a9e069 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Tue, 24 Aug 2004 03:43:17 +0000 Subject: [PATCH 229/341] (Regexps): Correct cryptic @ref. (Configuring Scrolling): Correct invalid @xref. (Regexp Replace): Standardize reference to hardcopy Elisp Manual in @pxref. --- man/search.texi | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/man/search.texi b/man/search.texi index c31bc60af62..a0c64275de0 100644 --- a/man/search.texi +++ b/man/search.texi @@ -434,7 +434,7 @@ Search}. This manual describes regular expression features that users typically want to use. There are additional features that are mainly used in Lisp programs; see @ref{Regular Expressions,,, -elisp, the same manual}. +elisp, The Emacs Lisp Reference Manual}. Regular expressions have a syntax in which a few characters are special constructs and the rest are @dfn{ordinary}. An ordinary @@ -921,7 +921,8 @@ The buffer contents. @item The selected window and selected frame. @item -The current match-data @xref{Match Data,,,elisp}. +The current match-data. @xref{Match Data,,, elisp, The Emacs Lisp +Reference Manual}. @end enumerate Additionally, the command must not delete the current window and must @@ -930,7 +931,7 @@ window's size, or create or delete other windows and frames. Note that an attempt by a command to scroll the text @emph{horizontally} won't work, although it will do no harm---any such -scrolling will be overriden and nullified by the display code. +scrolling will be overridden and nullified by the display code. @node Replace, Other Repeating Search, Configuring Scrolling, Search @section Replacement Commands @@ -1063,7 +1064,7 @@ M-x replace-regexp @key{RET} \(x\)\|y @key{RET} @end example For computing replacement strings for @samp{\,}, the @code{format} -function is often useful (@pxref{Formatting Strings,,,elisp, GNU Emacs +function is often useful (@pxref{Formatting Strings,,, elisp, The Emacs Lisp Reference Manual}). For example, to add consecutively numbered strings like @samp{ABC00042} to columns 73 @w{to 80} (unless they are already occupied), you can use @@ -1084,7 +1085,7 @@ M-x replace-regexp @key{RET} \footnote@{ @key{RET} @end example @noindent -will add labels starting with @samp{\label@{fn:0@}} to occurences of +will add labels starting with @samp{\label@{fn:0@}} to occurrences of @samp{\footnote@{}, but letting you edit each replacement before performing it. To number the labels starting at 1, use @samp{\,(1+ \#)} instead of @samp{\#}. From 09139bc51ac3948a89346dc209b00d02fdfd17af Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Tue, 24 Aug 2004 03:45:41 +0000 Subject: [PATCH 230/341] (Font Lock): Correct invalid @xref. --- man/ChangeLog | 9 +++++++++ man/display.texi | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/man/ChangeLog b/man/ChangeLog index 90106818d5c..72024ae917a 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,12 @@ +2004-08-23 Luc Teirlinck + + * display.texi (Font Lock): Correct invalid @xref. + + * search.texi (Regexps): Correct cryptic @ref. + (Configuring Scrolling): Correct invalid @xref. + (Regexp Replace): Standardize reference to hardcopy Elisp Manual + in @pxref. + 2004-08-22 Luc Teirlinck * kmacro.texi (Keyboard Macro Counter, Keyboard Macro Step-Edit): diff --git a/man/display.texi b/man/display.texi index 2c530ec480a..b78eb8ab939 100644 --- a/man/display.texi +++ b/man/display.texi @@ -316,7 +316,8 @@ comments, use this: @findex font-lock-remove-keywords To remove keywords from the font-lock highlighting patterns, use the function @code{font-lock-remove-keywords}. @xref{Search-based -Fontification,,,elisp}, for documentation of the format of this list. +Fontification,,, elisp, The Emacs Lisp Reference Manual}, for +documentation of the format of this list. @cindex just-in-time (JIT) font-lock @cindex background syntax highlighting From 10b43ac3fd25e09cfe100497d88e1ddb9f040770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 24 Aug 2004 10:54:39 +0000 Subject: [PATCH 231/341] * xfns.c (x_window_to_frame, x_any_window_to_frame) (x_non_menubar_window_to_frame, x_menubar_window_to_frame) (x_top_window_to_frame): Return 0 if wdesc is None. --- src/ChangeLog | 6 ++++++ src/xfns.c | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index cbf06bc480f..35731460a70 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-08-24 Jan Dj,Ad(Brv + + * xfns.c (x_window_to_frame, x_any_window_to_frame) + (x_non_menubar_window_to_frame, x_menubar_window_to_frame) + (x_top_window_to_frame): Return 0 if wdesc is None. + 2004-08-22 Richard M. Stallman * process.c (process_send_signal) [SIGNALS_VIA_CHARACTERS, diff --git a/src/xfns.c b/src/xfns.c index 3f484f3935a..8368e62a445 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -281,6 +281,8 @@ x_window_to_frame (dpyinfo, wdesc) Lisp_Object tail, frame; struct frame *f; + if (wdesc == None) return 0; + for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) { frame = XCAR (tail); @@ -330,6 +332,8 @@ x_any_window_to_frame (dpyinfo, wdesc) struct frame *f, *found; struct x_output *x; + if (wdesc == None) return NULL; + found = NULL; for (tail = Vframe_list; GC_CONSP (tail) && !found; tail = XCDR (tail)) { @@ -384,6 +388,8 @@ x_non_menubar_window_to_frame (dpyinfo, wdesc) struct frame *f; struct x_output *x; + if (wdesc == None) return 0; + for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) { frame = XCAR (tail); @@ -430,6 +436,8 @@ x_menubar_window_to_frame (dpyinfo, wdesc) struct frame *f; struct x_output *x; + if (wdesc == None) return 0; + for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) { frame = XCAR (tail); @@ -475,6 +483,8 @@ x_top_window_to_frame (dpyinfo, wdesc) struct frame *f; struct x_output *x; + if (wdesc == None) return 0; + for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) { frame = XCAR (tail); From 2728b5d02c0686c40c49aebd00f7d5520b371aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 24 Aug 2004 17:22:33 +0000 Subject: [PATCH 232/341] * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed. --- src/ChangeLog | 2 ++ src/xterm.c | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 35731460a70..d49514b2fc0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2004-08-24 Jan Dj,Ad(Brv + * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed. + * xfns.c (x_window_to_frame, x_any_window_to_frame) (x_non_menubar_window_to_frame, x_menubar_window_to_frame) (x_top_window_to_frame): Return 0 if wdesc is None. diff --git a/src/xterm.c b/src/xterm.c index 5e6a236c4be..c1bfd11985e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7604,11 +7604,13 @@ static Lisp_Object x_catch_errors_unwind (old_val) Lisp_Object old_val; { - Lisp_Object first; + Lisp_Object first = XCAR (old_val); + Display *dpy = XSAVE_VALUE (first)->pointer; - first = XCAR (old_val); - - XSync (XSAVE_VALUE (first)->pointer, False); + /* The display may have been closed before this function is called. + Check if it is still open before calling XSync. */ + if (x_display_info_for_display (dpy) != 0) + XSync (dpy, False); x_error_message_string = XCDR (old_val); return Qnil; From 969abb75106111728b3db3fa2a5c908831a3114b Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Tue, 24 Aug 2004 21:29:09 +0000 Subject: [PATCH 233/341] *** empty log message *** --- man/ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 72024ae917a..e5a99a7db0d 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,9 +1,9 @@ 2004-08-23 Luc Teirlinck - * display.texi (Font Lock): Correct invalid @xref. + * display.texi (Font Lock): Correct invalid (for hardcopy) @xref. - * search.texi (Regexps): Correct cryptic @ref. - (Configuring Scrolling): Correct invalid @xref. + * search.texi (Regexps): Correct cryptic (in hardcopy) @ref. + (Configuring Scrolling): Correct invalid (for hardcopy) @xref. (Regexp Replace): Standardize reference to hardcopy Elisp Manual in @pxref. From 55a88c8a6052877050ef5f3305d603986021a175 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 24 Aug 2004 22:14:46 +0000 Subject: [PATCH 234/341] *** empty log message *** --- lisp/ChangeLog | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a0dcde78786..2a0bfe55f24 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-23 Stefan Monnier + + * vc-svn.el (vc-svn-diff): Treat options from vc-svn-diff-switches and + vc-diff-switches differently. + 2004-08-22 Luc Teirlinck * speedbar.el (speedbar-file-regexp): Give it a phony defvar @@ -7,8 +12,8 @@ 2004-08-22 Richard M. Stallman - * textmodes/flyspell.el (flyspell-word): Use - set-process-query-on-exit-flag. + * textmodes/flyspell.el (flyspell-word): + Use set-process-query-on-exit-flag. (flyspell-highlight-duplicate-region): Take POSS as arg. (flyspell-word): Pass POSS as arg. @@ -51,8 +56,7 @@ 2004-08-22 Andreas Schwab - * cvs-status.el: Require pcvs during byte-compiling for - defun-cvs-mode. + * cvs-status.el: Require pcvs during byte-compiling for defun-cvs-mode. 2004-08-22 Masatake YAMATO From 1c6cfb0b0de4e888d79cb8a661ed6dfeeda97729 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 25 Aug 2004 00:22:23 +0000 Subject: [PATCH 235/341] (Non-ASCII Rebinding): Fix and simplify the description for unibyte mode. --- man/ChangeLog | 5 +++++ man/custom.texi | 12 +++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index e5a99a7db0d..7619fabe89d 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2004-08-25 Kenichi Handa + + * custom.texi (Non-ASCII Rebinding): Fix and simplify the + description for unibyte mode. + 2004-08-23 Luc Teirlinck * display.texi (Font Lock): Correct invalid (for hardcopy) @xref. diff --git a/man/custom.texi b/man/custom.texi index aa5b35dc43e..d27bc8e0ed5 100644 --- a/man/custom.texi +++ b/man/custom.texi @@ -1635,17 +1635,15 @@ The Emacs Lisp Reference Manual}.}: Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}. Since this puts a non-@acronym{ASCII} character in the @file{.emacs}, -you should specify the proper coding system for that file. @xref{Init -Syntax}. You should specify the same coding system for the file that -you use for your keyboard. +you should specify for that file a coding system that supports +that character. @xref{Init Syntax}. -@strong{Warning:} if you change the keyboard encoding, or change -from unibyte to multibyte mode, such that the code that +@strong{Warning:} if you change the keyboard encoding, such that the code that @kbd{C-q} inserts becomes different, you'll need to edit the Lisp expression accordingly. -If you bind 8-bit characters like this in your init file, you may find it -convenient to specify that it is unibyte. @xref{Enabling Multibyte}. +@strong{Warning:} @kbd{C-q} will insert the wrong code if you visit +the file @file{.emacs} in a unibyte buffer, so don't do that. @node Mouse Buttons @subsection Rebinding Mouse Buttons From eccf9613456f3573f9dc72d3dcb59f31f9f90442 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Wed, 25 Aug 2004 05:55:39 +0000 Subject: [PATCH 236/341] Upgraded to MH-E version 7.82. See etc/MH-E-NEWS and lisp/mh-e/ChangeLog for details. --- etc/ChangeLog | 4 ++++ etc/MH-E-NEWS | 6 ++++++ etc/NEWS | 2 +- lisp/mh-e/ChangeLog | 35 +++++++++++++++++++++++++++++++++++ lisp/mh-e/mh-acros.el | 13 +++++++------ lisp/mh-e/mh-customize.el | 7 +++++++ lisp/mh-e/mh-e.el | 5 +++-- lisp/mh-e/mh-init.el | 4 ++-- lisp/mh-e/mh-loaddefs.el | 28 ++++++++++++++-------------- lisp/mh-e/mh-mime.el | 4 +++- 10 files changed, 82 insertions(+), 26 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index cd7888b1a4a..48c6da4e32d 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2004-08-24 Bill Wohler + + * NEWS, MH-E-NEWS: Upgraded to MH-E version 7.82. + 2004-08-22 David Kastrup * PROBLEMS, MAILINGLISTS: Update AUCTeX information. diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS index 32b71b1d98c..a022106f563 100644 --- a/etc/MH-E-NEWS +++ b/etc/MH-E-NEWS @@ -6,6 +6,12 @@ Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +* Changes in MH-E 7.82 + +Version 7.81 continues to address the saga surrounding the use of CL +macros in CVS Emacs and fixes the auto-detection of vanilla MH (SF +#1014781). + * Changes in MH-E 7.81 Version 7.81 fixes a `wrong-type-argument' argument error that diff --git a/etc/NEWS b/etc/NEWS index 932cf3d3fa8..c10ec4531b2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -660,7 +660,7 @@ You can now put the init files .emacs and .emacs_SHELL under ** MH-E changes. -Upgraded to MH-E version 7.81. There have been major changes since +Upgraded to MH-E version 7.82. There have been major changes since version 5.0.2; see MH-E-NEWS for details. +++ diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 990291caead..dd1062da816 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,38 @@ +2004-08-21 Bill Wohler + + * Released MH-E version 7.82. + + * MH-E-NEWS, README: Updated for release 7.82. + + * mh-e.el (Version, mh-version): Updated for release 7.82. + +2004-08-24 Bill Wohler + + * mh-init.el (mh-variant-set): Changed MH to mh as that's what is + emitted by `mh-variant-mh-info' (closes SF #1014781). + (mh-variant-p): Added mu-mh to docstring. + +2004-08-23 Satyaki Das + + * mh-acros.el (mh-require-cl): Remove unneeded autoloads. + (require): Add an advice to the function so that at compile time + the uncompiled file is loaded. This avoids compilation problems + when built in the Emacs tree. + + * mh-mime.el (mh-identity-pgg-default-user-id): Defvar the + variable, to avoid compiler warnings. + + * mh-e.el (mh-seq): Load mh-seq since functions defined there are + used here. Without this, the state mh-seq.elc would be loaded. + + * mh-customize.el (mh-init, mh-identity): Load mh-init and + mh-identity at compile time manually, before the corresponding + stale elc files get autoloaded. + +2004-08-21 Bill Wohler + + * mh-e.el (Version, mh-version): Added +cvs to release number. + 2004-08-21 Bill Wohler * Released MH-E version 7.81. diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el index dd8660a8ce3..16383304503 100644 --- a/lisp/mh-e/mh-acros.el +++ b/lisp/mh-e/mh-acros.el @@ -51,12 +51,7 @@ Some versions of `cl' produce code for the expansion of \(setf (gethash ...) ...) that uses functions in `cl' at run time. This macro recognizes that and loads `cl' where appropriate." (if (eq (car (macroexpand '(setf (gethash foo bar) baz))) 'cl-puthash) - `(progn - (require 'cl) - ;; Autoloads of CL functions go here... - (autoload 'cl-puthash "cl") - (autoload 'values "cl") - (autoload 'copy-tree "cl")) + `(require 'cl) `(eval-when-compile (require 'cl)))) ;;; Macros to generate correct code for different emacs variants @@ -130,6 +125,12 @@ various structure fields. Lookup `defstruct' for more details." (list 'nth ,x z))) (quote ,struct-name)))) +(defadvice require (around mh-prefer-el activate) + "Modify `require' to load uncompiled MH-E files." + (or (featurep (ad-get-arg 0)) + (and (string-match "^mh-" (symbol-name (ad-get-arg 0))) + (load (format "%s.el" (ad-get-arg 0)) t t)) + ad-do-it)) (provide 'mh-acros) diff --git a/lisp/mh-e/mh-customize.el b/lisp/mh-e/mh-customize.el index 67a126a8327..622c457897f 100644 --- a/lisp/mh-e/mh-customize.el +++ b/lisp/mh-e/mh-customize.el @@ -78,6 +78,13 @@ (when mh-xemacs-flag (require 'mh-xemacs)) +;; XXX: Functions autoloaded from the following files are used to initialize +;; customizable variables. They are require'd here, since otherwise the +;; corresponding .elc would be loaded at compile time. +(eval-when-compile + (require 'mh-init) + (require 'mh-identity)) + (defun mh-customize (&optional delete-other-windows-flag) "Customize MH-E variables. If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 5cbb97b72d0..2081d49b6cd 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -5,7 +5,7 @@ ;; Author: Bill Wohler ;; Maintainer: Bill Wohler -;; Version: 7.81 +;; Version: 7.82 ;; Keywords: mail ;; This file is part of GNU Emacs. @@ -89,6 +89,7 @@ (require 'mh-utils) (require 'mh-init) (require 'mh-inc) +(require 'mh-seq) (require 'gnus-util) (require 'easymenu) @@ -96,7 +97,7 @@ (defvar font-lock-auto-fontify) (defvar font-lock-defaults) -(defconst mh-version "7.81" "Version number of MH-E.") +(defconst mh-version "7.82" "Version number of MH-E.") ;;; Autoloads (autoload 'Info-goto-node "info") diff --git a/lisp/mh-e/mh-init.el b/lisp/mh-e/mh-init.el index ac7305fa217..a975b882128 100644 --- a/lisp/mh-e/mh-init.el +++ b/lisp/mh-e/mh-init.el @@ -90,7 +90,7 @@ GNU mailutils." (cond ((mh-variant-set-variant 'nmh) (message "%s installed as MH variant" mh-variant-in-use)) - ((mh-variant-set-variant 'MH) + ((mh-variant-set-variant 'mh) (message "%s installed as MH variant" mh-variant-in-use)) ((mh-variant-set-variant 'mu-mh) (message "%s installed as MH variant" mh-variant-in-use)) @@ -145,7 +145,7 @@ If VARIANT is a symbol, select the first entry that matches that variant." ;;;###mh-autoload (defun mh-variant-p (&rest variants) "Return t if variant is any of VARIANTS. -Currently known variants are 'mh and 'nmh." +Currently known variants are 'MH, 'nmh, and 'mu-mh." (let ((variant-in-use (cadr (assoc 'variant (assoc mh-variant-in-use mh-variants))))) (not (null (member variant-in-use variants))))) diff --git a/lisp/mh-e/mh-loaddefs.el b/lisp/mh-e/mh-loaddefs.el index 6a88278a847..fd989ffa3b9 100644 --- a/lisp/mh-e/mh-loaddefs.el +++ b/lisp/mh-e/mh-loaddefs.el @@ -13,7 +13,7 @@ ;;;;;; mh-check-whom mh-insert-signature mh-to-fcc mh-to-field mh-fill-paragraph-function ;;;;;; mh-get-header-field mh-send-other-window mh-send mh-reply ;;;;;; mh-redistribute mh-forward mh-extract-rejected-mail mh-edit-again) -;;;;;; "mh-comp" "mh-comp.el" (16665 55172)) +;;;;;; "mh-comp" "mh-comp.el" (16665 53716)) ;;; Generated autoloads from mh-comp.el (autoload (quote mh-edit-again) "mh-comp" "\ @@ -183,7 +183,7 @@ If we are at the first header field go to the start of the message body." t nil) ;;;;;; mh-store-msg mh-undo-folder mh-sort-folder mh-page-digest-backwards ;;;;;; mh-page-digest mh-pipe-msg mh-pack-folder mh-list-folders ;;;;;; mh-kill-folder mh-copy-msg mh-burst-digest) "mh-funcs" "mh-funcs.el" -;;;;;; (16671 49652)) +;;;;;; (16671 48788)) ;;; Generated autoloads from mh-funcs.el (autoload (quote mh-burst-digest) "mh-funcs" "\ @@ -261,7 +261,7 @@ Display cheat sheet for the commands of the current prefix in minibuffer." t nil ;;;;;; mh-identity-insert-attribution-verb mh-identity-handler-attribution-verb ;;;;;; mh-identity-handler-signature mh-identity-handler-gpg-identity ;;;;;; mh-insert-identity mh-identity-list-set mh-identity-make-menu) -;;;;;; "mh-identity" "mh-identity.el" (16680 7172)) +;;;;;; "mh-identity" "mh-identity.el" (16671 57010)) ;;; Generated autoloads from mh-identity.el (autoload (quote mh-identity-make-menu) "mh-identity" "\ @@ -307,7 +307,7 @@ If the field wasn't present, the VALUE is added at the bottom of the header." ni ;;;*** ;;;### (autoloads (mh-inc-spool-list-set) "mh-inc" "mh-inc.el" (16671 -;;;;;; 49652)) +;;;;;; 48848)) ;;; Generated autoloads from mh-inc.el (autoload (quote mh-inc-spool-list-set) "mh-inc" "\ @@ -326,7 +326,7 @@ This is called after 'customize is used to alter `mh-inc-spool-list'." nil nil) ;;;;;; mh-index-parse-search-regexp mh-index-do-search mh-index-p ;;;;;; mh-index-read-data mh-index-search mh-index-create-sequences ;;;;;; mh-create-sequence-map mh-index-update-maps) "mh-index" "mh-index.el" -;;;;;; (16665 55172)) +;;;;;; (16665 53754)) ;;; Generated autoloads from mh-index.el (autoload (quote mh-index-update-maps) "mh-index" "\ @@ -582,7 +582,7 @@ system." nil nil) ;;;*** ;;;### (autoloads (mh-variants mh-variant-p mh-variant-set) "mh-init" -;;;;;; "mh-init.el" (16680 9361)) +;;;;;; "mh-init.el" (16684 6777)) ;;; Generated autoloads from mh-init.el (autoload (quote mh-variant-set) "mh-init" "\ @@ -593,7 +593,7 @@ GNU mailutils." t nil) (autoload (quote mh-variant-p) "mh-init" "\ Return t if variant is any of VARIANTS. -Currently known variants are 'mh and 'nmh." nil nil) +Currently known variants are 'MH, 'nmh, and 'mu-mh." nil nil) (autoload (quote mh-variants) "mh-init" "\ Return a list of installed variants of MH on the system. @@ -604,7 +604,7 @@ by the variable `mh-variants'." nil nil) ;;;*** ;;;### (autoloads (mh-junk-whitelist mh-junk-blacklist) "mh-junk" -;;;;;; "mh-junk.el" (16671 49652)) +;;;;;; "mh-junk.el" (16671 48929)) ;;; Generated autoloads from mh-junk.el (autoload (quote mh-junk-blacklist) "mh-junk" "\ @@ -644,7 +644,7 @@ The `mh-junk-program' option specifies the spam program in use." t nil) ;;;;;; mh-mhn-compose-external-compressed-tar mh-mhn-compose-anon-ftp ;;;;;; mh-mhn-compose-insertion mh-file-mime-type mh-have-file-command ;;;;;; mh-compose-forward mh-compose-insertion) "mh-mime" "mh-mime.el" -;;;;;; (16680 7172)) +;;;;;; (16684 7323)) ;;; Generated autoloads from mh-mime.el (autoload (quote mh-compose-insertion) "mh-mime" "\ @@ -857,7 +857,7 @@ View MIME PART-INDEX externally." t nil) ;;;*** ;;;### (autoloads (mh-do-search mh-pick-do-search mh-search-folder) -;;;;;; "mh-pick" "mh-pick.el" (16671 49652)) +;;;;;; "mh-pick" "mh-pick.el" (16671 49140)) ;;; Generated autoloads from mh-pick.el (autoload (quote mh-search-folder) "mh-pick" "\ @@ -882,7 +882,7 @@ indexing program specified in `mh-index-program' is used." t nil) ;;;### (autoloads (mh-print-msg mh-ps-print-toggle-mime mh-ps-print-toggle-color ;;;;;; mh-ps-print-toggle-faces mh-ps-print-msg-show mh-ps-print-msg-file -;;;;;; mh-ps-print-msg) "mh-print" "mh-print.el" (16680 9361)) +;;;;;; mh-ps-print-msg) "mh-print" "mh-print.el" (16680 11171)) ;;; Generated autoloads from mh-print.el (autoload (quote mh-ps-print-msg) "mh-print" "\ @@ -935,7 +935,7 @@ The messages are formatted by mhl. See the variable `mhl-formfile'." t nil) ;;;;;; mh-rename-seq mh-translate-range mh-read-range mh-read-seq-default ;;;;;; mh-notate-deleted-and-refiled mh-widen mh-put-msg-in-seq ;;;;;; mh-narrow-to-seq mh-msg-is-in-seq mh-list-sequences mh-delete-seq) -;;;;;; "mh-seq" "mh-seq.el" (16668 22297)) +;;;;;; "mh-seq" "mh-seq.el" (16671 65286)) ;;; Generated autoloads from mh-seq.el (autoload (quote mh-delete-seq) "mh-seq" "\ @@ -1157,7 +1157,7 @@ Use \\\\[mh-widen] to undo this command." t nil) ;;;### (autoloads (mh-speed-add-folder mh-speed-invalidate-map mh-speed-flists ;;;;;; mh-speed-view mh-speed-toggle mh-folder-speedbar-buttons) -;;;;;; "mh-speed" "mh-speed.el" (16665 55171)) +;;;;;; "mh-speed" "mh-speed.el" (16665 53793)) ;;; Generated autoloads from mh-speed.el (autoload (quote mh-folder-speedbar-buttons) "mh-speed" "\ @@ -1196,7 +1196,7 @@ The function invalidates the latest ancestor that is present." nil nil) ;;;;;; mh-alias-grab-from-field mh-alias-add-alias mh-alias-for-from-p ;;;;;; mh-alias-address-to-alias mh-alias-letter-expand-alias mh-alias-minibuffer-confirm-address ;;;;;; mh-read-address mh-alias-reload-maybe mh-alias-reload) "mh-alias" -;;;;;; "mh-alias.el" (16671 49553)) +;;;;;; "mh-alias.el" (16671 49382)) ;;; Generated autoloads from mh-alias.el (autoload (quote mh-alias-reload) "mh-alias" "\ diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index f952f8b80fb..72cb654dedd 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -583,6 +583,8 @@ automatically." (mml-insert-empty-tag 'part 'type type 'filename file 'disposition dispos 'description description))) +(defvar mh-identity-pgg-default-user-id) + (defun mh-secure-message (method mode &optional identity) "Add directive to Encrypt/Sign an entire message. METHOD should be one of: \"pgpmime\", \"pgp\", \"smime\". @@ -852,7 +854,7 @@ If message has been encoded for transfer take that into account." ;;;###mh-autoload (defun mh-toggle-mh-decode-mime-flag () "Toggle whether MH-E should decode MIME or not." - (interactive) + (interactive) (setq mh-decode-mime-flag (not mh-decode-mime-flag)) (mh-show nil t) (message (format "(setq mh-decode-mime-flag %s)" mh-decode-mime-flag))) From 5e4c34ce89498c4a6a84a73a65065b5d49dec9b5 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Wed, 25 Aug 2004 06:09:12 +0000 Subject: [PATCH 237/341] Fixed typo. --- etc/MH-E-NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS index a022106f563..f82bf4cb045 100644 --- a/etc/MH-E-NEWS +++ b/etc/MH-E-NEWS @@ -8,7 +8,7 @@ notice and this notice are preserved. * Changes in MH-E 7.82 -Version 7.81 continues to address the saga surrounding the use of CL +Version 7.82 continues to address the saga surrounding the use of CL macros in CVS Emacs and fixes the auto-detection of vanilla MH (SF #1014781). From e5927b52aa1a746cbf655a2973259159d9241772 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Wed, 25 Aug 2004 18:40:22 +0000 Subject: [PATCH 238/341] (ielm-tab, ielm-complete-symbol): Doc fix. (inferior-emacs-lisp-mode): Use `set-process-query-on-exit-flag'. --- lisp/ielm.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ielm.el b/lisp/ielm.el index 944e2453cb9..96969bfc878 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -198,7 +198,7 @@ This variable is buffer-local.") ;;; Completion stuff (defun ielm-tab nil - "Possibly indent the current line as lisp code." + "Possibly indent the current line as Lisp code." (interactive) (if (or (eq (preceding-char) ?\n) (eq (char-syntax (preceding-char)) ? )) @@ -207,7 +207,7 @@ This variable is buffer-local.") t))) (defun ielm-complete-symbol nil - "Complete the lisp symbol before point." + "Complete the Lisp symbol before point." ;; A wrapper for lisp-complete symbol that returns non-nil if ;; completion has occurred (let* ((btick (buffer-modified-tick)) @@ -528,7 +528,7 @@ Customized bindings may be defined in `ielm-map', which currently contains: (condition-case nil (start-process "ielm" (current-buffer) "hexl") (file-error (start-process "ielm" (current-buffer) "cat"))) - (process-kill-without-query (ielm-process)) + (set-process-query-on-exit-flag (ielm-process) nil) (goto-char (point-max)) ;; Lisp output can include raw characters that confuse comint's From 2eb43e13c1386eed86898e973dbf0355ed16ed5c Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Wed, 25 Aug 2004 18:46:04 +0000 Subject: [PATCH 239/341] *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2a0bfe55f24..16fddac9015 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-25 John Paul Wallington + + * ielm.el (ielm-tab, ielm-complete-symbol): Doc fix. + (inferior-emacs-lisp-mode): Use `set-process-query-on-exit-flag'. + 2004-08-23 Stefan Monnier * vc-svn.el (vc-svn-diff): Treat options from vc-svn-diff-switches and From 003274a0575fb52458b1915ef602c7308cdf2196 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Wed, 25 Aug 2004 19:05:24 +0000 Subject: [PATCH 240/341] (tex-validate-buffer): Distinguish between 0, 1, and many mismatches. (tex-start-shell): Use `set-process-query-on-exit-flag'. --- lisp/ChangeLog | 4 ++++ lisp/textmodes/tex-mode.el | 15 +++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 16fddac9015..a52bb001fea 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2004-08-25 John Paul Wallington + * textmodes/tex-mode.el (tex-validate-buffer): Distinguish between + 0, 1, and many mismatches in message. + (tex-start-shell): Use `set-process-query-on-exit-flag'. + * ielm.el (ielm-tab, ielm-complete-symbol): Doc fix. (inferior-emacs-lisp-mode): Use `set-process-query-on-exit-flag'. diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 28bf9f6cf28..115dd6f88f0 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1141,10 +1141,13 @@ on the line for the invalidity you want to see." 'occur-target tem))))) (goto-char prev-end)))) (with-current-buffer standard-output - (if (eq num-matches 0) - (insert "None!\n")) - (if (interactive-p) - (message "%d mismatches found" num-matches)))))) + (let ((no-matches (zerop num-matches))) + (if no-matches + (insert "None!\n")) + (if (interactive-p) + (message "%s mismatch%s found" + (if no-matches "No" num-matches) + (if (> num-matches 1) "es" "")))))))) (defun tex-validate-region (start end) "Check for mismatched braces or $'s in region. @@ -1459,7 +1462,7 @@ Mark is left at original location." nil) (let ((proc (get-process "tex-shell"))) (set-process-sentinel proc 'tex-shell-sentinel) - (process-kill-without-query proc) + (set-process-query-on-exit-flag proc nil) (tex-shell) (while (zerop (buffer-size)) (sleep-for 1))))) @@ -1928,7 +1931,7 @@ for the error messages." (re-search-forward "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move)) (let* ((this-error (copy-marker begin-of-error)) - (linenum (string-to-int (match-string 1))) + (linenum (string-to-number (match-string 1))) (error-text (regexp-quote (match-string 3))) (filename (save-excursion From 9f14953b059e16fd785c78814c23f4b2a5ea0652 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Thu, 26 Aug 2004 01:47:55 +0000 Subject: [PATCH 241/341] *** empty log message *** --- etc/NEWS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index c10ec4531b2..5995bf3dd97 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -194,6 +194,11 @@ just put point at the end of the buffer and it stays there. This rule applies to file buffers. For non-file buffers, the behavior may be mode dependent. +If you are sure that the file will only change by growing at the end, +then you can tail the file more efficiently by using the new minor +mode Auto Revert Tail mode. The function `auto-revert-tail-mode' +toggles this mode. + ** Auto Revert mode is now more careful to avoid excessive reverts and other potential problems when deciding which non-file buffers to revert. This matters especially if Global Auto Revert mode is enabled From c513d7cf44d65f6fc6f54593ed3f654cca188f88 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 26 Aug 2004 16:17:48 +0000 Subject: [PATCH 242/341] (Difference between Emacs and XEmacs): Rewrite. --- man/ChangeLog | 4 ++++ man/faq.texi | 46 +++++++++++++--------------------------------- 2 files changed, 17 insertions(+), 33 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 7619fabe89d..f3ff703a0a4 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2004-08-26 Richard M. Stallman + + * faq.texi (Difference between Emacs and XEmacs): Rewrite. + 2004-08-25 Kenichi Handa * custom.texi (Non-ASCII Rebinding): Fix and simplify the diff --git a/man/faq.texi b/man/faq.texi index c887739ca8f..2e99ec730e1 100644 --- a/man/faq.texi +++ b/man/faq.texi @@ -3586,45 +3586,25 @@ A list of sites mirroring @samp{ftp.gnu.org} can be found at @cindex Lucid Emacs @cindex Epoch -First of all, they're both GNU Emacs. XEmacs is just as much a later -version of GNU Emacs as the FSF-distributed version. This FAQ refers to -the latest version to be distributed by the FSF as ``Emacs,'' partly -because the XEmacs maintainers now refer to their product using the -``XEmacs'' name, and partly because there isn't any accurate way to -differentiate between the two without getting mired in paragraphs of -legalese and history. +XEmacs is a branch version of Emacs. It was earlier called as Lucid +Emacs, and it was based on a prerelease version of Emacs 19. In this +FAQ, we use the name ``Emacs'' only for the official version. -XEmacs, which began life as Lucid Emacs, is based on an early version of -Emacs 19 and Epoch, an X-aware version of Emacs 18. - -Emacs (i.e., the version distributed by the FSF) has a larger installed -base and now always contains the MULE multilingual facilities. -XEmacs can do some clever tricks with X and MS-Windows, such as -putting arbitrary graphics in a buffer. Similar facilities have been -implemented for Emacs as part of a new redisplay implementation for -Emacs 21, and are available in the latest Emacs releases. -Emacs and XEmacs each come with -Lisp packages that are lacking in the other; RMS says that the FSF would -include more packages that come with XEmacs, but that the XEmacs -maintainers don't always keep track of the authors of contributed code, -which makes it impossible for the FSF to have certain legal papers -signed. (Without these legal papers, the FSF will not distribute Lisp -packages with Emacs.) The two versions have some -significant differences at the Lisp programming level. +Emacs and XEmacs each come with Lisp packages that are lacking in the +other. The two versions have some significant differences at the Lisp +programming level. Many XEmacs features have found their way into recent versions of Emacs, and more features can be expected in the future, but there are still many differences between the two. -The latest stable branch of XEmacs as of this writing is 21.4; you can -get it at - -@uref{ftp://ftp.xemacs.org/pub/xemacs/xemacs-21.4/xemacs-21.4.12.tar.gz} - -More information about XEmacs, including a list of frequently asked -questions (FAQ), is available at - -@uref{http://www.xemacs.org/} +The FSF has used some of the code in XEmacs, and would like to use +other parts, but the earlier XEmacs maintainers did not always keep +track of the authors of contributed code, which makes it impossible +for the FSF to get copyright papers signed for that code. (The FSF +requires these papers for all the code included in Emacs, aside from +generic C support packages that are not integrated into the code of +Emacs proper.) @node Emacs for MS-DOS, Emacs for Windows, Difference between Emacs and XEmacs, Finding Emacs and related packages @section Where can I get Emacs for my PC running MS-DOS? From 0e48150a65b1645e0a9ea1c678dc79b782043e28 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Thu, 26 Aug 2004 18:20:52 +0000 Subject: [PATCH 243/341] (time-to-seconds): Add autoload cookies. --- lisp/ChangeLog | 4 ++++ lisp/calendar/time-date.el | 1 + 2 files changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a52bb001fea..2141bcd959f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-08-27 Masatake YAMATO + + * calendar/time-date.el (time-to-seconds): Add autoload cookies. + 2004-08-25 John Paul Wallington * textmodes/tex-mode.el (tex-validate-buffer): Distinguish between diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 846231befe6..6439089273a 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -45,6 +45,7 @@ (timezone-make-date-arpa-standard date))) (error (error "Invalid date: %s" date)))) +;;;###autoload (defun time-to-seconds (time) "Convert time value TIME to a floating point number. You can use `float-time' instead." From 6eb3ee72e0d9a53835288bbd6b53dafddea714d6 Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 26 Aug 2004 18:28:44 +0000 Subject: [PATCH 244/341] fileio.c (Fread_file_name): Call x_file_dialog on carbon on tool-bar/menu click macfns.c (Fx_file_dialog): Implemented using NavServices --- src/ChangeLog | 6 ++ src/fileio.c | 2 +- src/macfns.c | 216 +++++++++++++++++++++++++++++++++----------------- 3 files changed, 150 insertions(+), 74 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d49514b2fc0..fa1922c6255 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-08-26 Steven Tamm + + * fileio.c (Fread_file_name): Call x_file_dialog on carbon on + tool-bar/menu click + * macfns.c (Fx_file_dialog): Implemented using NavServices + 2004-08-24 Jan Dj,Ad(Brv * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed. diff --git a/src/fileio.c b/src/fileio.c index 5acfee7c02c..b9299910186 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6304,7 +6304,7 @@ and `read-file-name-function'. */) GCPRO2 (insdef, default_filename); -#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) +#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined(TARGET_API_MAC_CARBON) if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) && use_dialog_box && use_file_dialog diff --git a/src/macfns.c b/src/macfns.c index ec014e772e3..fbade05ea17 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -4192,19 +4192,27 @@ Value is t if tooltip was open, nil otherwise. */) +#ifdef TARGET_API_MAC_CARBON /*********************************************************************** File selection dialog ***********************************************************************/ -#if 0 /* MAC_TODO: can standard file dialog */ +/** + There is a relatively standard way to do this using applescript to run + a (choose file) method. However, this doesn't do "the right thing" + by working only if the find-file occurred during a menu or toolbar + click. So we must do the file dialog by hand, using the navigation + manager. This also has more flexibility in determining the default + directory and whether or not we are going to choose a file. + **/ + extern Lisp_Object Qfile_name_history; DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 4, 0, doc: /* Read file name, prompting with PROMPT in directory DIR. Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file selection box, if -specified. Don't let the user enter a file name in the file -selection dialog's entry field, if MUSTMATCH is non-nil. */) +specified. Ensure that file exists if MUSTMATCH is non-nil. */) (prompt, dir, default_filename, mustmatch) Lisp_Object prompt, dir, default_filename, mustmatch; { @@ -4212,9 +4220,8 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */) Lisp_Object file = Qnil; int count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; - char filename[MAX_PATH + 1]; - char init_dir[MAX_PATH + 1]; - int use_dialog_p = 1; + char filename[1001]; + int default_filter_index = 1; /* 1: All Files, 2: Directories only */ GCPRO5 (prompt, dir, default_filename, mustmatch, file); CHECK_STRING (prompt); @@ -4223,87 +4230,150 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */) /* Create the dialog with PROMPT as title, using DIR as initial directory and using "*" as pattern. */ dir = Fexpand_file_name (dir, Qnil); - strncpy (init_dir, SDATA (dir), MAX_PATH); - init_dir[MAX_PATH] = '\0'; - unixtodos_filename (init_dir); - if (STRINGP (default_filename)) - { - char *file_name_only; - char *full_path_name = SDATA (default_filename); + { + OSStatus status; + NavDialogCreationOptions options; + NavDialogRef dialogRef; + NavTypeListHandle fileTypes = NULL; + NavUserAction userAction; + CFStringRef message=NULL, client=NULL, saveName = NULL; + + /* No need for a callback function because we are modal */ + NavGetDefaultDialogCreationOptions(&options); + options.modality = kWindowModalityAppModal; + options.location.h = options.location.v = -1; + options.optionFlags = kNavDefaultNavDlogOptions; + options.optionFlags |= kNavAllFilesInPopup; /* All files allowed */ + options.optionFlags |= kNavSelectAllReadableItem; + if (!NILP(prompt)) + { + message = CFStringCreateWithCStringNoCopy(NULL, SDATA(prompt), + kCFStringEncodingUTF8, + kCFAllocatorNull); + options.message = message; + } + /* Don't set the application, let it use default. + client = CFStringCreateWithCStringNoCopy(NULL, "Emacs", + kCFStringEncodingMacRoman, NULL); + options.clientName = client; + */ - unixtodos_filename (full_path_name); + /* Do Dired hack copied from w32fns.c */ + if (!NILP(prompt) && strncmp (SDATA(prompt), "Dired", 5) == 0) + status = NavCreateChooseFolderDialog(&options, NULL, NULL, NULL, + &dialogRef); + else if (NILP (mustmatch)) + { + /* This is a save dialog */ + if (!NILP(default_filename)) + { + saveName = CFStringCreateWithCString(NULL, SDATA(default_filename), + kCFStringEncodingUTF8); + options.saveFileName = saveName; + options.optionFlags |= kNavSelectDefaultLocation; + } + /* MAC_TODO: Find a better way to determine if this is a save + or load dialog than comparing dir with default_filename */ + if (EQ(dir, default_filename)) + { + status = NavCreateChooseFileDialog(&options, fileTypes, + NULL, NULL, NULL, NULL, + &dialogRef); + } + else { + status = NavCreatePutFileDialog(&options, + 'TEXT', kNavGenericSignature, + NULL, NULL, &dialogRef); + } + } + else + { + /* This is an open dialog*/ + status = NavCreateChooseFileDialog(&options, fileTypes, + NULL, NULL, NULL, NULL, + &dialogRef); + } + + /* Set the default location and continue*/ + if (status == noErr) { + if (!NILP(dir)) { + FSRef defLoc; + AEDesc defLocAed; + status = FSPathMakeRef(SDATA(dir), &defLoc, NULL); + if (status == noErr) + { + AECreateDesc(typeFSRef, &defLoc, sizeof(FSRef), &defLocAed); + NavCustomControl(dialogRef, kNavCtlSetLocation, (void*) &defLocAed); + } + AEDisposeDesc(&defLocAed); + } - file_name_only = strrchr (full_path_name, '\\'); - if (!file_name_only) - file_name_only = full_path_name; - else - { - file_name_only++; - - /* If default_file_name is a directory, don't use the open - file dialog, as it does not support selecting - directories. */ - if (!(*file_name_only)) - use_dialog_p = 0; - } - - strncpy (filename, file_name_only, MAX_PATH); - filename[MAX_PATH] = '\0'; - } - else - filename[0] = '\0'; - - if (use_dialog_p) - { - OPENFILENAME file_details; - char *filename_file; - - /* Prevent redisplay. */ - specbind (Qinhibit_redisplay, Qt); BLOCK_INPUT; - - bzero (&file_details, sizeof (file_details)); - file_details.lStructSize = sizeof (file_details); - file_details.hwndOwner = FRAME_W32_WINDOW (f); - file_details.lpstrFile = filename; - file_details.nMaxFile = sizeof (filename); - file_details.lpstrInitialDir = init_dir; - file_details.lpstrTitle = SDATA (prompt); - file_details.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR; - - if (!NILP (mustmatch)) - file_details.Flags |= OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; - - if (GetOpenFileName (&file_details)) - { - dostounix_filename (filename); - file = build_string (filename); - } - else - file = Qnil; - + status = NavDialogRun(dialogRef); UNBLOCK_INPUT; - file = unbind_to (count, file); } - /* Open File dialog will not allow folders to be selected, so resort - to minibuffer completing reads for directories. */ - else - file = Fcompleting_read (prompt, intern ("read-file-name-internal"), - dir, mustmatch, dir, Qfile_name_history, - default_filename, Qnil); + + if (saveName) CFRelease(saveName); + if (client) CFRelease(client); + if (message) CFRelease(message); + + if (status == noErr) { + userAction = NavDialogGetUserAction(dialogRef); + switch (userAction) + { + case kNavUserActionNone: + case kNavUserActionCancel: + NavDialogDispose(dialogRef); + Fsignal (Qquit, Qnil); /* Treat cancel like C-g */ + return; + case kNavUserActionOpen: + case kNavUserActionChoose: + case kNavUserActionSaveAs: + { + NavReplyRecord reply; + AEDesc aed; + FSRef fsRef; + status = NavDialogGetReply(dialogRef, &reply); + AECoerceDesc(&reply.selection, typeFSRef, &aed); + AEGetDescData(&aed, (void *) &fsRef, sizeof (FSRef)); + FSRefMakePath(&fsRef, (UInt8 *) filename, 1000); + AEDisposeDesc(&aed); + if (reply.saveFileName) + { + /* If it was a saved file, we need to add the file name */ + int len = strlen(filename); + if (len && filename[len-1] != '/') + filename[len++] = '/'; + CFStringGetCString(reply.saveFileName, filename+len, + 1000-len, kCFStringEncodingUTF8); + } + file = DECODE_FILE(build_string (filename)); + NavDisposeReply(&reply); + } + break; + } + NavDialogDispose(dialogRef); + } + else { + /* Fall back on minibuffer if there was a problem */ + file = Fcompleting_read (prompt, intern ("read-file-name-internal"), + dir, mustmatch, dir, Qfile_name_history, + default_filename, Qnil); + } + } UNGCPRO; - + /* Make "Cancel" equivalent to C-g. */ if (NILP (file)) Fsignal (Qquit, Qnil); - + return unbind_to (count, file); } -#endif /* MAC_TODO */ +#endif /*********************************************************************** Initialization @@ -4507,7 +4577,7 @@ Chinese, Japanese, and Korean. */); last_show_tip_args = Qnil; staticpro (&last_show_tip_args); -#if 0 /* MAC_TODO */ +#if TARGET_API_MAC_CARBON defsubr (&Sx_file_dialog); #endif } From 383418e5122ee80b530e7df96c27be7cffd8a5f1 Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 26 Aug 2004 18:43:29 +0000 Subject: [PATCH 245/341] macmenu.c (ENCODE_MENU_STRING): Added to handle multibyte strings in menu items. (single_submenu): Use ENCODE_MENU_STRING (mac_menu_show): Use ENCODE_MENU_STRING. Reset grabbed because button release isn't passed to event loop (add_menu_item): Use SetMenuItemWithCFString --- src/ChangeLog | 9 +++++++++ src/macmenu.c | 30 +++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index fa1922c6255..aa3721d9106 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2004-08-26 YAMAMOTO Mitsuharu + + * macmenu.c (ENCODE_MENU_STRING): Added to handle multibyte + strings in menu items. + (single_submenu): Use ENCODE_MENU_STRING + (mac_menu_show): Use ENCODE_MENU_STRING. Reset grabbed because + button release isn't passed to event loop + (add_menu_item): Use SetMenuItemWithCFString + 2004-08-26 Steven Tamm * fileio.c (Fread_file_name): Call x_file_dialog on carbon on diff --git a/src/macmenu.c b/src/macmenu.c index d205ee3b877..67e18481a1b 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -163,6 +163,12 @@ extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; extern Lisp_Object Qmenu_bar_update_hook; +#if TARGET_API_MAC_CARBON +#define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str) +#else +#define ENCODE_MENU_STRING(str) ENCODE_SYSTEM (str) +#endif + void set_frame_menubar (); static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, @@ -1246,13 +1252,13 @@ single_submenu (item_key, item_name, maps) #ifndef HAVE_MULTILINGUAL_MENU if (STRING_MULTIBYTE (item_name)) { - item_name = ENCODE_SYSTEM (item_name); + item_name = ENCODE_MENU_STRING (item_name); AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; } if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) { - descrip = ENCODE_SYSTEM (descrip); + descrip = ENCODE_MENU_STRING (descrip); AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; } #endif /* not HAVE_MULTILINGUAL_MENU */ @@ -1705,12 +1711,12 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) #ifndef HAVE_MULTILINGUAL_MENU if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) { - item_name = ENCODE_SYSTEM (item_name); + item_name = ENCODE_MENU_STRING (item_name); AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; } if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) { - descrip = ENCODE_SYSTEM (descrip); + descrip = ENCODE_MENU_STRING (descrip); AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; } #endif /* not HAVE_MULTILINGUAL_MENU */ @@ -1764,7 +1770,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) #ifndef HAVE_MULTILINGUAL_MENU if (STRING_MULTIBYTE (title)) - title = ENCODE_SYSTEM (title); + title = ENCODE_MENU_STRING (title); #endif wv_title->name = (char *) SDATA (title); wv_title->enabled = TRUE; @@ -1813,6 +1819,10 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) discard_mouse_events (); #endif + /* Must reset this manually because the button release event is not + passed to Emacs event loop. */ + FRAME_MAC_DISPLAY_INFO (f)->grabbed = 0; + /* Free the widget_value objects we used to specify the contents. */ free_menubar_widget_value_tree (first_wv); @@ -2219,8 +2229,18 @@ add_menu_item (MenuHandle menu, widget_value *wv, int submenu, strncat (item_name, wv->key, 255); } item_name[255] = 0; +#if TARGET_API_MAC_CARBON + { + CFStringRef string = + CFStringCreateWithCString (NULL, item_name, kCFStringEncodingUTF8); + + SetMenuItemTextWithCFString (menu, pos, string); + CFRelease (string); + } +#else c2pstr (item_name); SetMenuItemText (menu, pos, item_name); +#endif if (wv->enabled && !force_disable) #if TARGET_API_MAC_CARBON From 11d2e01ba3a82c41eec105df81260568f048e726 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 27 Aug 2004 00:25:59 +0000 Subject: [PATCH 246/341] (utf-8-post-read-conversion): If the buffer is unibyte, temporarily set it multibyte. --- lisp/ChangeLog | 5 +++++ lisp/international/utf-8.el | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2141bcd959f..66ef44650d5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-27 Kenichi Handa + + * international/utf-8.el (utf-8-post-read-conversion): If the + buffer is unibyte, temporarily make it multibyte. + 2004-08-27 Masatake YAMATO * calendar/time-date.el (time-to-seconds): Add autoload cookies. diff --git a/lisp/international/utf-8.el b/lisp/international/utf-8.el index bad79b58743..5a7acee0f0e 100644 --- a/lisp/international/utf-8.el +++ b/lisp/international/utf-8.el @@ -870,7 +870,9 @@ Also compose particular scripts if `utf-8-compose-scripts' is non-nil." ;; version of the string in the loop, since it's always loaded as ;; unibyte from a byte-compiled file. (let ((range (string-as-multibyte "^\xc0-\xc3\xe1-\xf7")) + (buffer-multibyte enable-multibyte-characters) hash-table ch) + (set-buffer-multibyte t) (when utf-translate-cjk-mode (if (not utf-translate-cjk-lang-env) ;; Check these characters: @@ -893,7 +895,9 @@ Also compose particular scripts if `utf-8-compose-scripts' is non-nil." (progn (insert ch) (delete-char 1)) - (forward-char 1))))) + (forward-char 1)))) + (or buffer-multibyte + (set-buffer-multibyte nil))) (when (and utf-8-compose-scripts (> length 1)) ;; These currently have definitions which cover the relevant From 9c301a4ce8d5a2f49feae61da91e4cf15fcba072 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 27 Aug 2004 04:40:17 +0000 Subject: [PATCH 247/341] (Difference between Emacs and XEmacs): Explain not to contrast XEmacs with GNU Emacs. --- man/ChangeLog | 5 +++++ man/faq.texi | 25 ++++++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index f3ff703a0a4..c396e8f1ce4 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2004-08-27 Richard M. Stallman + + * faq.texi (Difference between Emacs and XEmacs): + Explain not to contrast XEmacs with GNU Emacs. + 2004-08-26 Richard M. Stallman * faq.texi (Difference between Emacs and XEmacs): Rewrite. diff --git a/man/faq.texi b/man/faq.texi index 2e99ec730e1..fffffcde4c0 100644 --- a/man/faq.texi +++ b/man/faq.texi @@ -3592,19 +3592,22 @@ FAQ, we use the name ``Emacs'' only for the official version. Emacs and XEmacs each come with Lisp packages that are lacking in the other. The two versions have some significant differences at the Lisp -programming level. +programming level. Many XEmacs features have found their way into +recent versions of Emacs, and more features can be expected in the +future, but there are still many differences between the two. -Many XEmacs features have found their way into recent versions of Emacs, -and more features can be expected in the future, but there are still many -differences between the two. +We have used some of the code in XEmacs, and would like to use other +parts, but the earlier XEmacs maintainers did not always keep track of +the authors of contributed code, which makes it impossible for the FSF +to get copyright papers signed for that code. (The FSF requires these +papers for all the code included in the Emacs release, aside from +generic C support packages that retain their separate identity and are +not integrated into the code of Emacs proper.) -The FSF has used some of the code in XEmacs, and would like to use -other parts, but the earlier XEmacs maintainers did not always keep -track of the authors of contributed code, which makes it impossible -for the FSF to get copyright papers signed for that code. (The FSF -requires these papers for all the code included in Emacs, aside from -generic C support packages that are not integrated into the code of -Emacs proper.) +If you want to talk about these two versions and distinguish them, +please call them ``Emacs'' and ``XEmacs.'' To contrast ``XEmacs'' +with ``GNU Emacs'' would be misleading, since XEmacs too has its +origin in the GNU Project. @node Emacs for MS-DOS, Emacs for Windows, Difference between Emacs and XEmacs, Finding Emacs and related packages @section Where can I get Emacs for my PC running MS-DOS? From 5500be54e134938c0fd50c6a629fc7b7f84d9d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 27 Aug 2004 16:50:02 +0000 Subject: [PATCH 248/341] * gtkutil.c (xg_create_frame_widgets): Compensate for tool bar when tool bar items is 0. --- src/ChangeLog | 5 +++++ src/gtkutil.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index aa3721d9106..fd12877d2ce 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-08-27 Jan Dj,Ad(Brv + + * gtkutil.c (xg_create_frame_widgets): Compensate for tool bar when + tool bar items is 0. + 2004-08-26 YAMAMOTO Mitsuharu * macmenu.c (ENCODE_MENU_STRING): Added to handle multibyte diff --git a/src/gtkutil.c b/src/gtkutil.c index 3ffba0ba745..fabdae74dc6 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -793,7 +793,7 @@ xg_create_frame_widgets (f) up in the wrong place as tool bar height has not been taken into account. So we cheat a bit by setting a height that is what it will have later on when tool bar items are added. */ - if (FRAME_EXTERNAL_TOOL_BAR (f) && FRAME_TOOLBAR_HEIGHT (f) == 0) + if (FRAME_EXTERNAL_TOOL_BAR (f) && f->n_tool_bar_items == 0) FRAME_TOOLBAR_HEIGHT (f) = 34; From 059cd32943b2598a756c7826d177e55679836a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 27 Aug 2004 16:57:36 +0000 Subject: [PATCH 249/341] * xmenu.c (set_frame_menubar): Reintroduce inhibit_garbage_collection from 2002-07-15T00:01:34Z!raeburn@raeburn.org so that strings from ENCODE_UTF_8 isn't GC:ed before used. --- src/ChangeLog | 3 +++ src/xmenu.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index fd12877d2ce..7779dddb124 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2004-08-27 Jan Dj,Ad(Brv + * xmenu.c (set_frame_menubar): Reintroduce inhibit_garbage_collection + from 2002-07-15T00:01:34Z!raeburn@raeburn.org so that strings from ENCODE_UTF_8 isn't GC:ed before used. + * gtkutil.c (xg_create_frame_widgets): Compensate for tool bar when tool bar items is 0. diff --git a/src/xmenu.c b/src/xmenu.c index 473e29de88d..7ef0e8c857d 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1930,6 +1930,7 @@ set_frame_menubar (f, first_time, deep_p) FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); items = FRAME_MENU_BAR_ITEMS (f); + inhibit_garbage_collection (); /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) From ba34fe2002aefbc5a47c9e2a47fd8b3f55a168c2 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 27 Aug 2004 23:23:06 +0000 Subject: [PATCH 250/341] (Acknowledgments): Use `@unnumbered'. --- man/ack.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/ack.texi b/man/ack.texi index 5d64b38cdf7..0d957dcef86 100644 --- a/man/ack.texi +++ b/man/ack.texi @@ -4,7 +4,7 @@ @c See file emacs.texi for copying conditions. @c @node Acknowledgments, Screen, Concept Index, Top -@chapter Acknowledgments +@unnumbered Acknowledgments Many people have contributed code included in the Free Software Foundation's distribution of GNU Emacs. To show our appreciation for From 2e7cfad6327cd5a3119f173a95f3a349b62b2466 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 27 Aug 2004 23:25:13 +0000 Subject: [PATCH 251/341] Adapt sectioning in Info to the node structure. (Invoking emacsclient): Make "Invoking emacsclient" a subsection of "Using Emacs as a Server". --- man/misc.texi | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/man/misc.texi b/man/misc.texi index 3c5909a9f56..d3aa352d091 100644 --- a/man/misc.texi +++ b/man/misc.texi @@ -1,5 +1,5 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000, 2001 +@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000, 2001, 2004 @c Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @iftex @@ -14,6 +14,11 @@ an Emacs session for later resumption, emulating other editors, and various diversions and amusements. @end iftex + +@ifnottex +@raisesections +@end ifnottex + @node Gnus, Shell, Calendar/Diary, Top @section Gnus @cindex Gnus @@ -1264,7 +1269,7 @@ automatically when you finish with them. @end menu @node Invoking emacsclient,, Emacs Server, Emacs Server -@section Invoking @code{emacsclient} +@subsection Invoking @code{emacsclient} To run the @code{emacsclient} program, specify file names as arguments, and optionally line numbers as well. Do it like this: @@ -2448,6 +2453,10 @@ Likewise, @kbd{M-x snake} provides an implementation of Snake. The command @kbd{M-x zone} plays games with the display when Emacs is idle. +@ifnottex +@lowersections +@end ifnottex + @ignore arch-tag: 8f094220-c0d5-4e9e-af7d-3e0da8187474 @end ignore From 254196f5a42e04a22f4bd377d1af7f6a42a40670 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 27 Aug 2004 23:28:06 +0000 Subject: [PATCH 252/341] (Building): Interchange nodes (for correct numbering). --- man/building.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/man/building.texi b/man/building.texi index f7c1883e0d3..85240003eec 100644 --- a/man/building.texi +++ b/man/building.texi @@ -23,8 +23,8 @@ in the larger process of developing and maintaining programs. with different facilities for running the Lisp programs. * Libraries: Lisp Libraries. Creating Lisp programs to run in Emacs. -* Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer. * Eval: Lisp Eval. Executing a single Lisp expression in Emacs. +* Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer. * External Lisp:: Communicating through Emacs with a separate Lisp. @end menu @@ -644,7 +644,7 @@ to know GDB commands. @menu * Layout:: Control the number of displayed buffers. * Breakpoints Buffer:: A breakpoint control panel. -* Stack Buffer:: Select a frame from the call stack. +* Stack Buffer:: Select a frame from the call stack. * Watch Expressions:: Monitor variable values in the speedbar. * Other Buffers:: Input/output, locals, registers and assembler buffers. @end menu @@ -698,12 +698,12 @@ is the relevant buffer type e.g breakpoints. @node Breakpoints Buffer @subsubsection Breakpoints Buffer -The breakpoints buffer shows the existing breakpoints and watchpoints +The breakpoints buffer shows the existing breakpoints and watchpoints (@pxref{Breakpoints,,, gdb, The GNU debugger}). It has three special commands: @table @kbd -@item @key{SPC} +@item @key{SPC} @kindex SPC @r{(GDB breakpoints buffer)} @findex gdb-toggle-breakpoint Enable/disable the breakpoint at the current line From c8b21b5ed25a07054123585896668d0cfddfee6f Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 27 Aug 2004 23:30:03 +0000 Subject: [PATCH 253/341] Interchange nodes (for correct numbering). --- man/programs.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/programs.texi b/man/programs.texi index e19c8364f2b..abe0083b39e 100644 --- a/man/programs.texi +++ b/man/programs.texi @@ -31,8 +31,8 @@ Highlight program syntax (@pxref{Font Lock}). * Defuns:: Commands to operate on major top-level parts of a program. * Program Indent:: Adjusting indentation to show the nesting. -* Comments:: Inserting, killing, and aligning comments. * Parentheses:: Commands that operate on parentheses. +* Comments:: Inserting, killing, and aligning comments. * Documentation:: Getting documentation of functions you plan to call. * Hideshow:: Displaying blocks selectively. * Symbol Completion:: Completion on symbol names of your program or language. From 6cca5de04520b4bba47c873d64253a4549861510 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 27 Aug 2004 23:35:06 +0000 Subject: [PATCH 254/341] Adapt sectioning in Info to the node structure. --- man/commands.texi | 8 ++++++++ man/entering.texi | 8 ++++++++ man/killing.texi | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/man/commands.texi b/man/commands.texi index ea14e36128a..54ec50acfe8 100644 --- a/man/commands.texi +++ b/man/commands.texi @@ -10,6 +10,10 @@ of @dfn{keys} and @dfn{commands}, which are fundamental for understanding how Emacs interprets your keyboard and mouse input. @end iftex +@ifnottex +@raisesections +@end ifnottex + @node User Input, Keys, Screen, Top @section Kinds of User Input @cindex input with the keyboard @@ -266,6 +270,10 @@ with codes 128 through 255 can also appear in multibyte buffers. alphabet of non-@acronym{ASCII} characters, but they all fit in one byte. They use codes 0200 through 0377. @xref{Single-Byte Character Support}. +@ifnottex +@lowersections +@end ifnottex + @ignore arch-tag: 9be43eef-d1f4-4d03-a916-c741ea713a45 @end ignore diff --git a/man/entering.texi b/man/entering.texi index 9200082328a..31ac47b3c62 100644 --- a/man/entering.texi +++ b/man/entering.texi @@ -59,6 +59,10 @@ Emacs running, you can use the @command{emacsclient} program to open a file in the already running Emacs. @xref{Emacs Server}, for more information on editing files with Emacs from other programs. +@ifnottex +@raisesections +@end ifnottex + @node Exiting, Basic, Entering Emacs, Top @section Exiting Emacs @cindex exiting @@ -150,6 +154,10 @@ systems as the characters for stopping or killing a program, but that is their only relationship with the operating system. You can customize these keys to run any commands of your choice (@pxref{Keymaps}). +@ifnottex +@lowersections +@end ifnottex + @ignore arch-tag: df798d8b-f253-4113-b585-f528f078a944 @end ignore diff --git a/man/killing.texi b/man/killing.texi index b5f1ce30772..8865dfc2f1b 100644 --- a/man/killing.texi +++ b/man/killing.texi @@ -25,6 +25,10 @@ one buffer and yank it in another buffer. @end iftex +@ifnottex +@raisesections +@end ifnottex + @node Killing, Yanking, Mark, Top @section Deletion and Killing @@ -646,6 +650,10 @@ rectangle shifts right. @code{string-rectangle}, but inserts the string on each line, shifting the original text to the right. +@ifnottex +@lowersections +@end ifnottex + @ignore arch-tag: d8da8f96-0928-449a-816e-ff2d3497866c @end ignore From 0b96ec6804796e832fa931fe9c21e41f11a5ba8c Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 27 Aug 2004 23:36:38 +0000 Subject: [PATCH 255/341] Make "GNU GENERAL PUBLIC LICENSE" an appendix. Rearrange order of nodes and sections such that both "GNU GENERAL PUBLIC LICENSE" and "GNU Free Documentation License" appear at the end, as appropriate for appendices. (Acknowledgments): Use `@unnumberedsec'. --- man/emacs.texi | 195 +++++++++++++++++++++++++------------------------ 1 file changed, 98 insertions(+), 97 deletions(-) diff --git a/man/emacs.texi b/man/emacs.texi index ad9658ab368..a87000793d5 100644 --- a/man/emacs.texi +++ b/man/emacs.texi @@ -901,7 +901,7 @@ all GNU Emacs features. We don't try to describe VMS usage in this manual. @xref{MS-DOS}, for information about using Emacs on MS-DOS. @end iftex -@node Distrib, Copying, Top, Top +@node Distrib, Intro, Top, Top @unnumbered Distribution GNU Emacs is @dfn{free software}; this means that everyone is free to @@ -956,8 +956,8 @@ might instead suggest ordering a CD-ROM from the Foundation occasionally, or subscribing to periodic updates. @ifnotinfo -@node Acknowledgments, Copying, Distrib, Top -@section Acknowledgments +@node Acknowledgments, Intro, Distrib, Top +@unnumberedsec Acknowledgments Contributors to GNU Emacs include Per Abrahamsen, Jay K. Adams, Joe Arceneaux, Boaz Ben-Zvi, Jim Blandy, Terrence Brannon, Frank Bresz, @@ -1002,8 +1002,101 @@ S. T. Wu, Tom Wurgler, Eli Zaretskii, Jamie Zawinski, Ian T. Zimmermann, Reto Zimmermann, and Neal Ziring. @end ifnotinfo -@node Copying, GNU Free Documentation License, Distrib, Top -@unnumbered GNU GENERAL PUBLIC LICENSE + +@node Intro, Glossary, Distrib, Top +@unnumbered Introduction + + You are reading about GNU Emacs, the GNU incarnation of the advanced, +self-documenting, customizable, extensible real-time display editor Emacs. +(The `G' in `GNU' is not silent.) + + We say that Emacs is a @dfn{display} editor because normally the text +being edited is visible on the screen and is updated automatically as you +type your commands. @xref{Screen,Display}. + + We call it a @dfn{real-time} editor because the display is updated very +frequently, usually after each character or pair of characters you +type. This minimizes the amount of information you must keep in your +head as you edit. @xref{Basic,Real-time,Basic Editing}. + + We call Emacs advanced because it provides facilities that go beyond +simple insertion and deletion: controlling subprocesses; automatic +indentation of programs; viewing two or more files at once; editing +formatted text; and dealing in terms of characters, words, lines, +sentences, paragraphs, and pages, as well as expressions and comments in +several different programming languages. + + @dfn{Self-documenting} means that at any time you can type a special +character, @kbd{Control-h}, to find out what your options are. You can +also use it to find out what any command does, or to find all the commands +that pertain to a topic. @xref{Help}. + + @dfn{Customizable} means that you can change the definitions of Emacs +commands in little ways. For example, if you use a programming language in +which comments start with @samp{<**} and end with @samp{**>}, you can tell +the Emacs comment manipulation commands to use those strings +(@pxref{Comments}). Another sort of customization is rearrangement of the +command set. For example, if you prefer the four basic cursor motion +commands (up, down, left and right) on keys in a diamond pattern on the +keyboard, you can rebind the keys that way. @xref{Customization}. + + @dfn{Extensible} means that you can go beyond simple customization and +write entirely new commands, programs in the Lisp language to be run by +Emacs's own Lisp interpreter. Emacs is an ``on-line extensible'' +system, which means that it is divided into many functions that call +each other, any of which can be redefined in the middle of an editing +session. Almost any part of Emacs can be replaced without making a +separate copy of all of Emacs. Most of the editing commands of Emacs +are written in Lisp; the few exceptions could have been written +in Lisp but are written in C for efficiency. Although only a programmer +can write an extension, anybody can use it afterward. If you want to +learn Emacs Lisp programming, we recommend the @cite{Introduction to +Emacs Lisp} by Robert J. Chassell, also published by the Free Software +Foundation. + + When run under the X Window System, Emacs provides its own menus and +convenient bindings to mouse buttons. But Emacs can provide many of the +benefits of a window system on a text-only terminal. For instance, you +can look at or edit several files at once, move text between files, and +edit files while running shell commands. + +@include screen.texi +@include commands.texi +@include entering.texi +@include basic.texi +@include mini.texi +@include m-x.texi +@include help.texi +@include mark.texi +@include killing.texi +@include regs.texi +@include display.texi +@include search.texi +@include fixit.texi +@include kmacro.texi +@include files.texi +@include buffers.texi +@include windows.texi +@include frames.texi +@include mule.texi +@include major.texi +@include indent.texi +@include text.texi +@include programs.texi +@include building.texi +@include maintaining.texi +@include abbrevs.texi +@include picture.texi +@include sending.texi +@include rmail.texi +@include dired.texi +@include calendar.texi +@include misc.texi +@include custom.texi +@include trouble.texi + +@node Copying, GNU Free Documentation License, Service, Top +@appendix GNU GENERAL PUBLIC LICENSE @center Version 2, June 1991 @display @@ -1399,98 +1492,6 @@ library. If this is what you want to do, use the GNU Library General Public License instead of this License. @include doclicense.texi - -@node Intro, Glossary, GNU Free Documentation License, Top -@unnumbered Introduction - - You are reading about GNU Emacs, the GNU incarnation of the advanced, -self-documenting, customizable, extensible real-time display editor Emacs. -(The `G' in `GNU' is not silent.) - - We say that Emacs is a @dfn{display} editor because normally the text -being edited is visible on the screen and is updated automatically as you -type your commands. @xref{Screen,Display}. - - We call it a @dfn{real-time} editor because the display is updated very -frequently, usually after each character or pair of characters you -type. This minimizes the amount of information you must keep in your -head as you edit. @xref{Basic,Real-time,Basic Editing}. - - We call Emacs advanced because it provides facilities that go beyond -simple insertion and deletion: controlling subprocesses; automatic -indentation of programs; viewing two or more files at once; editing -formatted text; and dealing in terms of characters, words, lines, -sentences, paragraphs, and pages, as well as expressions and comments in -several different programming languages. - - @dfn{Self-documenting} means that at any time you can type a special -character, @kbd{Control-h}, to find out what your options are. You can -also use it to find out what any command does, or to find all the commands -that pertain to a topic. @xref{Help}. - - @dfn{Customizable} means that you can change the definitions of Emacs -commands in little ways. For example, if you use a programming language in -which comments start with @samp{<**} and end with @samp{**>}, you can tell -the Emacs comment manipulation commands to use those strings -(@pxref{Comments}). Another sort of customization is rearrangement of the -command set. For example, if you prefer the four basic cursor motion -commands (up, down, left and right) on keys in a diamond pattern on the -keyboard, you can rebind the keys that way. @xref{Customization}. - - @dfn{Extensible} means that you can go beyond simple customization and -write entirely new commands, programs in the Lisp language to be run by -Emacs's own Lisp interpreter. Emacs is an ``on-line extensible'' -system, which means that it is divided into many functions that call -each other, any of which can be redefined in the middle of an editing -session. Almost any part of Emacs can be replaced without making a -separate copy of all of Emacs. Most of the editing commands of Emacs -are written in Lisp; the few exceptions could have been written -in Lisp but are written in C for efficiency. Although only a programmer -can write an extension, anybody can use it afterward. If you want to -learn Emacs Lisp programming, we recommend the @cite{Introduction to -Emacs Lisp} by Robert J. Chassell, also published by the Free Software -Foundation. - - When run under the X Window System, Emacs provides its own menus and -convenient bindings to mouse buttons. But Emacs can provide many of the -benefits of a window system on a text-only terminal. For instance, you -can look at or edit several files at once, move text between files, and -edit files while running shell commands. - -@include screen.texi -@include commands.texi -@include entering.texi -@include basic.texi -@include mini.texi -@include m-x.texi -@include help.texi -@include mark.texi -@include killing.texi -@include regs.texi -@include display.texi -@include search.texi -@include fixit.texi -@include kmacro.texi -@include files.texi -@include buffers.texi -@include windows.texi -@include frames.texi -@include mule.texi -@include major.texi -@include indent.texi -@include text.texi -@include programs.texi -@include building.texi -@include maintaining.texi -@include abbrevs.texi -@include picture.texi -@include sending.texi -@include rmail.texi -@include dired.texi -@include calendar.texi -@include misc.texi -@include custom.texi -@include trouble.texi @include cmdargs.texi @include xresources.texi From 0d6e975434e867d1a33c838d6ffa5298d86784f1 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 27 Aug 2004 23:38:35 +0000 Subject: [PATCH 256/341] Adapt sectioning in Info to the node structure. Adapt node pointers to change in emacs.texi. --- man/trouble.texi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/man/trouble.texi b/man/trouble.texi index e7f6ae7608b..142560c1fe8 100644 --- a/man/trouble.texi +++ b/man/trouble.texi @@ -1,5 +1,5 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985,86,87,93,94,95,1997,2001 Free Software Foundation, Inc. +@c Copyright (C) 1985,86,87,93,94,95,1997,2001,2004 Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @iftex @chapter Dealing with Common Problems @@ -10,6 +10,10 @@ recover from a mysterious situation. Emacs bugs and system crashes are also considered. @end iftex +@ifnottex +@raisesections +@end ifnottex + @node Quitting, Lossage, Customization, Top @section Quitting and Aborting @cindex quitting @@ -1044,7 +1048,7 @@ you have not yet started work, it is useful to contact possible to suggest ways to make your extension fit in better with the rest of Emacs. -@node Service, Command Arguments, Contributing, Top +@node Service, Copying, Contributing, Top @section How To Get Help with GNU Emacs If you need help installing, using or changing GNU Emacs, there are two @@ -1063,6 +1067,10 @@ The service directory is found in the file named @file{etc/SERVICE} in the Emacs distribution. @end itemize +@ifnottex +@lowersections +@end ifnottex + @ignore arch-tag: c9cba76d-b2cb-4e0c-ae3f-19d5ef35817c @end ignore From 5e6230d8d9ea4a25fe71930e224de699201a12cc Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 27 Aug 2004 23:42:41 +0000 Subject: [PATCH 257/341] Adapt node pointers to change in emacs.texi. --- man/ChangeLog | 21 ++++++++++++++++++++- man/cmdargs.texi | 2 +- man/doclicense.texi | 3 +-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index c396e8f1ce4..9502e0c8256 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,6 +1,25 @@ +2004-08-27 Luc Teirlinck + + * ack.texi (Acknowledgments): Use `@unnumbered'. + * misc.texi : Adapt sectioning in Info to the node structure. + (Invoking emacsclient): Make "Invoking emacsclient" a subsection + of "Using Emacs as a Server". + * building.texi (Building): Interchange nodes (for correct numbering). + * programs.texi (Programs): Interchange nodes (for correct numbering). + * killing.texi, entering.texi, commands.texi: Adapt sectioning in + Info to the node structure. + * emacs.texi: Make "GNU GENERAL PUBLIC LICENSE" an appendix. + Rearrange order of nodes and sections such that both "GNU GENERAL + PUBLIC LICENSE" and "GNU Free Documentation License" appear at the + end, as appropriate for appendices. + (Acknowledgments): Use `@unnumberedsec'. + * trouble.texi: Adapt sectioning in Info to the node structure. + Adapt node pointers to change in emacs.texi. + * cmdargs.texi, doclicense.texi: Adapt node pointers. + 2004-08-27 Richard M. Stallman - * faq.texi (Difference between Emacs and XEmacs): + * faq.texi (Difference between Emacs and XEmacs): Explain not to contrast XEmacs with GNU Emacs. 2004-08-26 Richard M. Stallman diff --git a/man/cmdargs.texi b/man/cmdargs.texi index f528b804c72..7548431aa4c 100644 --- a/man/cmdargs.texi +++ b/man/cmdargs.texi @@ -1,7 +1,7 @@ @c This is part of the Emacs manual. @c Copyright (C) 1985,86,87,93,94,95,97,2001,03,2004 Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. -@node Command Arguments, X Resources, Service, Top +@node Command Arguments, X Resources, GNU Free Documentation License, Top @appendix Command Line Arguments @cindex command line arguments @cindex arguments (command line) diff --git a/man/doclicense.texi b/man/doclicense.texi index 23ec98c202f..78ec35f5aab 100644 --- a/man/doclicense.texi +++ b/man/doclicense.texi @@ -1,6 +1,5 @@ @c -*-texinfo-*- -@node GNU Free Documentation License, Intro, Copying, Top - +@node GNU Free Documentation License, Command Arguments, Copying, Top @appendix GNU Free Documentation License @center Version 1.1, March 2000 From 9933ae48747f32b48be6a50a9d2c09213da5da78 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 28 Aug 2004 00:20:24 +0000 Subject: [PATCH 258/341] Minor whitespace change. --- man/emacs.texi | 1 - 1 file changed, 1 deletion(-) diff --git a/man/emacs.texi b/man/emacs.texi index a87000793d5..68997c0265d 100644 --- a/man/emacs.texi +++ b/man/emacs.texi @@ -1002,7 +1002,6 @@ S. T. Wu, Tom Wurgler, Eli Zaretskii, Jamie Zawinski, Ian T. Zimmermann, Reto Zimmermann, and Neal Ziring. @end ifnotinfo - @node Intro, Glossary, Distrib, Top @unnumbered Introduction From 73b740878793bf03550e29d3be459c2cbc5fb80f Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 28 Aug 2004 00:41:31 +0000 Subject: [PATCH 259/341] (Abbrev Expansion): `abbrev-start-location' can be an integer or a marker. (Abbrev Expansion): Replace example for `pre-abbrev-expand-hook'. --- lispref/abbrevs.texi | 51 +++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/lispref/abbrevs.texi b/lispref/abbrevs.texi index d586d0bbc13..1f873312222 100644 --- a/lispref/abbrevs.texi +++ b/lispref/abbrevs.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Emacs Lisp Reference Manual. -@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1999 +@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1999, 2004 @c Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. @setfilename ../info/abbrevs @@ -288,7 +288,7 @@ expansion. @end defopt @defvar abbrev-start-location -The value of this variable is a marker pointing to the buffer position +The value of this variable is a buffer position (an integer or a marker) for @code{expand-abbrev} to use as the start of the next abbrev to be expanded. The value can also be @code{nil}, which means to use the word before point instead. @code{abbrev-start-location} is set to @@ -331,32 +331,43 @@ hook, the hook functions receive no arguments. However, they can find the abbrev to be expanded by looking in the buffer before point. Running the hook is the first thing that @code{expand-abbrev} does, and so a hook function can be used to change the current abbrev table before -abbrev lookup happens. +abbrev lookup happens. (Although you have to do this carefully. See +the example below.) @end defvar The following sample code shows a simple use of -@code{pre-abbrev-expand-hook}. If the user terminates an abbrev with -a punctuation character, the hook function asks for confirmation. It -aborts expansion if the user does not confirm. +@code{pre-abbrev-expand-hook}. It assumes that @code{foo-mode} is a +mode for editing certain files in which lines that start with @samp{#} +are comments. You want to use Text mode abbrevs for those lines. The +regular local abbrev table, @code{foo-mode-abbrev-table} is +appropriate for all other lines. Then you can put the following code +in your @file{.emacs} file. @xref{Standard Abbrev Tables}, for the +definitions of @code{local-abbrev-table} and @code{text-mode-abbrev-table}. @smallexample -(add-hook 'pre-abbrev-expand-hook 'query-if-not-space) +(defun foo-mode-pre-abbrev-expand () + (when (save-excursion (forward-line 0) (eq (char-after) ?#)) + (let ((local-abbrev-table text-mode-abbrev-table) + ;; Avoid infinite loop. + (pre-abbrev-expand-hook nil)) + (expand-abbrev)) + ;; We have already called `expand-abbrev' in this hook. + ;; Hence we want the "actual" call following this hook to be a no-op. + (setq abbrev-start-location (point-max) + abbrev-start-location-buffer (current-buffer)))) -;; @r{This is the function invoked by @code{pre-abbrev-expand-hook}.} - -;; @r{If the user terminated the abbrev with a space, the function does} -;; @r{nothing (that is, it returns so that the abbrev can expand). If the} -;; @r{user entered some other character, this function asks whether} -;; @r{expansion should continue.} - -;; @r{The function's return value makes no difference.} - -(defun query-if-not-space () - (if (/= ?\s last-command-char) - (if (not (y-or-n-p "Do you want to expand this abbrev? ")) - (error "Not expanding this abbrev")))) +(add-hook 'foo-mode-hook + #'(lambda () + (add-hook 'pre-abbrev-expand-hook + 'foo-mode-pre-abbrev-expand + nil t))) @end smallexample +Note that @code{foo-mode-pre-abbrex-expand} just returns @code{nil} +without doing anything for lines not starting with @samp{#}. Hence +abbrevs expand normally using @code{foo-mode-abbrev-table} as local +abbrev table for such lines. + @node Standard Abbrev Tables, , Abbrev Expansion, Abbrevs @comment node-name, next, previous, up @section Standard Abbrev Tables From ef4da64f62a53cfbd2583eabbb64936366374e83 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 28 Aug 2004 00:44:30 +0000 Subject: [PATCH 260/341] Fix texinfo usage, esp. doublequotes. (Difference between Emacs and XEmacs): Some clarification. --- man/ChangeLog | 5 ++- man/faq.texi | 86 ++++++++++++++++++++++++--------------------------- 2 files changed, 45 insertions(+), 46 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 9502e0c8256..3198a3f4537 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -19,7 +19,10 @@ 2004-08-27 Richard M. Stallman - * faq.texi (Difference between Emacs and XEmacs): + * faq.texi: Fix texinfo usage, esp. doublequotes. + (Difference between Emacs and XEmacs): Some clarification. + + * faq.texi (Difference between Emacs and XEmacs): Explain not to contrast XEmacs with GNU Emacs. 2004-08-26 Richard M. Stallman diff --git a/man/faq.texi b/man/faq.texi index fffffcde4c0..14ed2de3332 100644 --- a/man/faq.texi +++ b/man/faq.texi @@ -17,7 +17,7 @@ Copyright 1990,1991,1992 Joseph Brian Wells@* @quotation This list of frequently asked questions about GNU Emacs with answers -("FAQ") may be translated into other languages, transformed into other +(``FAQ'') may be translated into other languages, transformed into other formats (e.g. Texinfo, Info, WWW, WAIS), and updated with new information. The same conditions apply to any derivative of the FAQ as apply to the FAQ @@ -906,8 +906,8 @@ where that is). Emacs General Public License @item DISTRIB -Emacs Availability Information, including the popular "Free Software -Foundation Order Form" +Emacs Availability Information, including the popular Free Software +Foundation Order Form @item FTP How to get GNU Software by Internet FTP or by UUCP @@ -935,7 +935,7 @@ Emacs news, a history of recent user-visible changes GNU Service Directory @item SUN-SUPPORT -including "Using Emacstool with GNU Emacs" +including ``Using Emacstool with GNU Emacs'' @end table @@ -1045,7 +1045,7 @@ send usenet/news.answers/GNU-Emacs-FAQ/part5 @end example For more information, send email to @email{mail-server@@rtfm.mit.edu} -with "help" and "index" in the body on separate lines. +with @samp{help} and @samp{index} in the body on separate lines. @item As the very last resort, you can e-mail a request to @@ -1864,7 +1864,7 @@ edge of the window. @end itemize @node Overwrite mode, Turning off beeping, Horizontal scrolling, Common requests -@section How do I make Emacs "typeover" or "overwrite" instead of inserting? +@section How do I make Emacs ``typeover'' or ``overwrite'' instead of inserting? @cindex @key{Insert} @cindex @code{overwrite-mode} @cindex Overwriting existing text @@ -2075,7 +2075,7 @@ onwards), to look at the resource names for the menu bar, assuming Emacs was compiled with the X toolkit. @node Evaluating Emacs Lisp code, Changing the length of a Tab, Valid X resources, Common requests -@section How do I execute ("evaluate") a piece of Emacs Lisp code? +@section How do I execute (``evaluate'') a piece of Emacs Lisp code? @cindex Evaluating Lisp code @cindex Lisp forms, evaluating @@ -2162,7 +2162,7 @@ since version 19.20. @xref{Changing the included text prefix}, for additional information. @node Underlining paragraphs, Repeating a command as many times as possible, Inserting > at the beginning of each line, Common requests -@section How do I insert "_^H" before each character in a region to get an underlined paragraph? +@section How do I insert @samp{_^H} before each character in a region to get an underlined paragraph? @cindex Underlining a region of text @cindex @code{underline-region} @@ -2264,7 +2264,7 @@ Quick command-line switch descriptions are also available. For example, You probably don't want to do this, since backups are useful, especially when something goes wrong. -To avoid seeing backup files (and other "uninteresting" files) in Dired, +To avoid seeing backup files (and other ``uninteresting'' files) in Dired, load @code{dired-x} by adding the following to your @file{.emacs} file: @lisp @@ -2733,7 +2733,7 @@ sizes of up to 33,554,431 bytes): @end example @noindent -This method may result in "ILLEGAL DATATYPE" and other random errors on +This method may result in ``ILLEGAL DATATYPE'' and other random errors on some machines. @email{daveg@@csvax.cs.caltech.edu, David Gillespie} explains how this @@ -2824,7 +2824,7 @@ stty -icrnl -onlcr -echo susp ^Z @end example @node Shell process exits abnormally, Problems with Shell Mode on MS-Windows, ^M in the shell buffer, Bugs and problems -@section Why do I get "Process shell exited abnormally with code 1"? +@section Why do I get ``Process shell exited abnormally with code 1''? @cindex Abnormal exits from @code{shell-mode} @cindex @code{shell-mode} exits @cindex Process shell exited @@ -2881,7 +2881,7 @@ antivirus software; disabling the resident antivirus program solves the problems in those cases. @node Termcap/Terminfo entries for Emacs, Spontaneous entry into isearch-mode, Problems with Shell Mode on MS-Windows, Bugs and problems -@section Where is the termcap/terminfo entry for terminal type "emacs"? +@section Where is the termcap/terminfo entry for terminal type @samp{emacs}? @cindex Termcap @cindex Terminfo @cindex Emacs entries for termcap/terminfo @@ -2915,7 +2915,7 @@ if ("$term" == emacs) set term=dumb @end example @node Spontaneous entry into isearch-mode, Problems talking to certain hosts, Termcap/Terminfo entries for Emacs, Bugs and problems -@section Why does Emacs spontaneously start displaying "I-search:" and beeping? +@section Why does Emacs spontaneously start displaying @samp{I-search:} and beeping? @cindex Spontaneous entry into isearch-mode @cindex isearch-mode, spontaneous entry into @cindex Beeping without obvious reason @@ -2972,7 +2972,7 @@ properly told to do DNS lookups with the correct command line switch. @end itemize @node Errors with init files, Emacs ignores X resources, Problems talking to certain hosts, Bugs and problems -@section Why does Emacs say "Error in init file"? +@section Why does Emacs say @samp{Error in init file}? @cindex Error in @file{.emacs} @cindex Error in init file @cindex Init file, errors in @@ -3238,7 +3238,7 @@ access control enabled, only authorized clients can connect @end itemize @node Dired claims that no file is on this line, , Security risks with Emacs, Bugs and problems -@section Dired says, "no file on this line" when I try to do something. +@section Dired says, @samp{no file on this line} when I try to do something. @cindex Dired does not see a file @c FIXME: I think this is fixed in Emacs 21, but I didn't have time to @@ -3441,7 +3441,7 @@ Emacs needs to be linked with the static version of the X11 library, @file{libX11.a}. This may be missing. On OpenWindows, you may need to use @code{add_services} to add the -"OpenWindows Programmers" optional software category from the CD-ROM. +``OpenWindows Programmers'' optional software category from the CD-ROM. On HP-UX 8.0, you may need to run @code{update} again to load the X11-PRG ``fileset''. This may be missing even if you specified ``all @@ -3580,34 +3580,37 @@ A list of sites mirroring @samp{ftp.gnu.org} can be found at @uref{http://www.gnu.org/order/ftp.html} @node Difference between Emacs and XEmacs, Emacs for MS-DOS, Current GNU distributions, Finding Emacs and related packages -@section What is the difference between Emacs and XEmacs (formerly "Lucid Emacs")? +@section What is the difference between Emacs and XEmacs (formerly Lucid Emacs)? @cindex XEmacs @cindex Difference Emacs and XEmacs @cindex Lucid Emacs @cindex Epoch -XEmacs is a branch version of Emacs. It was earlier called as Lucid -Emacs, and it was based on a prerelease version of Emacs 19. In this -FAQ, we use the name ``Emacs'' only for the official version. +XEmacs is a branch version of Emacs. It was first called Lucid Emacs, +and was initially derived from a prerelease version of Emacs 19. In +this FAQ, we use the name ``Emacs'' only for the official version. Emacs and XEmacs each come with Lisp packages that are lacking in the other. The two versions have some significant differences at the Lisp -programming level. Many XEmacs features have found their way into -recent versions of Emacs, and more features can be expected in the -future, but there are still many differences between the two. +programming level. Their current features are roughly comparable, +though the support for some operating systems, character sets and +specific packages might be quite different. -We have used some of the code in XEmacs, and would like to use other -parts, but the earlier XEmacs maintainers did not always keep track of -the authors of contributed code, which makes it impossible for the FSF -to get copyright papers signed for that code. (The FSF requires these -papers for all the code included in the Emacs release, aside from -generic C support packages that retain their separate identity and are -not integrated into the code of Emacs proper.) +Some XEmacs code has been contributed to Emacs, and we would like to +use other parts, but the earlier XEmacs maintainers did not always +keep track of the authors of contributed code, which makes it +impossible for the FSF to get copyright papers signed for that code. +(The FSF requires these papers for all the code included in the Emacs +release, aside from generic C support packages that retain their +separate identity and are not integrated into the code of Emacs +proper.) If you want to talk about these two versions and distinguish them, please call them ``Emacs'' and ``XEmacs.'' To contrast ``XEmacs'' with ``GNU Emacs'' would be misleading, since XEmacs too has its -origin in the GNU Project. +origin in the work of the GNU Project. Terms such as ``Emacsen'' and +``(X)Emacs'' are not wrong, but they are not very clear, so it +is better to write ``Emacs and XEmacs.'' @node Emacs for MS-DOS, Emacs for Windows, Difference between Emacs and XEmacs, Finding Emacs and related packages @section Where can I get Emacs for my PC running MS-DOS? @@ -3683,7 +3686,7 @@ directory of the Emacs sources contains some additional information regarding Emacs under MS-DOS. For a list of other MS-DOS implementations of Emacs (and Emacs -look-alikes), consult the list of "Emacs implementations and literature," +look-alikes), consult the list of ``Emacs implementations and literature,'' available at @uref{ftp://rtfm.mit.edu/pub/usenet/comp.emacs/} @@ -3768,18 +3771,11 @@ menus, and multiple frames. You can get it from @cindex Apple computers, Emacs for @cindex Macintosh, Emacs for -An unofficial port of GNU Emacs 18.59 to the Macintosh is available at a -number of ftp sites, the home being -@uref{ftp://ftp.cs.cornell.edu/pub/parmet/Emacs-1.17.sit.bin}. - -A port of Emacs 20.4 is available at -@uref{http://www.cs.hku.hk/~choi/emacs/index.html}. - Beginning with version 21.1, the Macintosh is supported in the official Emacs distribution; see the files @file{mac/README} and @file{mac/INSTALL} in the Emacs distribution for build instructions. -Apple's forthcoming "OS X" is based largely on NeXTSTEP and OpenStep. +Apple's ``OS X'' is based largely on NeXTSTEP and OpenStep. @xref{Emacs for NeXTSTEP}, for more details about that version. @node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages @@ -4174,7 +4170,7 @@ jde-subscribe@@sunsite.auc.dk @end table @node Patch, , JDE, Major packages and programs -@section Patch --- program to apply "diffs" for updating files +@section Patch --- program to apply ``diffs'' for updating files @cindex Updating files with diffs @cindex Patching source files with diffs @cindex Diffs and patching @@ -4247,8 +4243,8 @@ command are required. For example, @noindent can be placed directly into the @file{.emacs} file. If the key binding is -local, the command is used in conjunction with the "add-hook" command. -For example, in tex-mode, a local binding might be +local, the command is used in conjunction with the @samp{add-hook} function. +For example, in TeX mode, a local binding might be @lisp (add-hook 'tex-mode-hook @@ -4287,7 +4283,7 @@ can be bound to a key and thus treated as a macro. For example: @end itemize @node Invalid prefix characters, Terminal setup code works after Emacs has begun, Binding keys to commands, Key bindings -@section Why does Emacs say "Key sequence XXX uses invalid prefix characters"? +@section Why does Emacs say @samp{Key sequence XXX uses invalid prefix characters}? @cindex Prefix characters, invalid @cindex Invalid prefix characters @cindex Misspecified key sequences @@ -4682,7 +4678,7 @@ translation. @cindex Generating control characters @cindex Control characters, generating -On terminals (but not under X), some common "aliases" are: +On terminals (but not under X), some common ``aliases'' are: @table @asis From 2b96f80c1702aa77b10fe6073ab6ec9ea3baab04 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 28 Aug 2004 00:50:35 +0000 Subject: [PATCH 261/341] *** empty log message *** --- lispref/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 894d78646d1..234cc779019 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,9 @@ +2004-08-27 Luc Teirlinck + + * abbrevs.texi (Abbrev Expansion): `abbrev-start-location' can be + an integer or a marker. + (Abbrev Expansion): Replace example for `pre-abbrev-expand-hook'. + 2004-08-22 Richard M. Stallman * modes.texi (Major Mode Conventions): Discuss rebinding of From 06d5f0ed4c75906e82c8a644eea53b8a342313c3 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 28 Aug 2004 01:59:29 +0000 Subject: [PATCH 262/341] (Acknowledgments): Put inside @iftex instead of @ifnotinfo. --- man/emacs.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/emacs.texi b/man/emacs.texi index 68997c0265d..82d87f693aa 100644 --- a/man/emacs.texi +++ b/man/emacs.texi @@ -955,7 +955,7 @@ company policy is unsympathetic to the idea of donating to charity, you might instead suggest ordering a CD-ROM from the Foundation occasionally, or subscribing to periodic updates. -@ifnotinfo +@iftex @node Acknowledgments, Intro, Distrib, Top @unnumberedsec Acknowledgments @@ -1000,7 +1000,7 @@ Warsaw, Morten Welinder, Joseph Brian Wells, Rodney Whitby, Ed Wilkinson, Mike Williams, Steven A. Wood, Dale R. Worley, Felix S. T. Wu, Tom Wurgler, Eli Zaretskii, Jamie Zawinski, Ian T. Zimmermann, Reto Zimmermann, and Neal Ziring. -@end ifnotinfo +@end iftex @node Intro, Glossary, Distrib, Top @unnumbered Introduction From acaa6478a891407b3ad758b7d394e8e367efd0e5 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 28 Aug 2004 02:14:16 +0000 Subject: [PATCH 263/341] (Basic Window): When using a window system, the value of point in a non-selected window is indicated by a hollow box. (Split Window): Side by side windows are separated by a scrollbar, if scrollbars are used. C-Mouse-2 on scrollbar now also works for toolkit scrollbars. (Change Window): Correct Mouse-2 vs Mouse-3 mess-up. (Window Convenience): Update bindings for `winner-undo' and `winner-redo'. --- man/windows.texi | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/man/windows.texi b/man/windows.texi index f9b4003f038..8416c4be076 100644 --- a/man/windows.texi +++ b/man/windows.texi @@ -1,5 +1,5 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001 Free Software Foundation, Inc. +@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2004 Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @node Windows, Frames, Buffers, Top @chapter Multiple Windows @@ -36,11 +36,11 @@ each window has its own value of point. At any time, one of the windows is the @dfn{selected window}; the buffer this window is displaying is the current buffer. The terminal's cursor shows the location of point in this window. Each other window -has a location of point as well, but since the terminal has only one -cursor there is no way to show where those locations are. When multiple -frames are visible in X, each frame has a cursor which appears in the -frame's selected window. The cursor in the selected frame is solid; the -cursor in other frames is a hollow box. +has a location of point as well. On text-only terminals, there is no +way to show where those locations are, since the terminal has only one +cursor. If you are using a window system, the location of point in a +non-selected window is indicated by a hollow box. The cursor in the +selected window is blinking or solid. Commands to move point affect the value of point for the selected Emacs window only. They do not change the value of point in any other Emacs @@ -93,20 +93,20 @@ numeric argument specifies how many lines to give to the top window. @findex split-window-horizontally @kbd{C-x 3} (@code{split-window-horizontally}) breaks the selected window into two side-by-side windows. A numeric argument specifies how -many columns to give the one on the left. A line of vertical bars -separates the two windows. Windows that are not the full width of the -screen have mode lines, but they are truncated. On terminals where -Emacs does not support highlighting, truncated mode lines sometimes do -not appear in inverse video. +many columns to give the one on the left. If you are not using +scrollbars, a line of vertical bars separates the two windows. +Windows that are not the full width of the screen have mode lines, but +they are truncated. On terminals where Emacs does not support +highlighting, truncated mode lines sometimes do not appear in inverse +video. @kindex C-Mouse-2 @r{(scroll bar)} You can split a window horizontally or vertically by clicking -@kbd{C-Mouse-2} in the mode line or the scroll bar. (This does not -work in scroll bars implemented by X toolkits.) The line of splitting -goes through the place where you click: if you click on the mode line, -the new scroll bar goes above the spot; if you click in the scroll -bar, the mode line of the split window is side by side with your -click. +@kbd{C-Mouse-2} in the mode line or the scroll bar. The line of +splitting goes through the place where you click: if you click on the +mode line, the new scroll bar goes above the spot; if you click in the +scroll bar, the mode line of the split window is side by side with +your click. @vindex truncate-partial-width-windows When a window is less than the full width, text lines too long to fit are @@ -319,8 +319,8 @@ the minibuffer); the selected window expands to use the whole frame except for the echo area. You can also delete a window by clicking on its mode line with -@kbd{Mouse-2}, and delete all the windows in a frame except one window -by clicking on that window's mode line with @kbd{Mouse-3}. +@kbd{Mouse-3}, and delete all the windows in a frame except one window +by clicking on that window's mode line with @kbd{Mouse-2}. The easiest way to adjust window heights is with a mouse. If you press @kbd{Mouse-1} on a mode line, you can drag that mode line up or @@ -370,8 +370,8 @@ heights of all the windows in the selected frame. @kbd{M-x winner-mode} is a global minor mode that records the changes in the window configuration (i.e. how the frames are partitioned into windows), so that you can ``undo'' them. To undo, -use @kbd{C-x left} (@code{winner-undo}). If you change your mind -while undoing, you can redo the changes you had undone using @kbd{C-x +use @kbd{C-c left} (@code{winner-undo}). If you change your mind +while undoing, you can redo the changes you had undone using @kbd{C-c right} (@code{M-x winner-redo}). Another way to enable Winner mode is by customizing the variable @code{winner-mode}. From 779bc8006b7f4d0e5be663af9ac3348906a2a9c6 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 28 Aug 2004 02:35:31 +0000 Subject: [PATCH 264/341] (Secondary Selection): Setting the secondary selection with M-Drag-Mouse-1 does not alter the kill ring, setting it with M-Mouse-1 and M-Mouse-3 does. (Mode Line Mouse): C-Mouse-2 on scroll bar now also works for toolkit scroll bars. (Scroll Bars): Ditto. --- man/ChangeLog | 23 ++++++++++++++++++++--- man/frames.texi | 24 ++++++++++++------------ 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 3198a3f4537..bcdd54403cb 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,5 +1,21 @@ 2004-08-27 Luc Teirlinck + * frames.texi (Secondary Selection): Setting the secondary + selection with M-Drag-Mouse-1 does not alter the kill ring, + setting it with M-Mouse-1 and M-Mouse-3 does. + (Mode Line Mouse): C-Mouse-2 on scroll bar now also works for + toolkit scroll bars. + (Scroll Bars): Ditto. + + * windows.texi (Basic Window): When using a window system, the value + of point in a non-selected window is indicated by a hollow box. + (Split Window): Side by side windows are separated by a scroll bar, + if scroll bars are used. + C-Mouse-2 on scroll bar now also works for toolkit scroll bars. + (Change Window): Correct Mouse-2 vs Mouse-3 mess-up. + (Window Convenience): Update bindings for `winner-undo' and + `winner-redo'. + * ack.texi (Acknowledgments): Use `@unnumbered'. * misc.texi : Adapt sectioning in Info to the node structure. (Invoking emacsclient): Make "Invoking emacsclient" a subsection @@ -12,7 +28,8 @@ Rearrange order of nodes and sections such that both "GNU GENERAL PUBLIC LICENSE" and "GNU Free Documentation License" appear at the end, as appropriate for appendices. - (Acknowledgments): Use `@unnumberedsec'. + (Acknowledgments): Put inside @iftex instead of @ifnotinfo. + Use `@unnumberedsec'. * trouble.texi: Adapt sectioning in Info to the node structure. Adapt node pointers to change in emacs.texi. * cmdargs.texi, doclicense.texi: Adapt node pointers. @@ -21,8 +38,8 @@ * faq.texi: Fix texinfo usage, esp. doublequotes. (Difference between Emacs and XEmacs): Some clarification. - - * faq.texi (Difference between Emacs and XEmacs): + + * faq.texi (Difference between Emacs and XEmacs): Explain not to contrast XEmacs with GNU Emacs. 2004-08-26 Richard M. Stallman diff --git a/man/frames.texi b/man/frames.texi index 7896adc41f6..50b6a4ed398 100644 --- a/man/frames.texi +++ b/man/frames.texi @@ -1,5 +1,5 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 99, 2000, 2001 +@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 99, 2000, 2001, 2004 @c Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @node Frames, International, Windows, Top @@ -230,6 +230,8 @@ dragging, the window scrolls at a steady rate until you move the mouse back into the window. This way, you can mark regions that don't fit entirely on the screen. +This way of setting the secondary selection does not alter the kill ring. + @findex mouse-start-secondary @kindex M-Mouse-1 @item M-Mouse-1 @@ -240,8 +242,9 @@ Set one endpoint for the @dfn{secondary selection} @kindex M-Mouse-3 @item M-Mouse-3 Make a secondary selection, using the place specified with @kbd{M-Mouse-1} -as the other end (@code{mouse-secondary-save-then-kill}). A second click -at the same place kills the secondary selection just made. +as the other end (@code{mouse-secondary-save-then-kill}). This also +puts the selected text in the kill ring. A second click at the same +place kills the secondary selection just made. @findex mouse-yank-secondary @kindex M-Mouse-2 @@ -376,8 +379,7 @@ horizontally, above the place in the mode line where you click. @kindex C-Mouse-2 @r{(scroll bar)} @kbd{C-Mouse-2} on a scroll bar splits the corresponding window -vertically, unless you are using an X toolkit's implementation of -scroll bars. @xref{Split Window}. +vertically. @xref{Split Window}. The commands above apply to areas of the mode line which do not have special mouse bindings of their own. Some areas, such as the buffer @@ -747,10 +749,8 @@ the level where you click up to the top of the window. @kbd{Mouse-3} down to the level where you click. By clicking repeatedly in the same place, you can scroll by the same distance over and over. - If you are using Emacs's own implementation of scroll bars, as opposed -to scroll bars from an X toolkit, you can also click @kbd{C-Mouse-2} in -the scroll bar to split a window vertically. The split occurs on the -line where you click. + You can also click @kbd{C-Mouse-2} in the scroll bar to split a +window vertically. The split occurs on the line where you click. @findex scroll-bar-mode @vindex scroll-bar-mode @@ -800,9 +800,9 @@ buffers are scrolled. @section Drag and drop in Emacs. @cindex drag and drop - Emacs supports drag and drop so that dropping of files and text is handeled. + Emacs supports drag and drop so that dropping of files and text is handled. Currently supported drag and drop protocols are XDND, Motif and the old -KDE 1.x protocol. There is no drag support yet. +KDE 1.x protocol. There is no drag support yet. When text is dropped on Emacs, Emacs inserts the text where it is dropped. When a file is dragged from a file manager to Emacs, Emacs opens that file. As a special case, if a file is dropped on a dired buffer the file is @@ -896,7 +896,7 @@ file names. You can customize the option @code{use-file-dialog} to suppress the use of file selection windows even if you still want other kinds -of dialogs. This option has no effect if you have supressed all dialog +of dialogs. This option has no effect if you have suppressed all dialog boxes with the option @code{use-dialog-box}. From 1b6d517f29bb81996bc6c2ee1a3deb6355959371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Sat, 28 Aug 2004 07:45:42 +0000 Subject: [PATCH 265/341] * FOR-RELEASE (Indications): Removed entry about GTK and geometry, (now behaves as well as other ports). --- admin/ChangeLog | 5 +++++ admin/FOR-RELEASE | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/ChangeLog b/admin/ChangeLog index b164f414a88..05437fce532 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2004-08-28 Jan Dj,Ad(Brv + + * FOR-RELEASE (Indications): Removed entry about GTK and geometry, + (now behaves as well as other ports). + 2004-06-28 Jan Dj,Ad(Brv * FOR-RELEASE: Removed entry about GTK and monochrome displays (done). diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 2d5738a8683..8cdfb2c5dab 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -38,8 +38,6 @@ isearch faces. * GTK RELATED BUGS -** Make geometry specifications work correctly for GTK. - ** Make GTK scrollbars behave like others w.r.t. overscrolling. From 87fdf320e91ef0ed5c83f69ff40191d6ba936efc Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 28 Aug 2004 14:00:38 +0000 Subject: [PATCH 266/341] (prin1-char): Put `shift' modifier into the basic character, if it has an uppercase form. --- lisp/emacs-lisp/lisp-mode.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index df05555ae7b..bcc9c2a89a7 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -459,14 +459,20 @@ alternative printed representations that can be displayed." If CHAR is not a character, return nil." (and (integerp char) (eventp char) - (let ((c (event-basic-type char))) + (let ((c (event-basic-type char)) + (mods (event-modifiers char))) + ;; Prevent ?A from turning into ?\S-a. + (if (and (memq 'shift mods) + (not (let ((case-fold-search nil)) + (char-equal c (upcase c))))) + (setq c (upcase c) mods nil)) (concat "?" (mapconcat (lambda (modif) (cond ((eq modif 'super) "\\s-") (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-)))) - (event-modifiers char) "") + mods "") (cond ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) ((eq c 127) "\\C-?") From a0d84262dce24db23d5c71869269469f61abdc5e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 28 Aug 2004 15:30:10 +0000 Subject: [PATCH 267/341] (find-tag-default): Moved from etags.el. --- lisp/subr.el | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index 4eb1f691ff4..49b85e18394 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1969,6 +1969,27 @@ Uses the `derived-mode-parent' property of the symbol to trace backwards." (setq parent (get parent 'derived-mode-parent)))) parent)) +(defun find-tag-default () + "Determine default tag to search for, based on text at point. +If there is no plausible default, return nil." + (save-excursion + (while (looking-at "\\sw\\|\\s_") + (forward-char 1)) + (if (or (re-search-backward "\\sw\\|\\s_" + (save-excursion (beginning-of-line) (point)) + t) + (re-search-forward "\\(\\sw\\|\\s_\\)+" + (save-excursion (end-of-line) (point)) + t)) + (progn (goto-char (match-end 0)) + (buffer-substring-no-properties + (point) + (progn (forward-sexp -1) + (while (looking-at "\\s'") + (forward-char 1)) + (point)))) + nil))) + (defmacro with-syntax-table (table &rest body) "Evaluate BODY with syntax table of current buffer set to TABLE. The syntax table of the current buffer is saved, BODY is evaluated, and the From fb1558445c2d42add2852e4dd26b79d69cf321c9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 28 Aug 2004 15:30:31 +0000 Subject: [PATCH 268/341] (find-tag-default): Moved to subr.el. --- lisp/progmodes/etags.el | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 4464df3a916..ddbd2ce6f35 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -772,26 +772,6 @@ Assumes the tags table is the current buffer." (all-completions string (tags-completion-table) predicate) (try-completion string (tags-completion-table) predicate)))) -;; Return a default tag to search for, based on the text at point. -(defun find-tag-default () - (save-excursion - (while (looking-at "\\sw\\|\\s_") - (forward-char 1)) - (if (or (re-search-backward "\\sw\\|\\s_" - (save-excursion (beginning-of-line) (point)) - t) - (re-search-forward "\\(\\sw\\|\\s_\\)+" - (save-excursion (end-of-line) (point)) - t)) - (progn (goto-char (match-end 0)) - (buffer-substring-no-properties - (point) - (progn (forward-sexp -1) - (while (looking-at "\\s'") - (forward-char 1)) - (point)))) - nil))) - ;; Read a tag name from the minibuffer with defaulting and completion. (defun find-tag-tag (string) (let* ((completion-ignore-case (if (memq tags-case-fold-search '(t nil)) From 8a9cad92b1c9eecbdc9268a885413b7c5d08c7fa Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 28 Aug 2004 15:31:20 +0000 Subject: [PATCH 269/341] (grep-default-command): Use find-tag-default. (grep-tag-default): Function deleted. --- lisp/progmodes/grep.el | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 5b678f26171..f4acd564a3c 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -384,9 +384,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." (let ((tag-default (funcall (or find-tag-default-function (get major-mode 'find-tag-default-function) - ;; We use grep-tag-default instead of - ;; find-tag-default, to avoid loading etags. - 'grep-tag-default))) + 'find-tag-default))) (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)") (grep-default (or (car grep-history) grep-command))) ;; Replace the thing matching for with that around cursor. @@ -457,25 +455,6 @@ temporarily highlight in visited source lines." (set (make-local-variable 'compilation-error-regexp-alist) grep-regexp-alist)) -;; This is a copy of find-tag-default from etags.el. -;;;###autoload -(defun grep-tag-default () - (save-excursion - (while (looking-at "\\sw\\|\\s_") - (forward-char 1)) - (when (or (re-search-backward "\\sw\\|\\s_" - (save-excursion (beginning-of-line) (point)) - t) - (re-search-forward "\\(\\sw\\|\\s_\\)+" - (save-excursion (end-of-line) (point)) - t)) - (goto-char (match-end 0)) - (buffer-substring (point) - (progn (forward-sexp -1) - (while (looking-at "\\s'") - (forward-char 1)) - (point)))))) - ;;;###autoload (defun grep-find (command-args) "Run grep via find, with user-specified args COMMAND-ARGS. From ea2e9f8dc96dc66f57318731bb44aebb8c61271d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 28 Aug 2004 15:32:06 +0000 Subject: [PATCH 270/341] Whitespace change. --- lisp/ChangeLog | 12 ++++++++++++ lisp/emacs-lisp/lisp-mode.el | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66ef44650d5..af7cb76df6b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2004-08-28 Richard M. Stallman + + * progmodes/grep.el (grep-default-command): Use find-tag-default. + (grep-tag-default): Function deleted. + + * subr.el (find-tag-default): Moved from etags.el. + + * progmodes/etags.el (find-tag-default): Moved to subr.el. + + * emacs-lisp/lisp-mode.el (prin1-char): Put `shift' modifier + into the basic character if it has an uppercase form. + 2004-08-27 Kenichi Handa * international/utf-8.el (utf-8-post-read-conversion): If the diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index bcc9c2a89a7..d6f601cd121 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -363,7 +363,7 @@ if that value is non-nil." (when (stringp default) (if (string-match ":+" default) (substring default (match-end 0)) - default)))) + default)))) ;; Used in old LispM code. (defalias 'common-lisp-mode 'lisp-mode) From bc57b735864ed31b2c3fe7ee8638bcef7f920f37 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 28 Aug 2004 16:13:32 +0000 Subject: [PATCH 271/341] (edit-tab-stops-buffer): Doc fix. --- lisp/indent.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/indent.el b/lisp/indent.el index e56db11b6f1..2d223b05ad6 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -442,8 +442,8 @@ This should be a list of integers, ordered from smallest to largest." "Keymap used in `edit-tab-stops'.") (defvar edit-tab-stops-buffer nil - "Buffer whose tab stops are being edited--in case -the variable `tab-stop-list' is local in that buffer.") + "Buffer whose tab stops are being edited. +This matters if the variable `tab-stop-list' is local in that buffer.") (defun edit-tab-stops () "Edit the tab stops used by `tab-to-tab-stop'. From a71eb4358f07a506b6413cd7f17f266077f269de Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 28 Aug 2004 16:23:49 +0000 Subject: [PATCH 272/341] *** empty log message *** --- lisp/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index af7cb76df6b..faf8c354e23 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-08-28 Luc Teirlinck + + * indent.el (edit-tab-stops-buffer): Doc fix. + 2004-08-28 Richard M. Stallman * progmodes/grep.el (grep-default-command): Use find-tag-default. From e3c90032654790641e7fe83f9df8b0002cff7496 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 28 Aug 2004 18:44:24 +0000 Subject: [PATCH 273/341] (Emacs for MS-DOS): Update URLs for the MS-DOS port of Emacs and related programs. --- man/ChangeLog | 5 +++++ man/faq.texi | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index bcdd54403cb..d859a3b2fe0 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2004-08-28 Eli Zaretskii + + * faq.texi (Emacs for MS-DOS): Update URLs for the MS-DOS port of + Emacs and related programs. + 2004-08-27 Luc Teirlinck * frames.texi (Secondary Selection): Setting the secondary diff --git a/man/faq.texi b/man/faq.texi index 14ed2de3332..6ca849d7b1e 100644 --- a/man/faq.texi +++ b/man/faq.texi @@ -3626,17 +3626,17 @@ Windows (3.X, 9X, ME, NT, and 2000) and supports long file names under Windows 9X, Windows ME, and Windows 2000. More information is available from -@uref{http://www.simtel.net/pub/djgpp/v2gnu/emacs.README} +@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/emacs.README} The binary itself is available in the files @file{em*.zip} in the directory -@uref{http://www.simtel.net/pub/djgpp/v2gnu/} +@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/} If you prefer to compile Emacs for yourself, you can do so with the current distribution directly. You will need a 386 (or better) processor, and to be running MS-DOS 3.0 or later. According to -@email{eliz@@is.elta.co.il, Eli Zaretskii} and +@email{eliz@@gnu.org, Eli Zaretskii} and @email{hankedr@@dms.auburn.edu, Darrel Hankerson}, you will need the following: @@ -3650,7 +3650,7 @@ long file names on Windows 9X/ME/2K. You can get the latest release of DJGPP by retrieving all of the files in -@uref{http://www.simtel.net/pub/gnu/djgpp/v2*} +@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2*} @item Unpacking program The easiest way is to use @code{djtar} which comes with DJGPP v2.x, @@ -3669,7 +3669,7 @@ actually prevent Emacs from building successfully! @item make, mv, sed, and rm All of these utilities are available at -@uref{http://www.simtel.net/pub/gnu/djgpp/v2gnu} +@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu} 16-bit utilities can be found in GNUish, at From 2222855e833fccb2c3a620e31855d81a7364ae6d Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Sun, 29 Aug 2004 16:56:17 +0000 Subject: [PATCH 274/341] Fixing whitespace style issue with #define --- src/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index b9299910186..a90111b22b6 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6304,7 +6304,7 @@ and `read-file-name-function'. */) GCPRO2 (insdef, default_filename); -#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined(TARGET_API_MAC_CARBON) +#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined (TARGET_API_MAC_CARBON) if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) && use_dialog_box && use_file_dialog From cfb0cdc1fd45b4720605c789ee9d687addb21b9b Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 29 Aug 2004 20:04:45 +0000 Subject: [PATCH 275/341] Add ack.texi and AUTHORS. --- admin/FOR-RELEASE | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 8cdfb2c5dab..fbbacaf6456 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -14,6 +14,10 @@ Tasks needed before the next release. ** Update man/info.texi. +** Update man/ack.texi. + +** Update AUTHORS. + * NEW FEATURES From 2661eae951908207096f1893eb3159c4944cf2e2 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 29 Aug 2004 20:55:46 +0000 Subject: [PATCH 276/341] *** empty log message *** --- admin/ChangeLog | 8 ++++++-- lisp/ChangeLog | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/admin/ChangeLog b/admin/ChangeLog index 05437fce532..dafae3c1158 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,11 +1,15 @@ +2004-08-29 Kim F. Storm + + * FOR-RELEASE (Documentation): Add man/ack.texi and AUTHORS. + 2004-08-28 Jan Dj,Ad(Brv - * FOR-RELEASE (Indications): Removed entry about GTK and geometry, + * FOR-RELEASE (Indications): Remove entry about GTK and geometry, (now behaves as well as other ports). 2004-06-28 Jan Dj,Ad(Brv - * FOR-RELEASE: Removed entry about GTK and monochrome displays (done). + * FOR-RELEASE: Remove entry about GTK and monochrome displays (done). 2002-06-26 Eli Zaretskii diff --git a/lisp/ChangeLog b/lisp/ChangeLog index faf8c354e23..5168f53d1cb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,43 @@ +2004-08-29 Kim F. Storm + + * emulation/cua-base.el (cua-auto-expand-rectangles): Remove + automatic rectangle padding feature; replace by non-destructive + virtual rectangle edges feature. + (cua-virtual-rectangle-edges): New defcustom. + (cua-auto-tabify-rectangles): New defcustom. + (cua-paste): If paste into a marked rectangle, insert rectangle at + current column, even if virtual; also paste exactly as many lines + as has been marked (ignore additional lines or add empty lines), + but paste whole source if only one line is marked. + (cua--update-indications): No longer use overwrite-cursor to + indicate rectangle padding + + * emulation/cua-rect.el (cua--rectangle-padding): Remove. + (cua--rectangle-virtual-edges): New defun. + (cua--rectangle-get-corners): Remove optional PAD arg. + (cua--rectangle-set-corners): Never do padding. + (cua--forward-line): Remove optional PAD arg. Simplify. + (cua-resize-rectangle-right, cua-resize-rectangle-left) + (cua-resize-rectangle-down, cua-resize-rectangle-up): + (cua-resize-rectangle-bot, cua-resize-rectangle-top) + (cua-resize-rectangle-page-up, cua-resize-rectangle-page-down) + (cua--rectangle-move): Never do padding. Simplify. + (cua--tabify-start): New defun. + (cua--rectangle-operation): Add tabify arg. All callers changed. + (cua--pad-rectangle): Remove. + (cua--delete-rectangle): Handle delete with virtual edges. + (cua--extract-rectangle): Add spaces if rectangle has virtual edges. + (cua--insert-rectangle): Handle insert at virtual column. + Perform auto-tabify if necessary. + (cua--activate-rectangle): Remove optional FORCE arg. + Never do padding. Simplify. + (cua--highlight-rectangle): Enhance for virtual edges. + (cua-toggle-rectangle-padding): Remove command. + (cua-toggle-rectangle-virtual-edges): New command. + (cua-sequence-rectangle): Add optional TABIFY arg. Callers changed. + (cua--rectangle-post-command): Don't force rectangle padding. + (cua--init-rectangles): Bind M-p to cua-toggle-rectangle-virtual-edges. + 2004-08-28 Luc Teirlinck * indent.el (edit-tab-stops-buffer): Doc fix. From 7279710840de2d2d67d6a91ebfa0a857372de5ec Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 29 Aug 2004 20:57:19 +0000 Subject: [PATCH 277/341] (cua--rectangle-padding): Remove. (cua--rectangle-virtual-edges): New defun. (cua--rectangle-get-corners): Remove optional PAD arg. (cua--rectangle-set-corners): Never do padding. (cua--forward-line): Remove optional PAD arg. Simplify. (cua-resize-rectangle-right, cua-resize-rectangle-left) (cua-resize-rectangle-down, cua-resize-rectangle-up): (cua-resize-rectangle-bot, cua-resize-rectangle-top) (cua-resize-rectangle-page-up, cua-resize-rectangle-page-down) (cua--rectangle-move): Never do padding. Simplify. (cua--tabify-start): New defun. (cua--rectangle-operation): Add tabify arg. All callers changed. (cua--pad-rectangle): Remove. (cua--delete-rectangle): Handle delete with virtual edges. (cua--extract-rectangle): Add spaces if rectangle has virtual edges. (cua--insert-rectangle): Handle insert at virtual column. Perform auto-tabify if necessary. (cua--activate-rectangle): Remove optional FORCE arg. Never do padding. Simplify. (cua--highlight-rectangle): Enhance for virtual edges. (cua-toggle-rectangle-padding): Remove command. (cua-toggle-rectangle-virtual-edges): New command. (cua-sequence-rectangle): Add optional TABIFY arg. Callers changed. (cua--rectangle-post-command): Don't force rectangle padding. (cua--init-rectangles): Bind M-p to cua-toggle-rectangle-virtual-edges. --- lisp/emulation/cua-rect.el | 386 +++++++++++++++++++++++-------------- 1 file changed, 240 insertions(+), 146 deletions(-) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 965fe63bced..626ef22cf2d 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -44,10 +44,10 @@ (require 'rect) ;; If non-nil, restrict current region to this rectangle. -;; Value is a vector [top bot left right corner ins pad select]. +;; Value is a vector [top bot left right corner ins virt select]. ;; CORNER specifies currently active corner 0=t/l 1=t/r 2=b/l 3=b/r. ;; INS specifies whether to insert on left(nil) or right(t) side. -;; If PAD is non-nil, tabs are converted to spaces when necessary. +;; If VIRT is non-nil, virtual straight edges are enabled. ;; If SELECT is a regexp, only lines starting with that regexp are affected.") (defvar cua--rectangle nil) (make-variable-buffer-local 'cua--rectangle) @@ -65,6 +65,8 @@ (defvar cua--rectangle-overlays nil) (make-variable-buffer-local 'cua--rectangle-overlays) +(defvar cua--virtual-edges-debug nil) + ;; Per-buffer CUA mode undo list. (defvar cua--undo-list nil) (make-variable-buffer-local 'cua--undo-list) @@ -97,7 +99,7 @@ Knows about CUA rectangle highlighting in addition to standard undo." (defvar cua--tidy-undo-counter 0 "Number of times `cua--tidy-undo-lists' have run successfully.") -;; Clean out danling entries from cua's undo list. +;; Clean out dangling entries from cua's undo list. ;; Since this list contains pointers into the standard undo list, ;; such references are only meningful as undo information if the ;; corresponding entry is still on the standard undo list. @@ -203,11 +205,11 @@ Knows about CUA rectangle highlighting in addition to standard undo." (aref cua--rectangle 5)) (cua--rectangle-left)))) -(defun cua--rectangle-padding (&optional set val) - ;; Current setting of rectangle padding +(defun cua--rectangle-virtual-edges (&optional set val) + ;; Current setting of rectangle virtual-edges (if set (aset cua--rectangle 6 val)) - (and (not buffer-read-only) + (and ;(not buffer-read-only) (aref cua--rectangle 6))) (defun cua--rectangle-restriction (&optional val bounded negated) @@ -226,7 +228,7 @@ Knows about CUA rectangle highlighting in addition to standard undo." (if (< (cua--rectangle-bot) (cua--rectangle-top)) (message "rectangle bot < top"))) -(defun cua--rectangle-get-corners (&optional pad) +(defun cua--rectangle-get-corners () ;; Calculate the rectangular region represented by point and mark, ;; putting start in the upper left corner and end in the ;; bottom right corner. @@ -245,12 +247,12 @@ Knows about CUA rectangle highlighting in addition to standard undo." (setq r (1- r))) (setq l (prog1 r (setq r l))) (goto-char top) - (move-to-column l pad) + (move-to-column l) (setq top (point)) (goto-char bot) - (move-to-column r pad) + (move-to-column r) (setq bot (point)))) - (vector top bot l r corner 0 pad nil))) + (vector top bot l r corner 0 cua-virtual-rectangle-edges nil))) (defun cua--rectangle-set-corners () ;; Set mark and point in opposite corners of current rectangle. @@ -269,24 +271,21 @@ Knows about CUA rectangle highlighting in addition to standard undo." (setq pp (cua--rectangle-bot) pc (cua--rectangle-right) mp (cua--rectangle-top) mc (cua--rectangle-left)))) (goto-char mp) - (move-to-column mc (cua--rectangle-padding)) + (move-to-column mc) (set-mark (point)) (goto-char pp) - (move-to-column pc (cua--rectangle-padding)))) + (move-to-column pc) + )) ;;; Rectangle resizing -(defun cua--forward-line (n pad) +(defun cua--forward-line (n) ;; Move forward/backward one line. Returns t if movement. - (if (or (not pad) (< n 0)) - (= (forward-line n) 0) - (next-line 1) - t)) + (= (forward-line n) 0)) (defun cua--rectangle-resized () ;; Refresh state after resizing rectangle (setq cua--buffer-and-point-before-command nil) - (cua--pad-rectangle) (cua--rectangle-insert-col 0) (cua--rectangle-set-corners) (cua--keep-active)) @@ -294,47 +293,35 @@ Knows about CUA rectangle highlighting in addition to standard undo." (defun cua-resize-rectangle-right (n) "Resize rectangle to the right." (interactive "p") - (let ((pad (cua--rectangle-padding)) (resized (> n 0))) + (let ((resized (> n 0))) (while (> n 0) (setq n (1- n)) (cond - ((and (cua--rectangle-right-side) (or pad (eolp))) - (cua--rectangle-right (1+ (cua--rectangle-right))) - (move-to-column (cua--rectangle-right) pad)) ((cua--rectangle-right-side) - (forward-char 1) - (cua--rectangle-right (current-column))) - ((or pad (eolp)) - (cua--rectangle-left (1+ (cua--rectangle-left))) - (move-to-column (cua--rectangle-right) pad)) + (cua--rectangle-right (1+ (cua--rectangle-right))) + (move-to-column (cua--rectangle-right))) (t - (forward-char 1) - (cua--rectangle-left (current-column))))) + (cua--rectangle-left (1+ (cua--rectangle-left))) + (move-to-column (cua--rectangle-right))))) (if resized (cua--rectangle-resized)))) (defun cua-resize-rectangle-left (n) "Resize rectangle to the left." (interactive "p") - (let ((pad (cua--rectangle-padding)) resized) + (let (resized) (while (> n 0) (setq n (1- n)) (if (or (= (cua--rectangle-right) 0) (and (not (cua--rectangle-right-side)) (= (cua--rectangle-left) 0))) (setq n 0) (cond - ((and (cua--rectangle-right-side) (or pad (eolp) (bolp))) - (cua--rectangle-right (1- (cua--rectangle-right))) - (move-to-column (cua--rectangle-right) pad)) ((cua--rectangle-right-side) - (backward-char 1) - (cua--rectangle-right (current-column))) - ((or pad (eolp) (bolp)) - (cua--rectangle-left (1- (cua--rectangle-left))) - (move-to-column (cua--rectangle-right) pad)) + (cua--rectangle-right (1- (cua--rectangle-right))) + (move-to-column (cua--rectangle-right))) (t - (backward-char 1) - (cua--rectangle-left (current-column)))) + (cua--rectangle-left (1- (cua--rectangle-left))) + (move-to-column (cua--rectangle-right)))) (setq resized t))) (if resized (cua--rectangle-resized)))) @@ -342,20 +329,20 @@ Knows about CUA rectangle highlighting in addition to standard undo." (defun cua-resize-rectangle-down (n) "Resize rectangle downwards." (interactive "p") - (let ((pad (cua--rectangle-padding)) resized) + (let (resized) (while (> n 0) (setq n (1- n)) (cond ((>= (cua--rectangle-corner) 2) (goto-char (cua--rectangle-bot)) - (when (cua--forward-line 1 pad) - (move-to-column (cua--rectangle-column) pad) + (when (cua--forward-line 1) + (move-to-column (cua--rectangle-column)) (cua--rectangle-bot t) (setq resized t))) (t (goto-char (cua--rectangle-top)) - (when (cua--forward-line 1 pad) - (move-to-column (cua--rectangle-column) pad) + (when (cua--forward-line 1) + (move-to-column (cua--rectangle-column)) (cua--rectangle-top t) (setq resized t))))) (if resized @@ -364,20 +351,20 @@ Knows about CUA rectangle highlighting in addition to standard undo." (defun cua-resize-rectangle-up (n) "Resize rectangle upwards." (interactive "p") - (let ((pad (cua--rectangle-padding)) resized) + (let (resized) (while (> n 0) (setq n (1- n)) (cond ((>= (cua--rectangle-corner) 2) (goto-char (cua--rectangle-bot)) - (when (cua--forward-line -1 pad) - (move-to-column (cua--rectangle-column) pad) + (when (cua--forward-line -1) + (move-to-column (cua--rectangle-column)) (cua--rectangle-bot t) (setq resized t))) (t (goto-char (cua--rectangle-top)) - (when (cua--forward-line -1 pad) - (move-to-column (cua--rectangle-column) pad) + (when (cua--forward-line -1) + (move-to-column (cua--rectangle-column)) (cua--rectangle-top t) (setq resized t))))) (if resized @@ -408,7 +395,7 @@ Knows about CUA rectangle highlighting in addition to standard undo." "Resize rectangle to bottom of buffer." (interactive) (goto-char (point-max)) - (move-to-column (cua--rectangle-column) (cua--rectangle-padding)) + (move-to-column (cua--rectangle-column)) (cua--rectangle-bot t) (cua--rectangle-resized)) @@ -416,31 +403,29 @@ Knows about CUA rectangle highlighting in addition to standard undo." "Resize rectangle to top of buffer." (interactive) (goto-char (point-min)) - (move-to-column (cua--rectangle-column) (cua--rectangle-padding)) + (move-to-column (cua--rectangle-column)) (cua--rectangle-top t) (cua--rectangle-resized)) (defun cua-resize-rectangle-page-up () "Resize rectangle upwards by one scroll page." (interactive) - (let ((pad (cua--rectangle-padding))) - (scroll-down) - (move-to-column (cua--rectangle-column) pad) - (if (>= (cua--rectangle-corner) 2) - (cua--rectangle-bot t) - (cua--rectangle-top t)) - (cua--rectangle-resized))) + (scroll-down) + (move-to-column (cua--rectangle-column)) + (if (>= (cua--rectangle-corner) 2) + (cua--rectangle-bot t) + (cua--rectangle-top t)) + (cua--rectangle-resized)) (defun cua-resize-rectangle-page-down () "Resize rectangle downwards by one scroll page." (interactive) - (let ((pad (cua--rectangle-padding))) - (scroll-up) - (move-to-column (cua--rectangle-column) pad) - (if (>= (cua--rectangle-corner) 2) - (cua--rectangle-bot t) - (cua--rectangle-top t)) - (cua--rectangle-resized))) + (scroll-up) + (move-to-column (cua--rectangle-column)) + (if (>= (cua--rectangle-corner) 2) + (cua--rectangle-bot t) + (cua--rectangle-top t)) + (cua--rectangle-resized)) ;;; Mouse support @@ -450,7 +435,8 @@ Knows about CUA rectangle highlighting in addition to standard undo." "Set rectangle corner at mouse click position." (interactive "e") (mouse-set-point event) - (if (cua--rectangle-padding) + ;; FIX ME -- need to calculate virtual column. + (if (cua--rectangle-virtual-edges) (move-to-column (car (posn-col-row (event-end event))) t)) (if (cua--rectangle-right-side) (cua--rectangle-right (current-column)) @@ -470,6 +456,7 @@ Knows about CUA rectangle highlighting in addition to standard undo." (cua--deactivate t)) (setq cua--last-rectangle nil) (mouse-set-point event) + ;; FIX ME -- need to calculate virtual column. (cua-set-rectangle-mark) (setq cua--buffer-and-point-before-command nil) (setq cua--mouse-last-pos nil)) @@ -489,13 +476,13 @@ If command is repeated at same position, delete the rectangle." (let ((cua-keep-region-after-copy t)) (cua-copy-rectangle arg) (setq cua--mouse-last-pos (cons (point) cua--last-killed-rectangle))))) + (defun cua--mouse-ignore (event) (interactive "e") (setq this-command last-command)) (defun cua--rectangle-move (dir) - (let ((pad (cua--rectangle-padding)) - (moved t) + (let ((moved t) (top (cua--rectangle-top)) (bot (cua--rectangle-bot)) (l (cua--rectangle-left)) @@ -503,17 +490,17 @@ If command is repeated at same position, delete the rectangle." (cond ((eq dir 'up) (goto-char top) - (when (cua--forward-line -1 pad) + (when (cua--forward-line -1) (cua--rectangle-top t) (goto-char bot) (forward-line -1) (cua--rectangle-bot t))) ((eq dir 'down) (goto-char bot) - (when (cua--forward-line 1 pad) + (when (cua--forward-line 1) (cua--rectangle-bot t) (goto-char top) - (cua--forward-line 1 pad) + (cua--forward-line 1) (cua--rectangle-top t))) ((eq dir 'left) (when (> l 0) @@ -526,19 +513,37 @@ If command is repeated at same position, delete the rectangle." (setq moved nil))) (when moved (setq cua--buffer-and-point-before-command nil) - (cua--pad-rectangle) (cua--rectangle-set-corners) (cua--keep-active)))) ;;; Operations on current rectangle -(defun cua--rectangle-operation (keep-clear visible undo pad &optional fct post-fct) +(defun cua--tabify-start (start end) + ;; Return position where auto-tabify should start (or nil if not required). + (save-excursion + (save-restriction + (widen) + (and (not buffer-read-only) + cua-auto-tabify-rectangles + (if (or (not (integerp cua-auto-tabify-rectangles)) + (= (point-min) (point-max)) + (progn + (goto-char (max (point-min) + (- start cua-auto-tabify-rectangles))) + (search-forward "\t" (min (point-max) + (+ end cua-auto-tabify-rectangles)) t))) + start))))) + +(defun cua--rectangle-operation (keep-clear visible undo pad tabify &optional fct post-fct) ;; Call FCT for each line of region with 4 parameters: ;; Region start, end, left-col, right-col ;; Point is at start when FCT is called + ;; Call fct with (s,e) = whole lines if VISIBLE non-nil. + ;; Only call fct for visible lines if VISIBLE==t. ;; Set undo boundary if UNDO is non-nil. - ;; Rectangle is padded if PAD = t or numeric and (cua--rectangle-padding) + ;; Rectangle is padded if PAD = t or numeric and (cua--rectangle-virtual-edges) + ;; Perform auto-tabify after operation if TABIFY is non-nil. ;; Mark is kept if keep-clear is 'keep and cleared if keep-clear is 'clear. (let* ((start (cua--rectangle-top)) (end (cua--rectangle-bot)) @@ -546,11 +551,12 @@ If command is repeated at same position, delete the rectangle." (r (1+ (cua--rectangle-right))) (m (make-marker)) (tabpad (and (integerp pad) (= pad 2))) - (sel (cua--rectangle-restriction))) + (sel (cua--rectangle-restriction)) + (tabify-start (and tabify (cua--tabify-start start end)))) (if undo (cua--rectangle-undo-boundary)) (if (integerp pad) - (setq pad (cua--rectangle-padding))) + (setq pad (cua--rectangle-virtual-edges))) (save-excursion (save-restriction (widen) @@ -558,7 +564,7 @@ If command is repeated at same position, delete the rectangle." (goto-char end) (and (bolp) (not (eolp)) (not (eobp)) (setq end (1+ end)))) - (when visible + (when (eq visible t) (setq start (max (window-start) start)) (setq end (min (window-end) end))) (goto-char end) @@ -575,7 +581,7 @@ If command is repeated at same position, delete the rectangle." (forward-char 1)) (set-marker m (point)) (move-to-column l pad) - (if (and fct (>= (current-column) l) (<= (current-column) r)) + (if (and fct (or visible (and (>= (current-column) l) (<= (current-column) r)))) (let ((v t) (p (point))) (when sel (if (car (cdr sel)) @@ -585,8 +591,7 @@ If command is repeated at same position, delete the rectangle." (if (car (cdr (cdr sel))) (setq v (null v)))) (if visible - (unless (eolp) - (funcall fct p m l r v)) + (funcall fct p m l r v) (if v (funcall fct p m l r))))) (set-marker m nil) @@ -594,7 +599,9 @@ If command is repeated at same position, delete the rectangle." (if (not visible) (cua--rectangle-bot t)) (if post-fct - (funcall post-fct l r)))) + (funcall post-fct l r)) + (when tabify-start + (tabify tabify-start (point))))) (cond ((eq keep-clear 'keep) (cua--keep-active)) @@ -607,48 +614,96 @@ If command is repeated at same position, delete the rectangle." (put 'cua--rectangle-operation 'lisp-indent-function 4) -(defun cua--pad-rectangle (&optional pad) - (if (or pad (cua--rectangle-padding)) - (cua--rectangle-operation nil nil t t))) - (defun cua--delete-rectangle () - (cua--rectangle-operation nil nil t 2 - '(lambda (s e l r) - (if (and (> e s) (<= e (point-max))) - (delete-region s e))))) + (let ((lines 0)) + (if (not (cua--rectangle-virtual-edges)) + (cua--rectangle-operation nil nil t 2 t + '(lambda (s e l r v) + (setq lines (1+ lines)) + (if (and (> e s) (<= e (point-max))) + (delete-region s e)))) + (cua--rectangle-operation nil 1 t nil t + '(lambda (s e l r v) + (setq lines (1+ lines)) + (when (and (> e s) (<= e (point-max))) + (delete-region s e))))) + lines)) (defun cua--extract-rectangle () (let (rect) - (cua--rectangle-operation nil nil nil 1 - '(lambda (s e l r) - (setq rect (cons (buffer-substring-no-properties s e) rect)))) - (nreverse rect))) + (if (not (cua--rectangle-virtual-edges)) + (cua--rectangle-operation nil nil nil nil nil ; do not tabify + '(lambda (s e l r) + (setq rect (cons (buffer-substring-no-properties s e) rect)))) + (cua--rectangle-operation nil 1 nil nil nil ; do not tabify + '(lambda (s e l r v) + (let ((copy t) (bs 0) (as 0) row) + (if (= s e) (setq e (1+ e))) + (goto-char s) + (move-to-column l) + (if (= (point) (line-end-position)) + (setq bs (- r l) + copy nil) + (skip-chars-forward "\s\t" e) + (setq bs (- (min r (current-column)) l) + s (point)) + (move-to-column r) + (skip-chars-backward "\s\t" s) + (setq as (- r (max (current-column) l)) + e (point))) + (setq row (if (and copy (> e s)) + (buffer-substring-no-properties s e) + "")) + (when (> bs 0) + (setq row (concat (make-string bs ?\s) row))) + (when (> as 0) + (setq row (concat row (make-string as ?\s)))) + (setq rect (cons row rect)))))) + (nreverse rect))) -(defun cua--insert-rectangle (rect &optional below) +(defun cua--insert-rectangle (rect &optional below paste-column line-count) ;; Insert rectangle as insert-rectangle, but don't set mark and exit with ;; point at either next to top right or below bottom left corner ;; Notice: In overwrite mode, the rectangle is inserted as separate text lines. - (if (and below (eq below 'auto)) + (if (eq below 'auto) (setq below (and (bolp) (or (eolp) (eobp) (= (1+ (point)) (point-max)))))) + (unless paste-column + (setq paste-column (current-column))) (let ((lines rect) - (insertcolumn (current-column)) (first t) + (tabify-start (cua--tabify-start (point) (point))) + last-column p) (while (or lines below) (or first (if overwrite-mode (insert ?\n) (forward-line 1) - (or (bolp) (insert ?\n)) - (move-to-column insertcolumn t))) + (or (bolp) (insert ?\n)))) + (unless overwrite-mode + (move-to-column paste-column t)) (if (not lines) (setq below nil) (insert-for-yank (car lines)) + (unless last-column + (setq last-column (current-column))) (setq lines (cdr lines)) (and first (not below) (setq p (point)))) - (setq first nil)) + (setq first nil) + (if (and line-count (= (setq line-count (1- line-count)) 0)) + (setq lines nil))) + (when (and line-count last-column (not overwrite-mode)) + (while (> line-count 0) + (forward-line 1) + (or (bolp) (insert ?\n)) + (move-to-column paste-column t) + (insert-char ?\s (- last-column paste-column -1)) + (setq line-count (1- line-count)))) + (when (and tabify-start + (not overwrite-mode)) + (tabify tabify-start (point))) (and p (not overwrite-mode) (goto-char p)))) @@ -662,7 +717,7 @@ If command is repeated at same position, delete the rectangle." (function (lambda (row) (concat row "\n"))) killed-rectangle ""))))) -(defun cua--activate-rectangle (&optional force) +(defun cua--activate-rectangle () ;; Turn on rectangular marking mode by disabling transient mark mode ;; and manually handling highlighting from a post command hook. ;; Be careful if we are already marking a rectangle. @@ -671,12 +726,8 @@ If command is repeated at same position, delete the rectangle." (eq (car cua--last-rectangle) (current-buffer)) (eq (car (cdr cua--last-rectangle)) (point))) (cdr (cdr cua--last-rectangle)) - (cua--rectangle-get-corners - (and (not buffer-read-only) - (or cua-auto-expand-rectangles - force - (eq major-mode 'picture-mode))))) - cua--status-string (if (cua--rectangle-padding) " Pad" "") + (cua--rectangle-get-corners)) + cua--status-string (if (cua--rectangle-virtual-edges) " [R]" "") cua--last-rectangle nil)) ;; (defvar cua-save-point nil) @@ -698,7 +749,7 @@ If command is repeated at same position, delete the rectangle." ;; Each overlay extends across all the columns of the rectangle. ;; We try to reuse overlays where possible because this is more efficient ;; and results in less flicker. - ;; If cua--rectangle-padding is nil and the buffer contains tabs or short lines, + ;; If cua--rectangle-virtual-edges is nil and the buffer contains tabs or short lines, ;; the higlighted region may not be perfectly rectangular. (let ((deactivate-mark deactivate-mark) (old cua--rectangle-overlays) @@ -707,12 +758,59 @@ If command is repeated at same position, delete the rectangle." (right (1+ (cua--rectangle-right)))) (when (/= left right) (sit-for 0) ; make window top/bottom reliable - (cua--rectangle-operation nil t nil nil + (cua--rectangle-operation nil t nil nil nil ; do not tabify '(lambda (s e l r v) (let ((rface (if v 'cua-rectangle-face 'cua-rectangle-noselect-face)) - overlay) - ;; Trim old leading overlays. + overlay bs as) (if (= s e) (setq e (1+ e))) + (when (cua--rectangle-virtual-edges) + (let ((lb (line-beginning-position)) + (le (line-end-position)) + cl cl0 pl cr cr0 pr) + (goto-char s) + (setq cl (move-to-column l) + pl (point)) + (setq cr (move-to-column r) + pr (point)) + (if (= lb pl) + (setq cl0 0) + (goto-char (1- pl)) + (setq cl0 (current-column))) + (if (= lb le) + (setq cr0 0) + (goto-char (1- pr)) + (setq cr0 (current-column))) + (unless (and (= cl l) (= cr r)) + (when (/= cl l) + (setq bs (propertize + (make-string + (- l cl0 (if (and (= le pl) (/= le lb)) 1 0)) + (if cua--virtual-edges-debug ?. ?\s)) + 'face 'default)) + (if (/= pl le) + (setq s (1- s)))) + (cond + ((= cr r) + (if (and (/= cr0 (1- cr)) + (= (mod cr tab-width) 0)) + (setq e (1- e)))) + ((= cr cl) + (setq bs (concat bs + (propertize + (make-string + (- r l) + (if cua--virtual-edges-debug ?, ?\s)) + 'face rface))) + (setq rface nil)) + (t + (setq as (propertize + (make-string + (- r cr0 (if (= le pr) 1 0)) + (if cua--virtual-edges-debug ?~ ?\s)) + 'face rface)) + (if (/= pr le) + (setq e (1- e)))))))) + ;; Trim old leading overlays. (while (and old (setq overlay (car old)) (< (overlay-start overlay) s) @@ -728,8 +826,10 @@ If command is repeated at same position, delete the rectangle." (move-overlay overlay s e) (setq old (cdr old))) (setq overlay (make-overlay s e))) - (overlay-put overlay 'face rface) - (setq new (cons overlay new)))))) + (overlay-put overlay 'before-string bs) + (overlay-put overlay 'after-string as) + (overlay-put overlay 'face rface) + (setq new (cons overlay new)))))) ;; Trim old trailing overlays. (mapcar (function delete-overlay) old) (setq cua--rectangle-overlays (nreverse new)))) @@ -737,9 +837,9 @@ If command is repeated at same position, delete the rectangle." (defun cua--indent-rectangle (&optional ch to-col clear) ;; Indent current rectangle. (let ((col (cua--rectangle-insert-col)) - (pad (cua--rectangle-padding)) + (pad (cua--rectangle-virtual-edges)) indent) - (cua--rectangle-operation (if clear 'clear 'corners) nil t pad + (cua--rectangle-operation (if clear 'clear 'corners) nil t pad t '(lambda (s e l r) (move-to-column col pad) (if (and (eolp) @@ -877,21 +977,18 @@ With prefix argument, the toggle restriction." (cua--rectangle-corner (if (= (cua--rectangle-left) (cua--rectangle-right)) 0 1)) (cua--rectangle-set-corners)) -(defun cua-toggle-rectangle-padding () +(defun cua-toggle-rectangle-virtual-edges () (interactive) - (if buffer-read-only - (message "Cannot do padding in read-only buffer.") - (cua--rectangle-padding t (not (cua--rectangle-padding))) - (cua--pad-rectangle) - (cua--rectangle-set-corners)) - (setq cua--status-string (and (cua--rectangle-padding) " Pad")) + (cua--rectangle-virtual-edges t (not (cua--rectangle-virtual-edges))) + (cua--rectangle-set-corners) + (setq cua--status-string (and (cua--rectangle-virtual-edges) " [R]")) (cua--keep-active)) (defun cua-do-rectangle-padding () (interactive) (if buffer-read-only (message "Cannot do padding in read-only buffer.") - (cua--pad-rectangle t) + (cua--rectangle-operation nil nil t t t) (cua--rectangle-set-corners)) (cua--keep-active)) @@ -900,7 +997,7 @@ With prefix argument, the toggle restriction." The text previously in the region is not overwritten by the blanks, but instead winds up to the right of the rectangle." (interactive) - (cua--rectangle-operation 'corners nil t 1 + (cua--rectangle-operation 'corners nil t 1 nil '(lambda (s e l r) (skip-chars-forward " \t") (let ((ws (- (current-column) l)) @@ -915,7 +1012,7 @@ On each line in the rectangle, all continuous whitespace starting at that column is deleted. With prefix arg, also delete whitespace to the left of that column." (interactive "P") - (cua--rectangle-operation 'clear nil t 1 + (cua--rectangle-operation 'clear nil t 1 nil '(lambda (s e l r) (when arg (skip-syntax-backward " " (line-beginning-position)) @@ -927,7 +1024,7 @@ With prefix arg, also delete whitespace to the left of that column." "Blank out CUA rectangle. The text previously in the rectangle is overwritten by the blanks." (interactive) - (cua--rectangle-operation 'keep nil nil 1 + (cua--rectangle-operation 'keep nil nil 1 nil '(lambda (s e l r) (goto-char e) (skip-syntax-forward " " (line-end-position)) @@ -942,7 +1039,7 @@ The text previously in the rectangle is overwritten by the blanks." "Align rectangle lines to left column." (interactive) (let (x) - (cua--rectangle-operation 'clear nil t t + (cua--rectangle-operation 'clear nil t t nil '(lambda (s e l r) (let ((b (line-beginning-position))) (skip-syntax-backward "^ " b) @@ -984,7 +1081,7 @@ The text previously in the rectangle is overwritten by the blanks." "Replace CUA rectangle contents with STRING on each line. The length of STRING need not be the same as the rectangle width." (interactive "sString rectangle: ") - (cua--rectangle-operation 'keep nil t t + (cua--rectangle-operation 'keep nil t t nil '(lambda (s e l r) (delete-region s e) (skip-chars-forward " \t") @@ -999,7 +1096,7 @@ The length of STRING need not be the same as the rectangle width." (defun cua-fill-char-rectangle (ch) "Replace CUA rectangle contents with CHARACTER." (interactive "cFill rectangle with character: ") - (cua--rectangle-operation 'clear nil t 1 + (cua--rectangle-operation 'clear nil t 1 nil '(lambda (s e l r) (delete-region s e) (move-to-column l t) @@ -1010,7 +1107,7 @@ The length of STRING need not be the same as the rectangle width." (interactive "sReplace regexp: \nsNew text: ") (if buffer-read-only (message "Cannot replace in read-only buffer") - (cua--rectangle-operation 'keep nil t 1 + (cua--rectangle-operation 'keep nil t 1 nil '(lambda (s e l r) (if (re-search-forward regexp e t) (replace-match newtext nil nil)))))) @@ -1018,7 +1115,7 @@ The length of STRING need not be the same as the rectangle width." (defun cua-incr-rectangle (increment) "Increment each line of CUA rectangle by prefix amount." (interactive "p") - (cua--rectangle-operation 'keep nil t 1 + (cua--rectangle-operation 'keep nil t 1 nil '(lambda (s e l r) (cond ((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t) @@ -1051,36 +1148,36 @@ The numbers are formatted according to the FORMAT string." (if (= (length fmt) 0) (setq fmt cua--rectangle-seq-format) (setq cua--rectangle-seq-format fmt)) - (cua--rectangle-operation 'clear nil t 1 + (cua--rectangle-operation 'clear nil t 1 nil '(lambda (s e l r) (delete-region s e) (insert (format fmt first)) (setq first (+ first incr))))) -(defmacro cua--convert-rectangle-as (command) - `(cua--rectangle-operation 'clear nil nil nil +(defmacro cua--convert-rectangle-as (command tabify) + `(cua--rectangle-operation 'clear nil nil nil ,tabify '(lambda (s e l r) (,command s e)))) (defun cua-upcase-rectangle () "Convert the rectangle to upper case." (interactive) - (cua--convert-rectangle-as upcase-region)) + (cua--convert-rectangle-as upcase-region nil)) (defun cua-downcase-rectangle () "Convert the rectangle to lower case." (interactive) - (cua--convert-rectangle-as downcase-region)) + (cua--convert-rectangle-as downcase-region nil)) (defun cua-upcase-initials-rectangle () "Convert the rectangle initials to upper case." (interactive) - (cua--convert-rectangle-as upcase-initials-region)) + (cua--convert-rectangle-as upcase-initials-region nil)) (defun cua-capitalize-rectangle () "Convert the rectangle to proper case." (interactive) - (cua--convert-rectangle-as capitalize-region)) + (cua--convert-rectangle-as capitalize-region nil)) ;;; Replace/rearrange text in current rectangle @@ -1116,7 +1213,7 @@ The numbers are formatted according to the FORMAT string." (setq z (reverse z)) (if cua--debug (print z auxbuf)) - (cua--rectangle-operation nil nil t pad + (cua--rectangle-operation nil nil t pad nil '(lambda (s e l r) (let (cc) (goto-char e) @@ -1232,9 +1329,9 @@ With prefix arg, indent to that column." "Delete char to left or right of rectangle." (interactive) (let ((col (cua--rectangle-insert-col)) - (pad (cua--rectangle-padding)) + (pad (cua--rectangle-virtual-edges)) indent) - (cua--rectangle-operation 'corners nil t pad + (cua--rectangle-operation 'corners nil t pad nil '(lambda (s e l r) (move-to-column (if (cua--rectangle-right-side t) @@ -1282,10 +1379,7 @@ With prefix arg, indent to that column." (cua--rectangle-left (current-column))) (if (>= (cua--rectangle-corner) 2) (cua--rectangle-bot t) - (cua--rectangle-top t)) - (if (cua--rectangle-padding) - (setq unread-command-events - (cons (if cua-use-hyper-key ?\H-P ?\M-P) unread-command-events))))) + (cua--rectangle-top t)))) (if cua--rectangle (if (and mark-active (not deactivate-mark)) @@ -1379,7 +1473,7 @@ With prefix arg, indent to that column." (cua--rect-M/H-key ?m 'cua-copy-rectangle-as-text) (cua--rect-M/H-key ?n 'cua-sequence-rectangle) (cua--rect-M/H-key ?o 'cua-open-rectangle) - (cua--rect-M/H-key ?p 'cua-toggle-rectangle-padding) + (cua--rect-M/H-key ?p 'cua-toggle-rectangle-virtual-edges) (cua--rect-M/H-key ?P 'cua-do-rectangle-padding) (cua--rect-M/H-key ?q 'cua-refill-rectangle) (cua--rect-M/H-key ?r 'cua-replace-in-rectangle) From 85d392cbe017a930006c84c02a59687e9b0d6585 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 29 Aug 2004 20:57:42 +0000 Subject: [PATCH 278/341] (cua-auto-expand-rectangles): Remove automatic rectangle padding feature; replace by non-destructive virtual rectangle edges feature. (cua-virtual-rectangle-edges): New defcustom. (cua-auto-tabify-rectangles): New defcustom. (cua-paste): If paste into a marked rectangle, insert rectangle at current column, even if virtual; also paste exactly as many lines as has been marked (ignore additional lines or add empty lines), but paste whole source if only one line is marked. (cua--update-indications): No longer use overwrite-cursor to indicate rectangle padding --- lisp/emulation/cua-base.el | 91 ++++++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 33 deletions(-) diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index b39945c7712..fb3c537936f 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -141,30 +141,39 @@ ;; completely separate set of "rectangle commands" [C-x r ...] on the ;; region to copy, kill, fill a.s.o. the virtual rectangle. ;; -;; cua-mode's superior rectangle support is based on using a true visual -;; representation of the selected rectangle. To start a rectangle, use -;; [S-return] and extend it using the normal movement keys (up, down, -;; left, right, home, end, C-home, C-end). Once the rectangle has the -;; desired size, you can cut or copy it using C-x and C-c (or C-w and M-w), -;; and you can subsequently insert it - as a rectangle - using C-v (or -;; C-y). So the only new command you need to know to work with -;; cua-mode rectangles is S-return! +;; cua-mode's superior rectangle support uses a true visual +;; representation of the selected rectangle, i.e. it highlights the +;; actual part of the buffer that is currently selected as part of the +;; rectangle. Unlike emacs' traditional rectangle commands, the +;; selected rectangle always as straight left and right edges, even +;; when those are in the middle of a TAB character or beyond the end +;; of the current line. And it does this without actually modifying +;; the buffer contents (it uses display overlays to visualize the +;; virtual dimensions of the rectangle). +;; +;; This means that cua-mode's rectangles are not limited to the actual +;; contents of the buffer, so if the cursor is currently at the end of a +;; short line, you can still extend the rectangle to include more columns +;; of longer lines in the same rectangle. And you can also have the +;; left edge of a rectangle start in the middle of a TAB character. +;; Sounds strange? Try it! +;; +;; To start a rectangle, use [S-return] and extend it using the normal +;; movement keys (up, down, left, right, home, end, C-home, +;; C-end). Once the rectangle has the desired size, you can cut or +;; copy it using C-x and C-c (or C-w and M-w), and you can +;; subsequently insert it - as a rectangle - using C-v (or C-y). So +;; the only new command you need to know to work with cua-mode +;; rectangles is S-return! ;; ;; Normally, when you paste a rectangle using C-v (C-y), each line of ;; the rectangle is inserted into the existing lines in the buffer. ;; If overwrite-mode is active when you paste a rectangle, it is ;; inserted as normal (multi-line) text. ;; -;; Furthermore, cua-mode's rectangles are not limited to the actual -;; contents of the buffer, so if the cursor is currently at the end of a -;; short line, you can still extend the rectangle to include more columns -;; of longer lines in the same rectangle. Sounds strange? Try it! -;; -;; You can enable padding for just this rectangle by pressing [M-p]; -;; this works like entering `picture-mode' where the tabs and spaces -;; are automatically converted/inserted to make the rectangle truly -;; rectangular. Or you can do it for all rectangles by setting the -;; `cua-auto-expand-rectangles' variable. +;; If you prefer the traditional rectangle marking (i.e. don't want +;; straight edges), [M-p] toggles this for the current rectangle, +;; or you can customize cua-virtual-rectangle-edges. ;; And there's more: If you want to extend or reduce the size of the ;; rectangle in one of the other corners of the rectangle, just use @@ -204,8 +213,8 @@ ;; a supplied format string (prompt) ;; [M-o] opens the rectangle by moving the highlighted text to the ;; right of the rectangle and filling the rectangle with blanks. -;; [M-p] toggles rectangle padding, i.e. insert tabs and spaces to -;; make rectangles truly rectangular +;; [M-p] toggles virtual straight rectangle edges +;; [M-P] inserts tabs and spaces (padding) to make real straight edges ;; [M-q] performs text filling on the rectangle ;; [M-r] replaces REGEXP (prompt) by STRING (prompt) in rectangle ;; [M-R] reverse the lines in the rectangle @@ -347,14 +356,27 @@ managers, so try setting this to nil, if prefix override doesn't work." ;;; Rectangle Customization -(defcustom cua-auto-expand-rectangles nil - "*If non-nil, rectangles are padded with spaces to make straight edges. -This implies modifying buffer contents by expanding tabs and inserting spaces. -Consequently, this is inhibited in read-only buffers. -Can be toggled by [M-p] while the rectangle is active," +(defcustom cua-virtual-rectangle-edges t + "*If non-nil, rectangles have virtual straight edges. +Note that although rectangles are always DISPLAYED with straight edges, the +buffer is NOT modified, until you execute a command that actually modifies it. +\[M-p] toggles this feature when a rectangle is active." :type 'boolean :group 'cua) +(defcustom cua-auto-tabify-rectangles 1000 + "*If non-nil, automatically tabify after rectangle commands. +This basically means that `tabify' is applied to all lines that +are modified by inserting or deleting a rectangle. If value is +an integer, cua will look for existing tabs in a region around +the rectangle, and only do the conversion if any tabs are already +present. The number specifies then number of characters before +and after the region marked by the rectangle to search." + :type '(choice (number :tag "Auto detect (limit)") + (const :tag "Disabled" nil) + (other :tag "Enabled" t)) + :group 'cua) + (defcustom cua-enable-rectangle-auto-help t "*If non-nil, automatically show help for region, rectangle and global mark." :type 'boolean @@ -412,7 +434,6 @@ Can be toggled by [M-p] while the rectangle is active," (frame-parameter nil 'cursor-color) "red") "Normal (non-overwrite) cursor color. -Also used to indicate that rectangle padding is not in effect. Default is to load cursor color from initial or default frame parameters. If the value is a COLOR name, then only the `cursor-color' attribute will be @@ -462,7 +483,6 @@ a cons (TYPE . COLOR), then both properties are affected." (defcustom cua-overwrite-cursor-color "yellow" "*Cursor color used when overwrite mode is set, if non-nil. -Also used to indicate that rectangle padding is in effect. Only used when `cua-enable-cursor-indications' is non-nil. If the value is a COLOR name, then only the `cursor-color' attribute will be @@ -806,7 +826,8 @@ If global mark is active, copy from register or one character." (interactive "P") (setq arg (cua--prefix-arg arg)) (let ((regtxt (and cua--register (get-register cua--register))) - (count (prefix-numeric-value arg))) + (count (prefix-numeric-value arg)) + paste-column paste-lines) (cond ((and cua--register (not regtxt)) (message "Nothing in register %c" cua--register)) @@ -825,7 +846,12 @@ If global mark is active, copy from register or one character." ;; the same region that we are going to delete. ;; That would make yank a no-op. (if cua--rectangle - (cua--delete-rectangle) + (progn + (goto-char (min (mark) (point))) + (setq paste-column (cua--rectangle-left)) + (setq paste-lines (cua--delete-rectangle)) + (if (= paste-lines 1) + (setq paste-lines nil))) ;; paste all (if (string= (buffer-substring (point) (mark)) (car kill-ring)) (current-kill 1)) @@ -843,7 +869,8 @@ If global mark is active, copy from register or one character." (setq this-command 'cua--paste-rectangle) (undo-boundary) (setq buffer-undo-list (cons pt buffer-undo-list))) - (cua--insert-rectangle (cdr cua--last-killed-rectangle)) + (cua--insert-rectangle (cdr cua--last-killed-rectangle) + nil paste-column paste-lines) (if arg (goto-char pt)))) (t (yank arg))))))) @@ -1033,9 +1060,7 @@ If ARG is the atom `-', scroll upward by nearly full screen." ((and buffer-read-only cua-read-only-cursor-color) cua-read-only-cursor-color) - ((and cua-overwrite-cursor-color - (or overwrite-mode - (and cua--rectangle (cua--rectangle-padding)))) + ((and cua-overwrite-cursor-color overwrite-mode) cua-overwrite-cursor-color) (t cua-normal-cursor-color))) (color (if (consp cursor) (cdr cursor) cursor)) From 4f4ce5976e0922de725f83663a7975b387356d86 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 30 Aug 2004 16:05:47 +0000 Subject: [PATCH 279/341] (prin1-char): Don't turn S-a into A. Don't return a string that would read as the wrong character code. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/lisp-mode.el | 40 ++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5168f53d1cb..fab95b30909 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-30 Richard M. Stallman + + * emacs-lisp/lisp-mode.el (prin1-char): Don't turn S-a into A. + Don't return a string that would read as the wrong character code. + 2004-08-29 Kim F. Storm * emulation/cua-base.el (cua-auto-expand-rectangles): Remove diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index d6f601cd121..e2aac327ddc 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -460,26 +460,36 @@ If CHAR is not a character, return nil." (and (integerp char) (eventp char) (let ((c (event-basic-type char)) - (mods (event-modifiers char))) + (mods (event-modifiers char)) + string) ;; Prevent ?A from turning into ?\S-a. (if (and (memq 'shift mods) + (zerop (logand char ?\S-\^@)) (not (let ((case-fold-search nil)) (char-equal c (upcase c))))) (setq c (upcase c) mods nil)) - (concat - "?" - (mapconcat - (lambda (modif) - (cond ((eq modif 'super) "\\s-") - (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-)))) - mods "") - (cond - ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) - ((eq c 127) "\\C-?") - (t - (condition-case nil - (string c) - (error nil)))))))) + ;; What string are we considering using? + (condition-case nil + (setq string + (concat + "?" + (mapconcat + (lambda (modif) + (cond ((eq modif 'super) "\\s-") + (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-)))) + mods "") + (cond + ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) + ((eq c 127) "\\C-?") + (t + (string c))))) + (error nil)) + ;; Verify the string reads a CHAR, not to some other character. + ;; If it doesn't, return nil instead. + (and string + (= (car (read-from-string string)) char) + string)))) + (defun eval-last-sexp-1 (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in minibuffer. From 11715f92de50ee7c004386d9de00b7f3e2df633b Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Mon, 30 Aug 2004 18:06:21 +0000 Subject: [PATCH 280/341] macmenu.c (mac_menu_show): Remove shadowing of menu variable by using different names for inner loop variables. --- src/ChangeLog | 5 +++++ src/macmenu.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7779dddb124..e45f9b6e563 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-08-30 Steven Tamm + + * macmenu.c (mac_menu_show): Remove shadowing of menu variable + by using different names for inner loop variables. + 2004-08-27 Jan Dj,Ad(Brv * xmenu.c (set_frame_menubar): Reintroduce inhibit_garbage_collection diff --git a/src/macmenu.c b/src/macmenu.c index 67e18481a1b..9b09bfb3327 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -1807,9 +1807,9 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) /* Get the refcon to find the correct item*/ if (menu_item_selection) { - menu = GetMenuHandle (HiWord (menu_item_choice)); - if (menu) { - GetMenuItemRefCon (menu, menu_item_selection, &refcon); + MenuHandle sel_menu = GetMenuHandle (HiWord (menu_item_choice)); + if (sel_menu) { + GetMenuItemRefCon (sel_menu, menu_item_selection, &refcon); } } @@ -1831,11 +1831,11 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) { int i = MIN_POPUP_SUBMENU_ID; MenuHandle submenu = GetMenuHandle (i); - while (menu != NULL) + while (submenu != NULL) { DeleteMenu (i); - DisposeMenu (menu); - menu = GetMenuHandle (++i); + DisposeMenu (submenu); + submenu = GetMenuHandle (++i); } } From f04232c3c2242acb4c2a188565a61cf3a986f3e8 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Mon, 30 Aug 2004 19:05:10 +0000 Subject: [PATCH 281/341] (tex-validate-buffer): Use distinct strings rather than programatically constructing message. --- lisp/ChangeLog | 5 +++++ lisp/textmodes/tex-mode.el | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fab95b30909..e6b3e1f60a7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-08-30 John Paul Wallington + + * textmodes/tex-mode.el (tex-validate-buffer): Use distinct + strings rather than programatically constructing message. + 2004-08-30 Richard M. Stallman * emacs-lisp/lisp-mode.el (prin1-char): Don't turn S-a into A. diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 115dd6f88f0..1c4b89f0a62 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1145,9 +1145,10 @@ on the line for the invalidity you want to see." (if no-matches (insert "None!\n")) (if (interactive-p) - (message "%s mismatch%s found" - (if no-matches "No" num-matches) - (if (> num-matches 1) "es" "")))))))) + (message (cond (no-matches "No mismatches found") + ((= num-matches 1) "1 mismatch found") + (t "%d mismatches found")) + num-matches))))))) (defun tex-validate-region (start end) "Check for mismatched braces or $'s in region. From 05bdae441ba3e9ffe5d71ac877955ae7dc20429f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 30 Aug 2004 19:42:20 +0000 Subject: [PATCH 282/341] * lwlib.h (_widget_value): Added lname and lkey. --- lwlib/ChangeLog | 4 ++++ lwlib/lwlib.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 3b69d955392..923f52debdd 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,7 @@ +2004-08-30 Jan Dj,Ad(Brv + + * lwlib.h (_widget_value): Added lname and lkey. + 2004-01-12 Jan Dj,Ad(Brv * xlwmenuP.h (_XlwMenu_part): Added top_depth. diff --git a/lwlib/lwlib.h b/lwlib/lwlib.h index 02560e47545..a141c600526 100644 --- a/lwlib/lwlib.h +++ b/lwlib/lwlib.h @@ -64,10 +64,12 @@ enum menu_separator typedef struct _widget_value { /* name of widget */ + Lisp_Object lname; char* name; /* value (meaning depend on widget type) */ char* value; /* keyboard equivalent. no implications for XtTranslations */ + Lisp_Object lkey; char* key; /* Help string or nil if none. GC finds this string through the frame's menu_bar_vector From 2bf436c3bb916cc9368dafeb54d1cab0196e15cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 30 Aug 2004 19:42:53 +0000 Subject: [PATCH 283/341] * xmenu.c (digest_single_submenu): Set lname and lkey in widget_value instead of name and key. (update_submenu_strings): New function. (set_frame_menubar): Remove call to inhibit_garbage_collection, call update_submenu_strings. Call ENCODE_MENU_STRING for top level menu names. * gtkutil.h (_widget_value): Added lname and lkey. --- src/ChangeLog | 11 ++++++++++ src/gtkutil.h | 2 ++ src/xmenu.c | 59 +++++++++++++++++++++++++++++++++++++++------------ 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e45f9b6e563..b761d28b29e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2004-08-30 Jan Dj,Ad(Brv + + * xmenu.c (digest_single_submenu): Set lname and lkey in widget_value + instead of name and key. + (update_submenu_strings): New function. + (set_frame_menubar): Remove call to inhibit_garbage_collection, + call update_submenu_strings. Call ENCODE_MENU_STRING for top level + menu names. + + * gtkutil.h (_widget_value): Added lname and lkey. + 2004-08-30 Steven Tamm * macmenu.c (mac_menu_show): Remove shadowing of menu variable diff --git a/src/gtkutil.h b/src/gtkutil.h index b31ec8c2a1f..b35ab94b2cb 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h @@ -96,10 +96,12 @@ typedef struct xg_menu_item_cb_data_ typedef struct _widget_value { /* name of widget */ + Lisp_Object lname; char *name; /* value (meaning depend on widget type) */ char *value; /* keyboard equivalent. no implications for XtTranslations */ + Lisp_Object lkey; char *key; /* Help string or nil if none. GC finds this string through the frame's menu_bar_vector diff --git a/src/xmenu.c b/src/xmenu.c index 7ef0e8c857d..2eed2b4987e 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1701,12 +1701,9 @@ digest_single_submenu (start, end, top_level_items) save_wv->next = wv; else first_wv->contents = wv; - wv->name = pane_string; - /* Ignore the @ that means "separate pane". - This is a kludge, but this isn't worth more time. */ - if (!NILP (prefix) && wv->name[0] == '@') - wv->name++; - wv->value = 0; + wv->lname = pane_name; + /* Set value to 1 so update_submenu_strings can handle '@' */ + wv->value = (char *)1; wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; wv->help = Qnil; @@ -1749,9 +1746,9 @@ digest_single_submenu (start, end, top_level_items) else save_wv->contents = wv; - wv->name = (char *) SDATA (item_name); + wv->lname = item_name; if (!NILP (descrip)) - wv->key = (char *) SDATA (descrip); + wv->lkey = descrip; wv->value = 0; /* The EMACS_INT cast avoids a warning. There's no problem as long as pointers have enough bits to hold small integers. */ @@ -1790,6 +1787,42 @@ digest_single_submenu (start, end, top_level_items) return first_wv; } + +/* Walk through thw widget_value tree starting at FIRST_WV and update + the char * pointers from the corresponding lisp values. + We do this after building the whole tree, since GC may happen while the + tree is constructed, and small strings are relocated. So we must wait + until no GC can happen before storing pointers into lisp values. */ +static void +update_submenu_strings (first_wv) + widget_value *first_wv; +{ + widget_value *wv; + + for (wv = first_wv; wv; wv = wv->next) + { + if (wv->lname && ! NILP (wv->lname)) + { + wv->name = SDATA (wv->lname); + + /* Ignore the @ that means "separate pane". + This is a kludge, but this isn't worth more time. */ + if (wv->value == (char *)1) + { + if (wv->name[0] == '@') + wv->name++; + wv->value = 0; + } + } + + if (wv->lkey && ! NILP (wv->lkey)) + wv->key = SDATA (wv->lkey); + + if (wv->contents) + update_submenu_strings (wv->contents); + } +} + /* Recompute all the widgets of frame F, when the menu bar has been changed. Value is non-zero if widgets were updated. */ @@ -1930,7 +1963,6 @@ set_frame_menubar (f, first_time, deep_p) FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); items = FRAME_MENU_BAR_ITEMS (f); - inhibit_garbage_collection (); /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) @@ -2023,9 +2055,10 @@ set_frame_menubar (f, first_time, deep_p) Lisp_Object string; string = XVECTOR (items)->contents[i + 1]; if (NILP (string)) - break; - wv->name = (char *) SDATA (string); - wv = wv->next; + break; + wv->name = (char *) SDATA (ENCODE_MENU_STRING (string)); + update_submenu_strings (wv->contents); + wv = wv->next; } f->menu_bar_vector = menu_items; @@ -2055,7 +2088,7 @@ set_frame_menubar (f, first_time, deep_p) break; wv = xmalloc_widget_value (); - wv->name = (char *) SDATA (string); + wv->name = (char *) SDATA (ENCODE_MENU_STRING (string)); wv->value = 0; wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; From ec867797797c80ba00a29af18fb9c38f137a0a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 30 Aug 2004 20:14:21 +0000 Subject: [PATCH 284/341] Don't call ENCODE_MENU_STRING on top level menu names, GC may occur. --- src/ChangeLog | 3 +-- src/xmenu.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b761d28b29e..8d441748ffd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,8 +4,7 @@ instead of name and key. (update_submenu_strings): New function. (set_frame_menubar): Remove call to inhibit_garbage_collection, - call update_submenu_strings. Call ENCODE_MENU_STRING for top level - menu names. + call update_submenu_strings. * gtkutil.h (_widget_value): Added lname and lkey. diff --git a/src/xmenu.c b/src/xmenu.c index 2eed2b4987e..229f9c37de7 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -2056,7 +2056,7 @@ set_frame_menubar (f, first_time, deep_p) string = XVECTOR (items)->contents[i + 1]; if (NILP (string)) break; - wv->name = (char *) SDATA (ENCODE_MENU_STRING (string)); + wv->name = (char *) SDATA (string); update_submenu_strings (wv->contents); wv = wv->next; } @@ -2088,7 +2088,7 @@ set_frame_menubar (f, first_time, deep_p) break; wv = xmalloc_widget_value (); - wv->name = (char *) SDATA (ENCODE_MENU_STRING (string)); + wv->name = (char *) SDATA (string); wv->value = 0; wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; From 5560d460b36bdddb2c0f2f230606dd07c67a37e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 30 Aug 2004 20:31:09 +0000 Subject: [PATCH 285/341] Fix typo in comment string. --- src/xmenu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmenu.c b/src/xmenu.c index 229f9c37de7..7f6e7c398a9 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1788,7 +1788,7 @@ digest_single_submenu (start, end, top_level_items) return first_wv; } -/* Walk through thw widget_value tree starting at FIRST_WV and update +/* Walk through the widget_value tree starting at FIRST_WV and update the char * pointers from the corresponding lisp values. We do this after building the whole tree, since GC may happen while the tree is constructed, and small strings are relocated. So we must wait From 16ceacc222529b8cdfd6fa7b2031940a926717f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 30 Aug 2004 20:32:00 +0000 Subject: [PATCH 286/341] * macmenu.c (_widget_value): Added lname and lkey. (single_submenu): Set lname and lkey in widget_value instead of name and key. (update_submenu_strings): New function. (set_frame_menubar): Remove call to inhibit_garbage_collection, call update_submenu_strings. --- src/ChangeLog | 7 +++++++ src/macmenu.c | 53 +++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8d441748ffd..14eece1b04e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,12 @@ 2004-08-30 Jan Dj,Ad(Brv + * macmenu.c (_widget_value): Added lname and lkey. + (single_submenu): Set lname and lkey in widget_value + instead of name and key. + (update_submenu_strings): New function. + (set_frame_menubar): Remove call to inhibit_garbage_collection, + call update_submenu_strings. + * xmenu.c (digest_single_submenu): Set lname and lkey in widget_value instead of name and key. (update_submenu_strings): New function. diff --git a/src/macmenu.c b/src/macmenu.c index 9b09bfb3327..88012b01f73 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -90,10 +90,12 @@ enum button_type typedef struct _widget_value { /* name of widget */ + Lisp_Object lname; char* name; /* value (meaning depend on widget type) */ char* value; /* keyboard equivalent. no implications for XtTranslations */ + Lisp_Object lkey; char* key; /* Help string or nil if none. GC finds this string through the frame's menu_bar_vector @@ -1221,12 +1223,9 @@ single_submenu (item_key, item_name, maps) save_wv->next = wv; else first_wv->contents = wv; - wv->name = pane_string; - /* Ignore the @ that means "separate pane". - This is a kludge, but this isn't worth more time. */ - if (!NILP (prefix) && wv->name[0] == '@') - wv->name++; - wv->value = 0; + wv->lname = pane_name; + /* Set value to 1 so update_submenu_strings can handle '@' */ + wv->value = (char *)1; wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; wv->help = Qnil; @@ -1269,9 +1268,9 @@ single_submenu (item_key, item_name, maps) else save_wv->contents = wv; - wv->name = (char *) SDATA (item_name); + wv->lname = item_name; if (!NILP (descrip)) - wv->key = (char *) SDATA (descrip); + wv->lkey = descrip; wv->value = 0; /* The EMACS_INT cast avoids a warning. There's no problem as long as pointers have enough bits to hold small integers. */ @@ -1310,6 +1309,41 @@ single_submenu (item_key, item_name, maps) return first_wv; } +/* Walk through the widget_value tree starting at FIRST_WV and update + the char * pointers from the corresponding lisp values. + We do this after building the whole tree, since GC may happen while the + tree is constructed, and small strings are relocated. So we must wait + until no GC can happen before storing pointers into lisp values. */ +static void +update_submenu_strings (first_wv) + widget_value *first_wv; +{ + widget_value *wv; + + for (wv = first_wv; wv; wv = wv->next) + { + if (wv->lname && ! NILP (wv->lname)) + { + wv->name = SDATA (wv->lname); + + /* Ignore the @ that means "separate pane". + This is a kludge, but this isn't worth more time. */ + if (wv->value == (char *)1) + { + if (wv->name[0] == '@') + wv->name++; + wv->value = 0; + } + } + + if (wv->lkey && ! NILP (wv->lkey)) + wv->key = SDATA (wv->lkey); + + if (wv->contents) + update_submenu_strings (wv->contents); + } +} + /* Set the contents of the menubar widgets of frame F. The argument FIRST_TIME is currently ignored; @@ -1388,8 +1422,6 @@ set_frame_menubar (f, first_time, deep_p) items = FRAME_MENU_BAR_ITEMS (f); - inhibit_garbage_collection (); - /* Save the frame's previous menu bar contents data. */ if (previous_menu_items_used) bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items, @@ -1454,6 +1486,7 @@ set_frame_menubar (f, first_time, deep_p) if (NILP (string)) break; wv->name = (char *) SDATA (string); + update_submenu_strings (wv->contents); wv = wv->next; } From 2aa2f8b8c979787390f8ebf6ebe22fa81bbe7c06 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 30 Aug 2004 22:03:18 +0000 Subject: [PATCH 287/341] Various minor changes in addition to: (Indentation Commands): Correct description of `indent-relative'. (Tab Stops): is no longer bound to `tab-to-tab-stop' in Text mode. The *Tab Stops* buffer uses Overwrite Mode. (Just Spaces): `untabify' converts sequences of at least two spaces to tabs. --- man/ChangeLog | 9 +++++++++ man/indent.texi | 48 ++++++++++++++++++++++-------------------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index d859a3b2fe0..8af5062c7e7 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,12 @@ +2004-08-30 Luc Teirlinck + + * indent.texi: Various minor changes in addition to: + (Indentation Commands): Correct description of `indent-relative'. + (Tab Stops): is no longer bound to `tab-to-tab-stop' in Text + mode. The *Tab Stops* buffer uses Overwrite Mode. + (Just Spaces): `untabify' converts sequences of at least two + spaces to tabs. + 2004-08-28 Eli Zaretskii * faq.texi (Emacs for MS-DOS): Update URLs for the MS-DOS port of diff --git a/man/indent.texi b/man/indent.texi index d2134103240..ab640e76462 100644 --- a/man/indent.texi +++ b/man/indent.texi @@ -1,5 +1,5 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997 Free Software Foundation, Inc. +@c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997, 2004 Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @node Indentation, Text, Major Modes, Top @chapter Indentation @@ -75,7 +75,7 @@ type @key{TAB}, it aligns the line as a whole. Normally, all of the above methods insert an optimal mix of tabs and spaces to align to the desired column. @xref{Just Spaces}, for how to disable use of tabs. However, @kbd{C-q @key{TAB}} always inserts a -tab, even they are disabled for the indentation commands. +tab, even when tabs are disabled for the indentation commands. @c In Text mode, @key{TAB} runs the command @code{tab-to-tab-stop}, which @c indents to the next tab stop column. You can set the tab stops with @@ -95,7 +95,8 @@ tab, even they are disabled for the indentation commands. @findex back-to-indentation To move over the indentation on a line, do @kbd{M-m} (@code{back-to-indentation}). This command, given anywhere on a line, -positions point at the first nonblank character on the line. +positions point at the first nonblank character on the line, if any, +or else at the end of the line. To insert an indented line before the current line, do @kbd{C-a C-o @key{TAB}}. To make an indented line after the current line, use @@ -134,13 +135,13 @@ appears after the newline that is deleted. @xref{Fill Prefix}. @findex indent-region @findex indent-rigidly There are also commands for changing the indentation of several lines -at once. @kbd{C-M-\} (@code{indent-region}) applies to all the lines -that begin in the region; it indents each line in the ``usual'' way, as -if you had typed @key{TAB} at the beginning of the line. A numeric -argument specifies the column to indent to, and each line is shifted -left or right so that its first nonblank character appears in that -column. @kbd{C-x @key{TAB}} (@code{indent-rigidly}) moves all of the -lines in the region right by its argument (left, for negative +at once. They apply to all the lines that begin in the region. +@kbd{C-M-\} (@code{indent-region}) indents each line in the ``usual'' +way, as if you had typed @key{TAB} at the beginning of the line. A +numeric argument specifies the column to indent to, and each line is +shifted left or right so that its first nonblank character appears in +that column. @kbd{C-x @key{TAB}} (@code{indent-rigidly}) moves all of +the lines in the region right by its argument (left, for negative arguments). The whole group of lines moves rigidly sideways, which is how the command gets its name.@refill @@ -152,12 +153,10 @@ such as -1000. @findex indent-relative @kbd{M-x indent-relative} indents at point based on the previous line (actually, the last nonempty line). It inserts whitespace at point, moving -point, until it is underneath an indentation point in the previous line. +point, until it is underneath the next indentation point in the previous line. An indentation point is the end of a sequence of whitespace or the end of the line. If point is farther right than any indentation point in the -previous line, the whitespace before point is deleted and the first -indentation point then applicable is used. If no indentation point is -applicable even then, @code{indent-relative} runs @code{tab-to-tab-stop} +previous line, @code{indent-relative} runs @code{tab-to-tab-stop} @ifinfo (@pxref{Tab Stops}), @end ifinfo @@ -167,9 +166,6 @@ applicable even then, @code{indent-relative} runs @code{tab-to-tab-stop} unless it is called with a numeric argument, in which case it does nothing. - @code{indent-relative} is the definition of @key{TAB} in Indented Text -mode. @xref{Text}. - @xref{Format Indentation}, for another way of specifying the indentation for part of your text. @@ -181,10 +177,9 @@ indentation for part of your text. @cindex tables, indentation for @kindex M-i @findex tab-to-tab-stop - For typing in tables, you can use Text mode's definition of @key{TAB}, -@code{tab-to-tab-stop}. This command inserts indentation before point, -enough to reach the next tab stop column. If you are not in Text mode, -this command can be found on the key @kbd{M-i}. + For typing in tables, you can use @kbd{M-i} (@code{tab-to-tab-stop}). +This command inserts indentation before point, enough to reach the +next tab stop column. @findex edit-tab-stops @findex edit-tab-stops-note-changes @@ -198,10 +193,11 @@ increasing order. edit-tab-stops}, which creates and selects a buffer containing a description of the tab stop settings. You can edit this buffer to specify different tab stops, and then type @kbd{C-c C-c} to make those -new tab stops take effect. @code{edit-tab-stops} records which buffer -was current when you invoked it, and stores the tab stops back in that -buffer; normally all buffers share the same tab stops and changing them -in one buffer affects all, but if you happen to make +new tab stops take effect. The buffer uses Overwrite mode +(@pxref{Minor Modes}). @code{edit-tab-stops} records which buffer was +current when you invoked it, and stores the tab stops back in that +buffer; normally all buffers share the same tab stops and changing +them in one buffer affects all, but if you happen to make @code{tab-stop-list} local in one buffer then @code{edit-tab-stops} in that buffer will edit the local settings. @@ -242,7 +238,7 @@ that your file looks the same regardless of the tab width setting. @findex untabify There are also commands to convert tabs to spaces or vice versa, always preserving the columns of all nonblank text. @kbd{M-x tabify} scans the -region for sequences of spaces, and converts sequences of at least three +region for sequences of spaces, and converts sequences of at least two spaces to tabs if that can be done without changing indentation. @kbd{M-x untabify} changes all tabs in the region to appropriate numbers of spaces. From 7a01b040852e9b361cedf14efca552e5a7fd28ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 31 Aug 2004 11:24:10 +0000 Subject: [PATCH 288/341] * x-dnd.el (x-dnd-protocol-alist): Document update. (x-dnd-known-types): Defcustom it. (x-dnd-handle-motif): Print message-atom in error message. --- lisp/ChangeLog | 6 ++++++ lisp/x-dnd.el | 17 ++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e6b3e1f60a7..80626c5d2b7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-08-31 Jan Dj,Ad(Brv + + * x-dnd.el (x-dnd-protocol-alist): Document update. + (x-dnd-known-types): Defcustom it. + (x-dnd-handle-motif): Print message-atom in error message. + 2004-08-30 John Paul Wallington * textmodes/tex-mode.el (tex-validate-buffer): Use distinct diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index 7d43a10556e..0f9237f3409 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -58,8 +58,8 @@ The default value for this variable is `x-dnd-default-test-function'." ) "The functions to call for different protocols when a drop is made. -This variable is used by `x-dnd-handle-uri-list' and `x-dnd-handle-moz-url'. -The list contains of (REGEXP . FUNCTION) pairs. +This variable is used by `x-dnd-handle-uri-list', `x-dnd-handle-file-name' +and `x-dnd-handle-moz-url'. The list contains of (REGEXP . FUNCTION) pairs. The functions shall take two arguments, URL, which is the URL dropped and ACTION which is the action to be performed for the drop (move, copy, link, private or ask). @@ -104,9 +104,7 @@ is successful, nil if not." :type 'boolean :group 'x) -;; Internal variables - -(defvar x-dnd-known-types +(defcustom x-dnd-known-types '("text/uri-list" "text/x-moz-url" "_NETSCAPE_URL" @@ -121,7 +119,12 @@ is successful, nil if not." "TEXT" ) "The types accepted by default for dropped data. -The types are chosen in the order they appear in the list.") +The types are chosen in the order they appear in the list." + :type '(repeat string) + :group 'x +) + +;; Internal variables (defvar x-dnd-current-state nil "The current state for a drop. @@ -865,7 +868,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." timestamp) (x-dnd-forget-drop frame))) - (t (error "Unknown Motif DND message %s %s" message data))))) + (t (error "Unknown Motif DND message %s %s" message-atom data))))) ;;; From bd9d61d42e556feec8da90df496ff60c55c09aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 31 Aug 2004 11:32:03 +0000 Subject: [PATCH 289/341] * frames.texi (Drag and drop): Add documentation about x-dnd-test-function and x-dnd-known-types. --- man/ChangeLog | 5 +++++ man/frames.texi | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/man/ChangeLog b/man/ChangeLog index 8af5062c7e7..d0fc0026eb1 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2004-08-31 Jan Dj,Ad(Brv + + * frames.texi (Drag and drop): Add documentation about + x-dnd-test-function and x-dnd-known-types. + 2004-08-30 Luc Teirlinck * indent.texi: Various minor changes in addition to: diff --git a/man/frames.texi b/man/frames.texi index 50b6a4ed398..dee050922e6 100644 --- a/man/frames.texi +++ b/man/frames.texi @@ -809,6 +809,17 @@ As a special case, if a file is dropped on a dired buffer the file is copied or moved (depends on exactly how it is dragged and the application it was dragged from) to the directory the dired buffer is displaying. +@vindex x-dnd-test-function +@vindex x-dnd-known-types + When a user drags something from another application over Emacs, that other +application expects Emacs to tell it if Emacs can handle the data that is +dragged. The variable @code{x-dnd-test-function} is used by Emacs to determine +what to reply. The default value is @code{x-dnd-default-test-function} +which accepts drops if the type of the data to be dropped is present in +@code{x-dnd-known-types}. You can customize @code{x-dnd-test-function} and/or +@code{x-dnd-known-types} if you want Emacs to accept or reject drops based +on some other criteria. + @vindex x-dnd-open-file-other-window A file is normally opened in the window it is dropped on, but if you prefer the file to be opened in a new window you can customize the variable From f7e2238577c4a735538a9b0e496d874b32f54e40 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 31 Aug 2004 22:42:35 +0000 Subject: [PATCH 290/341] *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 14eece1b04e..77a331a7802 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-08-31 NAKAMURA Toshikazu (tiny change) + + * w32fns.c (w32_load_font): If a BDF font is already loaded, do not + reload it. + 2004-08-30 Jan Dj,Ad(Brv * macmenu.c (_widget_value): Added lname and lkey. From 63e50ea6725779bc769024071e8590432f5de99c Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 31 Aug 2004 22:43:26 +0000 Subject: [PATCH 291/341] 2004-08-31 NAKAMURA Toshikazu (tiny change) * w32fns.c (w32_load_font): If a BDF font is already loaded, do not reload it. --- src/w32fns.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/w32fns.c b/src/w32fns.c index 0cb3abe91cd..8d695fd65bc 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -4642,6 +4642,7 @@ int size; { Lisp_Object bdf_fonts; struct font_info *retval = NULL; + struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); bdf_fonts = w32_list_bdf_fonts (build_string (fontname), 1); @@ -4649,11 +4650,22 @@ int size; { char *bdf_name, *bdf_file; Lisp_Object bdf_pair; + int i; bdf_name = SDATA (XCAR (bdf_fonts)); bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist); bdf_file = SDATA (XCDR (bdf_pair)); + // If the font is already loaded, do not load it again. + for (i = 0; i < dpyinfo->n_fonts; i++) + { + if ((dpyinfo->font_table[i].name + && !strcmp (dpyinfo->font_table[i].name, bdf_name)) + || (dpyinfo->font_table[i].full_name + && !strcmp (dpyinfo->font_table[i].full_name, bdf_name))) + return dpyinfo->font_table[i]; + } + retval = w32_load_bdf_font (f, bdf_name, size, bdf_file); bdf_fonts = XCDR (bdf_fonts); From 745e0c15bbafa7db801057de5df0a68d772b0800 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 31 Aug 2004 22:48:41 +0000 Subject: [PATCH 292/341] Fix typo in last checkin --- src/w32fns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/w32fns.c b/src/w32fns.c index 8d695fd65bc..e60385c8129 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -4663,7 +4663,7 @@ int size; && !strcmp (dpyinfo->font_table[i].name, bdf_name)) || (dpyinfo->font_table[i].full_name && !strcmp (dpyinfo->font_table[i].full_name, bdf_name))) - return dpyinfo->font_table[i]; + return dpyinfo->font_table + i; } retval = w32_load_bdf_font (f, bdf_name, size, bdf_file); From 2b1c8da040de829cd62574b24e332097f27493ce Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Tue, 31 Aug 2004 23:38:53 +0000 Subject: [PATCH 293/341] (apply-macro-to-region-lines): Make it operate on all lines that begin in the region, rather than on all complete lines in the region. --- lisp/macros.el | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lisp/macros.el b/lisp/macros.el index 72ba3f11721..0de5d223ee0 100644 --- a/lisp/macros.el +++ b/lisp/macros.el @@ -1,6 +1,6 @@ ;;; macros.el --- non-primitive commands for keyboard macros -;; Copyright (C) 1985, 86, 87, 92, 94, 95 Free Software Foundation, Inc. +;; Copyright (C) 1985, 86, 87, 92, 94, 95, 04 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: abbrev @@ -151,7 +151,7 @@ use this command, and then save the file." (cond ((= char ?\\) (insert "\\\\")) ((= char ?\") - (insert "\\\"")) + (insert "\\\"")) ((= char ?\;) (insert "\\;")) ((= char 127) @@ -240,8 +240,9 @@ Possibilities: \\ ;;;###autoload (defun apply-macro-to-region-lines (top bottom &optional macro) - "For each complete line between point and mark, move to the beginning -of the line, and run the last keyboard macro. + "Apply last keyboard macro to all lines in the region. +For each line that begins in the region, move to the beginning of +the line, and run the last keyboard macro. When called from lisp, this function takes two arguments TOP and BOTTOM, describing the current region. TOP must be before BOTTOM. @@ -277,8 +278,7 @@ and write a macro to massage a word into a table entry: \\C-x ) and then select the region of un-tablified names and use -`\\[apply-macro-to-region-lines]' to build the table from the names. -" +`\\[apply-macro-to-region-lines]' to build the table from the names." (interactive "r") (or macro (progn @@ -286,10 +286,7 @@ and then select the region of un-tablified names and use (error "No keyboard macro has been defined")) (setq macro last-kbd-macro))) (save-excursion - (let ((end-marker (progn - (goto-char bottom) - (beginning-of-line) - (point-marker))) + (let ((end-marker (copy-marker bottom)) next-line-marker) (goto-char top) (if (not (bolp)) From 8871f2babc8acf63fd9fbab68dd6d4e04566520f Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Tue, 31 Aug 2004 23:47:53 +0000 Subject: [PATCH 294/341] (Basic Keyboard Macro): `apply-macro-to-region-lines' now operates on all lines that begin in the region, rather than on all complete lines in the region. --- man/kmacro.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/man/kmacro.texi b/man/kmacro.texi index d3c24873cd0..bad186f88b2 100644 --- a/man/kmacro.texi +++ b/man/kmacro.texi @@ -71,7 +71,7 @@ Insert in the buffer a keyboard macro's definition, as Lisp code. @item C-x C-k e Edit a previously defined keyboard macro (@code{edit-kbd-macro}). @item C-x C-k r -Run the last keyboard macro on each complete line in the region +Run the last keyboard macro on each line that begins in the region (@code{apply-macro-to-region-lines}). @end table @@ -174,8 +174,8 @@ before appending to it. @findex apply-macro-to-region-lines @kindex C-x C-k r The command @kbd{C-x C-k r} (@code{apply-macro-to-region-lines}) -repeats the last defined keyboard macro on each complete line within -the current region. It does this line by line, by moving point to the +repeats the last defined keyboard macro on each line that begins in +the region. It does this line by line, by moving point to the beginning of the line and then executing the macro. @node Keyboard Macro Ring From 61b73aa496f8ef3df53706f158048e6e8e578886 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Tue, 31 Aug 2004 23:53:10 +0000 Subject: [PATCH 295/341] *** empty log message *** --- etc/NEWS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 5995bf3dd97..958d616d97c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -98,6 +98,9 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types. * Changes in Emacs 21.4 +** `apply-macro-to-region-lines' now operates on all lines that begin +in the region, rather than on all complete lines in the region. + ** global-whitespace-mode is a new alias for whitespace-global-mode. +++ From 7d01236c2247fe2e499ed6c1759acfb0dfe04570 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Wed, 1 Sep 2004 00:09:17 +0000 Subject: [PATCH 296/341] *** empty log message *** --- etc/NEWS | 1 + lisp/ChangeLog | 6 ++++++ man/ChangeLog | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 958d616d97c..ef3c6de93ec 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -98,6 +98,7 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types. * Changes in Emacs 21.4 ++++ ** `apply-macro-to-region-lines' now operates on all lines that begin in the region, rather than on all complete lines in the region. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 80626c5d2b7..ef39c44370a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-08-31 Luc Teirlinck + + * macros.el (apply-macro-to-region-lines): Make it operate on all + lines that begin in the region, rather than on all complete lines + in the region. + 2004-08-31 Jan Dj,Ad(Brv * x-dnd.el (x-dnd-protocol-alist): Document update. diff --git a/man/ChangeLog b/man/ChangeLog index d0fc0026eb1..cc859cffb05 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,9 @@ +2004-08-31 Luc Teirlinck + + * kmacro.texi (Basic Keyboard Macro): + `apply-macro-to-region-lines' now operates on all lines that begin + in the region, rather than on all complete lines in the region. + 2004-08-31 Jan Dj,Ad(Brv * frames.texi (Drag and drop): Add documentation about From 310abb0b815e22977e87685855fbccdd7e329bba Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 1 Sep 2004 16:19:04 +0000 Subject: [PATCH 297/341] (next-error, previous-error, first-error) (next-error-no-select, previous-error-no-select): Make arguments optional. --- lisp/simple.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 78ca8e63f2e..32eecec8d4b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -135,7 +135,7 @@ to navigate in it.") (current-buffer))) (error "No next-error capable buffer found")))))))) -(defun next-error (arg &optional reset) +(defun next-error (&optional arg reset) "Visit next next-error message and corresponding source code. If all the error messages parsed so far have been processed already, @@ -175,7 +175,7 @@ See variables `compilation-parse-errors-function' and (define-key ctl-x-map "`" 'next-error) -(defun previous-error (n) +(defun previous-error (&optional n) "Visit previous next-error message and corresponding source code. Prefix arg N says how many error messages to move backwards (or @@ -183,9 +183,9 @@ forwards, if negative). This operates on the output from the \\[compile] and \\[grep] commands." (interactive "p") - (next-error (- n))) + (next-error (- (or n 1)))) -(defun first-error (n) +(defun first-error (&optional n) "Restart at the first error. Visit corresponding source code. With prefix arg N, visit the source code of the Nth error. @@ -193,7 +193,7 @@ This operates on the output from the \\[compile] command, for instance." (interactive "p") (next-error n t)) -(defun next-error-no-select (n) +(defun next-error-no-select (&optional n) "Move point to the next error in the next-error buffer and highlight match. Prefix arg N says how many error messages to move forwards (or backwards, if negative). @@ -203,14 +203,14 @@ select the source buffer." (next-error n) (pop-to-buffer next-error-last-buffer)) -(defun previous-error-no-select (n) +(defun previous-error-no-select (&optional n) "Move point to the previous error in the next-error buffer and highlight match. Prefix arg N says how many error messages to move backwards (or forwards, if negative). Finds and highlights the source line like \\[previous-error], but does not select the source buffer." (interactive "p") - (next-error-no-select (- n))) + (next-error-no-select (- (or n 1)))) ;;; From 03e75c7e0ad48c6297f7248f71faa1e9c6805707 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 1 Sep 2004 17:05:59 +0000 Subject: [PATCH 298/341] * simple.el (next-error-find-buffer): Move the rule "if current buffer is a next-error capable buffer" after the rule "if next-error-last-buffer is set to a live buffer". Simplify to test all rules in one `or'. (next-error): Doc fix. --- lisp/simple.el | 90 +++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 32eecec8d4b..2b21967a000 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -91,49 +91,48 @@ to navigate in it.") (or (and extra-test (funcall extra-test)) next-error-function))) -;; Return a next-error capable buffer according to the following rules: -;; 1. If the current buffer is a next-error capable buffer, return it. -;; 2. If one window on the selected frame displays such buffer, return it. -;; 3. If next-error-last-buffer is set to a live buffer, use that. -;; 4. Otherwise, look for a next-error capable buffer in a buffer list. -;; 5. Signal an error if there are none. (defun next-error-find-buffer (&optional other-buffer extra-test) - (if (and (not other-buffer) - (next-error-buffer-p (current-buffer) extra-test)) - ;; The current buffer is a next-error capable buffer. - (current-buffer) - (or - (let ((window-buffers - (delete-dups - (delq nil - (mapcar (lambda (w) - (and (next-error-buffer-p (window-buffer w) extra-test) - (window-buffer w))) - (window-list)))))) - (if other-buffer - (setq window-buffers (delq (current-buffer) window-buffers))) - (if (eq (length window-buffers) 1) - (car window-buffers))) - (if (and next-error-last-buffer (buffer-name next-error-last-buffer) - (next-error-buffer-p next-error-last-buffer extra-test) - (or (not other-buffer) (not (eq next-error-last-buffer - (current-buffer))))) - next-error-last-buffer - (let ((buffers (buffer-list))) - (while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test)) - (and other-buffer - (eq (car buffers) (current-buffer))))) - (setq buffers (cdr buffers))) - (if buffers - (car buffers) - (or (and other-buffer - (next-error-buffer-p (current-buffer) extra-test) - ;; The current buffer is a next-error capable buffer. - (progn - (if other-buffer - (message "This is the only next-error capable buffer.")) - (current-buffer))) - (error "No next-error capable buffer found")))))))) + "Return a next-error capable buffer." + (or + ;; 1. If one window on the selected frame displays such buffer, return it. + (let ((window-buffers + (delete-dups + (delq nil (mapcar (lambda (w) + (if (next-error-buffer-p + (window-buffer w) extra-test) + (window-buffer w))) + (window-list)))))) + (if other-buffer + (setq window-buffers (delq (current-buffer) window-buffers))) + (if (eq (length window-buffers) 1) + (car window-buffers))) + ;; 2. If next-error-last-buffer is set to a live buffer, use that. + (if (and next-error-last-buffer + (buffer-name next-error-last-buffer) + (next-error-buffer-p next-error-last-buffer extra-test) + (or (not other-buffer) + (not (eq next-error-last-buffer (current-buffer))))) + next-error-last-buffer) + ;; 3. If the current buffer is a next-error capable buffer, return it. + (if (and (not other-buffer) + (next-error-buffer-p (current-buffer) extra-test)) + (current-buffer)) + ;; 4. Look for a next-error capable buffer in a buffer list. + (let ((buffers (buffer-list))) + (while (and buffers + (or (not (next-error-buffer-p (car buffers) extra-test)) + (and other-buffer (eq (car buffers) (current-buffer))))) + (setq buffers (cdr buffers))) + (if buffers + (car buffers) + (or (and other-buffer + (next-error-buffer-p (current-buffer) extra-test) + ;; The current buffer is a next-error capable buffer. + (progn + (if other-buffer + (message "This is the only next-error capable buffer")) + (current-buffer))) + (error "No next-error capable buffer found")))))) (defun next-error (&optional arg reset) "Visit next next-error message and corresponding source code. @@ -153,9 +152,10 @@ compilation, grep, or occur buffer. It can also operate on any buffer with output from the \\[compile], \\[grep] commands, or, more generally, on any buffer in Compilation mode or with Compilation Minor mode enabled, or any buffer in which -`next-error-function' is bound to an appropriate -function. To specify use of a particular buffer for error -messages, type \\[next-error] in that buffer. +`next-error-function' is bound to an appropriate function. +To specify use of a particular buffer for error messages, type +\\[next-error] in that buffer when it is the only one displayed +in the current frame. Once \\[next-error] has chosen the buffer for error messages, it stays with that buffer until you use it in some other buffer which From ee9c5954f0c3e32993580b22f11acf51039452c7 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 1 Sep 2004 18:41:06 +0000 Subject: [PATCH 299/341] * simple.el (next-error): New defgroup and defface. (next-error-highlight, next-error-highlight-no-select): New defcustoms. (next-error-no-select): Let-bind next-error-highlight to the value of next-error-highlight-no-select before calling `next-error'. --- lisp/simple.el | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 2b21967a000..271a07ee531 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -65,7 +65,7 @@ (setq found buffer))) (setq list (cdr list))) (switch-to-buffer found))) - + ;;; next-error support framework (defvar next-error-last-buffer nil "The most recent next-error buffer. @@ -200,7 +200,8 @@ backwards, if negative). Finds and highlights the source line like \\[next-error], but does not select the source buffer." (interactive "p") - (next-error n) + (let ((next-error-highlight next-error-highlight-no-select)) + (next-error n)) (pop-to-buffer next-error-last-buffer)) (defun previous-error-no-select (&optional n) @@ -212,6 +213,43 @@ select the source buffer." (interactive "p") (next-error-no-select (- (or n 1)))) +(defgroup next-error nil + "next-error support framework." + :group 'compilation + :version "21.4") + +(defface next-error + '((t (:inherit region))) + "Face used to highlight next error locus." + :group 'next-error + :version "21.4") + +(defcustom next-error-highlight 0.1 + "*Highlighting of locations in selected source buffers. +If number, highlight the locus in next-error face for given time in seconds. +If t, use persistent overlays fontified in next-error face. +If nil, don't highlight the locus in the source buffer. +If `fringe-arrow', indicate the locus by the fringe arrow." + :type '(choice (number :tag "Delay") + (const :tag "Persistent overlay" t) + (const :tag "No highlighting" nil) + (const :tag "Fringe arrow" 'fringe-arrow)) + :group 'next-error + :version "21.4") + +(defcustom next-error-highlight-no-select 0.1 + "*Highlighting of locations in non-selected source buffers. +If number, highlight the locus in next-error face for given time in seconds. +If t, use persistent overlays fontified in next-error face. +If nil, don't highlight the locus in the source buffer. +If `fringe-arrow', indicate the locus by the fringe arrow." + :type '(choice (number :tag "Delay") + (const :tag "Persistent overlay" t) + (const :tag "No highlighting" nil) + (const :tag "Fringe arrow" 'fringe-arrow)) + :group 'next-error + :version "21.4") + ;;; (defun fundamental-mode () From 2beb6aa0e09e024638d830b685892faebe8b4db1 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 1 Sep 2004 18:44:35 +0000 Subject: [PATCH 300/341] (compilation-goto-locus): Use `next-error' face instead of `region'. Set 4-th argument of `move-overlay' to `current-buffer' to move overlay to different source buffers. Use new variable `next-error-highlight'. --- lisp/progmodes/compile.el | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 32fa246b9f6..b890f542b8d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1564,7 +1564,7 @@ All arguments are markers. If END-MK is non nil, mark is set there." (unless compilation-highlight-overlay (setq compilation-highlight-overlay (make-overlay (point-min) (point-min))) - (overlay-put compilation-highlight-overlay 'face 'region)) + (overlay-put compilation-highlight-overlay 'face 'next-error)) (with-current-buffer (marker-buffer mk) (save-excursion (end-of-line) @@ -1574,11 +1574,18 @@ All arguments are markers. If END-MK is non nil, mark is set there." (re-search-forward highlight-regexp end t)) (progn (goto-char (match-beginning 0)) - (move-overlay compilation-highlight-overlay (match-beginning 0) (match-end 0))) - (move-overlay compilation-highlight-overlay (point) end)) - (sit-for 0.5) - (delete-overlay compilation-highlight-overlay))))))) - + (move-overlay compilation-highlight-overlay + (match-beginning 0) (match-end 0) + (current-buffer))) + (move-overlay compilation-highlight-overlay + (point) end (current-buffer))) + (if (numberp next-error-highlight) + (sit-for next-error-highlight)) + (if (not (eq next-error-highlight t)) + (delete-overlay compilation-highlight-overlay)))))) + (when (and (eq next-error-highlight 'fringe-arrow)) + (set (make-local-variable 'overlay-arrow-position) + (copy-marker (line-beginning-position)))))) (defun compilation-find-file (marker filename dir &rest formats) "Find a buffer for file FILENAME. From 8b3094c7c622d3420a9e6ca0f82792954a3d00be Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 1 Sep 2004 18:48:19 +0000 Subject: [PATCH 301/341] Add `next-error-highlight' and `next-error-highlight-no-select'. --- etc/NEWS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index ef3c6de93ec..2b4f16efa13 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1862,7 +1862,9 @@ This option allows you to specify environment variables for inferior compilation processes without affecting the environment that all subprocesses inherit. -*** `next-error' now temporarily highlights the corresponding source line. +*** New options `next-error-highlight' and `next-error-highlight-no-select' +specify the method of highlighting of the corresponding source line +in new face `next-error'. ** Grep has been decoupled from compilation mode setup. From 0b02cda944925610e955e59438165ff9116858d6 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 1 Sep 2004 19:29:28 +0000 Subject: [PATCH 302/341] (Info-search-whitespace-regexp): Fix backslashes. (Info-search): Add new optional arguments for the sake of isearch. Replace whitespace in Info-search-whitespace-regexp literally. Add backward search. Don't call `Info-select-node' if regexp is found in the same Info node. Don't add node to Info-history for wrapped isearch. (Info-search-backward, Info-isearch-search, Info-isearch-wrap) (Info-isearch-push-state, Info-isearch-pop-state): New funs. (Info-mode): Set local variables `isearch-search-fun-function', `isearch-wrap-function', `isearch-push-state-function', `search-whitespace-regexp'. --- lisp/info.el | 120 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 100 insertions(+), 20 deletions(-) diff --git a/lisp/info.el b/lisp/info.el index 43e1dafcc6f..13bf3901d6d 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -188,7 +188,7 @@ file, so be prepared for a few surprises if you enable this feature." :type 'boolean :group 'info) -(defcustom Info-search-whitespace-regexp "\\\\(?:\\\\s-+\\\\)" +(defcustom Info-search-whitespace-regexp "\\(?:\\s-+\\)" "*If non-nil, regular expression to match a sequence of whitespace chars. This applies to Info search for regular expressions. You might want to use something like \"[ \\t\\r\\n]+\" instead. @@ -1442,8 +1442,9 @@ If FORK is a string, it is the name to use for the new buffer." (defvar Info-search-case-fold nil "The value of `case-fold-search' from previous `Info-search' command.") -(defun Info-search (regexp) - "Search for REGEXP, starting from point, and select node it's found in." +(defun Info-search (regexp &optional bound noerror count direction) + "Search for REGEXP, starting from point, and select node it's found in. +If DIRECTION is `backward', search in the reverse direction." (interactive (list (read-string (if Info-search-history (format "Regexp search%s (default `%s'): " @@ -1458,31 +1459,42 @@ If FORK is a string, it is the name to use for the new buffer." (setq regexp (car Info-search-history))) (when regexp (let (found beg-found give-up + (backward (eq direction 'backward)) (onode Info-current-node) (ofile Info-current-file) (opoint (point)) + (opoint-min (point-min)) + (opoint-max (point-max)) (ostart (window-start)) (osubfile Info-current-subfile)) (when Info-search-whitespace-regexp - (setq regexp (replace-regexp-in-string - "[ \t\n]+" Info-search-whitespace-regexp regexp))) + (setq regexp + (mapconcat 'identity (split-string regexp "[ \t\n]+") + Info-search-whitespace-regexp))) (setq Info-search-case-fold case-fold-search) (save-excursion (save-restriction (widen) (while (and (not give-up) (or (null found) - (isearch-range-invisible beg-found found))) - (if (re-search-forward regexp nil t) - (setq found (point) beg-found (match-beginning 0)) + (if backward + (isearch-range-invisible found beg-found) + (isearch-range-invisible beg-found found)))) + (if (if backward + (re-search-backward regexp bound t) + (re-search-forward regexp bound t)) + (setq found (point) beg-found (if backward (match-end 0) + (match-beginning 0))) (setq give-up t))))) ;; If no subfiles, give error now. (if give-up (if (null Info-current-subfile) - (re-search-forward regexp) + (if backward + (re-search-backward regexp) + (re-search-forward regexp)) (setq found nil))) - (unless found + (unless (or found bound) (unwind-protect ;; Try other subfiles. (let ((list ())) @@ -1498,29 +1510,39 @@ If FORK is a string, it is the name to use for the new buffer." ;; Find the subfile we just searched. (search-forward (concat "\n" osubfile ": ")) ;; Skip that one. - (forward-line 1) + (forward-line (if backward 0 1)) ;; Make a list of all following subfiles. ;; Each elt has the form (VIRT-POSITION . SUBFILENAME). - (while (not (eobp)) - (re-search-forward "\\(^.*\\): [0-9]+$") + (while (not (if backward (bobp) (eobp))) + (if backward + (re-search-backward "\\(^.*\\): [0-9]+$") + (re-search-forward "\\(^.*\\): [0-9]+$")) (goto-char (+ (match-end 1) 2)) (setq list (cons (cons (+ (point-min) (read (current-buffer))) (match-string-no-properties 1)) list)) - (goto-char (1+ (match-end 0)))) + (goto-char (if backward + (1- (match-beginning 0)) + (1+ (match-end 0))))) ;; Put in forward order (setq list (nreverse list)))) (while list (message "Searching subfile %s..." (cdr (car list))) (Info-read-subfile (car (car list))) + (if backward (goto-char (point-max))) (setq list (cdr list)) (setq give-up nil found nil) (while (and (not give-up) (or (null found) - (isearch-range-invisible beg-found found))) - (if (re-search-forward regexp nil t) - (setq found (point) beg-found (match-beginning 0)) + (if backward + (isearch-range-invisible found beg-found) + (isearch-range-invisible beg-found found)))) + (if (if backward + (re-search-backward regexp nil t) + (re-search-forward regexp nil t)) + (setq found (point) beg-found (if backward (match-end 0) + (match-beginning 0))) (setq give-up t))) (if give-up (setq found nil)) @@ -1534,12 +1556,20 @@ If FORK is a string, it is the name to use for the new buffer." (goto-char opoint) (Info-select-node) (set-window-start (selected-window) ostart))))) - (widen) - (goto-char found) - (Info-select-node) + + (if (and (string= osubfile Info-current-subfile) + (> found opoint-min) + (< found opoint-max)) + ;; Search landed in the same node + (goto-char found) + (widen) + (goto-char found) + (save-match-data (Info-select-node))) + ;; Use string-equal, not equal, to ignore text props. (or (and (string-equal onode Info-current-node) (equal ofile Info-current-file)) + (and isearch-mode isearch-wrapped (eq opoint opoint-min)) (setq Info-history (cons (list ofile onode opoint) Info-history)))))) @@ -1556,6 +1586,48 @@ If FORK is a string, it is the name to use for the new buffer." (if Info-search-history (Info-search (car Info-search-history)) (call-interactively 'Info-search)))) + +(defun Info-search-backward (regexp &optional bound noerror count) + "Search for REGEXP in the reverse direction." + (interactive (list (read-string + (if Info-search-history + (format "Regexp search%s backward (default `%s'): " + (if case-fold-search "" " case-sensitively") + (car Info-search-history)) + (format "Regexp search%s backward: " + (if case-fold-search "" " case-sensitively"))) + nil 'Info-search-history))) + (Info-search regexp bound noerror count 'backward)) + +(defun Info-isearch-search () + (cond + (isearch-word + (if isearch-forward 'word-search-forward 'word-search-backward)) + (isearch-regexp + (lambda (regexp bound noerror) + (condition-case nil + (progn + (Info-search regexp bound noerror nil + (unless isearch-forward 'backward)) + (point)) + (error nil)))) + (t + (if isearch-forward 'search-forward 'search-backward)))) + +(defun Info-isearch-wrap () + (if isearch-regexp + (if isearch-forward (Info-top-node) (Info-final-node)) + (goto-char (if isearch-forward (point-min) (point-max))))) + +(defun Info-isearch-push-state () + `(lambda (cmd) + (Info-isearch-pop-state cmd ,Info-current-file ,Info-current-node))) + +(defun Info-isearch-pop-state (cmd file node) + (or (and (string= Info-current-file file) + (string= Info-current-node node)) + (progn (Info-find-node file node) (sit-for 0)))) + (defun Info-extract-pointer (name &optional errorname) "Extract the value of the node-pointer named NAME. @@ -3064,6 +3136,14 @@ Advanced commands: (setq desktop-save-buffer 'Info-desktop-buffer-misc-data) (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t) (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) + (set (make-local-variable 'isearch-search-fun-function) + 'Info-isearch-search) + (set (make-local-variable 'isearch-wrap-function) + 'Info-isearch-wrap) + (set (make-local-variable 'isearch-push-state-function) + 'Info-isearch-push-state) + (set (make-local-variable 'search-whitespace-regexp) + Info-search-whitespace-regexp) (Info-set-mode-line) (run-hooks 'Info-mode-hook)) From 1a699acfc29e47c6ea37346005612c6e3ae8b681 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 1 Sep 2004 19:42:58 +0000 Subject: [PATCH 303/341] Remove ancient Change Log section. (isearch-string, isearch-message-string, isearch-point) (isearch-success, isearch-forward-flag, isearch-other-end) (isearch-word, isearch-invalid-regexp, isearch-wrapped) (isearch-barrier, isearch-within-brackets) (isearch-case-fold-search): Add suffix `-state' to state-related defsubsts to avoid name clashes with other function names. --- lisp/isearch.el | 99 ++++++++++++++++--------------------------------- 1 file changed, 31 insertions(+), 68 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 2c20d45bbd8..d21e28008a9 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -61,43 +61,6 @@ ;; - Integrate the emacs 19 generalized command history. ;; - Hooks and options for failed search. -;;; Change Log: - -;; Changes before those recorded in ChangeLog: - -;; Revision 1.4 92/09/14 16:26:02 liberte -;; Added prefix args to isearch-forward, etc. to switch between -;; string and regular expression searching. -;; Added some support for lemacs. -;; Added general isearch-highlight option - but only for lemacs so far. -;; Added support for frame switching in emacs 19. -;; Added word search option to isearch-edit-string. -;; Renamed isearch-quit to isearch-abort. -;; Numerous changes to comments and doc strings. -;; -;; Revision 1.3 92/06/29 13:10:08 liberte -;; Moved modal isearch-mode handling into isearch-mode. -;; Got rid of buffer-local isearch variables. -;; isearch-edit-string used by ring adjustments, completion, and -;; nonincremental searching. C-s and C-r are additional exit commands. -;; Renamed all regex to regexp. -;; Got rid of found-start and found-point globals. -;; Generalized handling of upper-case chars. - -;; Revision 1.2 92/05/27 11:33:57 liberte -;; Emacs version 19 has a search ring, which is supported here. -;; Other fixes found in the version 19 isearch are included here. -;; -;; Also see variables search-caps-disable-folding, -;; search-nonincremental-instead, search-whitespace-regexp, and -;; commands isearch-toggle-regexp, isearch-edit-string. -;; -;; semi-modal isearching is supported. - -;; Changes for 1.1 -;; 3/18/92 Fixed invalid-regexp. -;; 3/18/92 Fixed yanking in regexps. - ;;; Code: @@ -776,57 +739,57 @@ REGEXP says which ring to use." ;; The search status structure and stack. -(defsubst isearch-string (frame) +(defsubst isearch-string-state (frame) "Return the search string in FRAME." (aref frame 0)) -(defsubst isearch-message-string (frame) +(defsubst isearch-message-state (frame) "Return the search string to display to the user in FRAME." (aref frame 1)) -(defsubst isearch-point (frame) +(defsubst isearch-point-state (frame) "Return the point in FRAME." (aref frame 2)) -(defsubst isearch-success (frame) +(defsubst isearch-success-state (frame) "Return the success flag in FRAME." (aref frame 3)) -(defsubst isearch-forward-flag (frame) +(defsubst isearch-forward-state (frame) "Return the searching-forward flag in FRAME." (aref frame 4)) -(defsubst isearch-other-end (frame) +(defsubst isearch-other-end-state (frame) "Return the other end of the match in FRAME." (aref frame 5)) -(defsubst isearch-word (frame) +(defsubst isearch-word-state (frame) "Return the search-by-word flag in FRAME." (aref frame 6)) -(defsubst isearch-invalid-regexp (frame) +(defsubst isearch-invalid-regexp-state (frame) "Return the regexp error message in FRAME, or nil if its regexp is valid." (aref frame 7)) -(defsubst isearch-wrapped (frame) +(defsubst isearch-wrapped-state (frame) "Return the search-wrapped flag in FRAME." (aref frame 8)) -(defsubst isearch-barrier (frame) +(defsubst isearch-barrier-state (frame) "Return the barrier value in FRAME." (aref frame 9)) -(defsubst isearch-within-brackets (frame) +(defsubst isearch-within-brackets-state (frame) "Return the in-character-class flag in FRAME." (aref frame 10)) -(defsubst isearch-case-fold-search (frame) +(defsubst isearch-case-fold-search-state (frame) "Return the case-folding flag in FRAME." (aref frame 11)) (defun isearch-top-state () (let ((cmd (car isearch-cmds))) - (setq isearch-string (isearch-string cmd) - isearch-message (isearch-message-string cmd) - isearch-success (isearch-success cmd) - isearch-forward (isearch-forward-flag cmd) - isearch-other-end (isearch-other-end cmd) - isearch-word (isearch-word cmd) - isearch-invalid-regexp (isearch-invalid-regexp cmd) - isearch-wrapped (isearch-wrapped cmd) - isearch-barrier (isearch-barrier cmd) - isearch-within-brackets (isearch-within-brackets cmd) - isearch-case-fold-search (isearch-case-fold-search cmd)) - (goto-char (isearch-point cmd)))) + (setq isearch-string (isearch-string-state cmd) + isearch-message (isearch-message-state cmd) + isearch-success (isearch-success-state cmd) + isearch-forward (isearch-forward-state cmd) + isearch-other-end (isearch-other-end-state cmd) + isearch-word (isearch-word-state cmd) + isearch-invalid-regexp (isearch-invalid-regexp-state cmd) + isearch-wrapped (isearch-wrapped-state cmd) + isearch-barrier (isearch-barrier-state cmd) + isearch-within-brackets (isearch-within-brackets-state cmd) + isearch-case-fold-search (isearch-case-fold-search-state cmd)) + (goto-char (isearch-point-state cmd)))) (defun isearch-pop-state () (setq isearch-cmds (cdr isearch-cmds)) @@ -1347,7 +1310,7 @@ barrier." ;; We have to check 2 stack frames because the last might be ;; invalid just because of a backslash. (or (not isearch-invalid-regexp) - (not (isearch-invalid-regexp (cadr isearch-cmds))) + (not (isearch-invalid-regexp-state (cadr isearch-cmds))) allow-invalid)) (if to-barrier (progn (goto-char isearch-barrier) @@ -1362,8 +1325,8 @@ barrier." ;; Also skip over postfix operators -- though horrid, ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly legal. (while (and previous - (or (isearch-invalid-regexp frame) - (let* ((string (isearch-string frame)) + (or (isearch-invalid-regexp-state frame) + (let* ((string (isearch-string-state frame)) (lchar (aref string (1- (length string))))) ;; The operators aren't always operators; check ;; backslashes. This doesn't handle the case of @@ -1371,7 +1334,7 @@ barrier." ;; being special, but then we should fall back to ;; the barrier anyway because it's all optional. (if (isearch-backslash - (isearch-string (car previous))) + (isearch-string-state (car previous))) (eq lchar ?\}) (memq lchar '(?* ?? ?+)))))) (setq stack previous previous (cdr previous) frame (car stack))) @@ -1379,7 +1342,7 @@ barrier." ;; `stack' now refers the most recent valid regexp that is not at ;; all optional in its last term. Now dig one level deeper and find ;; what matched before that. - (let ((last-other-end (or (isearch-other-end (car previous)) + (let ((last-other-end (or (isearch-other-end-state (car previous)) isearch-barrier))) (goto-char (if isearch-forward (max last-other-end isearch-barrier) @@ -2012,9 +1975,9 @@ Can be changed via `isearch-search-fun-function' for special needs." (if isearch-success nil ;; Ding if failed this time after succeeding last time. - (and (isearch-success (car isearch-cmds)) + (and (isearch-success-state (car isearch-cmds)) (ding)) - (goto-char (isearch-point (car isearch-cmds))))) + (goto-char (isearch-point-state (car isearch-cmds))))) ;; Called when opening an overlay, and we are still in isearch. From 6a18e4e72c2ab83d2cca8b6a6c432676ade70347 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 1 Sep 2004 20:35:12 +0000 Subject: [PATCH 304/341] * isearch.el (isearch-wrap-function) (isearch-push-state-function): New defvars. (isearch-pop-fun-state): New defsubst. (isearch-top-state): Call function saved in `isearch-pop-fun-state'. (isearch-push-state): Set the result of calling `isearch-push-state-function' to the `isearch-pop-fun-state' field. (isearch-cancel): Call function saved in `isearch-pop-fun-state' to restore the mode-specific starting point of terminated search. (isearch-abort): Call `isearch-cancel' instead of its duplicated code. (isearch-repeat): Call `isearch-wrap-function' if defined. (isearch-message-prefix): Don't add prefix "over" to the message for wrapped search if `isearch-wrap-function' is defined. (isearch-search): Call function saved in `isearch-pop-fun-state' to restore the mode-specific starting point of failed search. --- lisp/ChangeLog | 66 ++++++++++++++++++++++++++++++++++++++++++++----- lisp/isearch.el | 44 +++++++++++++++++++++++---------- 2 files changed, 91 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ef39c44370a..9871aac6976 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,60 @@ +2004-09-01 Juri Linkov + + * isearch.el (isearch-wrap-function) + (isearch-push-state-function): New defvars. + (isearch-pop-fun-state): New defsubst. + (isearch-top-state): Call function saved in `isearch-pop-fun-state'. + (isearch-push-state): Set the result of calling + `isearch-push-state-function' to the `isearch-pop-fun-state' field. + (isearch-cancel): Call function saved in `isearch-pop-fun-state' to + restore the mode-specific starting point of terminated search. + (isearch-abort): Call `isearch-cancel' instead of its duplicated code. + (isearch-repeat): Call `isearch-wrap-function' if defined. + (isearch-message-prefix): Don't add prefix "over" to the message + for wrapped search if `isearch-wrap-function' is defined. + (isearch-search): Call function saved in `isearch-pop-fun-state' to + restore the mode-specific starting point of failed search. + + * info.el (Info-search-whitespace-regexp): Fix backslashes. + (Info-search): Add new optional arguments for the sake of isearch. + Replace whitespace in Info-search-whitespace-regexp literally. + Add backward search. Don't call `Info-select-node' if regexp is + found in the same Info node. Don't add node to Info-history for + wrapped isearch. + (Info-search-backward, Info-isearch-search, Info-isearch-wrap) + (Info-isearch-push-state, Info-isearch-pop-state): New funs. + (Info-mode): Set local variables `isearch-search-fun-function', + `isearch-wrap-function', `isearch-push-state-function', + `search-whitespace-regexp'. + + * isearch.el: Remove ancient Change Log section. + (isearch-string, isearch-message-string, isearch-point) + (isearch-success, isearch-forward-flag, isearch-other-end) + (isearch-word, isearch-invalid-regexp, isearch-wrapped) + (isearch-barrier, isearch-within-brackets) + (isearch-case-fold-search): Add suffix `-state' to state-related + defsubsts to avoid name clashes with other function names. + + * simple.el (next-error): New defgroup and defface. + (next-error-highlight, next-error-highlight-no-select): + New defcustoms. + (next-error-no-select): Let-bind next-error-highlight to the value + of next-error-highlight-no-select before calling `next-error'. + + * progmodes/compile.el (compilation-goto-locus): + Use `next-error' face instead of `region'. Set 4-th argument of + `move-overlay' to `current-buffer' to move overlay to different + source buffers. Use new variable `next-error-highlight'. + + * simple.el (next-error-find-buffer): Move the rule + "if current buffer is a next-error capable buffer" after the + rule "if next-error-last-buffer is set to a live buffer". + Simplify to test all rules in one `or'. + (next-error): Doc fix. + (next-error, previous-error, first-error) + (next-error-no-select, previous-error-no-select): + Make arguments optional. + 2004-08-31 Luc Teirlinck * macros.el (apply-macro-to-region-lines): Make it operate on all @@ -612,7 +669,6 @@ (ps-generate-string-list): Comment fix. (ps-message-log-max): Code fix. - 2004-07-22 Michael Piotrowski (tiny change) * ps-print.el (ps-begin-file): Improve the DSC compliance of the @@ -632,11 +688,9 @@ 2004-07-20 Richard M. Stallman - * textmodes/fill.el (fill-comment-paragraph): Handle indent-tabs-mode. - (fill-delete-newlines): Call sentence-end as function. - (fill-nobreak-p, canonically-space-region): Likewise. - (fill-nobreak-p): If this break point is at the end of the line, - don't consider the newline which follows as a reason to return t. + * textmodes/fill.el (fill-nobreak-p): If this break point is + at the end of the line, don't consider the newline which follows + as a reason to return t. 2004-07-19 John Paul Wallington diff --git a/lisp/isearch.el b/lisp/isearch.el index d21e28008a9..b8865693d0b 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -57,10 +57,6 @@ ;; keep the behavior. No point in forcing nonincremental search until ;; the last possible moment. -;; TODO -;; - Integrate the emacs 19 generalized command history. -;; - Hooks and options for failed search. - ;;; Code: @@ -161,6 +157,15 @@ Ordinarily the text becomes invisible again at the end of the search." (defvar isearch-mode-end-hook nil "Function(s) to call after terminating an incremental search.") +(defvar isearch-wrap-function nil + "Function to call to wrap the search when search is failed. +If nil, move point to the beginning of the buffer for a forward search, +or to the end of the buffer for a backward search.") + +(defvar isearch-push-state-function nil + "Function to save a function restoring the mode-specific isearch state +to the search status stack.") + ;; Search ring. (defvar search-ring nil @@ -775,6 +780,9 @@ REGEXP says which ring to use." (defsubst isearch-case-fold-search-state (frame) "Return the case-folding flag in FRAME." (aref frame 11)) +(defsubst isearch-pop-fun-state (frame) + "Return the function restoring the mode-specific isearch state in FRAME." + (aref frame 12)) (defun isearch-top-state () (let ((cmd (car isearch-cmds))) @@ -789,6 +797,8 @@ REGEXP says which ring to use." isearch-barrier (isearch-barrier-state cmd) isearch-within-brackets (isearch-within-brackets-state cmd) isearch-case-fold-search (isearch-case-fold-search-state cmd)) + (if (functionp (isearch-pop-fun-state cmd)) + (funcall (isearch-pop-fun-state cmd) cmd)) (goto-char (isearch-point-state cmd)))) (defun isearch-pop-state () @@ -801,7 +811,9 @@ REGEXP says which ring to use." isearch-success isearch-forward isearch-other-end isearch-word isearch-invalid-regexp isearch-wrapped isearch-barrier - isearch-within-brackets isearch-case-fold-search) + isearch-within-brackets isearch-case-fold-search + (if isearch-push-state-function + (funcall isearch-push-state-function))) isearch-cmds))) @@ -987,10 +999,13 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst (defun isearch-cancel () "Terminate the search and go back to the starting point." (interactive) + (if (functionp (isearch-pop-fun-state (car (last isearch-cmds)))) + (funcall (isearch-pop-fun-state (car (last isearch-cmds))) + (car (last isearch-cmds)))) (goto-char isearch-opoint) - (isearch-done t) + (isearch-done t) ; exit isearch (isearch-clean-overlays) - (signal 'quit nil)) ; and pass on quit signal + (signal 'quit nil)) ; and pass on quit signal (defun isearch-abort () "Abort incremental search mode if searching is successful, signaling quit. @@ -1002,11 +1017,9 @@ Use `isearch-exit' to quit without signaling." (if isearch-success ;; If search is successful, move back to starting point ;; and really do quit. - (progn (goto-char isearch-opoint) - (setq isearch-success nil) - (isearch-done t) ; exit isearch - (isearch-clean-overlays) - (signal 'quit nil)) ; and pass on quit signal + (progn + (setq isearch-success nil) + (isearch-cancel)) ;; If search is failing, or has an incomplete regexp, ;; rub out until it is once more successful. (while (or (not isearch-success) isearch-invalid-regexp) @@ -1031,7 +1044,9 @@ Use `isearch-exit' to quit without signaling." ;; If already have what to search for, repeat it. (or isearch-success (progn - (goto-char (if isearch-forward (point-min) (point-max))) + (if isearch-wrap-function + (funcall isearch-wrap-function) + (goto-char (if isearch-forward (point-min) (point-max)))) (setq isearch-wrapped t)))) ;; C-s in reverse or C-r in forward, change direction. (setq isearch-forward (not isearch-forward))) @@ -1881,6 +1896,7 @@ If there is no completion possible, say so and continue searching." (or isearch-success (setq ellipsis nil)) (let ((m (concat (if isearch-success "" "failing ") (if (and isearch-wrapped + (not isearch-wrap-function) (if isearch-forward (> (point) isearch-opoint) (< (point) isearch-opoint))) @@ -1977,6 +1993,8 @@ Can be changed via `isearch-search-fun-function' for special needs." ;; Ding if failed this time after succeeding last time. (and (isearch-success-state (car isearch-cmds)) (ding)) + (if (functionp (isearch-pop-fun-state (car isearch-cmds))) + (funcall (isearch-pop-fun-state (car isearch-cmds)) (car isearch-cmds))) (goto-char (isearch-point-state (car isearch-cmds))))) From 0dfddff5b5ce4e2a5e72a456b609bc27c4a9e9e6 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 09:21:20 +0000 Subject: [PATCH 305/341] Regexp isearch can search through multiple nodes. Add Info-search-backward. --- etc/NEWS | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2b4f16efa13..ec00bb58f4f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -519,6 +519,13 @@ mode toggling function instead. *** A numeric prefix argument of `info' selects an Info buffer with the number appended to the *info* buffer name. +*** Regexp isearch (C-M-s and C-M-r) can search through multiple nodes. +Failed isearch wraps to the top/final node. + +*** New search commands: `Info-search-case-sensitively' (bound to S), +`Info-search-backward', and `Info-search-next' which repeats the last +search without prompting for a new search string. + *** New command `Info-history' (bound to L) displays a menu of visited nodes. *** New command `Info-toc' (bound to T) creates a node with table of contents @@ -532,11 +539,6 @@ possible matches. the current Info node name into the kill ring. With a zero prefix arg, puts the node name inside the `info' function call. -*** New command `Info-search-case-sensitively' (bound to S). - -*** New command `Info-search-next' (unbound) repeats the last search -without prompting for a new search string. - *** New face `info-xref-visited' distinguishes visited nodes from unvisited and a new option `Info-fontify-visited-nodes' to control this. From a14cb2558532ededa58b904b3309208bcbcf84ea Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 09:30:26 +0000 Subject: [PATCH 306/341] (Regexp Replace): Add missing backslash to \footnote. --- man/ChangeLog | 4 ++++ man/search.texi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/man/ChangeLog b/man/ChangeLog index cc859cffb05..e93293c431a 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2004-09-02 Juri Linkov + + * search.texi (Regexp Replace): Add missing backslash to \footnote. + 2004-08-31 Luc Teirlinck * kmacro.texi (Basic Keyboard Macro): diff --git a/man/search.texi b/man/search.texi index a0c64275de0..5a3814ebf5d 100644 --- a/man/search.texi +++ b/man/search.texi @@ -1080,7 +1080,7 @@ ask you to edit the replacement string in the minibuffer, putting point where the @samp{\?} was. For example, @example -M-x replace-regexp @key{RET} \footnote@{ @key{RET} +M-x replace-regexp @key{RET} \\footnote@{ @key{RET} \&\\label@{fn:\#\?@} @key{RET} @end example From 15658fd8e861639267f655e7b29ae55beb93d4e3 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 09:36:35 +0000 Subject: [PATCH 307/341] (Compilation Mode): Add a paragraph about rules for finding the compilation buffer for `next-error'. --- man/building.texi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/man/building.texi b/man/building.texi index 85240003eec..b3d4659a402 100644 --- a/man/building.texi +++ b/man/building.texi @@ -204,6 +204,14 @@ commands advance from there. When @kbd{C-x `} gets to the end of the buffer and finds no more error messages to visit, it fails and signals an Emacs error. + You don't have to be in the compilation buffer in order to use +@code{next-error}. If one window on the selected frame can be the +target of the @code{next-error} call, it is used. Else, if a buffer +previously had @code{next-error} called on it, it is used. Else, +if the current buffer can be the target of @code{next-error}, it is +used. Else, all the buffers Emacs manages are tried for +@code{next-error} support. + @kbd{C-u C-x `} starts scanning from the beginning of the compilation buffer. This is one way to process the same set of errors again. From d4bc156f106db041939f7d2cf374d113986b68f5 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 09:37:09 +0000 Subject: [PATCH 308/341] (Other Repeating Search): Mention that Occur mode supports the next-error functionality. --- man/search.texi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/man/search.texi b/man/search.texi index 5a3814ebf5d..e678ac66339 100644 --- a/man/search.texi +++ b/man/search.texi @@ -1286,6 +1286,9 @@ searched and moves point to the original of the chosen occurrence. @kbd{o} and @kbd{C-o} display the match in another window; @kbd{C-o} does not select it. +Occur mode supports the @code{next-error} functionality described in +in @ref{Compilation Mode}. + @item M-x list-matching-lines Synonym for @kbd{M-x occur}. From 74a18969ef4cc8dead121f656e1b2e0c6eaa3a5b Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 09:42:13 +0000 Subject: [PATCH 309/341] (ispell-html-skip-alists): Fix backslashes in docstring. --- lisp/textmodes/ispell.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 77c63379e2b..435e2e5f27a 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1228,7 +1228,7 @@ for skipping in latex mode.") "*Lists of start and end keys to skip in HTML buffers. Same format as `ispell-skip-region-alist' Note - substrings of other matches must come last - (e.g. \"<[tT][tT]/\" and \"<[^ \t\n>]\").") + (e.g. \"<[tT][tT]/\" and \"<[^ \\t\\n>]\").") (defvar ispell-local-pdict ispell-personal-dictionary From 017c959d5dcf46bf7b7a81974442987042c439fe Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 09:43:38 +0000 Subject: [PATCH 310/341] (beginning-of-defun, end-of-defun): Do not push mark if inhibit-mark-movement is non-nil. --- lisp/emacs-lisp/lisp.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 25fde86cd96..46d3d2625a1 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -176,7 +176,8 @@ If variable `beginning-of-defun-function' is non-nil, its value is called as a function to find the defun's beginning." (interactive "p") (and (eq this-command 'beginning-of-defun) - (or (eq last-command 'beginning-of-defun) (push-mark))) + (or inhibit-mark-movement (eq last-command 'beginning-of-defun) + (push-mark))) (and (beginning-of-defun-raw arg) (progn (beginning-of-line) t))) @@ -226,7 +227,8 @@ If variable `end-of-defun-function' is non-nil, its value is called as a function to find the defun's end." (interactive "p") (and (eq this-command 'end-of-defun) - (or (eq last-command 'end-of-defun) (push-mark))) + (or inhibit-mark-movement (eq last-command 'end-of-defun) + (push-mark))) (if (or (null arg) (= arg 0)) (setq arg 1)) (if end-of-defun-function (if (> arg 0) From e4aa3c949789dbc004c6a90f49c9bd5b8b157e36 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 09:45:31 +0000 Subject: [PATCH 311/341] (compilation-buffer-name): Compare major mode with second element of compilation-arguments instead of third to reflect latest changes in compilation-arguments structure. (recompile): Use global variable `compilation-directory' to get recent compilation directory only when `recompile' is invoked NOT in the compilation buffer. Otherwise, use `default-directory' of the compilation buffer. --- lisp/progmodes/compile.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index b890f542b8d..7a0aa42faff 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -458,9 +458,9 @@ starting the compilation process.") :version "21.4") (defface compilation-info-face - '((((class color) (min-colors 16) (background light)) + '((((class color) (min-colors 16) (background light)) (:foreground "Green3" :weight bold)) - (((class color) (min-colors 16) (background dark)) + (((class color) (min-colors 16) (background dark)) (:foreground "Green" :weight bold)) (((class color)) (:foreground "green" :weight bold)) (t (:weight bold))) @@ -789,7 +789,10 @@ If this is run in a Compilation mode buffer, re-use the arguments from the original use. Otherwise, recompile using `compile-command'." (interactive) (save-some-buffers (not compilation-ask-about-save) nil) - (let ((default-directory (or compilation-directory default-directory))) + (let ((default-directory + (or (and (not (eq major-mode (nth 1 compilation-arguments))) + compilation-directory) + default-directory))) (apply 'compilation-start (or compilation-arguments `(,(eval compile-command)))))) @@ -816,8 +819,7 @@ Otherwise, construct a buffer name from MODE-NAME." (funcall name-function mode-name)) (compilation-buffer-name-function (funcall compilation-buffer-name-function mode-name)) - ((and (eq major-mode 'compilation-mode) - (equal mode-name (nth 2 compilation-arguments))) + ((eq major-mode (nth 1 compilation-arguments)) (buffer-name)) (t (concat "*" (downcase mode-name) "*")))) @@ -1522,7 +1524,7 @@ If nil, don't scroll the compilation output window." (defun compilation-goto-locus (msg mk end-mk) "Jump to an error corresponding to MSG at MK. -All arguments are markers. If END-MK is non nil, mark is set there." +All arguments are markers. If END-MK is non-nil, mark is set there." (if (eq (window-buffer (selected-window)) (marker-buffer msg)) ;; If the compilation buffer window is selected, From c3829a8e2fa294b3b15c4827d11c12653e2df3c3 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 09:46:47 +0000 Subject: [PATCH 312/341] *** empty log message *** --- lisp/ChangeLog | 16 ++++++++++++++++ man/ChangeLog | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9871aac6976..e9f9e39ef72 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2004-09-02 Juri Linkov + + * progmodes/compile.el (compilation-buffer-name): Compare major + mode with second element of compilation-arguments instead of third + to reflect latest changes in compilation-arguments structure. + (recompile): Use global variable `compilation-directory' to get + recent compilation directory only when `recompile' is invoked NOT + in the compilation buffer. Otherwise, use `default-directory' of + the compilation buffer. + + * emacs-lisp/lisp.el (beginning-of-defun, end-of-defun): + Do not push mark if inhibit-mark-movement is non-nil. + + * textmodes/ispell.el (ispell-html-skip-alists): + Fix backslashes in docstring. + 2004-09-01 Juri Linkov * isearch.el (isearch-wrap-function) diff --git a/man/ChangeLog b/man/ChangeLog index e93293c431a..b294270f258 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,11 @@ +2004-09-02 Teodor Zlatanov + + * building.texi (Compilation Mode): Add a paragraph about rules + for finding the compilation buffer for `next-error'. + + * search.texi (Other Repeating Search): Mention that Occur mode + supports the next-error functionality. + 2004-09-02 Juri Linkov * search.texi (Regexp Replace): Add missing backslash to \footnote. From b10daec70920a4d17425bdfe816f2e4ec1a793e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 2 Sep 2004 16:15:48 +0000 Subject: [PATCH 313/341] * xfns.c (x_set_name_internal): New function. Check if we shall call xfree before ENCODE_UTF_8. (x_set_name, x_set_title): Call x_set_name_internal. --- src/ChangeLog | 6 ++ src/xfns.c | 209 +++++++++++++++++++++----------------------------- 2 files changed, 92 insertions(+), 123 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 77a331a7802..1f3c06e8cf9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2004-09-02 Jan Dj,Ad(Brv + + * xfns.c (x_set_name_internal): New function. Check if we shall call + xfree before ENCODE_UTF_8. + (x_set_name, x_set_title): Call x_set_name_internal. + 2004-08-31 NAKAMURA Toshikazu (tiny change) * w32fns.c (w32_load_font): If a BDF font is already loaded, do not diff --git a/src/xfns.c b/src/xfns.c index 8368e62a445..5ebdeca97d5 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1560,6 +1560,90 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp) } +/* Set the WM name to NAME for frame F. Also set the icon name. + If the frame already has an icon name, use that, otherwise set the + icon name to NAME. */ + +static void +x_set_name_internal (f, name) + FRAME_PTR f; + Lisp_Object name; +{ + if (FRAME_X_WINDOW (f)) + { + BLOCK_INPUT; +#ifdef HAVE_X11R4 + { + XTextProperty text, icon; + int bytes, stringp; + int do_free_icon_value = 0, do_free_text_value = 0; + Lisp_Object coding_system; + + coding_system = Qcompound_text; + /* Note: Encoding strategy + + We encode NAME by compound-text and use "COMPOUND-TEXT" in + text.encoding. But, there are non-internationalized window + managers which don't support that encoding. So, if NAME + contains only ASCII and 8859-1 characters, encode it by + iso-latin-1, and use "STRING" in text.encoding hoping that + such window managers at least analyze this format correctly, + i.e. treat 8-bit bytes as 8859-1 characters. + + We may also be able to use "UTF8_STRING" in text.encoding + in the future which can encode all Unicode characters. + But, for the moment, there's no way to know that the + current window manager supports it or not. */ + text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp); + text.encoding = (stringp ? XA_STRING + : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); + text.format = 8; + text.nitems = bytes; + + /* Check early, because ENCODE_UTF_8 below may GC and name may be + relocated. */ + do_free_text_value = text.value != SDATA (name); + + if (NILP (f->icon_name)) + { + icon = text; + } + else + { + /* See the above comment "Note: Encoding strategy". */ + icon.value = x_encode_text (f->icon_name, coding_system, 0, + &bytes, &stringp); + icon.encoding = (stringp ? XA_STRING + : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); + icon.format = 8; + icon.nitems = bytes; + do_free_icon_value = icon.value != SDATA (f->icon_name); + } + +#ifdef USE_GTK + gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), + SDATA (ENCODE_UTF_8 (name))); +#else /* not USE_GTK */ + XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); +#endif /* not USE_GTK */ + + XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &icon); + + if (do_free_icon_value) + xfree (icon.value); + if (do_free_text_value) + xfree (text.value); + } +#else /* not HAVE_X11R4 */ + XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + SDATA (name)); + XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), + SDATA (name)); +#endif /* not HAVE_X11R4 */ + UNBLOCK_INPUT; + } +} + /* Change the name of frame F to NAME. If NAME is nil, set F's name to x_id_name. @@ -1615,73 +1699,7 @@ x_set_name (f, name, explicit) if (! NILP (f->title)) name = f->title; - if (FRAME_X_WINDOW (f)) - { - BLOCK_INPUT; -#ifdef HAVE_X11R4 - { - XTextProperty text, icon; - int bytes, stringp; - Lisp_Object coding_system; - - /* Note: Encoding strategy - - We encode NAME by compound-text and use "COMPOUND-TEXT" in - text.encoding. But, there are non-internationalized window - managers which don't support that encoding. So, if NAME - contains only ASCII and 8859-1 characters, encode it by - iso-latin-1, and use "STRING" in text.encoding hoping that - such window managers at least analyze this format correctly, - i.e. treat 8-bit bytes as 8859-1 characters. - - We may also be able to use "UTF8_STRING" in text.encoding - in the future which can encode all Unicode characters. - But, for the moment, there's no way to know that the - current window manager supports it or not. */ - coding_system = Qcompound_text; - text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp); - text.encoding = (stringp ? XA_STRING - : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); - text.format = 8; - text.nitems = bytes; - - if (NILP (f->icon_name)) - { - icon = text; - } - else - { - /* See the above comment "Note: Encoding strategy". */ - icon.value = x_encode_text (f->icon_name, coding_system, 0, - &bytes, &stringp); - icon.encoding = (stringp ? XA_STRING - : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); - icon.format = 8; - icon.nitems = bytes; - } -#ifdef USE_GTK - gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - SDATA (ENCODE_UTF_8 (name))); -#else /* not USE_GTK */ - XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); -#endif /* not USE_GTK */ - - XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &icon); - - if (!NILP (f->icon_name) - && icon.value != (unsigned char *) SDATA (f->icon_name)) - xfree (icon.value); - if (text.value != (unsigned char *) SDATA (name)) - xfree (text.value); - } -#else /* not HAVE_X11R4 */ - XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - SDATA (name)); - XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - SDATA (name)); -#endif /* not HAVE_X11R4 */ - UNBLOCK_INPUT; - } + x_set_name_internal (f, name); } /* This function should be called when the user's lisp code has @@ -1735,62 +1753,7 @@ x_set_title (f, name, old_name) else CHECK_STRING (name); - if (FRAME_X_WINDOW (f)) - { - BLOCK_INPUT; -#ifdef HAVE_X11R4 - { - XTextProperty text, icon; - int bytes, stringp; - Lisp_Object coding_system; - - coding_system = Qcompound_text; - /* See the comment "Note: Encoding strategy" in x_set_name. */ - text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp); - text.encoding = (stringp ? XA_STRING - : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); - text.format = 8; - text.nitems = bytes; - - if (NILP (f->icon_name)) - { - icon = text; - } - else - { - /* See the comment "Note: Encoding strategy" in x_set_name. */ - icon.value = x_encode_text (f->icon_name, coding_system, 0, - &bytes, &stringp); - icon.encoding = (stringp ? XA_STRING - : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); - icon.format = 8; - icon.nitems = bytes; - } - -#ifdef USE_GTK - gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - SDATA (ENCODE_UTF_8 (name))); -#else /* not USE_GTK */ - XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); -#endif /* not USE_GTK */ - - XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), - &icon); - - if (!NILP (f->icon_name) - && icon.value != (unsigned char *) SDATA (f->icon_name)) - xfree (icon.value); - if (text.value != (unsigned char *) SDATA (name)) - xfree (text.value); - } -#else /* not HAVE_X11R4 */ - XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - SDATA (name)); - XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - SDATA (name)); -#endif /* not HAVE_X11R4 */ - UNBLOCK_INPUT; - } + x_set_name_internal (f, name); } void From 9dc3a46a444a46e00ed3287a3174d73ed9511dac Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 16:35:17 +0000 Subject: [PATCH 314/341] (compilation-error-properties): Allow to funcall col and end-col. (compilation-mode-font-lock-keywords): Check col and end-col by `integerp'. (compilation-goto-locus): If end-mk is non-nil in transient mark mode don't activate the mark (and don't display message in push-mark), but highlight overlay between mk and end-mk. --- lisp/progmodes/compile.el | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 7a0aa42faff..ea174233289 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -579,12 +579,17 @@ Faces `compilation-error-face', `compilation-warning-face', (and end-line (setq end-line (match-string-no-properties end-line)) (setq end-line (string-to-number end-line))) - (and col - (setq col (match-string-no-properties col)) - (setq col (- (string-to-number col) compilation-first-column))) - (if (and end-col (setq end-col (match-string-no-properties end-col))) - (setq end-col (- (string-to-number end-col) compilation-first-column -1)) - (if end-line (setq end-col -1))) + (if col + (if (functionp col) + (setq col (funcall col)) + (and + (setq col (match-string-no-properties col)) + (setq col (- (string-to-number col) compilation-first-column))))) + (if (and end-col (functionp end-col)) + (setq end-col (funcall end-col)) + (if (and end-col (setq end-col (match-string-no-properties end-col))) + (setq end-col (- (string-to-number end-col) compilation-first-column -1)) + (if end-line (setq end-col -1)))) (if (consp type) ; not a static type, check what it is. (setq type (or (and (car type) (match-end (car type)) 1) (and (cdr type) (match-end (cdr type)) 0) @@ -726,9 +731,9 @@ FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME) or nil." ,@(when end-line `((,end-line compilation-line-face nil t))) - ,@(when col + ,@(when (integerp col) `((,col compilation-column-face nil t))) - ,@(when end-col + ,@(when (integerp end-col) `((,end-col compilation-column-face nil t))) ,@(nthcdr 6 item) @@ -1524,7 +1529,8 @@ If nil, don't scroll the compilation output window." (defun compilation-goto-locus (msg mk end-mk) "Jump to an error corresponding to MSG at MK. -All arguments are markers. If END-MK is non-nil, mark is set there." +All arguments are markers. If END-MK is non-nil, mark is set there +and overlay is highlighted between MK and END-MK." (if (eq (window-buffer (selected-window)) (marker-buffer msg)) ;; If the compilation buffer window is selected, @@ -1540,7 +1546,7 @@ All arguments are markers. If END-MK is non-nil, mark is set there." (widen) (goto-char mk)) (if end-mk - (push-mark end-mk nil t) + (push-mark end-mk t) (if mark-active (setq mark-active))) ;; If hideshow got in the way of ;; seeing the right place, open permanently. @@ -1561,17 +1567,16 @@ All arguments are markers. If END-MK is non-nil, mark is set there." compilation-highlight-regexp))) (compilation-set-window-height w) - (when (and highlight-regexp - (not (and end-mk transient-mark-mode))) + (when highlight-regexp (unless compilation-highlight-overlay (setq compilation-highlight-overlay (make-overlay (point-min) (point-min))) (overlay-put compilation-highlight-overlay 'face 'next-error)) (with-current-buffer (marker-buffer mk) (save-excursion - (end-of-line) + (if end-mk (goto-char end-mk) (end-of-line)) (let ((end (point))) - (beginning-of-line) + (if mk (goto-char mk) (beginning-of-line)) (if (and (stringp highlight-regexp) (re-search-forward highlight-regexp end t)) (progn From 277df08871a1da3b83e648af97e336861c1b8742 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 16:35:42 +0000 Subject: [PATCH 315/341] (grep-highlight-matches): New defcustom. (grep-regexp-alist): Add rule to highlight grep matches. (grep-process-setup): Set env-vars GREP_OPTIONS and GREP_COLOR. --- lisp/progmodes/grep.el | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index f4acd564a3c..9d48fd37569 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -64,6 +64,21 @@ will be parsed and highlighted as soon as you try to move to them." :version "21.4" :group 'grep) +(defcustom grep-highlight-matches t + "*Non-nil to use special markers to highlight grep matches. + +Some grep programs are able to surround matches with special +markers in grep output. Such markers can be used to highlight +matches in grep mode. + +This option sets the environment variable GREP_COLOR to specify +markers for highlighting and GREP_OPTIONS to add the --color +option in front of any explicit grep options before starting +the grep." + :type 'boolean + :version "21.4" + :group 'grep) + (defcustom grep-scroll-output nil "*Non-nil to scroll the *grep* buffer window as output appears. @@ -230,6 +245,23 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies '(("^\\(.+?\\)[:( \t]+\ \\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ \\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?[:) \t]" 1 (2 . 5) (4 . 6)) + ("^\\(.+?\\)[:(]+\\([0-9]+\\)\\([:)]\\).*?\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" + 1 2 + ((lambda () + (setq compilation-error-screen-columns nil) + (- (match-beginning 5) (match-end 3) 8)) + . + (lambda () (- (match-end 5) (match-end 3) 8))) + nil nil + (4 (list 'face nil 'invisible t 'intangible t)) + (5 (list 'face compilation-column-face)) + (6 (list 'face nil 'invisible t 'intangible t)) + ;; highlight other matches on the same line + ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" + nil nil + (1 (list 'face nil 'invisible t 'intangible t)) + (2 (list 'face compilation-column-face) t) + (3 (list 'face nil 'invisible t 'intangible t)))) ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") @@ -300,6 +332,10 @@ This variable's value takes effect when `grep-compute-defaults' is called.") (defun grep-process-setup () "Setup compilation variables and buffer for `grep'. Set up `compilation-exit-message-function' and run `grep-setup-hook'." + (when grep-highlight-matches + ;; Modify `process-environment' locally bound in `compilation-start' + (setenv "GREP_OPTIONS" (concat (getenv "GREP_OPTIONS") " --color=always")) + (setenv "GREP_COLOR" "01;41")) (set (make-local-variable 'compilation-exit-message-function) (lambda (status code msg) (if (eq status 'exit) From fc11ddc8d7b8eb0013a8573fcecf6e0e934348e5 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 16:36:18 +0000 Subject: [PATCH 316/341] (Info-fontify-node): Don't compute other-tag if Info-hide-note-references=hide. --- lisp/info.el | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lisp/info.el b/lisp/info.el index 13bf3901d6d..802fcf1642e 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -3525,23 +3525,24 @@ Preserve text properties." other-tag) (when not-fontified-p (when Info-hide-note-references - ;; *Note is often used where *note should have been - (goto-char start) - (skip-syntax-backward " ") - (setq other-tag - (cond ((memq (char-before) '(nil ?\. ?! ??)) - "See ") - ((memq (char-before) '(?\, ?\; ?\: ?-)) - "see ") - ((memq (char-before) '(?\( ?\[ ?\{)) - ;; Check whether the paren is preceded by - ;; an end of sentence - (skip-syntax-backward " (") - (if (memq (char-before) '(nil ?\. ?! ??)) - "See " - "see ")) - ((save-match-data (looking-at "\n\n")) - "See "))) + (when (not (eq Info-hide-note-references 'hide)) + ;; *Note is often used where *note should have been + (goto-char start) + (skip-syntax-backward " ") + (setq other-tag + (cond ((memq (char-before) '(nil ?\. ?! ??)) + "See ") + ((memq (char-before) '(?\, ?\; ?\: ?-)) + "see ") + ((memq (char-before) '(?\( ?\[ ?\{)) + ;; Check whether the paren is preceded by + ;; an end of sentence + (skip-syntax-backward " (") + (if (memq (char-before) '(nil ?\. ?! ??)) + "See " + "see ")) + ((save-match-data (looking-at "\n\n")) + "See ")))) (goto-char next) (add-text-properties (match-beginning 1) @@ -3551,7 +3552,7 @@ Preserve text properties." (if (string-match "\n" (match-string 1)) (+ start1 (match-beginning 0))))) (match-end 1)) - (if (and other-tag (not (eq Info-hide-note-references 'hide))) + (if other-tag `(display ,other-tag front-sticky nil rear-nonsticky t) '(invisible t front-sticky nil rear-nonsticky t)))) (add-text-properties From 542e904c45959b990146846094519e799e7a5711 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 16:37:01 +0000 Subject: [PATCH 317/341] (function-called-at-point): Try `find-tag-default' when other methods failed. --- lisp/help.el | 55 +++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index 52a772779a5..bf0df4358a7 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -237,32 +237,35 @@ C-w Display information on absence of warranty for GNU Emacs." (defun function-called-at-point () "Return a function around point or else called by the list containing point. If that doesn't give a function, return nil." - (with-syntax-table emacs-lisp-mode-syntax-table - (or (condition-case () - (save-excursion - (or (not (zerop (skip-syntax-backward "_w"))) - (eq (char-syntax (following-char)) ?w) - (eq (char-syntax (following-char)) ?_) - (forward-sexp -1)) - (skip-chars-forward "'") - (let ((obj (read (current-buffer)))) - (and (symbolp obj) (fboundp obj) obj))) - (error nil)) - (condition-case () - (save-excursion - (save-restriction - (narrow-to-region (max (point-min) - (- (point) 1000)) (point-max)) - ;; Move up to surrounding paren, then after the open. - (backward-up-list 1) - (forward-char 1) - ;; If there is space here, this is probably something - ;; other than a real Lisp function call, so ignore it. - (if (looking-at "[ \t]") - (error "Probably not a Lisp function call")) - (let ((obj (read (current-buffer)))) - (and (symbolp obj) (fboundp obj) obj)))) - (error nil))))) + (or (with-syntax-table emacs-lisp-mode-syntax-table + (or (condition-case () + (save-excursion + (or (not (zerop (skip-syntax-backward "_w"))) + (eq (char-syntax (following-char)) ?w) + (eq (char-syntax (following-char)) ?_) + (forward-sexp -1)) + (skip-chars-forward "'") + (let ((obj (read (current-buffer)))) + (and (symbolp obj) (fboundp obj) obj))) + (error nil)) + (condition-case () + (save-excursion + (save-restriction + (narrow-to-region (max (point-min) + (- (point) 1000)) (point-max)) + ;; Move up to surrounding paren, then after the open. + (backward-up-list 1) + (forward-char 1) + ;; If there is space here, this is probably something + ;; other than a real Lisp function call, so ignore it. + (if (looking-at "[ \t]") + (error "Probably not a Lisp function call")) + (let ((obj (read (current-buffer)))) + (and (symbolp obj) (fboundp obj) obj)))) + (error nil)))) + (let* ((str (find-tag-default)) + (obj (if str (read str)))) + (and (symbolp obj) (fboundp obj) obj)))) ;;; `User' help functions From cc3064a5e99d3aa5bebb1713a1a275e67c0c33c1 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 16:37:22 +0000 Subject: [PATCH 318/341] (variable-at-point): Try `find-tag-default' when other methods failed. --- lisp/help-fns.el | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index e534c6998a7..d193ad344f5 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -461,18 +461,21 @@ face (according to `face-differs-from-default-p')." (defun variable-at-point () "Return the bound variable symbol found around point. Return 0 if there is no such symbol." - (condition-case () - (with-syntax-table emacs-lisp-mode-syntax-table - (save-excursion - (or (not (zerop (skip-syntax-backward "_w"))) - (eq (char-syntax (following-char)) ?w) - (eq (char-syntax (following-char)) ?_) - (forward-sexp -1)) - (skip-chars-forward "'") - (let ((obj (read (current-buffer)))) - (or (and (symbolp obj) (boundp obj) obj) - 0)))) - (error 0))) + (or (condition-case () + (with-syntax-table emacs-lisp-mode-syntax-table + (save-excursion + (or (not (zerop (skip-syntax-backward "_w"))) + (eq (char-syntax (following-char)) ?w) + (eq (char-syntax (following-char)) ?_) + (forward-sexp -1)) + (skip-chars-forward "'") + (let ((obj (read (current-buffer)))) + (and (symbolp obj) (boundp obj) obj)))) + (error nil)) + (let* ((str (find-tag-default)) + (obj (if str (read str)))) + (and (symbolp obj) (boundp obj) obj)) + 0)) ;;;###autoload (defun describe-variable (variable &optional buffer) From f02069102bdac8ff32609518de0d48c0861cad0c Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 2 Sep 2004 16:40:38 +0000 Subject: [PATCH 319/341] New option `grep-highlight-matches'. --- etc/NEWS | 7 ++++++- lisp/ChangeLog | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index ec00bb58f4f..5b5d897adf8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1878,7 +1878,12 @@ in new face `next-error'. `grep-scroll-output' can be used to override the corresponding compilation mode settings for grep commands. -*** Source line is temporarily highlighted when going to next match. +*** New option `grep-highlight-matches' highlightes matches in *grep* +buffer. It uses a special feature of some grep programs which accept +--color option to output markers around matches. When going to the next +match with `next-error' the exact match is highlighted in the source +buffer. Otherwise, if `grep-highlight-matches' is nil, the whole +source line is highlighted. *** New key bindings in grep output window: SPC and DEL scrolls window up and down. C-n and C-p moves to next and diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e9f9e39ef72..015fb9253c5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -7,6 +7,23 @@ recent compilation directory only when `recompile' is invoked NOT in the compilation buffer. Otherwise, use `default-directory' of the compilation buffer. + (compilation-error-properties): Allow to funcall col and end-col. + (compilation-mode-font-lock-keywords): Check col and end-col by + `integerp'. + (compilation-goto-locus): If end-mk is non-nil in transient mark + mode don't activate the mark (and don't display message in + push-mark), but highlight overlay between mk and end-mk. + + * progmodes/grep.el (grep-highlight-matches): New defcustom. + (grep-regexp-alist): Add rule to highlight grep matches. + (grep-process-setup): Set env-vars GREP_OPTIONS and GREP_COLOR. + + * info.el (Info-fontify-node): Don't compute other-tag + if Info-hide-note-references=hide. + + * help.el (function-called-at-point): + * help-fns.el (variable-at-point): + Try `find-tag-default' when other methods failed. * emacs-lisp/lisp.el (beginning-of-defun, end-of-defun): Do not push mark if inhibit-mark-movement is non-nil. From 2ca75b4224d8b99fb948a1a27e7fb92ec28db5a3 Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 2 Sep 2004 16:59:18 +0000 Subject: [PATCH 320/341] Add ASCII equivalents for some function keys. (mode-line-frame-identification): Sync with x-win.el. --- lisp/term/mac-win.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index e42c2151701..c0ea7a9385e 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -141,6 +141,9 @@ (if clipboard (decode-coding-string clipboard selection-coding-system t))))) +;; Don't show the frame name; that's redundant. +(setq-default mode-line-frame-identification " ") + (defun mac-drag-n-drop (event) "Edit the files listed in the drag-n-drop event.\n\ Switch to a buffer editing the last file dropped." @@ -262,6 +265,9 @@ ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman") ;; Tell read-char how to convert special chars to ASCII (put 'return 'ascii-character 13) +(put 'tab 'ascii-character ?\t) +(put 'backspace 'ascii-character 127) +(put 'escape 'ascii-character ?\e) ;; ;; Available colors From b3459c95eb15cac76a1d3ad9c6f1801e1748ef78 Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 2 Sep 2004 17:00:12 +0000 Subject: [PATCH 321/341] (x_real_positions): Save the current window port and set a new one before obtaining the global coordinate. Use FRAME_MAC_WINDOW. (x_set_name, x_set_title): Encode title to UTF8. Use SetWindowTitleWithCFString. (Fx_server_version): Get correct OS version. --- src/macfns.c | 49 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/src/macfns.c b/src/macfns.c index fbade05ea17..3b09b344a55 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -324,19 +324,21 @@ x_real_positions (f, xptr, yptr) Point pt; GrafPtr oldport; -#ifdef TARGET_API_MAC_CARBON + GetPort (&oldport); + SetPortWindowPort (FRAME_MAC_WINDOW (f)); + +#if TARGET_API_MAC_CARBON { Rect r; - GetWindowPortBounds (f->output_data.mac->mWP, &r); + GetWindowPortBounds (FRAME_MAC_WINDOW (f), &r); SetPt (&pt, r.left, r.top); } #else /* not TARGET_API_MAC_CARBON */ SetPt (&pt, - f->output_data.mac->mWP->portRect.left, - f->output_data.mac->mWP->portRect.top); + FRAME_MAC_WINDOW (f)->portRect.left, + FRAME_MAC_WINDOW (f)->portRect.top); #endif /* not TARGET_API_MAC_CARBON */ - GetPort (&oldport); LocalToGlobal (&pt); SetPort (oldport); @@ -1934,8 +1936,8 @@ x_set_name (f, name, explicit) if (FRAME_MAC_WINDOW (f)) { if (STRING_MULTIBYTE (name)) -#if 0 /* MAC_TODO: encoding title string */ - name = ENCODE_SYSTEM (name); +#if TARGET_API_MAC_CARBON + name = ENCODE_UTF_8 (name); #else return; #endif @@ -1943,6 +1945,14 @@ x_set_name (f, name, explicit) BLOCK_INPUT; { +#if TARGET_API_MAC_CARBON + CFStringRef windowTitle = + CFStringCreateWithCString (NULL, SDATA (name), + kCFStringEncodingUTF8); + + SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); + CFRelease (windowTitle); +#else Str255 windowTitle; if (strlen (SDATA (name)) < 255) { @@ -1950,6 +1960,7 @@ x_set_name (f, name, explicit) c2pstr (windowTitle); SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); } +#endif } UNBLOCK_INPUT; @@ -2008,8 +2019,8 @@ x_set_title (f, name, old_name) if (FRAME_MAC_WINDOW (f)) { if (STRING_MULTIBYTE (name)) -#if 0 /* MAC_TODO: encoding title string */ - name = ENCODE_SYSTEM (name); +#if TARGET_API_MAC_CARBON + name = ENCODE_UTF_8 (name); #else return; #endif @@ -2017,6 +2028,14 @@ x_set_title (f, name, old_name) BLOCK_INPUT; { +#if TARGET_API_MAC_CARBON + CFStringRef windowTitle = + CFStringCreateWithCString (NULL, SDATA (name), + kCFStringEncodingUTF8); + + SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle); + CFRelease (windowTitle); +#else Str255 windowTitle; if (strlen (SDATA (name)) < 255) { @@ -2024,6 +2043,7 @@ x_set_title (f, name, old_name) c2pstr (windowTitle); SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); } +#endif } UNBLOCK_INPUT; @@ -2981,17 +3001,20 @@ If omitted or nil, that stands for the selected frame's display. */) (display) Lisp_Object display; { - int mac_major_version, mac_minor_version; + int mac_major_version; SInt32 response; if (Gestalt (gestaltSystemVersion, &response) != noErr) error ("Cannot get Mac OS version"); - mac_major_version = (response >> 8) & 0xf; - mac_minor_version = (response >> 4) & 0xf; + mac_major_version = (response >> 8) & 0xff; + /* convert BCD to int */ + mac_major_version -= (mac_major_version >> 4) * 6; return Fcons (make_number (mac_major_version), - Fcons (make_number (mac_minor_version), Qnil)); + Fcons (make_number ((response >> 4) & 0xf), + Fcons (make_number (response & 0xf), + Qnil))); } DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0, From a8e080143bb539ad9eb9ad8e1e1a14701dafc44b Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 2 Sep 2004 17:00:36 +0000 Subject: [PATCH 322/341] (add_menu_item): Remove unused variable `i'. Don't let separator items destroy refence constants of other menu items. --- src/macmenu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/macmenu.c b/src/macmenu.c index 88012b01f73..740bda261d8 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -2240,7 +2240,7 @@ add_menu_item (MenuHandle menu, widget_value *wv, int submenu, int force_disable) { Str255 item_name; - int pos, i; + int pos; if (name_is_separator (wv->name)) AppendMenu (menu, "\p-"); @@ -2296,9 +2296,9 @@ add_menu_item (MenuHandle menu, widget_value *wv, int submenu, else SetItemMark (menu, pos, noMark); } - } - SetMenuItemRefCon (menu, pos, (UInt32) wv->call_data); + SetMenuItemRefCon (menu, pos, (UInt32) wv->call_data); + } if (submenu != NULL) SetMenuItemHierarchicalID (menu, pos, submenu); From 404e4b841e25f57265dc245342d809abf2c221f3 Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 2 Sep 2004 17:00:55 +0000 Subject: [PATCH 323/341] (x_update_end): Move SetPortWindowPort to inside BLOCK_INPUT. (x_set_offset): Use FRAME_MAC_WINDOW. --- src/macterm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/macterm.c b/src/macterm.c index 9e482a17c8e..0177d57fec8 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -1325,6 +1325,10 @@ static void x_update_end (f) struct frame *f; { + /* Mouse highlight may be displayed again. */ + FRAME_MAC_DISPLAY_INFO (f)->mouse_face_defer = 0; + + BLOCK_INPUT; /* Reset the background color of Mac OS Window to that of the frame after update so that it is used by Mac Toolbox to clear the update region before an update event is generated. */ @@ -1332,10 +1336,6 @@ x_update_end (f) mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f)); - /* Mouse highlight may be displayed again. */ - FRAME_MAC_DISPLAY_INFO (f)->mouse_face_defer = 0; - - BLOCK_INPUT; XFlush (FRAME_MAC_DISPLAY (f)); UNBLOCK_INPUT; } @@ -5123,7 +5123,7 @@ x_set_offset (f, xoff, yoff, change_gravity) modified_left = f->left_pos; modified_top = f->top_pos; - MoveWindow (f->output_data.mac->mWP, modified_left + 6, + MoveWindow (FRAME_MAC_WINDOW (f), modified_left + 6, modified_top + 42, false); UNBLOCK_INPUT; From b15de4146bcbd6efa054b2c6235c733f42d8bfc2 Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 2 Sep 2004 17:01:20 +0000 Subject: [PATCH 324/341] (note_mouse_highlight): Set the mouse pointer shape to nontext_cursor if it is on a scroll bar. --- src/xdisp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 334ebb72fcb..32cd0f745f0 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20892,7 +20892,8 @@ note_mouse_highlight (f, x, y) if (part == ON_VERTICAL_BORDER) cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor; - else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE) + else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE + || part == ON_SCROLL_BAR) cursor = FRAME_X_OUTPUT (f)->nontext_cursor; else cursor = FRAME_X_OUTPUT (f)->text_cursor; From 640a07706b1bdd45a0cbaadd49b72d2c5d79377b Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 2 Sep 2004 17:02:11 +0000 Subject: [PATCH 325/341] (LIBS_CARBON): New define to specify libraries for Carbon support. (LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++. Use LIBS_CARBON. --- src/s/darwin.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/s/darwin.h b/src/s/darwin.h index 814de2c2c51..f854ed9380b 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h @@ -243,11 +243,18 @@ Boston, MA 02111-1307, USA. */ specific headers. */ #define C_SWITCH_SYSTEM -fpascal-strings -fno-common -DMAC_OSX -I../mac/src -/* Link in the Carbon lib. The -headerpad option tells ld (see man - page) to leave room at the end of the header for adding load - commands. Needed for dumping. 0x690 is the total size of 30 - segment load commands (at 56 each). */ -#define LD_SWITCH_SYSTEM_TEMACS -prebind -framework Carbon -framework QuickTime -lstdc++ -Xlinker -headerpad -Xlinker 690 +/* Link in the Carbon lib. */ +#ifdef HAVE_CARBON +#define LIBS_CARBON -framework Carbon -framework QuickTime +#else +#define LIBS_CARBON -framework Carbon +#endif + +/* The -headerpad option tells ld (see man page) to leave room at the + end of the header for adding load commands. Needed for dumping. + 0x690 is the total size of 30 segment load commands (at 56 + each). */ +#define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_CARBON -Xlinker -headerpad -Xlinker 690 #define C_SWITCH_SYSTEM_TEMACS -Dtemacs From 9277ba618e5e10bd65b65e7ab1becca34b32321b Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 2 Sep 2004 17:03:16 +0000 Subject: [PATCH 326/341] * term/mac-win.el: Add ASCII equivalents for some function keys. (mode-line-frame-identification): Sync with x-win.el. * macfns.c (x_real_positions): Save the current window port and set a new one before obtaining the global coordinate. Use FRAME_MAC_WINDOW. (x_set_name, x_set_title): Encode title to UTF8. Use SetWindowTitleWithCFString. (Fx_server_version): Get correct OS version. * macmenu.c (add_menu_item): Remove unused variable `i'. Don't let separator items destroy refence constants of other menu items. * macterm.c (x_update_end): Move SetPortWindowPort to inside BLOCK_INPUT. (x_set_offset): Use FRAME_MAC_WINDOW. * xdisp.c (note_mouse_highlight): Set the mouse pointer shape to nontext_cursor if it is on a scroll bar. * s/darwin.h (LIBS_CARBON): New define to specify libraries for Carbon support. (LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++. Use LIBS_CARBON. --- src/ChangeLog | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 1f3c06e8cf9..a2ae10d158a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,30 @@ +2004-09-02 YAMAMOTO Mitsuharu + + * term/mac-win.el: Add ASCII equivalents for some function keys. + (mode-line-frame-identification): Sync with x-win.el. + + * macfns.c (x_real_positions): Save the current window port and + set a new one before obtaining the global coordinate. Use + FRAME_MAC_WINDOW. + (x_set_name, x_set_title): Encode title to UTF8. Use + SetWindowTitleWithCFString. + (Fx_server_version): Get correct OS version. + + * macmenu.c (add_menu_item): Remove unused variable `i'. Don't + let separator items destroy refence constants of other menu items. + + * macterm.c (x_update_end): Move SetPortWindowPort to inside + BLOCK_INPUT. + (x_set_offset): Use FRAME_MAC_WINDOW. + + * xdisp.c (note_mouse_highlight): Set the mouse pointer shape to + nontext_cursor if it is on a scroll bar. + + * s/darwin.h (LIBS_CARBON): New define to specify libraries for + Carbon support. + (LD_SWITCH_SYSTEM_TEMACS): Don't link with unused libstdc++. Use + LIBS_CARBON. + 2004-09-02 Jan Dj,Ad(Brv * xfns.c (x_set_name_internal): New function. Check if we shall call From cc2734ee7602101a6dc15e2a69edf1881ba4c6c6 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 2 Sep 2004 22:34:07 +0000 Subject: [PATCH 327/341] (set_cursor_from_row): Look for non-nil `cursor' property in overlay or text-property strings; set cursor on corresponding glyph rather than at end of the string. --- src/xdisp.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 32cd0f745f0..ad521e340ee 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -306,6 +306,7 @@ Lisp_Object Qline_height, Qtotal; extern Lisp_Object Qheight; extern Lisp_Object QCwidth, QCheight, QCascent; extern Lisp_Object Qscroll_bar; +extern Lisp_Object Qcursor; /* Non-nil means highlight trailing whitespace. */ @@ -10647,6 +10648,7 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) { struct glyph *glyph = row->glyphs[TEXT_AREA]; struct glyph *end = glyph + row->used[TEXT_AREA]; + struct glyph *cursor = NULL; /* The first glyph that starts a sequence of glyphs from string. */ struct glyph *string_start; /* The X coordinate of string_start. */ @@ -10656,6 +10658,7 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) /* The last known character position before string_start. */ int string_before_pos; int x = row->x; + int cursor_x = x; int pt_old = PT - delta; /* Skip over glyphs not having an object at the start of the row. @@ -10688,12 +10691,29 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos) string_start = glyph; string_start_x = x; /* Skip all glyphs from string. */ - SKIP_GLYPHS (glyph, end, x, STRINGP (glyph->object)); + do + { + if ((cursor == NULL || glyph > cursor) + && !NILP (Fget_char_property (make_number ((glyph)->charpos), + Qcursor, (glyph)->object))) + { + cursor = glyph; + cursor_x = x; + } + x += glyph->pixel_width; + ++glyph; + } + while (glyph < end && STRINGP (glyph->object)); } } - if (string_start - && (glyph == end || !BUFFERP (glyph->object) || last_pos > pt_old)) + if (cursor != NULL) + { + glyph = cursor; + x = cursor_x; + } + else if (string_start + && (glyph == end || !BUFFERP (glyph->object) || last_pos > pt_old)) { /* We may have skipped over point because the previous glyphs are from string. As there's no easy way to know the From 46540080eac5c7efa800b5646a4e0a2eea450c4f Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 2 Sep 2004 22:55:59 +0000 Subject: [PATCH 328/341] *** empty log message *** --- lisp/ChangeLog | 11 +++++++++++ src/ChangeLog | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 015fb9253c5..2877097c39a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2004-09-03 Kim F. Storm + + * emulation/cua-rect.el (cua--rectangle-set-corners): Ensure that + point is set (and displayed) inside rectangle. + (cua--rectangle-operation): Fix for highlight of empty lines. + (cua--highlight-rectangle): Fix highlight for tabs. + Position cursor at left/right edge of rectangle using new `cursor' + property on overlay strings. + (cua--indent-rectangle): Don't tabify. + (cua-rotate-rectangle): Ignore that point has moved. + 2004-09-02 Juri Linkov * progmodes/compile.el (compilation-buffer-name): Compare major diff --git a/src/ChangeLog b/src/ChangeLog index a2ae10d158a..c2999317d03 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ +2004-09-03 Kim F. Storm + + * xdisp.c (set_cursor_from_row): Look for non-nil `cursor' property + in overlay or text-property strings; set cursor on corresponding + glyph rather than at end of the string. + 2004-09-02 YAMAMOTO Mitsuharu - + * term/mac-win.el: Add ASCII equivalents for some function keys. (mode-line-frame-identification): Sync with x-win.el. From e2ea72e9dd38da3faac53ec969d2228624ddf024 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 2 Sep 2004 22:56:22 +0000 Subject: [PATCH 329/341] (cua--rectangle-set-corners): Ensure that point is set (and displayed) inside rectangle. (cua--rectangle-operation): Fix for highlight of empty lines. (cua--highlight-rectangle): Fix highlight for tabs. Position cursor at left/right edge of rectangle using new `cursor' property on overlay strings. (cua--indent-rectangle): Don't tabify. (cua-rotate-rectangle): Ignore that point has moved. --- lisp/emulation/cua-rect.el | 44 ++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 626ef22cf2d..03bf28494c3 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -274,7 +274,11 @@ Knows about CUA rectangle highlighting in addition to standard undo." (move-to-column mc) (set-mark (point)) (goto-char pp) - (move-to-column pc) + (if (and (if (cua--rectangle-right-side) + (= (move-to-column pc) (- pc tab-width)) + (> (move-to-column pc) pc)) + (not (bolp))) + (backward-char 1)) )) ;;; Rectangle resizing @@ -569,6 +573,8 @@ If command is repeated at same position, delete the rectangle." (setq end (min (window-end) end))) (goto-char end) (setq end (line-end-position)) + (if (and visible (bolp) (not (eobp))) + (setq end (1+ end))) (goto-char start) (setq start (line-beginning-position)) (narrow-to-region start end) @@ -761,7 +767,7 @@ If command is repeated at same position, delete the rectangle." (cua--rectangle-operation nil t nil nil nil ; do not tabify '(lambda (s e l r v) (let ((rface (if v 'cua-rectangle-face 'cua-rectangle-noselect-face)) - overlay bs as) + overlay bs ms as) (if (= s e) (setq e (1+ e))) (when (cua--rectangle-virtual-edges) (let ((lb (line-beginning-position)) @@ -791,23 +797,31 @@ If command is repeated at same position, delete the rectangle." (setq s (1- s)))) (cond ((= cr r) - (if (and (/= cr0 (1- cr)) - (= (mod cr tab-width) 0)) + (if (and (/= pr le) + (/= cr0 (1- cr)) + (or bs (/= cr0 (- cr tab-width))) + (/= (mod cr tab-width) 0)) (setq e (1- e)))) ((= cr cl) - (setq bs (concat bs - (propertize - (make-string - (- r l) - (if cua--virtual-edges-debug ?, ?\s)) - 'face rface))) + (setq ms (propertize + (make-string + (- r l) + (if cua--virtual-edges-debug ?, ?\s)) + 'face rface)) + (if (cua--rectangle-right-side) + (put-text-property (1- (length ms)) (length ms) 'cursor t ms) + (put-text-property 0 1 'cursor t ms)) + (setq bs (concat bs ms)) (setq rface nil)) - (t + (t (setq as (propertize (make-string (- r cr0 (if (= le pr) 1 0)) (if cua--virtual-edges-debug ?~ ?\s)) 'face rface)) + (if (cua--rectangle-right-side) + (put-text-property (1- (length as)) (length as) 'cursor t as) + (put-text-property 0 1 'cursor t as)) (if (/= pr le) (setq e (1- e)))))))) ;; Trim old leading overlays. @@ -826,7 +840,7 @@ If command is repeated at same position, delete the rectangle." (move-overlay overlay s e) (setq old (cdr old))) (setq overlay (make-overlay s e))) - (overlay-put overlay 'before-string bs) + (overlay-put overlay 'before-string bs) (overlay-put overlay 'after-string as) (overlay-put overlay 'face rface) (setq new (cons overlay new)))))) @@ -839,7 +853,7 @@ If command is repeated at same position, delete the rectangle." (let ((col (cua--rectangle-insert-col)) (pad (cua--rectangle-virtual-edges)) indent) - (cua--rectangle-operation (if clear 'clear 'corners) nil t pad t + (cua--rectangle-operation (if clear 'clear 'corners) nil t pad nil '(lambda (s e l r) (move-to-column col pad) (if (and (eolp) @@ -975,7 +989,9 @@ With prefix argument, the toggle restriction." (defun cua-rotate-rectangle () (interactive) (cua--rectangle-corner (if (= (cua--rectangle-left) (cua--rectangle-right)) 0 1)) - (cua--rectangle-set-corners)) + (cua--rectangle-set-corners) + (if (cua--rectangle-virtual-edges) + (setq cua--buffer-and-point-before-command nil))) (defun cua-toggle-rectangle-virtual-edges () (interactive) From 1f06d36755eeae2ae2663f9ee56b7ff747fa20a0 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Thu, 2 Sep 2004 23:26:16 +0000 Subject: [PATCH 330/341] (_widget_value): Added lname and lkey. (digest_single_submenu): Set lname and lkey in widget_value instead of name and key. (update_submenu_strings): New function. (set_frame_menubar): Remove call to inhibit_garbage_collection, call update_submenu_strings. (globals_of_w32menu): Check for Unicode API. (digest_single_submenu, w32_menu_show): Encode menu strings as UTF-8 if Unicode API is available. (utf8to16): New function. (add_menu_item): Use it when calling Unicode API. --- src/ChangeLog | 15 ++++ src/w32menu.c | 198 +++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 172 insertions(+), 41 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c2999317d03..77fd0bb7505 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2004-09-03 Jason Rumney + + * w32menu.c (_widget_value): Added lname and lkey. + (digest_single_submenu): Set lname and lkey in widget_value + instead of name and key. + (update_submenu_strings): New function. + (set_frame_menubar): Remove call to inhibit_garbage_collection, + call update_submenu_strings. + + * w32menu.c (globals_of_w32menu): Check for Unicode API. + (digest_single_submenu, w32_menu_show): Encode menu strings as + UTF-8 if Unicode API is available. + (utf8to16): New function. + (add_menu_item): Use it when calling Unicode API. + 2004-09-03 Kim F. Storm * xdisp.c (set_cursor_from_row): Look for non-nil `cursor' property diff --git a/src/w32menu.c b/src/w32menu.c index cc0932d7bf5..f3f3eb785b0 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -45,7 +45,6 @@ Boston, MA 02111-1307, USA. */ #include "dispextern.h" -#undef HAVE_MULTILINGUAL_MENU #undef HAVE_DIALOGS /* TODO: Implement native dialogs. */ /******************************************************************/ @@ -66,10 +65,12 @@ enum button_type typedef struct _widget_value { /* name of widget */ + Lisp_Object lname; char* name; /* value (meaning depend on widget type) */ char* value; /* keyboard equivalent. no implications for XtTranslations */ + Lisp_Object lkey; char* key; /* Help string or nil if none. GC finds this string through the frame's menu_bar_vector @@ -136,17 +137,21 @@ typedef BOOL (WINAPI * GetMenuItemInfoA_Proc) ( IN HMENU, IN UINT, IN BOOL, - IN OUT LPMENUITEMINFOA - ); + IN OUT LPMENUITEMINFOA); typedef BOOL (WINAPI * SetMenuItemInfoA_Proc) ( IN HMENU, IN UINT, IN BOOL, - IN LPCMENUITEMINFOA - ); + IN LPCMENUITEMINFOA); +typedef BOOL (WINAPI * AppendMenuW_Proc) ( + IN HMENU, + IN UINT, + IN UINT_PTR, + IN LPCWSTR); -GetMenuItemInfoA_Proc get_menu_item_info=NULL; -SetMenuItemInfoA_Proc set_menu_item_info=NULL; +GetMenuItemInfoA_Proc get_menu_item_info = NULL; +SetMenuItemInfoA_Proc set_menu_item_info = NULL; +AppendMenuW_Proc unicode_append_menu = NULL; Lisp_Object Vmenu_updating_frame; @@ -1235,13 +1240,17 @@ digest_single_submenu (start, end, top_level_items) pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); -#ifndef HAVE_MULTILINGUAL_MENU - if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) + if (STRINGP (pane_name)) { - pane_name = ENCODE_SYSTEM (pane_name); + if (unicode_append_menu) + /* Encode as UTF-8 for now. */ + pane_name = ENCODE_UTF_8 (pane_name); + else if (STRING_MULTIBYTE (pane_name)) + pane_name = ENCODE_SYSTEM (pane_name); + ASET (menu_items, i + MENU_ITEMS_PANE_NAME, pane_name); } -#endif + pane_string = (NILP (pane_name) ? "" : (char *) SDATA (pane_name)); /* If there is just one top-level pane, put all its items directly @@ -1259,12 +1268,9 @@ digest_single_submenu (start, end, top_level_items) save_wv->next = wv; else first_wv->contents = wv; - wv->name = pane_string; - /* Ignore the @ that means "separate pane". - This is a kludge, but this isn't worth more time. */ - if (!NILP (prefix) && wv->name[0] == '@') - wv->name++; - wv->value = 0; + wv->lname = pane_name; + /* Set value to 1 so update_submenu_strings can handle '@' */ + wv->value = (char *) 1; wv->enabled = 1; wv->button_type = BUTTON_TYPE_NONE; wv->help = Qnil; @@ -1287,10 +1293,13 @@ digest_single_submenu (start, end, top_level_items) selected = AREF (menu_items, i + MENU_ITEMS_ITEM_SELECTED); help = AREF (menu_items, i + MENU_ITEMS_ITEM_HELP); -#ifndef HAVE_MULTILINGUAL_MENU - if (STRING_MULTIBYTE (item_name)) + if (STRINGP (item_name)) { - item_name = ENCODE_SYSTEM (item_name); + if (unicode_append_menu) + item_name = ENCODE_UTF_8 (item_name); + else if (STRING_MULTIBYTE (item_name)) + item_name = ENCODE_SYSTEM (item_name); + ASET (menu_items, i + MENU_ITEMS_ITEM_NAME, item_name); } @@ -1299,7 +1308,6 @@ digest_single_submenu (start, end, top_level_items) descrip = ENCODE_SYSTEM (descrip); ASET (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY, descrip); } -#endif /* not HAVE_MULTILINGUAL_MENU */ wv = xmalloc_widget_value (); if (prev_wv) @@ -1307,9 +1315,9 @@ digest_single_submenu (start, end, top_level_items) else save_wv->contents = wv; - wv->name = (char *) SDATA (item_name); + wv->lname = item_name; if (!NILP (descrip)) - wv->key = (char *) SDATA (descrip); + wv->lkey = descrip; wv->value = 0; /* The EMACS_INT cast avoids a warning. There's no problem as long as pointers have enough bits to hold small integers. */ @@ -1348,6 +1356,43 @@ digest_single_submenu (start, end, top_level_items) return first_wv; } + + +/* Walk through the widget_value tree starting at FIRST_WV and update + the char * pointers from the corresponding lisp values. + We do this after building the whole tree, since GC may happen while the + tree is constructed, and small strings are relocated. So we must wait + until no GC can happen before storing pointers into lisp values. */ +static void +update_submenu_strings (first_wv) + widget_value *first_wv; +{ + widget_value *wv; + + for (wv = first_wv; wv; wv = wv->next) + { + if (wv->lname && ! NILP (wv->lname)) + { + wv->name = SDATA (wv->lname); + + /* Ignore the @ that means "separate pane". + This is a kludge, but this isn't worth more time. */ + if (wv->value == (char *)1) + { + if (wv->name[0] == '@') + wv->name++; + wv->value = 0; + } + } + + if (wv->lkey && ! NILP (wv->lkey)) + wv->key = SDATA (wv->lkey); + + if (wv->contents) + update_submenu_strings (wv->contents); + } +} + /* Set the contents of the menubar widgets of frame F. The argument FIRST_TIME is currently ignored; @@ -1516,6 +1561,7 @@ set_frame_menubar (f, first_time, deep_p) if (NILP (string)) break; wv->name = (char *) SDATA (string); + update_submenu_strings (wv->contents); wv = wv->next; } @@ -1729,13 +1775,17 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error) char *pane_string; pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); -#ifndef HAVE_MULTILINGUAL_MENU - if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) + + if (STRINGP (pane_name)) { - pane_name = ENCODE_SYSTEM (pane_name); + if (unicode_append_menu) + pane_name = ENCODE_UTF_8 (pane_name); + else if (STRING_MULTIBYTE (pane_name)) + pane_name = ENCODE_SYSTEM (pane_name); + ASET (menu_items, i + MENU_ITEMS_PANE_NAME, pane_name); } -#endif + pane_string = (NILP (pane_name) ? "" : (char *) SDATA (pane_name)); /* If there is just one top-level pane, put all its items directly @@ -1784,18 +1834,21 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error) selected = AREF (menu_items, i + MENU_ITEMS_ITEM_SELECTED); help = AREF (menu_items, i + MENU_ITEMS_ITEM_HELP); -#ifndef HAVE_MULTILINGUAL_MENU - if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) + if (STRINGP (item_name)) { - item_name = ENCODE_SYSTEM (item_name); + if (unicode_append_menu) + item_name = ENCODE_UTF_8 (item_name); + else if (STRING_MULTIBYTE (item_name)) + item_name = ENCODE_SYSTEM (item_name); + ASET (menu_items, i + MENU_ITEMS_ITEM_NAME, item_name); } - if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) + + if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) { descrip = ENCODE_SYSTEM (descrip); ASET (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY, descrip); } -#endif /* not HAVE_MULTILINGUAL_MENU */ wv = xmalloc_widget_value (); if (prev_wv) @@ -1844,10 +1897,11 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error) wv_sep->next = first_wv->contents; wv_sep->help = Qnil; -#ifndef HAVE_MULTILINGUAL_MENU - if (STRING_MULTIBYTE (title)) + if (unicode_append_menu) + title = ENCODE_UTF_8 (title); + else if (STRING_MULTIBYTE (title)) title = ENCODE_SYSTEM (title); -#endif + wv_title->name = (char *) SDATA (title); wv_title->enabled = TRUE; wv_title->title = TRUE; @@ -2150,6 +2204,46 @@ add_left_right_boundary (HMENU menu) return AppendMenu (menu, MF_MENUBARBREAK, 0, NULL); } +/* UTF8: 0xxxxxxx, 110xxxxx 10xxxxxx, 1110xxxx, 10xxxxxx, 10xxxxxx */ +static void +utf8to16 (unsigned char * src, int len, WCHAR * dest) +{ + while (len > 0) + { + int utf16; + if (*src < 0x80) + { + *dest = (WCHAR) *src; + dest++; src++; len--; + } + /* Since we might get >3 byte sequences which we don't handle, ignore the extra parts. */ + else if (*src < 0xC0) + { + src++; len--; + } + /* 2 char UTF-8 sequence. */ + else if (*src < 0xE0) + { + *dest = (WCHAR) (((*src & 0x1f) << 6) + | (*(src + 1) & 0x3f)); + src += 2; len -= 2; dest++; + } + else if (*src < 0xF0) + { + *dest = (WCHAR) (((*src & 0x0f) << 12) + | ((*(src + 1) & 0x3f) << 6) + | (*(src + 2) & 0x3f)); + src += 3; len -= 3; dest++; + } + else /* Not encodable. Insert Unicode Substitution char. */ + { + *dest = (WCHAR) 0xfffd; + src++; len--; dest++; + } + } + *dest = 0; +} + static int add_menu_item (HMENU menu, widget_value *wv, HMENU item) { @@ -2206,11 +2300,32 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item) fuFlags |= MF_UNCHECKED; } - return_value = - AppendMenu (menu, - fuFlags, - item != NULL ? (UINT) item : (UINT) wv->call_data, - out_string ); + if (unicode_append_menu && out_string) + { + /* Convert out_string from UTF-8 to UTF-16-LE. */ + int utf8_len = strlen (out_string); + WCHAR * utf16_string; + if (fuFlags & MF_OWNERDRAW) + utf16_string = local_alloc ((utf8_len + 1) * sizeof (WCHAR)); + else + utf16_string = alloca ((utf8_len + 1) * sizeof (WCHAR)); + + utf8to16 (out_string, utf8_len, utf16_string); + return_value = unicode_append_menu (menu, fuFlags, + item != NULL ? (UINT) item + : (UINT) wv->call_data, + utf16_string); + if (fuFlags & MF_OWNERDRAW) + local_free (out_string); + } + else + { + return_value = + AppendMenu (menu, + fuFlags, + item != NULL ? (UINT) item : (UINT) wv->call_data, + out_string ); + } /* This must be done after the menu item is created. */ if (!wv->title && wv->call_data != 0) @@ -2298,7 +2413,7 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags) struct frame *f = x_window_to_frame (&one_w32_display_info, owner); Lisp_Object frame, help; - // No help echo on owner-draw menu items. + /* No help echo on owner-draw menu items. */ if (flags & MF_OWNERDRAW || flags & MF_POPUP) help = Qnil; else @@ -2422,6 +2537,7 @@ void globals_of_w32menu () HMODULE user32 = GetModuleHandle ("user32.dll"); get_menu_item_info = (GetMenuItemInfoA_Proc) GetProcAddress (user32, "GetMenuItemInfoA"); set_menu_item_info = (SetMenuItemInfoA_Proc) GetProcAddress (user32, "SetMenuItemInfoA"); + unicode_append_menu = (AppendMenuW_Proc) GetProcAddress (user32, "AppendMenuW"); } /* arch-tag: 0eaed431-bb4e-4aac-a527-95a1b4f1fed0 From 28c5323581f30e6dcc54e3d6a2ffaeb87cd34967 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 3 Sep 2004 02:36:57 +0000 Subject: [PATCH 331/341] (Killing): Correct description of kill commands in read-only buffer. --- man/ChangeLog | 5 +++++ man/killing.texi | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index b294270f258..37554016f3d 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2004-09-02 Luc Teirlinck + + * killing.texi (Killing): Correct description of kill commands in + read-only buffer. + 2004-09-02 Teodor Zlatanov * building.texi (Compilation Mode): Add a paragraph about rules diff --git a/man/killing.texi b/man/killing.texi index 8865dfc2f1b..23ffd2b709a 100644 --- a/man/killing.texi +++ b/man/killing.texi @@ -1,5 +1,6 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985,86,87,93,94,95,97,00,2001 Free Software Foundation, Inc. +@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2004 +@c Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @iftex @chapter Killing and Moving Text @@ -49,11 +50,12 @@ can use the @kbd{C-x u} (@code{undo}) command to undo it You cannot kill read-only text, since such text does not allow any kind of modification. But some users like to use the kill commands to copy read-only text into the kill ring, without actually changing it. -If you set the variable @code{kill-read-only-ok} to a non-@code{nil} -value, the kill commands work specially in a read-only buffer: they -move over text, and copy it to the kill ring, without actually -deleting it from the buffer. When this happens, a message in the echo -area tells you what is happening. +Therefore, the kill commands work specially in a read-only buffer: +they move over text, and copy it to the kill ring, without actually +deleting it from the buffer. Normally, Emacs beeps and prints an +error message when this happens. But if you set the variable +@code{kill-read-only-ok} to a non-@code{nil} value, it just prints a +message in the echo area, telling you what is happening. The delete commands include @kbd{C-d} (@code{delete-char}) and @key{DEL} (@code{delete-backward-char}), which delete only one From c59ee3b4c27bc4b77706fd3332317160f50dd913 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 3 Sep 2004 12:19:45 +0000 Subject: [PATCH 332/341] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2877097c39a..29b8f3fa81c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2004-09-03 Kim F. Storm + * emulation/cua-rect.el (cua--overlay-keymap): New keymap for + highlight overlays; allow using RET when cursor is over a button. + (cua--highlight-rectangle): Use it. + (cua--rectangle-set-corners): Don't move backwards at eol. + (cua--forward-line): Don't move into void after eob. + * emulation/cua-rect.el (cua--rectangle-set-corners): Ensure that point is set (and displayed) inside rectangle. (cua--rectangle-operation): Fix for highlight of empty lines. From 1e71278bd3f67a41df44c56361f2b9c3b346d61b Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 3 Sep 2004 12:33:54 +0000 Subject: [PATCH 333/341] * emulation/cua-rect.el (cua--overlay-keymap): New keymap for highlight overlays; allow using RET when cursor is over a button. (cua--highlight-rectangle): Use it. (cua--rectangle-set-corners): Don't move backwards at eol. (cua--forward-line): Don't move into void after eob. --- lisp/emulation/cua-rect.el | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 03bf28494c3..3270b7fd62c 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -65,6 +65,10 @@ (defvar cua--rectangle-overlays nil) (make-variable-buffer-local 'cua--rectangle-overlays) +(defvar cua--overlay-keymap + (let ((map (make-sparse-keymap))) + (define-key map "\r" 'cua-rotate-rectangle))) + (defvar cua--virtual-edges-debug nil) ;; Per-buffer CUA mode undo list. @@ -274,8 +278,10 @@ Knows about CUA rectangle highlighting in addition to standard undo." (move-to-column mc) (set-mark (point)) (goto-char pp) + ;; Move cursor inside rectangle, except if char at rigth edge is a tab. (if (and (if (cua--rectangle-right-side) - (= (move-to-column pc) (- pc tab-width)) + (and (= (move-to-column pc) (- pc tab-width)) + (not (eolp))) (> (move-to-column pc) pc)) (not (bolp))) (backward-char 1)) @@ -285,7 +291,11 @@ Knows about CUA rectangle highlighting in addition to standard undo." (defun cua--forward-line (n) ;; Move forward/backward one line. Returns t if movement. - (= (forward-line n) 0)) + (let ((pt (point))) + (and (= (forward-line n) 0) + ;; Deal with end of buffer + (or (not (eobp)) + (goto-char pt))))) (defun cua--rectangle-resized () ;; Refresh state after resizing rectangle @@ -843,6 +853,7 @@ If command is repeated at same position, delete the rectangle." (overlay-put overlay 'before-string bs) (overlay-put overlay 'after-string as) (overlay-put overlay 'face rface) + (overlay-put overlay 'keymap cua--overlay-keymap) (setq new (cons overlay new)))))) ;; Trim old trailing overlays. (mapcar (function delete-overlay) old) From b4fab893cc4fb88a74e6ee203d77ac9bcd35c393 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 3 Sep 2004 17:23:42 +0000 Subject: [PATCH 334/341] (normal-top-level): Undo previous TERM change. --- lisp/ChangeLog | 4 ++++ lisp/startup.el | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 29b8f3fa81c..68eac702a2c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-09-03 Richard M. Stallman + + * startup.el (normal-top-level): Undo previous TERM change. + 2004-09-03 Kim F. Storm * emulation/cua-rect.el (cua--overlay-keymap): New keymap for diff --git a/lisp/startup.el b/lisp/startup.el index c1b25b1867d..f376fe5e0e1 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -348,9 +348,6 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." ;; `user-full-name' is now known; reset its standard-value here. (put 'user-full-name 'standard-value (list (default-value 'user-full-name))) - ;; Subprocesses of Emacs do not have direct access to the terminal, - ;; so unless told otherwise they should only assume a dumb terminal. - (setenv "TERM" "dumb") ;; For root, preserve owner and group when editing files. (if (equal (user-uid) 0) (setq backup-by-copying-when-mismatch t)) From d85519bb21a368ca9d4be6a62b9197b898dec2be Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 3 Sep 2004 20:32:57 +0000 Subject: [PATCH 335/341] (isearch-toggle-regexp): Set `isearch-success' and `isearch-adjusted' to `t'. (isearch-toggle-case-fold): Set `isearch-success' to `t'. (isearch-message-prefix): Add "pending" for isearch-adjusted. (isearch-other-meta-char): Restore isearch-point unconditionally. (isearch-query-replace): Add new arg `regexp-flag' and use it. Set point to start of match if region is not active in transient mark mode (to include the current match to region boundaries). Push the search string to `query-replace-from-history-variable'. Add prompt "Query replace regexp" for isearch-regexp. Add region beginning/end as last arguments of `perform-replace.' (isearch-query-replace-regexp): Replace code by the call to `isearch-query-replace' with arg `t'. --- lisp/isearch.el | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index b8865693d0b..9d1e56aaf6e 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1088,6 +1088,7 @@ Use `isearch-exit' to quit without signaling." (interactive) (setq isearch-regexp (not isearch-regexp)) (if isearch-regexp (setq isearch-word nil)) + (setq isearch-success t isearch-adjusted t) (isearch-update)) (defun isearch-toggle-case-fold () @@ -1100,34 +1101,39 @@ Use `isearch-exit' to quit without signaling." (isearch-message-prefix nil nil isearch-nonincremental) isearch-message (if isearch-case-fold-search "in" ""))) - (setq isearch-adjusted t) + (setq isearch-success t isearch-adjusted t) (sit-for 1) (isearch-update)) -(defun isearch-query-replace () +(defun isearch-query-replace (&optional regexp-flag) "Start query-replace with string to replace from last search string." (interactive) (barf-if-buffer-read-only) + (if regexp-flag (setq isearch-regexp t)) (let ((case-fold-search isearch-case-fold-search)) (isearch-done) (isearch-clean-overlays) - (and isearch-forward isearch-other-end (goto-char isearch-other-end)) + (if (and (< isearch-other-end (point)) + (not (and transient-mark-mode mark-active + (< isearch-opoint (point))))) + (goto-char isearch-other-end)) + (set query-replace-from-history-variable + (cons isearch-string + (symbol-value query-replace-from-history-variable))) (perform-replace isearch-string - (query-replace-read-to isearch-string "Query replace" isearch-regexp) - t isearch-regexp isearch-word))) + (query-replace-read-to + isearch-string + (if isearch-regexp "Query replace regexp" "Query replace") + isearch-regexp) + t isearch-regexp isearch-word nil nil + (if (and transient-mark-mode mark-active) (region-beginning)) + (if (and transient-mark-mode mark-active) (region-end))))) (defun isearch-query-replace-regexp () "Start query-replace-regexp with string to replace from last search string." (interactive) - (let ((query-replace-interactive t) - (case-fold-search isearch-case-fold-search)) - ;; Put search string into the right ring - (setq isearch-regexp t) - (isearch-done) - (isearch-clean-overlays) - (and isearch-forward isearch-other-end (goto-char isearch-other-end)) - (call-interactively 'query-replace-regexp))) + (isearch-query-replace t)) (defun isearch-delete-char () @@ -1620,8 +1626,7 @@ Isearch mode." (let ((ab-bel (isearch-string-out-of-window isearch-point))) (if ab-bel (isearch-back-into-window (eq ab-bel 'above) isearch-point) - (or (eq (point) isearch-point) - (goto-char isearch-point)))) + (goto-char isearch-point))) (isearch-update)) (search-exit-option (let (window) @@ -1895,6 +1900,7 @@ If there is no completion possible, say so and continue searching." ;; If currently failing, display no ellipsis. (or isearch-success (setq ellipsis nil)) (let ((m (concat (if isearch-success "" "failing ") + (if isearch-adjusted "pending " "") (if (and isearch-wrapped (not isearch-wrap-function) (if isearch-forward From 70567d1c1806712039697abd19ccd39eabbefc62 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 3 Sep 2004 20:43:38 +0000 Subject: [PATCH 336/341] Fix line breaks to follow Emacs conventions. --- src/xdisp.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index ad521e340ee..409d32449e5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11105,8 +11105,8 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, start_display (&it, w, startp); if (scroll_conservatively) - amount_to_scroll = - max (dy, FRAME_LINE_HEIGHT (f) * max (scroll_step, temp_scroll_step)); + amount_to_scroll + = max (dy, FRAME_LINE_HEIGHT (f) * max (scroll_step, temp_scroll_step)); else if (scroll_step || temp_scroll_step) amount_to_scroll = scroll_max; else @@ -11385,8 +11385,7 @@ try_cursor_movement (window, startp, scroll_step) else if (PT < XFASTINT (w->last_point)) { /* Cursor has to be moved backward. Note that PT >= - CHARPOS (startp) because of the outer - if-statement. */ + CHARPOS (startp) because of the outer if-statement. */ while (!row->mode_line_p && (MATRIX_ROW_START_CHARPOS (row) > PT || (MATRIX_ROW_START_CHARPOS (row) == PT @@ -11898,8 +11897,8 @@ redisplay_window (window, just_this_one_p) buffer. */ || !NILP (Vwindow_scroll_functions) || MINI_WINDOW_P (w) - || !(used_current_matrix_p = - try_window_reusing_current_matrix (w))) + || !(used_current_matrix_p + = try_window_reusing_current_matrix (w))) { IF_DEBUG (debug_method_add (w, "1")); try_window (window, startp); @@ -12028,8 +12027,8 @@ redisplay_window (window, just_this_one_p) || !NILP (Vwindow_scroll_functions) || !just_this_one_p || MINI_WINDOW_P (w) - || !(used_current_matrix_p = - try_window_reusing_current_matrix (w))) + || !(used_current_matrix_p + = try_window_reusing_current_matrix (w))) try_window (window, startp); /* If new fonts have been loaded (due to fontsets), give up. We @@ -15694,7 +15693,8 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky) The mode_line_string_face face property is always added to the string. */ -static int store_mode_line_string (string, lisp_string, copy_string, field_width, precision, props) +static int +store_mode_line_string (string, lisp_string, copy_string, field_width, precision, props) char *string; Lisp_Object lisp_string; int copy_string; @@ -15806,32 +15806,32 @@ If third optional arg NO-PROPS is non-nil, string is not propertized. */) if (NILP (format) || EQ (format, Qt)) { - face_id = NILP (format) - ? CURRENT_MODE_LINE_FACE_ID (w) : - HEADER_LINE_FACE_ID; - format = NILP (format) - ? current_buffer->mode_line_format - : current_buffer->header_line_format; + face_id = (NILP (format) + ? CURRENT_MODE_LINE_FACE_ID (w) + : HEADER_LINE_FACE_ID); + format = (NILP (format) + ? current_buffer->mode_line_format + : current_buffer->header_line_format); } init_iterator (&it, w, -1, -1, NULL, face_id); if (NILP (no_props)) { - mode_line_string_face = - (face_id == MODE_LINE_FACE_ID ? Qmode_line : - face_id == MODE_LINE_INACTIVE_FACE_ID ? Qmode_line_inactive : - face_id == HEADER_LINE_FACE_ID ? Qheader_line : Qnil); + mode_line_string_face + = (face_id == MODE_LINE_FACE_ID ? Qmode_line + : face_id == MODE_LINE_INACTIVE_FACE_ID ? Qmode_line_inactive + : face_id == HEADER_LINE_FACE_ID ? Qheader_line : Qnil); - mode_line_string_face_prop = - NILP (mode_line_string_face) ? Qnil : - Fcons (Qface, Fcons (mode_line_string_face, Qnil)); + mode_line_string_face_prop + = (NILP (mode_line_string_face) ? Qnil + : Fcons (Qface, Fcons (mode_line_string_face, Qnil))); /* We need a dummy last element in mode_line_string_list to indicate we are building the propertized mode-line string. Using mode_line_string_face_prop here GC protects it. */ - mode_line_string_list = - Fcons (mode_line_string_face_prop, Qnil); + mode_line_string_list + = Fcons (mode_line_string_face_prop, Qnil); frame_title_ptr = NULL; } else From cc2f7834aa66ddb29d39356e4e1df5aab3ae3622 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 3 Sep 2004 20:51:06 +0000 Subject: [PATCH 337/341] (Incremental Search): Update wording for M-%. --- man/search.texi | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/man/search.texi b/man/search.texi index e678ac66339..58265341c29 100644 --- a/man/search.texi +++ b/man/search.texi @@ -215,10 +215,9 @@ string. It uses the same text that @kbd{C-y} as a command would yank. there. In Transient Mark mode, incremental search sets the mark without activating it, and does so only if the mark is not already active. - @kbd{M-%} or @kbd{C-M-%} exits the incremental search and starts an -interactive command @code{query-replace} or @code{query-replace-regexp} -with the last search string inserted in the minibuffer as initial input -for the string to replace. + @kbd{M-%} typed in incremental search invokes @code{query-replace} +or @code{query-replace-regexp} (depending on search mode) with the +current search string used as the string to replace. @cindex lazy search highlighting @vindex isearch-lazy-highlight From dc29ba9b82d981df754dd5c88830f4a2b75fcbea Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 3 Sep 2004 20:53:43 +0000 Subject: [PATCH 338/341] Update M-% in isearch. --- etc/NEWS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 5b5d897adf8..b73cff939eb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1115,9 +1115,9 @@ Another method to grab a character is to enter the minibuffer by `M-e' and to type `C-f' at the end of the search string in the minibuffer. +++ -** M-% and C-M-% typed in isearch mode invoke `query-replace' and -`query-replace-regexp' with the current search string inserted -in the minibuffer as initial input for the string to replace. +** M-% typed in isearch mode invokes `query-replace' or +`query-replace-regexp' (depending on search mode) with the current +search string used as the string to replace. +++ ** Yanking text now discards certain text properties that can From 4bc6a87206ce290974b1712999f7cf69d34b20e9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 3 Sep 2004 21:34:11 +0000 Subject: [PATCH 339/341] *** empty log message *** --- lisp/ChangeLog | 5 +++++ src/ChangeLog | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 68eac702a2c..7a7d2e5f5a1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -19,6 +19,11 @@ (cua--indent-rectangle): Don't tabify. (cua-rotate-rectangle): Ignore that point has moved. +2004-09-02 YAMAMOTO Mitsuharu + + * term/mac-win.el: Add ASCII equivalents for some function keys. + (mode-line-frame-identification): Sync with x-win.el. + 2004-09-02 Juri Linkov * progmodes/compile.el (compilation-buffer-name): Compare major diff --git a/src/ChangeLog b/src/ChangeLog index 77fd0bb7505..8fd72a29c29 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -21,9 +21,6 @@ 2004-09-02 YAMAMOTO Mitsuharu - * term/mac-win.el: Add ASCII equivalents for some function keys. - (mode-line-frame-identification): Sync with x-win.el. - * macfns.c (x_real_positions): Save the current window port and set a new one before obtaining the global coordinate. Use FRAME_MAC_WINDOW. From 9e68f42d8e63609d322967815d720bdca8772337 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 3 Sep 2004 21:51:22 +0000 Subject: [PATCH 340/341] *** empty log message *** --- lisp/ChangeLog | 16 ++++++++++++++++ man/ChangeLog | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7a7d2e5f5a1..130ee51e80f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2004-09-03 Juri Linkov + + * isearch.el (isearch-toggle-regexp): Set `isearch-success' and + `isearch-adjusted' to `t'. + (isearch-toggle-case-fold): Set `isearch-success' to `t'. + (isearch-message-prefix): Add "pending" for isearch-adjusted. + (isearch-other-meta-char): Restore isearch-point unconditionally. + (isearch-query-replace): Add new arg `regexp-flag' and use it. + Set point to start of match if region is not active in transient + mark mode (to include the current match to region boundaries). + Push the search string to `query-replace-from-history-variable'. + Add prompt "Query replace regexp" for isearch-regexp. + Add region beginning/end as last arguments of `perform-replace.' + (isearch-query-replace-regexp): Replace code by the call to + `isearch-query-replace' with arg `t'. + 2004-09-03 Richard M. Stallman * startup.el (normal-top-level): Undo previous TERM change. diff --git a/man/ChangeLog b/man/ChangeLog index 37554016f3d..62d985b022f 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2004-09-03 Juri Linkov + + * search.texi (Incremental Search): Update wording for M-%. + 2004-09-02 Luc Teirlinck * killing.texi (Killing): Correct description of kill commands in From 90e118abf2dcc4aca4d7a7642247fa488554351e Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 3 Sep 2004 22:28:10 +0000 Subject: [PATCH 341/341] (auto-revert-handler): Bind `buffer-read-only' locally around the call to `revert-buffer'. --- lisp/ChangeLog | 5 +++++ lisp/autorevert.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 130ee51e80f..96fa1656f0a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-09-03 Luc Teirlinck + + * autorevert.el (auto-revert-handler): Bind `buffer-read-only' + locally around the call to `revert-buffer'. + 2004-09-03 Juri Linkov * isearch.el (isearch-toggle-regexp): Set `isearch-success' and diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 796ebaa27c8..ecf768c5732 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -421,7 +421,8 @@ This is an internal function used by Auto-Revert Mode." 'no-mini t)) (if auto-revert-tail-mode (auto-revert-tail-handler) - (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)) + (let ((buffer-read-only buffer-read-only)) + (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes))) (when buffer-file-name (when eob (goto-char (point-max))) (dolist (window eoblist)