From 7abcd3e393cead48a7ac8c76e6d85b40ca48effe Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 3 Aug 2006 14:26:27 +0000 Subject: [PATCH 001/153] * simple.el (line-move-to-column): Constrain move-to-column to current field. --- lisp/ChangeLog | 5 +++++ lisp/simple.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 28c8ac15e40..d6ca6734af4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-03 Chong Yidong + + * simple.el (line-move-to-column): Constrain move-to-column to + current field. + 2006-08-03 Stefan Monnier * font-lock.el (font-lock-beg, font-lock-end) diff --git a/lisp/simple.el b/lisp/simple.el index 2af4bbd1d76..9288ab6bd79 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3697,7 +3697,10 @@ because what we really need is for `move-to-column' and `current-column' to be able to ignore invisible text." (if (zerop col) (beginning-of-line) - (move-to-column col)) + (let ((opoint (point))) + (move-to-column col) + ;; move-to-column doesn't respect field boundaries. + (goto-char (constrain-to-field (point) opoint)))) (when (and line-move-ignore-invisible (not (bolp)) (line-move-invisible-p (1- (point)))) From d634a67054364f0a1d1ddad6791fe69186505fbe Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 3 Aug 2006 15:19:20 +0000 Subject: [PATCH 002/153] * process.c: Revert last change. --- src/ChangeLog | 4 ++++ src/process.c | 18 ++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 08590d793da..78cfea5dff2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-03 Chong Yidong + + * process.c: Revert last change. + 2006-08-01 Kim F. Storm * process.c (wait_reading_process_output_unwind): New function. diff --git a/src/process.c b/src/process.c index b24dee002c6..dc70ef37761 100644 --- a/src/process.c +++ b/src/process.c @@ -4158,14 +4158,6 @@ server_accept_connection (server, channel) when not inside wait_reading_process_output. */ static int waiting_for_user_input_p; -static Lisp_Object -wait_reading_process_output_unwind (data) - Lisp_Object data; -{ - waiting_for_user_input_p = XINT (data); - return Qnil; -} - /* This is here so breakpoints can be put on it. */ static void wait_reading_process_output_1 () @@ -4248,7 +4240,11 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, EMACS_TIME timeout, end_time; int wait_channel = -1; int got_some_input = 0; - int count = SPECPDL_INDEX (); + /* We can't record_unwind_protect here because after the + set_waiting_for_input call, C-g (interrupt_signal) would run + throw_to_read_char instead of Fsignal, which means unbind_to + doesn't get called. */ + int saved_waiting_for_user_input_p = waiting_for_user_input_p; FD_ZERO (&Available); #ifdef NON_BLOCKING_CONNECT @@ -4259,8 +4255,6 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, if (wait_proc != NULL) wait_channel = XINT (wait_proc->infd); - record_unwind_protect (wait_reading_process_output_unwind, - make_number (waiting_for_user_input_p)); waiting_for_user_input_p = read_kbd; /* Since we may need to wait several times, @@ -4887,7 +4881,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, } /* end for each file descriptor */ } /* end while exit conditions not met */ - unbind_to (count, Qnil); + waiting_for_user_input_p = saved_waiting_for_user_input_p; /* If calling from keyboard input, do not quit since we want to return C-g as an input character. From 8dea3e2baf6c0cf04bacf77745ac381ba291f522 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 3 Aug 2006 18:27:50 +0000 Subject: [PATCH 003/153] *** empty log message *** --- admin/FOR-RELEASE | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index cb5df6149c7..75720668bcf 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -31,6 +31,9 @@ and KDE projects, to use the new Emacs icons in etc/images/icons. * BUGS +** Romain Francoise , Aug 2: + Abort at end of Fbyte_code because specpdl did not balance. + ** bojohan's and johnsu01@wjsullivan.net's 18 July bug reports that "C-n doesn't work in Customize Option buffer in -nw with long value displayed". Yidong proposed a fix, but needs a field expert to check From 402adebf6941095fd63f6076352dcc380ff8413f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 3 Aug 2006 18:30:13 +0000 Subject: [PATCH 004/153] (gdb-script-font-lock-syntactic-keywords): Correctly mark the end-of-docstring char. --- lisp/ChangeLog | 10 ++++++++++ lisp/progmodes/gud.el | 10 +++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d6ca6734af4..1f6e469dd62 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-03 Stefan Monnier + + * progmodes/gud.el (gdb-script-font-lock-syntactic-keywords): + Correctly mark the end-of-docstring char. + 2006-08-03 Chong Yidong * simple.el (line-move-to-column): Constrain move-to-column to @@ -180,8 +185,13 @@ * tumme.el (tumme-backward-image): Add prefix argument. Add error when at first image. +<<<<<<< ChangeLog + (tumme-forward-image): Add prefix argument. + Add error when at last image. +======= (tumme-forward-image): Add prefix argument. Add error when at last image. +>>>>>>> 1.9899 2006-07-25 Stefan Monnier diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 97e54135a6f..84b40e8ba80 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -3180,7 +3180,15 @@ class of the file (using s to separate nested class ids)." (defvar gdb-script-font-lock-syntactic-keywords '(("^document\\s-.*\\(\n\\)" (1 "< b")) ;; It would be best to change the \n in front, but it's more difficult. - ("^en\\(d\\)\\>" (1 "> b")))) + ("^end\\>" + (0 (progn + (unless (eq (match-beginning 0) (point-min)) + (put-text-property (1- (match-beginning 0)) (match-beginning 0) + 'syntax-table (eval-when-compile + (string-to-syntax "> b"))) + (put-text-property (1- (match-beginning 0)) (match-end 0) + 'font-lock-multiline t) + nil)))))) (defun gdb-script-font-lock-syntactic-face (state) (cond From fa9398d09ea120de89f587bfba40453f7ef1a0a2 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 3 Aug 2006 18:30:37 +0000 Subject: [PATCH 005/153] *** empty log message *** --- admin/FOR-RELEASE | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 75720668bcf..342914337a3 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -34,6 +34,13 @@ and KDE projects, to use the new Emacs icons in etc/images/icons. ** Romain Francoise , Aug 2: Abort at end of Fbyte_code because specpdl did not balance. +** lennart.borgman July 27: Custom and mode-line-format default + M-x customize-option RET mode-line-format RET + +and then click the button "Erase Customization". This will set +mode-line-format to "%-" which does not seem to be useful. + + ** bojohan's and johnsu01@wjsullivan.net's 18 July bug reports that "C-n doesn't work in Customize Option buffer in -nw with long value displayed". Yidong proposed a fix, but needs a field expert to check From 8a38d42d83bb9fc54ce958ca6b791f7748e2f6d3 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Thu, 3 Aug 2006 18:41:58 +0000 Subject: [PATCH 006/153] *** empty log message *** --- lisp/ChangeLog | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1f6e469dd62..d00d8308c91 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -185,13 +185,8 @@ * tumme.el (tumme-backward-image): Add prefix argument. Add error when at first image. -<<<<<<< ChangeLog - (tumme-forward-image): Add prefix argument. - Add error when at last image. -======= (tumme-forward-image): Add prefix argument. Add error when at last image. ->>>>>>> 1.9899 2006-07-25 Stefan Monnier From f3e0a6de08025d4f77a55b74a28760cc9a5e30e7 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Thu, 3 Aug 2006 22:08:09 +0000 Subject: [PATCH 007/153] (w32_menu_show, w32_dialog_show): Call Fsignal to quit when no option selected except when for_click. --- src/ChangeLog | 5 +++++ src/w32menu.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 78cfea5dff2..1a70edd2a07 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-03 Jason Rumney + + * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit + when no option selected. + 2006-08-03 Chong Yidong * process.c: Revert last change. diff --git a/src/w32menu.c b/src/w32menu.c index 389e6c5b856..11af1d66b6f 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -1994,6 +1994,9 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error) } } } + else if (!for_click) + /* Make "Cancel" equivalent to C-g. */ + Fsignal (Qquit, Qnil); return Qnil; } @@ -2186,6 +2189,9 @@ w32_dialog_show (f, keymaps, title, header, error) } } } + else + /* Make "Cancel" equivalent to C-g. */ + Fsignal (Qquit, Qnil); return Qnil; } From dc3ca1078f41aaf51d84fe06f9cdf22672b8a85e Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 4 Aug 2006 01:41:14 +0000 Subject: [PATCH 008/153] (x_query_font): Compare names by ignoring case. --- src/xterm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 5e4eeb3bb64..4203411e888 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10056,8 +10056,8 @@ x_query_font (f, fontname) for (i = 0; i < dpyinfo->n_fonts; i++) if (dpyinfo->font_table[i].name - && (!strcmp (dpyinfo->font_table[i].name, fontname) - || !strcmp (dpyinfo->font_table[i].full_name, fontname))) + && (!strcasecmp (dpyinfo->font_table[i].name, fontname) + || !strcasecmp (dpyinfo->font_table[i].full_name, fontname))) return (dpyinfo->font_table + i); return NULL; } From fca31fbb6681f58052d28cd21f90b1510fe88292 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 4 Aug 2006 01:48:10 +0000 Subject: [PATCH 009/153] (describe-font): Improve docstring and error message. Use frame-parameter (not frame-parameters). --- lisp/international/mule-diag.el | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 0a2e5a7c325..57b77249ba8 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -1039,18 +1039,28 @@ but still contains full information about each coding system." ;;;###autoload (defun describe-font (fontname) - "Display information about fonts which partially match FONTNAME." - (interactive "sFontname (default current choice for ASCII chars): ") + "Display information about a font whose name is FONTNAME. +The font must be already used by Emacs." + (interactive "sFont name (default current choice for ASCII chars): ") (or (and window-system (fboundp 'fontset-list)) - (error "No fontsets being used")) - (when (or (not fontname) (= (length fontname) 0)) - (setq fontname (cdr (assq 'font (frame-parameters)))) - (if (query-fontset fontname) - (setq fontname - (nth 1 (assq 'ascii (aref (fontset-info fontname) 2)))))) - (let ((font-info (font-info fontname))) + (error "No fonts being used")) + (let (fontset font-info) + (when (or (not fontname) (= (length fontname) 0)) + (setq fontname (frame-parameter nil 'font)) + ;; Check if FONTNAME is a fontset. + (if (query-fontset fontname) + (setq fontset fontname + fontname (nth 1 (assq 'ascii + (aref (fontset-info fontname) 2)))))) + (setq font-info (font-info fontname)) (if (null font-info) - (message "No matching font") + (if fontset + ;; The font should be surely used. So, there's some + ;; problem about getting information about it. It is + ;; better to print the fontname to show which font has + ;; this problem. + (message "No information about \"%s\"" fontname) + (message "No matching font being used")) (with-output-to-temp-buffer "*Help*" (describe-font-internal font-info 'verbose))))) From ef8f7cddb377a5fd5b8ec6549ded05bb9aa3da81 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 4 Aug 2006 01:49:05 +0000 Subject: [PATCH 010/153] *** empty log message *** --- lisp/ChangeLog | 5 +++++ src/ChangeLog | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d00d8308c91..69a67e059bd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-04 Kenichi Handa + + * international/mule-diag.el (describe-font): Improve docstring + and error message. Use frame-parameter (not frame-parameters). + 2006-08-03 Stefan Monnier * progmodes/gud.el (gdb-script-font-lock-syntactic-keywords): diff --git a/src/ChangeLog b/src/ChangeLog index 1a70edd2a07..b81ffed78b1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-04 Kenichi Handa + + * xterm.c (x_query_font): Compare names by ignoring case. + 2006-08-03 Jason Rumney * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit From 6f64cebf164a4a613f445aa32e70e95ba6a50d45 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 4 Aug 2006 02:50:10 +0000 Subject: [PATCH 011/153] (w32_query_font): Compare names by ignoring case. --- src/ChangeLog | 2 ++ src/w32fns.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index b81ffed78b1..faa7db9b206 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2006-08-04 Kenichi Handa + * w32fns.c (w32_query_font): Compare names by ignoring case. + * xterm.c (x_query_font): Compare names by ignoring case. 2006-08-03 Jason Rumney diff --git a/src/w32fns.c b/src/w32fns.c index 68fcced88c2..a3df8de5338 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -6207,7 +6207,7 @@ w32_query_font (struct frame *f, char *fontname) for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) { - if (strcmp(pfi->name, fontname) == 0) return pfi; + if (strcasecmp(pfi->name, fontname) == 0) return pfi; } return NULL; From 65c6c6b6ca9b39fc0d06621db620c5b235e7d45f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 Aug 2006 10:42:41 +0000 Subject: [PATCH 012/153] (Formatting Strings): Warn against arbitrary strings as first arg to `format'. --- lispref/ChangeLog | 5 +++++ lispref/strings.texi | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index f3f3037e4d1..eb1fd9797c2 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +2006-08-04 Eli Zaretskii + + * strings.texi (Formatting Strings): Warn against arbitrary + strings as first arg to `format'. + 2006-07-31 Thien-Thi Nguyen * text.texi (Clickable Text): Mention `help-echo' text property. diff --git a/lispref/strings.texi b/lispref/strings.texi index 46c01982f32..12abc38ee02 100644 --- a/lispref/strings.texi +++ b/lispref/strings.texi @@ -701,7 +701,6 @@ arguments @var{objects} are the computed values to be formatted. The characters in @var{string}, other than the format specifications, are copied directly into the output; if they have text properties, -these are copied into the output also. @end defun @cindex @samp{%} in format @@ -719,6 +718,17 @@ For example: @end group @end example + Since @code{format} interprets @samp{%} characters as format +specifications, you should @emph{never} pass an arbitrary string as +the first argument. This is particularly true when the string is +generated by some Lisp code. Unless the string is @emph{known} to +never include any @samp{%} characters, pass @code{"%s"}, described +below, as the first argument, and the string as the second, like this: + +@example + (format "%s" @var{arbitrary-string}) +@end example + If @var{string} contains more than one format specification, the format specifications correspond to successive values from @var{objects}. Thus, the first format specification in @var{string} From df70725f7a2437a7c1edc39b4119a30016c84690 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 Aug 2006 11:36:02 +0000 Subject: [PATCH 013/153] (w32_createwindow): Handle -geometry command line option and the geometry settings in the Registry. --- src/w32fns.c | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/w32fns.c b/src/w32fns.c index a3df8de5338..4c933f0631e 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2066,7 +2066,8 @@ w32_createwindow (f) { HWND hwnd; RECT rect; - Lisp_Object top, left; + Lisp_Object top = Qunbound; + Lisp_Object left = Qunbound; rect.left = rect.top = 0; rect.right = FRAME_PIXEL_WIDTH (f); @@ -2079,13 +2080,41 @@ w32_createwindow (f) if (!hprevinst) { + Lisp_Object ifa; + w32_init_class (hinst); + + /* Handle the -geometry command line option and the geometry + settings in the registry. They are decoded and put into + initial-frame-alist by w32-win.el:x-handle-geometry. */ + ifa = Fsymbol_value (intern ("initial-frame-alist")); + if (CONSP (ifa)) + { + Lisp_Object lt = Fassq (Qleft, ifa); + Lisp_Object tp = Fassq (Qtop, ifa); + + if (!NILP (lt)) + { + lt = XCDR (lt); + if (INTEGERP (lt)) + left = lt; + } + if (!NILP (tp)) + { + tp = XCDR (tp); + if (INTEGERP (tp)) + top = tp; + } + } } - /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero - for anything that is not a number and is not Qunbound. */ - left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); - top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); + if (EQ (left, Qunbound) && EQ (top, Qunbound)) + { + /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero + for anything that is not a number and is not Qunbound. */ + left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); + top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); + } FRAME_W32_WINDOW (f) = hwnd = CreateWindow (EMACS_CLASS, From 8bdb96bccbcfe8d5c673235b293dcaceef966383 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 Aug 2006 11:43:27 +0000 Subject: [PATCH 014/153] (Window Size X) <--geometry>: Only width and height apply to all frames. --- man/cmdargs.texi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man/cmdargs.texi b/man/cmdargs.texi index a1b26bcdcb3..fc17d7ec695 100644 --- a/man/cmdargs.texi +++ b/man/cmdargs.texi @@ -1013,7 +1013,9 @@ position of the initial Emacs frame: @cindex geometry, command-line argument Specify the size @var{width} and @var{height} (measured in character columns and lines), and positions @var{xoffset} and @var{yoffset} -(measured in pixels). This applies to all frames. +(measured in pixels). The @var{width} and @var{height} parameters +apply to all frames, whereas @var{xoffset} and @var{yoffset} only to +the initial frame. @item -fs @opindex -fs From 316a275a1e626f7689affcf96f4e98953a6b5c97 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 Aug 2006 11:43:45 +0000 Subject: [PATCH 015/153] *** empty log message *** --- man/ChangeLog | 5 +++++ src/ChangeLog | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/man/ChangeLog b/man/ChangeLog index 4723b892276..ba745d0574b 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2006-08-04 Eli Zaretskii + + * cmdargs.texi (Window Size X) <--geometry>: Only width and height + apply to all frames. + 2006-08-03 Michael Olson * erc.texi: Update for ERC 5.1.4. diff --git a/src/ChangeLog b/src/ChangeLog index faa7db9b206..52847a7fe1f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-04 Ralf Angeli + + * w32fns.c (w32_createwindow): Handle -geometry command line option + and the geometry settings in the Registry. + 2006-08-04 Kenichi Handa * w32fns.c (w32_query_font): Compare names by ignoring case. From 0f2e2a3bbc74a84038de18603e5d734f38fa9db4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 4 Aug 2006 15:22:09 +0000 Subject: [PATCH 016/153] (Fsubst_char_in_region): Redo the setup work after running the before-change-functions since they may have altered the buffer. --- src/ChangeLog | 5 +++++ src/editfns.c | 24 +++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 52847a7fe1f..49c4649d144 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-04 Stefan Monnier + + * editfns.c (Fsubst_char_in_region): Redo the setup work after running + the before-change-functions since they may have altered the buffer. + 2006-08-04 Ralf Angeli * w32fns.c (w32_createwindow): Handle -geometry command line option diff --git a/src/editfns.c b/src/editfns.c index e692204c702..8ac61f3d006 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2691,6 +2691,10 @@ Both characters must have the same length of multi-byte form. */) Lisp_Object start, end, fromchar, tochar, noundo; { register int pos, pos_byte, stop, i, len, end_byte; + /* Keep track of the first change in the buffer: + if 0 we haven't found it yet. + if < 0 we've found it and we've run the before-change-function. + if > 0 we've actually performed it and the value is its position. */ int changed = 0; unsigned char fromstr[MAX_MULTIBYTE_LENGTH], tostr[MAX_MULTIBYTE_LENGTH]; unsigned char *p; @@ -2703,6 +2707,8 @@ Both characters must have the same length of multi-byte form. */) int last_changed = 0; int multibyte_p = !NILP (current_buffer->enable_multibyte_characters); + restart: + validate_region (&start, &end); CHECK_NUMBER (fromchar); CHECK_NUMBER (tochar); @@ -2740,7 +2746,7 @@ Both characters must have the same length of multi-byte form. */) That's faster than getting rid of things, and it prevents even the entry for a first change. Also inhibit locking the file. */ - if (!NILP (noundo)) + if (!changed && !NILP (noundo)) { record_unwind_protect (subst_char_in_region_unwind, current_buffer->undo_list); @@ -2774,10 +2780,14 @@ Both characters must have the same length of multi-byte form. */) && (len == 2 || (p[2] == fromstr[2] && (len == 3 || p[3] == fromstr[3])))))) { - if (! changed) + if (changed < 0) + /* We've already seen this and run the before-change-function; + this time we only need to record the actual position. */ + changed = pos; + else if (!changed) { - changed = pos; - modify_region (current_buffer, changed, XINT (end)); + changed = -1; + modify_region (current_buffer, pos, XINT (end)); if (! NILP (noundo)) { @@ -2786,6 +2796,10 @@ Both characters must have the same length of multi-byte form. */) if (MODIFF - 1 == current_buffer->auto_save_modified) current_buffer->auto_save_modified++; } + + /* The before-change-function may have moved the gap + or even modified the buffer so we should start over. */ + goto restart; } /* Take care of the case where the new character @@ -2838,7 +2852,7 @@ Both characters must have the same length of multi-byte form. */) pos++; } - if (changed) + if (changed > 0) { signal_after_change (changed, last_changed - changed, last_changed - changed); From 04146a367c7226bb47a2c6d0cd210c938a414e68 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 4 Aug 2006 15:44:27 +0000 Subject: [PATCH 017/153] "C-n doesn't work in Customize Option buffer in -nw with long value displayed" fix committed --- admin/FOR-RELEASE | 5 ----- 1 file changed, 5 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 342914337a3..8d618563d89 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -41,11 +41,6 @@ and then click the button "Erase Customization". This will set mode-line-format to "%-" which does not seem to be useful. -** bojohan's and johnsu01@wjsullivan.net's 18 July bug reports that - "C-n doesn't work in Customize Option buffer in -nw with long value - displayed". Yidong proposed a fix, but needs a field expert to check - it. - ** Markus Gritsch's report about Emacs looping on Windoze with the following .emacs file, and then reduce Emacs frame width to "something quite narrow": (setq-default truncate-lines t) From 3046c3f9246fde1c93c30bce6c011204333de29f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 Aug 2006 17:22:18 +0000 Subject: [PATCH 018/153] (w32_query_font): Fix last change: use stricmp. --- src/ChangeLog | 4 ++++ src/w32fns.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 49c4649d144..59be848bf58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-04 Eli Zaretskii + + * w32fns.c (w32_query_font): Fix last change: use stricmp. + 2006-08-04 Stefan Monnier * editfns.c (Fsubst_char_in_region): Redo the setup work after running diff --git a/src/w32fns.c b/src/w32fns.c index 4c933f0631e..e1cae4f3eb4 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -6236,7 +6236,7 @@ w32_query_font (struct frame *f, char *fontname) for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) { - if (strcasecmp(pfi->name, fontname) == 0) return pfi; + if (stricmp(pfi->name, fontname) == 0) return pfi; } return NULL; From 092869b9735590049a4be576970c95dc4b53af75 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 5 Aug 2006 01:38:21 +0000 Subject: [PATCH 019/153] * keyboard.c (read_char): Rebalance specpdl after receiving jump. --- src/ChangeLog | 6 ++++++ src/keyboard.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 59be848bf58..aa025125067 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-08-04 Chong Yidong + + * keyboard.c (read_char): Rebalance specpdl after receiving jump. + + * process.c: Reapply 2006-08-01 change. + 2006-08-04 Eli Zaretskii * w32fns.c (w32_query_font): Fix last change: use stricmp. diff --git a/src/keyboard.c b/src/keyboard.c index 95d880d1209..a4e1c98c013 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2403,7 +2403,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) EMACS_TIME *end_time; { volatile Lisp_Object c; - int count; + int count, jmpcount; jmp_buf local_getcjmp; jmp_buf save_jump; volatile int key_already_recorded = 0; @@ -2629,11 +2629,13 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) around any call to sit_for or kbd_buffer_get_event; it *must not* be in effect when we call redisplay. */ + jmpcount = SPECPDL_INDEX (); if (_setjmp (local_getcjmp)) { /* We must have saved the outer value of getcjmp here, so restore it now. */ restore_getcjmp (save_jump); + unbind_to (jmpcount, Qnil); XSETINT (c, quit_char); internal_last_event_frame = selected_frame; Vlast_event_frame = internal_last_event_frame; From 42ec1561cfb550dc580dd3e163b21289780a2a72 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 5 Aug 2006 01:38:42 +0000 Subject: [PATCH 020/153] * process.c: Reapply 2006-08-01 change. --- src/process.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/process.c b/src/process.c index dc70ef37761..b24dee002c6 100644 --- a/src/process.c +++ b/src/process.c @@ -4158,6 +4158,14 @@ server_accept_connection (server, channel) when not inside wait_reading_process_output. */ static int waiting_for_user_input_p; +static Lisp_Object +wait_reading_process_output_unwind (data) + Lisp_Object data; +{ + waiting_for_user_input_p = XINT (data); + return Qnil; +} + /* This is here so breakpoints can be put on it. */ static void wait_reading_process_output_1 () @@ -4240,11 +4248,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, EMACS_TIME timeout, end_time; int wait_channel = -1; int got_some_input = 0; - /* We can't record_unwind_protect here because after the - set_waiting_for_input call, C-g (interrupt_signal) would run - throw_to_read_char instead of Fsignal, which means unbind_to - doesn't get called. */ - int saved_waiting_for_user_input_p = waiting_for_user_input_p; + int count = SPECPDL_INDEX (); FD_ZERO (&Available); #ifdef NON_BLOCKING_CONNECT @@ -4255,6 +4259,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, if (wait_proc != NULL) wait_channel = XINT (wait_proc->infd); + record_unwind_protect (wait_reading_process_output_unwind, + make_number (waiting_for_user_input_p)); waiting_for_user_input_p = read_kbd; /* Since we may need to wait several times, @@ -4881,7 +4887,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, } /* end for each file descriptor */ } /* end while exit conditions not met */ - waiting_for_user_input_p = saved_waiting_for_user_input_p; + unbind_to (count, Qnil); /* If calling from keyboard input, do not quit since we want to return C-g as an input character. From 1b34e200d955daa147f41f4591743b2dcb544d6d Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 5 Aug 2006 01:39:40 +0000 Subject: [PATCH 021/153] specpdl unbalanced bug fixed. --- admin/FOR-RELEASE | 3 --- 1 file changed, 3 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 8d618563d89..9eb325a30b9 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -31,9 +31,6 @@ and KDE projects, to use the new Emacs icons in etc/images/icons. * BUGS -** Romain Francoise , Aug 2: - Abort at end of Fbyte_code because specpdl did not balance. - ** lennart.borgman July 27: Custom and mode-line-format default M-x customize-option RET mode-line-format RET From a59dcf2e3f5401dda51c567bdf0572911c61a20a Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 5 Aug 2006 01:40:27 +0000 Subject: [PATCH 022/153] *** empty log message *** --- admin/FOR-RELEASE | 2 -- 1 file changed, 2 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 9eb325a30b9..698fea62a25 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -46,8 +46,6 @@ mode-line-format to "%-" which does not seem to be useful. '(hscroll-step 1) ) -** David Kastrup's report on strange scrolling of large images. - ** Jorgen Schaefer 's June 18 bug report about fields and invisible overlays needs attention from a field expert. From 1a77c985dd4bca943808130f6a61b43b6a678678 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 5 Aug 2006 04:42:57 +0000 Subject: [PATCH 023/153] (escape-glyph): Doc fix. --- lisp/ChangeLog | 4 ++++ lisp/faces.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 69a67e059bd..9c0dbf645c9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-08-05 Richard Stallman + + * faces.el (escape-glyph): Doc fix. + 2006-08-04 Kenichi Handa * international/mule-diag.el (describe-font): Improve docstring diff --git a/lisp/faces.el b/lisp/faces.el index 0f0dd41aa69..fe2f5037826 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2008,7 +2008,7 @@ created." ;; red4 is too dark, but some say blue is too loud. ;; brown seems to work ok. -- rms. (t :foreground "brown")) - "Face for characters displayed as ^-sequences or \-sequences." + "Face for characters displayed as sequences using `^' or `\\'." :group 'basic-faces :version "22.1") From a1ebfe34232143515306a0559066944761098f3e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 09:49:01 +0000 Subject: [PATCH 024/153] (Formatting Strings) Resurrect erroneously removed line. --- lispref/strings.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lispref/strings.texi b/lispref/strings.texi index 12abc38ee02..17a62b546b4 100644 --- a/lispref/strings.texi +++ b/lispref/strings.texi @@ -700,7 +700,8 @@ in the copy with encodings of the corresponding @var{objects}. The arguments @var{objects} are the computed values to be formatted. The characters in @var{string}, other than the format specifications, -are copied directly into the output; if they have text properties, +are copied directly into the output, including their text properties, +if any. @end defun @cindex @samp{%} in format From 6b657e423e2e10e4d9f7061e76cd3f8f3fcff7b7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 12:00:32 +0000 Subject: [PATCH 025/153] (kbd_buffer_get_event): Return Qnil when current time is exactly equal to end_time, not only when it is past that. --- src/ChangeLog | 5 +++++ src/keyboard.c | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index aa025125067..28109540800 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-05 Eli Zaretskii + + * keyboard.c (kbd_buffer_get_event): Return Qnil when current time + is exactly equal to end_time, not only when it is past that. + 2006-08-04 Chong Yidong * keyboard.c (read_char): Rebalance specpdl after receiving jump. diff --git a/src/keyboard.c b/src/keyboard.c index a4e1c98c013..6f12994a1b8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3954,13 +3954,15 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) { EMACS_TIME duration; EMACS_GET_TIME (duration); - EMACS_SUB_TIME (duration, *end_time, duration); - if (EMACS_TIME_NEG_P (duration)) - return Qnil; + if (EMACS_TIME_GE (duration, *end_time)) + return Qnil; /* finished waiting */ else - wait_reading_process_output (EMACS_SECS (duration), - EMACS_USECS (duration), - -1, 1, Qnil, NULL, 0); + { + EMACS_SUB_TIME (duration, *end_time, duration); + wait_reading_process_output (EMACS_SECS (duration), + EMACS_USECS (duration), + -1, 1, Qnil, NULL, 0); + } } else wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0); From 10e81c5e228572be4adf6ea9ad0d16668c8840f8 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Sat, 5 Aug 2006 12:33:22 +0000 Subject: [PATCH 026/153] (New in Emacs 22): Expand. --- man/ChangeLog | 4 ++++ man/faq.texi | 58 +++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 51 insertions(+), 11 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index ba745d0574b..1e5a9d23e89 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2006-08-05 Romain Francoise + + * faq.texi (New in Emacs 22): Expand. + 2006-08-04 Eli Zaretskii * cmdargs.texi (Window Size X) <--geometry>: Only width and height diff --git a/man/faq.texi b/man/faq.texi index 7890c13a4d8..5c3bff470a3 100644 --- a/man/faq.texi +++ b/man/faq.texi @@ -1146,16 +1146,28 @@ and on @code{xterm} with @kbd{emacs -nw}. @cindex Emacs 22, new features in @cindex Recently introduced features -@c FIXME: Improve this node before the 22.1 release. @cindex Default features -Font-lock mode, auto-compression mode, and file name shadow mode are now -enabled by default. It is now possible to follow links with -@kbd{mouse-1}. +Font Lock mode, auto-compression mode, and file name shadow mode are now +enabled by default. On graphics displays it is now possible to follow +links with @kbd{mouse-1}, and the modeline of the selected window is now +highlighted. Window fringes are now customizable. The minibuffer +prompt is now displayed in a distinct face. -@cindex Supported systems -Emacs 22 features support for GNU/Linux systems on S390 and X86-64 -machines, as well as support for the Mac OS X and Cygwin operating -systems. +Emacs now reads abbrev definitions automatically at startup. The +maximum size of buffers has been doubled and is now 256M on 32-bit +machines. Grep mode is now separate from Compilation mode and has many +new specific options and commands. + +The original Emacs macro system has been replaced by the new Kmacro +package, which provides many new commands and features and a simple +interface that uses the function keys F3 and F4. Macros are now stored +in a macro ring, and can be debugged and edited interactively. + +The GUD (Grand Unified Debugger) package can now be used with a full +graphical user interface to the debugger which provides many features +found in traditional development environments, making it easy to +manipulate breakpoints, add watch points, display the call stack, etc. +Breakpoints are now displayed in the source buffer. @cindex GTK+ Toolkit @cindex Drag-and-drop @@ -1164,15 +1176,39 @@ Emacs can now be built with GTK+ widgets, and supports drag-and-drop operation on X. Mouse wheel support is now enabled by default. @cindex New modes -Many new modes and packages have been included in Emacs, such as Leim, -Calc, Tramp and URL, as well as IDO, CUA, rcirc, ERC, conf-mode, -python-mode, table, tumme, SES, ruler, Flymake, Org, PGG, etc. +Many new modes and packages have been included in Emacs, such as Calc, +Tramp and URL, as well as IDO, CUA, rcirc, ERC, conf-mode, python-mode, +table, tumme, SES, ruler, Flymake, Org, PGG, wdired, t-mouse, longlines, +dns-mode, savehist, Password, Printing, Reveal, etc. + +@cindex Multilingual Environment +Leim is now part of Emacs. Unicode support has been much improved, and +the following input methods have been added: belarusian, bulgarian-bds, +bulgarian-phonetic, chinese-sisheng, croatian, dutch, georgian, +latin-alt-postfix, latin-postfix, latin-prefix, latvian-keyboard, +lithuanian-numeric, lithuanian-keyboard, malayalam-inscript, rfc1345, +russian-computer, sgml, slovenian, tamil-inscript ucs, +ukrainian-computer, vietnamese-telex, and welsh. + +The following language environment have also been added: Belarusian, +Bulgarian, Chinese-EUC-TW, Croatian, French, Georgian, Italian, Latin-6, +Latin-7, Latvian, Lithuanian, Malayalam, Russian, Russian, Slovenian, +Swedish, Tajik, Tamil, UTF-8, Ukrainian, Ukrainian, Welsh, and +Windows-1255. + +@cindex Supported systems +Emacs 22 features support for GNU/Linux systems on S390 and x86-64 +machines, as well as support for the Mac OS X and Cygwin operating +systems. @cindex Documentation @cindex Emacs Lisp Manual In addition, Emacs 22 now includes the Emacs Lisp Reference Manual (@pxref{Emacs Lisp documentation}) and the Emacs Lisp Intro. +Many other changes have been made in Emacs 22, use @kbd{C-h n} to get a +full list. + @c ------------------------------------------------------------ @node Common requests, Bugs and problems, Status of Emacs, Top @chapter Common requests From ed91b2add33be7f813979c8c64e5cd92758d75fc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 13:01:10 +0000 Subject: [PATCH 027/153] (w32_valid_pointer_p): New function. --- src/w32.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/w32.c b/src/w32.c index c093eab599e..0da908ff932 100644 --- a/src/w32.c +++ b/src/w32.c @@ -323,6 +323,28 @@ w32_strerror (int error_no) return buf; } +/* Return 1 if P is a valid pointer to an object of size SIZE. Return + 0 if P is NOT a valid pointer. Return -1 if we cannot validate P. + + This is called from alloc.c:valid_pointer_p. */ +int +w32_valid_pointer_p (void *p, int size) +{ + SIZE_T done; + HANDLE h = OpenProcess (PROCESS_VM_READ, FALSE, GetCurrentProcessId ()); + + if (h) + { + unsigned char *buf = alloca (size); + int retval = ReadProcessMemory (h, p, buf, size, &done); + + CloseHandle (h); + return retval; + } + else + return -1; +} + static char startup_dir[MAXPATHLEN]; /* Get the current working directory. */ From 0c5c0e3dfe9396982d70d155430ec441867b3629 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 13:01:25 +0000 Subject: [PATCH 028/153] Add prototype for w32_valid_pointer_p. --- src/w32.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/w32.h b/src/w32.h index 1d5dbee6d40..6ba25a42403 100644 --- a/src/w32.h +++ b/src/w32.h @@ -110,6 +110,9 @@ extern void delete_child (child_process *cp); /* Equivalent of strerror for W32 error codes. */ extern char * w32_strerror (int error_no); +/* Validate a pointer. */ +extern int w32_valid_pointer_p (void *, int); + /* Get long (aka "true") form of file name, if it exists. */ extern BOOL w32_get_long_filename (char * name, char * buf, int size); From f892cf9c9d14e5920ad5c8ce236bd660f18c0816 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 13:01:50 +0000 Subject: [PATCH 029/153] Include w32.h. (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do the job. --- src/alloc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/alloc.c b/src/alloc.c index e5735e03fd9..eb7acfd649f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -80,6 +80,7 @@ extern POINTER_TYPE *sbrk (); #ifdef WINDOWSNT #include +#include "w32.h" #endif #ifdef DOUG_LEA_MALLOC @@ -4615,6 +4616,9 @@ int valid_pointer_p (p) void *p; { +#ifdef WINDOWSNT + return w32_valid_pointer_p (p, 16); +#else int fd; /* Obviously, we cannot just access it (we would SEGV trying), so we @@ -4631,6 +4635,7 @@ valid_pointer_p (p) } return -1; +#endif } /* Return 1 if OBJ is a valid lisp object. From b653cee476923bfab4fcaa808aa8b870051de70f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 13:30:17 +0000 Subject: [PATCH 030/153] (list-buffers-noselect): For Info buffers, use "(file)node" instead of the file name. --- lisp/buff-menu.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index e9e7e9a2bb8..398b362d4e4 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -117,6 +117,7 @@ file buffers. It affects both manual reverting and reverting by Auto Revert Mode.") (defvar Info-current-file) ;; from info.el +(defvar Info-current-node) ;; from info.el (make-variable-buffer-local 'Buffer-menu-files-only) @@ -786,7 +787,12 @@ For more information, see the function `buffer-menu'." ((eq file 'toc) (setq file "*Info TOC*")) ((not (stringp file)) ;; avoid errors - (setq file nil)))))) + (setq file nil)) + (t + (setq file (concat "(" + (file-name-nondirectory file) + ")" + Info-current-node))))))) (push (list buffer bits name (buffer-size) mode file) list)))))) ;; Preserve the original buffer-list ordering, just in case. From 0a3297f7bbfced678d4cd242d5c5eeb59fa57878 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 13:31:11 +0000 Subject: [PATCH 031/153] *** empty log message *** --- lisp/ChangeLog | 5 +++++ src/ChangeLog | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9c0dbf645c9..719ce5d4cac 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-05 Eli Zaretskii + + * buff-menu.el (list-buffers-noselect): For Info buffers, use + "(file)node" instead of the file name. + 2006-08-05 Richard Stallman * faces.el (escape-glyph): Doc fix. diff --git a/src/ChangeLog b/src/ChangeLog index 28109540800..80d99505c44 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2006-08-05 Eli Zaretskii + * w32.c (w32_valid_pointer_p): New function. + + * w32.h: Add prototype for w32_valid_pointer_p. + + * alloc.c: Include w32.h. + (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do + the job. + * keyboard.c (kbd_buffer_get_event): Return Qnil when current time is exactly equal to end_time, not only when it is past that. From 044c2978976821d4d799ac55ed7c7bdf23bacd22 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 6 Aug 2006 00:32:33 +0000 Subject: [PATCH 032/153] * bindings.el: Give mode-line-format, mode-line-modes, and mode-line-position `standard-value' properties. --- lisp/ChangeLog | 5 +++ lisp/bindings.el | 98 ++++++++++++++++++++++++++---------------------- 2 files changed, 59 insertions(+), 44 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 719ce5d4cac..09c891c29c2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-05 Chong Yidong + + * bindings.el: Give mode-line-format, mode-line-modes, and + mode-line-position `standard-value' properties. + 2006-08-05 Eli Zaretskii * buff-menu.el (list-buffers-noselect): For Info buffers, use diff --git a/lisp/bindings.el b/lisp/bindings.el index 699a05203af..65ff8b0f916 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -280,52 +280,62 @@ Keymap to display on minor modes.") ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete, ;; drag-mouse-1: resize, C-mouse-2: split horizontally" "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this") - (dashes (propertize "--" 'help-echo help-echo))) - (setq-default mode-line-format - (list - "%e" - (propertize "-" 'help-echo help-echo) - 'mode-line-mule-info - 'mode-line-modified - 'mode-line-frame-identification - 'mode-line-buffer-identification - (propertize " " 'help-echo help-echo) - 'mode-line-position - '(vc-mode vc-mode) - (propertize " " 'help-echo help-echo) - 'mode-line-modes - `(which-func-mode ("" which-func-format ,dashes)) - `(global-mode-string (,dashes global-mode-string)) - (propertize "-%-" 'help-echo help-echo))) + (dashes (propertize "--" 'help-echo help-echo)) + (standard-mode-line-format + (list + "%e" + (propertize "-" 'help-echo help-echo) + 'mode-line-mule-info + 'mode-line-modified + 'mode-line-frame-identification + 'mode-line-buffer-identification + (propertize " " 'help-echo help-echo) + 'mode-line-position + '(vc-mode vc-mode) + (propertize " " 'help-echo help-echo) + 'mode-line-modes + `(which-func-mode ("" which-func-format ,dashes)) + `(global-mode-string (,dashes global-mode-string)) + (propertize "-%-" 'help-echo help-echo))) + (standard-mode-line-modes + (list + (propertize "%[(" 'help-echo help-echo) + `(:propertize ("" mode-name) + help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes" + mouse-face mode-line-highlight + local-map ,mode-line-major-mode-keymap) + '("" mode-line-process) + `(:propertize ("" minor-mode-alist) + mouse-face mode-line-highlight + help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes" + local-map ,mode-line-minor-mode-keymap) + (propertize "%n" 'help-echo "mouse-2: widen" + 'mouse-face 'mode-line-highlight + 'local-map (make-mode-line-mouse-map + 'mouse-2 #'mode-line-widen)) + (propertize ")%]--" 'help-echo help-echo))) + (standard-mode-line-position + `((-3 ,(propertize "%p" 'help-echo help-echo)) + (size-indication-mode + (8 ,(propertize " of %I" 'help-echo help-echo))) + (line-number-mode + ((column-number-mode + (10 ,(propertize " (%l,%c)" 'help-echo help-echo)) + (6 ,(propertize " L%l" 'help-echo help-echo)))) + ((column-number-mode + (5 ,(propertize " C%c" 'help-echo help-echo)))))))) - (setq-default mode-line-modes - (list - (propertize "%[(" 'help-echo help-echo) - `(:propertize ("" mode-name) - help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes" - mouse-face mode-line-highlight - local-map ,mode-line-major-mode-keymap) - '("" mode-line-process) - `(:propertize ("" minor-mode-alist) - mouse-face mode-line-highlight - help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes" - local-map ,mode-line-minor-mode-keymap) - (propertize "%n" 'help-echo "mouse-2: widen" - 'mouse-face 'mode-line-highlight - 'local-map (make-mode-line-mouse-map - 'mouse-2 #'mode-line-widen)) - (propertize ")%]--" 'help-echo help-echo))) + (setq-default mode-line-format standard-mode-line-format) + (put 'mode-line-format 'standard-value + (list `(quote ,standard-mode-line-format))) - (setq-default mode-line-position - `((-3 ,(propertize "%p" 'help-echo help-echo)) - (size-indication-mode - (8 ,(propertize " of %I" 'help-echo help-echo))) - (line-number-mode - ((column-number-mode - (10 ,(propertize " (%l,%c)" 'help-echo help-echo)) - (6 ,(propertize " L%l" 'help-echo help-echo)))) - ((column-number-mode - (5 ,(propertize " C%c" 'help-echo help-echo)))))))) + (setq-default mode-line-modes standard-mode-line-modes) + (put 'mode-line-modes 'standard-value + (list `(quote ,standard-mode-line-modes))) + + (setq-default mode-line-position standard-mode-line-position) + (put 'mode-line-position 'standard-value + (list `(quote ,standard-mode-line-position)))) (defvar mode-line-buffer-identification-keymap nil "\ Keymap for what is displayed by `mode-line-buffer-identification'.") From 27bd6273775ea3d6801cd835da778db11336c6dd Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sun, 6 Aug 2006 00:39:02 +0000 Subject: [PATCH 033/153] *** empty log message *** --- etc/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index ae887b33da9..d5b56ded436 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2006-08-06 Nick Roberts + + * DEBUG (Note): Add note about ollowing a longjmp call. + 2006-08-03 Michael Olson * ERC-NEWS: Update for ERC 5.1.4. From 6205d23a8ce4ff231f42dc642d43e6cc9ff942d2 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sun, 6 Aug 2006 00:39:50 +0000 Subject: [PATCH 034/153] (Note): Add note about ollowing a longjmp call. --- etc/DEBUG | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etc/DEBUG b/etc/DEBUG index 63327b3ce5c..1eb5d5ca9f4 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -272,6 +272,13 @@ related data structures in a terse and user-friendly format: The above commands also exist in a version with an `x' suffix which takes an object of the relevant type as argument. +** Following longjmp call. + +Recent versions of glibc (2.4+?) encrypt stored values for setjmp/longjmp which +prevents GDB from being able to follow a longjmp call using `next'. To +disable this protection you need to set the environment variable +LD_POINTER_GUARD to 0. + ** Using GDB in Emacs Debugging with GDB in Emacs offers some advantages over the command line (See From bf69439f99cf722d8a76920a423c22686cbb0cf0 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sun, 6 Aug 2006 00:45:53 +0000 Subject: [PATCH 035/153] *** empty log message *** --- etc/ChangeLog | 1 + etc/DEBUG | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index d5b56ded436..1befad29a34 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,6 +1,7 @@ 2006-08-06 Nick Roberts * DEBUG (Note): Add note about ollowing a longjmp call. + Add local variables list for outline mode. 2006-08-03 Michael Olson diff --git a/etc/DEBUG b/etc/DEBUG index 1eb5d5ca9f4..bc81d1d5dc2 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -746,4 +746,10 @@ look at the disassembly to determine which registers are being used, and look at those registers directly, to see the actual current values of these variables. + +Local variables: +mode: outline +paragraph-separate: "[ ]*$" +end: + ;;; arch-tag: fbf32980-e35d-481f-8e4c-a2eca2586e6b From 7172336736efd9dcf4439f784703d2138f077684 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 6 Aug 2006 04:31:58 +0000 Subject: [PATCH 036/153] (describe-mode): Make minor mode list more concise. --- lisp/ChangeLog | 4 ++++ lisp/help.el | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 09c891c29c2..3f94298abca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-08-06 Richard Stallman + + * help.el (describe-mode): Make minor mode list more concise. + 2006-08-05 Chong Yidong * bindings.el: Give mode-line-format, mode-line-modes, and diff --git a/lisp/help.el b/lisp/help.el index 4d92f69cebd..af79bbcf57c 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -822,16 +822,13 @@ whose documentation describes the minor mode." (sort minor-modes (lambda (a b) (string-lessp (cadr a) (cadr b))))) (when minor-modes - (princ "Summary of minor modes:\n") + (princ "Enabled minor modes:\n") (make-local-variable 'help-button-cache) (with-current-buffer standard-output (dolist (mode minor-modes) (let ((mode-function (nth 0 mode)) (pretty-minor-mode (nth 1 mode)) (indicator (nth 2 mode))) - (setq indicator (if (zerop (length indicator)) - "no indicator" - (format "indicator%s" indicator))) (add-text-properties 0 (length pretty-minor-mode) '(face bold) pretty-minor-mode) (save-excursion @@ -840,16 +837,22 @@ whose documentation describes the minor mode." (push (point-marker) help-button-cache) ;; Document the minor modes fully. (insert pretty-minor-mode) - (princ (format " minor mode (%s):\n" indicator)) + (princ (format " minor mode (%s):\n" + (if (zerop (length indicator)) + "no indicator" + (format "indicator%s" + indicator)))) (princ (documentation mode-function))) - (princ " ") (insert-button pretty-minor-mode 'action (car help-button-cache) 'follow-link t 'help-echo "mouse-2, RET: show full information") - (princ (format " minor mode (%s):\n" indicator))))) - (princ "\n(Full information about these minor modes -follows the description of the major mode.)\n\n")) + (newline))) + (forward-line -1) + (fill-paragraph nil) + (forward-line 1)) + + (princ "\n(Information about these minor modes follows the major mode info.)\n\n")) ;; Document the major mode. (let ((mode mode-name)) (with-current-buffer standard-output From 9c6598c2494fce2fff84836a0fef6ff60e87c75a Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Sun, 6 Aug 2006 08:23:29 +0000 Subject: [PATCH 037/153] *** empty log message *** --- etc/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 1befad29a34..bc2d5cd0600 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,6 +1,6 @@ 2006-08-06 Nick Roberts - * DEBUG (Note): Add note about ollowing a longjmp call. + * DEBUG (Note): Add note about following a longjmp call. Add local variables list for outline mode. 2006-08-03 Michael Olson From 4c88aa80fe64722ea85826821838c52417c162da Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Sun, 6 Aug 2006 11:56:03 +0000 Subject: [PATCH 038/153] Fix typo reported by Peter Dyballa . --- etc/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index bc2d5cd0600..f144dd17954 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -191,7 +191,7 @@ 2006-05-29 Jan Dj,Ad(Brv - * NEWS: Mention F10 for Gtk+/Leddtif/Lucid menus. + * NEWS: Mention F10 for Gtk+/Lesstif/Lucid menus. 2006-05-26 Eli Zaretskii From 43ed3b8da0c563a5fec8708cada2ee39411062ec Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 6 Aug 2006 14:22:24 +0000 Subject: [PATCH 039/153] * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. (Fkill_all_local_variables): Use it. (syms_of_buffer): Defvar it. --- src/ChangeLog | 6 ++++++ src/buffer.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 80d99505c44..2e0563e44a7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-08-06 Chong Yidong + + * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. + (Fkill_all_local_variables): Use it. + (syms_of_buffer): Defvar it. + 2006-08-05 Eli Zaretskii * w32.c (w32_valid_pointer_p): New function. diff --git a/src/buffer.c b/src/buffer.c index fcb842de83c..3502afc9bf0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -146,6 +146,9 @@ Lisp_Object Vinhibit_read_only; Lisp_Object Vkill_buffer_query_functions; Lisp_Object Qkill_buffer_query_functions; +/* Hook run before changing a major mode. */ +Lisp_Object Vchange_major_mode_hook, Qchange_major_mode_hook; + /* List of functions to call before changing an unmodified buffer. */ Lisp_Object Vfirst_change_hook; @@ -2386,7 +2389,7 @@ the normal hook `change-major-mode-hook'. */) Lisp_Object oalist; if (!NILP (Vrun_hooks)) - call1 (Vrun_hooks, intern ("change-major-mode-hook")); + call1 (Vrun_hooks, Qchange_major_mode_hook); oalist = current_buffer->local_var_alist; /* Make sure none of the bindings in oalist @@ -5998,6 +6001,13 @@ t means to use hollow box cursor. See `cursor-type' for other values. */); doc: /* List of functions called with no args to query before killing a buffer. */); Vkill_buffer_query_functions = Qnil; + DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook, + doc: /* Normal hook run before changing the major mode of a buffer. +The function `kill-all-local-variables' runs this before doing anything else. */); + Vchange_major_mode_hook = Qnil; + Qchange_major_mode_hook = intern ("change-major-mode-hook"); + staticpro (&Qchange_major_mode_hook); + defsubr (&Sbuffer_live_p); defsubr (&Sbuffer_list); defsubr (&Sget_buffer); From 2f057fa7c1f20a1206b234cbfd30be5ce5917468 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 6 Aug 2006 14:23:55 +0000 Subject: [PATCH 040/153] "standard-value for mode-line-format" bug fixed. --- admin/FOR-RELEASE | 7 ------- 1 file changed, 7 deletions(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 698fea62a25..2cae3a71b1b 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -31,13 +31,6 @@ and KDE projects, to use the new Emacs icons in etc/images/icons. * BUGS -** lennart.borgman July 27: Custom and mode-line-format default - M-x customize-option RET mode-line-format RET - -and then click the button "Erase Customization". This will set -mode-line-format to "%-" which does not seem to be useful. - - ** Markus Gritsch's report about Emacs looping on Windoze with the following .emacs file, and then reduce Emacs frame width to "something quite narrow": (setq-default truncate-lines t) From b5bc193f309eadf04e02e5b1c9596fb07a456baf Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 7 Aug 2006 07:43:25 +0000 Subject: [PATCH 041/153] Update from erc--emacs--22 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-386 Creator: Michael Olson --- lisp/erc/ChangeLog | 17 +++++++++++++++++ lisp/erc/erc-log.el | 22 +++++++++++++++------- lisp/erc/erc.el | 18 +++++++++--------- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 0129bd43976..cd5b825b71e 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,20 @@ +2006-08-06 Michael Olson + + * erc.el (erc-arrange-session-in-multiple-windows): Fix bug with + multi-tty Emacs. + +2006-08-05 Michael Olson + + * erc-log.el (erc-log-standardize-name): New function that returns + a filename that is safe for use for a log file. + (erc-current-logfile): Use it. + + * erc.el (erc-startup-file-list): Search in ~/.emacs.d first, + since that is a fairly standard directory. + (erc-select-startup-file): Re-write to use + convert-standard-filename, which will ensure that MS-DOS systems + look for the _ercrc.el file. + 2006-08-02 Michael Olson * erc.el (erc-version-string): Release ERC 5.1.4. diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 418e45060bd..2fe29e82fe5 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -71,8 +71,6 @@ ;; markers. ;;; TODO: -;; * Erc needs a generalised make-safe-file-name function, so that -;; generated file names don't contain any invalid file characters. ;; ;; * Really, we need to lock the logfiles somehow, so that if a user ;; is running multiple emacsen and/or on the same channel as more @@ -293,17 +291,27 @@ is writeable (it will be created as necessary) and (funcall erc-enable-logging (or buffer (current-buffer))) erc-enable-logging))) +(defun erc-log-standardize-name (filename) + "Make FILENAME safe to use as the name of an ERC log. +This will not work with full paths, only names. + +Any unsafe characters in the name are replaced with \"!\". The +filename is downcased." + (downcase (erc-replace-regexp-in-string + "[/\\]" "!" (convert-standard-filename filename)))) + (defun erc-current-logfile (&optional buffer) "Return the logfile to use for BUFFER. If BUFFER is nil, the value of `current-buffer' is used. This is determined by `erc-generate-log-file-name-function'. The result is converted to lowercase, as IRC is case-insensitive" (expand-file-name - (downcase (funcall erc-generate-log-file-name-function - (or buffer (current-buffer)) - (or (erc-default-target) (buffer-name buffer)) - (erc-current-nick) - erc-session-server erc-session-port)) + (erc-log-standardize-name + (funcall erc-generate-log-file-name-function + (or buffer (current-buffer)) + (or (erc-default-target) (buffer-name buffer)) + (erc-current-nick) + erc-session-server erc-session-port)) erc-log-channels-directory)) (defun erc-generate-log-file-name-with-date (buffer &rest ignore) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 4317b831d56..bd31ee3d3b7 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -822,7 +822,8 @@ See `erc-server-flood-margin' for other flood-related parameters.") ;; Script parameters (defcustom erc-startup-file-list - '("~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") + '("~/.emacs.d/.ercrc.el" "~/.emacs.d/.ercrc" + "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") "List of files to try for a startup script. The first existent and readable one will get executed. @@ -5241,13 +5242,11 @@ If FILE is found, return the path to it." (defun erc-select-startup-file () "Select an ERC startup file. See also `erc-startup-file-list'." - (let ((l erc-startup-file-list) - (f nil)) - (while (and (not f) l) - (if (file-readable-p (car l)) - (setq f (car l))) - (setq l (cdr l))) - f)) + (catch 'found + (dolist (f erc-startup-file-list) + (setq f (convert-standard-file-name f)) + (when (file-readable-p f) + (throw 'found f))))) (defun erc-find-script-file (file) "Search for FILE in `default-directory', and any in `erc-script-path'." @@ -5894,7 +5893,8 @@ All windows are opened in the current frame." (setq bufs (cdr bufs)) (while bufs (split-window) - (switch-to-buffer-other-window (car bufs)) + (other-window 1) + (switch-to-buffer (car bufs)) (setq bufs (cdr bufs)) (balance-windows))))) From 26cced449af1c57c8a674aaafdbc6d57ef28cf57 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 7 Aug 2006 07:43:37 +0000 Subject: [PATCH 042/153] Fix ERC bug introduced in last patch Revision: emacs@sv.gnu.org/emacs--devo--0--patch-387 Creator: Michael Olson --- lisp/erc/ChangeLog | 1 + lisp/erc/erc.el | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index cd5b825b71e..b495eda20f1 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -2,6 +2,7 @@ * erc.el (erc-arrange-session-in-multiple-windows): Fix bug with multi-tty Emacs. + (erc-select-startup-file): Fix bug introduced by recent change. 2006-08-05 Michael Olson diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index bd31ee3d3b7..726d02ed613 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -5244,7 +5244,7 @@ If FILE is found, return the path to it." See also `erc-startup-file-list'." (catch 'found (dolist (f erc-startup-file-list) - (setq f (convert-standard-file-name f)) + (setq f (convert-standard-filename f)) (when (file-readable-p f) (throw 'found f))))) From f2c056984949eb4f9be66ad05a9ad865752ffa06 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 7 Aug 2006 07:43:48 +0000 Subject: [PATCH 043/153] Update from erc--emacs--22 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-388 Creator: Michael Olson --- lisp/erc/ChangeLog | 15 +++++++++++++++ lisp/erc/erc-backend.el | 15 ++++----------- lisp/erc/erc.el | 21 ++++++++++++++------- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index b495eda20f1..522e4623d63 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,18 @@ +2006-08-07 Michael Olson + + * erc-backend.el (erc-process-sentinel-1): Use erc-display-message + in several places instead of inserting text. + (erc-process-sentinel): Move to the input-marker before removing + the prompt. + + * erc.el (erc-port): Fix customization options. + (erc-display-message): Handle null type explicitly. Previously, + this was relying on a chance side-effect. Cosmetic indentation + tweak. + (english): Add 'finished and 'terminated entries to the catalog. + Add initial and terminal newlines to 'disconnected and + 'disconnected-noreconnect entries. Avoid long lines. + 2006-08-06 Michael Olson * erc.el (erc-arrange-session-in-multiple-windows): Fix bug with diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 705ca7a9e63..5acbcb05ab8 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -493,11 +493,7 @@ action." (if erc-server-quitting ;; normal quit (progn - (let ((string "\n\n*** ERC finished ***\n") - (inhibit-read-only t)) - (erc-put-text-property 0 (length string) - 'face 'erc-error-face string) - (insert string)) + (erc-display-message nil 'error (current-buffer) 'finished) (when erc-kill-server-buffer-on-quit (set-buffer-modified-p nil) (kill-buffer (current-buffer)))) @@ -519,12 +515,8 @@ action." (erc erc-session-server erc-session-port erc-server-current-nick erc-session-user-full-name t erc-session-password) ;; terminate, do not reconnect - (let ((string (concat "\n\n*** ERC terminated: " event - "\n")) - (inhibit-read-only t)) - (erc-put-text-property 0 (length string) - 'face 'erc-error-face string) - (insert string))))) + (erc-display-message nil 'error (current-buffer) + 'terminated ?e event)))) (defun erc-process-sentinel (cproc event) "Sentinel function for ERC process." @@ -545,6 +537,7 @@ action." (run-hook-with-args 'erc-disconnected-hook (erc-current-nick) (system-name) "") ;; Remove the prompt + (goto-char (or (marker-position erc-input-marker) (point-max))) (forward-line 0) (erc-remove-text-properties-region (point) (point-max)) (delete-region (point) (point-max)) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 726d02ed613..41d59576251 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -157,8 +157,8 @@ parameters and authentication." This can be either a string or a number." :group 'erc :type '(choice (const :tag "None" nil) - (const :tag "Port number" number) - (const :tag "Port string" string))) + (integer :tag "Port number") + (string :tag "Port string"))) (defcustom erc-nick nil "Nickname to use if one is not provided. @@ -2363,6 +2363,8 @@ See also `erc-format-message' and `erc-display-line'." msg))) (setq string (cond + ((null type) + string) ((listp type) (mapc (lambda (type) (setq string @@ -2375,7 +2377,7 @@ See also `erc-format-message' and `erc-display-line'." (if (not (erc-response-p parsed)) (erc-display-line string buffer) (unless (member (erc-response.command parsed) erc-hide-list) - (erc-put-text-property 0 (length string) 'erc-parsed parsed string) + (erc-put-text-property 0 (length string) 'erc-parsed parsed string) (erc-put-text-property 0 (length string) 'rear-sticky t string) (erc-display-line string buffer))))) @@ -5946,12 +5948,17 @@ All windows are opened in the current frame." (ctcp-request-to . "==> CTCP request from %n (%u@%h) to %t: %r") (ctcp-too-many . "Too many CTCP queries in single message. Ignoring") (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.") - (flood-strict-mode . "FLOOD PROTECTION: Switched to Strict Flood Control mode.") - (disconnected . "Connection failed! Re-establishing connection...") - (disconnected-noreconnect . "Connection failed! Not re-establishing connection.") + (flood-strict-mode + . "FLOOD PROTECTION: Switched to Strict Flood Control mode.") + (disconnected . "\n\nConnection failed! Re-establishing connection...\n") + (disconnected-noreconnect + . "\n\nConnection failed! Not re-establishing connection.\n") + (finished . "\n\n*** ERC finished ***\n") + (terminated . "\n\n*** ERC terminated: %e\n") (login . "Logging in as \'%n\'...") (nick-in-use . "%n is in use. Choose new nickname: ") - (nick-too-long . "WARNING: Nick length (%i) exceeds max NICKLEN(%l) defined by server") + (nick-too-long + . "WARNING: Nick length (%i) exceeds max NICKLEN(%l) defined by server") (no-default-channel . "No default channel") (no-invitation . "You've got no invitation") (no-target . "No target") From 34e5974a22ec15f2baa2364b8fea18609fdfb690 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 7 Aug 2006 13:39:53 +0000 Subject: [PATCH 044/153] * modes.texi (Hooks): Clarify. (Major Mode Basics): Mention define-derived-mode explicitly. (Major Mode Conventions): Rebinding RET is OK for some modes. Mention change-major-mode-hook and after-change-major-mode-hook. (Example Major Modes): Moved to end of Modes section. (Mode Line Basics): Clarify. (Mode Line Data): Mention help-echo and local-map in strings. Explain reason for treatment of non-risky variables. (Properties in Mode): Clarify. (Faces for Font Lock): Add font-lock-negation-char-face. --- lispref/ChangeLog | 13 + lispref/modes.texi | 697 +++++++++++++++++++++++---------------------- 2 files changed, 365 insertions(+), 345 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index eb1fd9797c2..8c963512d2f 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,16 @@ +2006-08-07 Chong Yidong + + * modes.texi (Hooks): Clarify. + (Major Mode Basics): Mention define-derived-mode explicitly. + (Major Mode Conventions): Rebinding RET is OK for some modes. + Mention change-major-mode-hook and after-change-major-mode-hook. + (Example Major Modes): Moved to end of Modes section. + (Mode Line Basics): Clarify. + (Mode Line Data): Mention help-echo and local-map in strings. + Explain reason for treatment of non-risky variables. + (Properties in Mode): Clarify. + (Faces for Font Lock): Add font-lock-negation-char-face. + 2006-08-04 Eli Zaretskii * strings.texi (Formatting Strings): Warn against arbitrary diff --git a/lispref/modes.texi b/lispref/modes.texi index 8b24db35621..e0953c403b2 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi @@ -43,18 +43,19 @@ up in the init file (@pxref{Init File}), but Lisp programs can set them also. @cindex normal hook Most of the hooks in Emacs are @dfn{normal hooks}. These variables -contain lists of functions to be called with no arguments. When the -hook name ends in @samp{-hook}, that tells you it is normal. We try to -make all hooks normal, as much as possible, so that you can use them in -a uniform way. +contain lists of functions to be called with no arguments. By +convention, whenever the hook name ends in @samp{-hook}, that tells +you it is normal. We try to make all hooks normal, as much as +possible, so that you can use them in a uniform way. - Every major mode function is supposed to run a normal hook called the -@dfn{mode hook} as the last step of initialization. This makes it easy -for a user to customize the behavior of the mode, by overriding the -buffer-local variable assignments already made by the mode. Most -minor modes also run a mode hook at their end. But hooks are used in -other contexts too. For example, the hook @code{suspend-hook} runs -just before Emacs suspends itself (@pxref{Suspending Emacs}). + Every major mode function is supposed to run a normal hook called +the @dfn{mode hook} as the one of the last steps of initialization. +This makes it easy for a user to customize the behavior of the mode, +by overriding the buffer-local variable assignments already made by +the mode. Most minor modes also run a mode hook at their end. But +hooks are used in other contexts too. For example, the hook +@code{suspend-hook} runs just before Emacs suspends itself +(@pxref{Suspending Emacs}). The recommended way to add a hook function to a normal hook is by calling @code{add-hook} (see below). The hook functions may be any of @@ -68,14 +69,11 @@ globally or buffer-locally with @code{add-hook}. indicates it is probably an @dfn{abnormal hook}. Then you should look at its documentation to see how to use the hook properly. - If the variable's name ends in @samp{-functions} or @samp{-hooks}, -then the value is a list of functions, but it is abnormal in that either -these functions are called with arguments or their values are used in -some way. You can use @code{add-hook} to add a function to the list, -but you must take care in writing the function. (A few of these -variables, notably those ending in @samp{-hooks}, are actually -normal hooks which were named before we established the convention of -using @samp{-hook} for them.) + @dfn{Abnormal hooks} are hooks in which the functions are called +with arguments, or the return values are used in some way. By +convention, abnormal hook names end in @samp{-functions} or +@samp{-hooks}. You can use @code{add-hook} to add a function to the +list, but you must take care in writing the function. If the variable's name ends in @samp{-function}, then its value is just a single function, not a list of functions. @@ -96,12 +94,13 @@ arguments, and runs each hook in turn. Each argument should be a symbol that is a normal hook variable. These arguments are processed in the order specified. -If a hook variable has a non-@code{nil} value, that value may be a -function or a list of functions. (The former option is considered -obsolete.) If the value is a function (either a lambda expression or -a symbol with a function definition), it is called. If it is a list -that isn't a function, its elements are called, consecutively. All -the hook functions are called with no arguments. +If a hook variable has a non-@code{nil} value, that value should be a +list of functions. Each function in this list is called, +consecutively, with no arguments. + +A hook variable can also be a single function (either a lambda +expression or a symbol with a function definition) to be called. This +use is considered obsolete. @end defun @defun run-hook-with-args hook &rest args @@ -187,7 +186,6 @@ to another major mode in the same buffer. @menu * Major Mode Basics:: * Major Mode Conventions:: Coding conventions for keymaps, etc. -* Example Major Modes:: Text mode and Lisp modes. * Auto Major Mode:: How Emacs chooses the major mode automatically. * Mode Help:: Finding out how to use a mode. * Derived Modes:: Defining a new major mode based on another major @@ -195,6 +193,7 @@ to another major mode in the same buffer. * Generic Modes:: Defining a simple major mode that supports comment syntax and Font Lock mode. * Mode Hooks:: Hooks run at the end of major mode functions. +* Example Major Modes:: Text mode and Lisp modes. @end menu @node Major Mode Basics @@ -214,14 +213,14 @@ specialized editing task, creating a new major mode is usually a good idea. In practice, writing a major mode is easy (in contrast to writing a minor mode, which is often difficult). - If the new mode is similar to an old one, it is often unwise to modify -the old one to serve two purposes, since it may become harder to use and -maintain. Instead, copy and rename an existing major mode definition -and alter the copy---or define a @dfn{derived mode} (@pxref{Derived -Modes}). For example, Rmail Edit mode, which is in -@file{emacs/lisp/mail/rmailedit.el}, is a major mode that is very similar to -Text mode except that it provides two additional commands. Its -definition is distinct from that of Text mode, but uses that of Text mode. + If the new mode is similar to an old one, it is often unwise to +modify the old one to serve two purposes, since it may become harder +to use and maintain. Instead, copy and rename an existing major mode +definition and alter the copy---or use @code{define-derived-mode} to +define a @dfn{derived mode} (@pxref{Derived Modes}). For example, +Rmail Edit mode is a major mode that is very similar to Text mode +except that it provides two additional commands. Its definition is +distinct from that of Text mode, but uses that of Text mode. Even if the new mode is not an obvious derivative of any other mode, it is convenient to use @code{define-derived-mode} with a @code{nil} @@ -287,8 +286,10 @@ Documentation}. @item The major mode command should start by calling -@code{kill-all-local-variables}. This is what gets rid of the -buffer-local variables of the major mode previously in effect. +@code{kill-all-local-variables}. This runs the normal hook +@code{change-major-mode-hook}, then gets rid of the buffer-local +variables of the major mode previously in effect. @xref{Creating +Buffer-Local}. @item The major mode command should set the variable @code{major-mode} to the @@ -355,9 +356,10 @@ 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 -a newline. The command to insert a newline and then indent is -@kbd{C-j}. Please keep this distinction uniform for all major modes. +Major modes modes for editing text should not define @key{RET} to do +anything other than insert a newline. The command to insert a newline +and then indent is @kbd{C-j}. It is ok for more specialized modes, +such as Info mode, to redefine @key{RET} to something else. @item Major modes should not alter options that are primarily a matter of user @@ -427,10 +429,11 @@ other packages would interfere with them. @item @cindex mode hook @cindex major mode hook -Each major mode should have a @dfn{mode hook} named -@code{@var{modename}-mode-hook}. The major mode command should run that -hook, with @code{run-mode-hooks}, as the very last thing it -does. @xref{Mode Hooks}. +Each major mode should have a normal @dfn{mode hook} named +@code{@var{modename}-mode-hook}. The very last thing the major mode command +should do is to call @code{run-mode-hooks}. This runs the mode hook, +and then runs the normal hook @code{after-change-major-mode-hook}. +@xref{Mode Hooks}. @item The major mode command may start by calling some other major mode @@ -488,281 +491,6 @@ that they may be evaluated more than once without adverse consequences. Even if you never load the file more than once, someone else will. @end itemize -@node Example Major Modes -@subsection Major Mode Examples - - Text mode is perhaps the simplest mode besides Fundamental mode. -Here are excerpts from @file{text-mode.el} that illustrate many of -the conventions listed above: - -@smallexample -@group -;; @r{Create the syntax table for this mode.} -(defvar text-mode-syntax-table - (let ((st (make-syntax-table))) - (modify-syntax-entry ?\" ". " st) - (modify-syntax-entry ?\\ ". " st) - ;; Add `p' so M-c on `hello' leads to `Hello', not `hello'. - (modify-syntax-entry ?' "w p" st) - st) - "Syntax table used while in `text-mode'.") -@end group - -;; @r{Create the keymap for this mode.} -@group -(defvar text-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "\e\t" 'ispell-complete-word) - (define-key map "\es" 'center-line) - (define-key map "\eS" 'center-paragraph) - map) - "Keymap for `text-mode'. -Many other modes, such as Mail mode, Outline mode -and Indented Text mode, inherit all the commands -defined in this map.") -@end group -@end smallexample - - Here is how the actual mode command is defined now: - -@smallexample -@group -(define-derived-mode text-mode nil "Text" - "Major mode for editing text written for humans to read. -In this mode, paragraphs are delimited only by blank or white lines. -You can thus get the full benefit of adaptive filling - (see the variable `adaptive-fill-mode'). -\\@{text-mode-map@} -Turning on Text mode runs the normal hook `text-mode-hook'." -@end group -@group - (make-local-variable 'text-mode-variant) - (setq text-mode-variant t) - ;; @r{These two lines are a feature added recently.} - (set (make-local-variable 'require-final-newline) - mode-require-final-newline) - (set (make-local-variable 'indent-line-function) 'indent-relative)) -@end group -@end smallexample - - But here is how it was defined formerly, before -@code{define-derived-mode} existed: - -@smallexample -@group -;; @r{This isn't needed nowadays, since @code{define-derived-mode} does it.} -(defvar text-mode-abbrev-table nil - "Abbrev table used while in text mode.") -(define-abbrev-table 'text-mode-abbrev-table ()) -@end group - -@group -(defun text-mode () - "Major mode for editing text intended for humans to read... - Special commands: \\@{text-mode-map@} -@end group -@group -Turning on text-mode runs the hook `text-mode-hook'." - (interactive) - (kill-all-local-variables) - (use-local-map text-mode-map) -@end group -@group - (setq local-abbrev-table text-mode-abbrev-table) - (set-syntax-table text-mode-syntax-table) -@end group -@group - ;; @r{These four lines are absent from the current version} - ;; @r{not because this is done some other way, but rather} - ;; @r{because nowadays Text mode uses the normal definition of paragraphs.} - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat "[ \t]*$\\|" page-delimiter)) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate paragraph-start) - (make-local-variable 'indent-line-function) - (setq indent-line-function 'indent-relative-maybe) -@end group -@group - (setq mode-name "Text") - (setq major-mode 'text-mode) - (run-mode-hooks 'text-mode-hook)) ; @r{Finally, this permits the user to} - ; @r{customize the mode with a hook.} -@end group -@end smallexample - -@cindex @file{lisp-mode.el} - The three Lisp modes (Lisp mode, Emacs Lisp mode, and Lisp -Interaction mode) have more features than Text mode and the code is -correspondingly more complicated. Here are excerpts from -@file{lisp-mode.el} that illustrate how these modes are written. - -@cindex syntax table example -@smallexample -@group -;; @r{Create mode-specific table variables.} -(defvar lisp-mode-syntax-table nil "") -(defvar lisp-mode-abbrev-table nil "") -@end group - -@group -(defvar emacs-lisp-mode-syntax-table - (let ((table (make-syntax-table))) - (let ((i 0)) -@end group - -@group - ;; @r{Set syntax of chars up to @samp{0} to say they are} - ;; @r{part of symbol names but not words.} - ;; @r{(The digit @samp{0} is @code{48} in the @acronym{ASCII} character set.)} - (while (< i ?0) - (modify-syntax-entry i "_ " table) - (setq i (1+ i))) - ;; @r{@dots{} similar code follows for other character ranges.} -@end group -@group - ;; @r{Then set the syntax codes for characters that are special in Lisp.} - (modify-syntax-entry ? " " table) - (modify-syntax-entry ?\t " " table) - (modify-syntax-entry ?\f " " table) - (modify-syntax-entry ?\n "> " table) -@end group -@group - ;; @r{Give CR the same syntax as newline, for selective-display.} - (modify-syntax-entry ?\^m "> " table) - (modify-syntax-entry ?\; "< " table) - (modify-syntax-entry ?` "' " table) - (modify-syntax-entry ?' "' " table) - (modify-syntax-entry ?, "' " table) -@end group -@group - ;; @r{@dots{}likewise for many other characters@dots{}} - (modify-syntax-entry ?\( "() " table) - (modify-syntax-entry ?\) ")( " table) - (modify-syntax-entry ?\[ "(] " table) - (modify-syntax-entry ?\] ")[ " table)) - table)) -@end group -@group -;; @r{Create an abbrev table for lisp-mode.} -(define-abbrev-table 'lisp-mode-abbrev-table ()) -@end group -@end smallexample - - Much code is shared among the three Lisp modes. The following -function sets various variables; it is called by each of the major Lisp -mode functions: - -@smallexample -@group -(defun lisp-mode-variables (lisp-syntax) - (when lisp-syntax - (set-syntax-table lisp-mode-syntax-table)) - (setq local-abbrev-table lisp-mode-abbrev-table) - @dots{} -@end group -@end smallexample - - Functions such as @code{forward-paragraph} use the value of the -@code{paragraph-start} variable. Since Lisp code is different from -ordinary text, the @code{paragraph-start} variable needs to be set -specially to handle Lisp. Also, comments are indented in a special -fashion in Lisp and the Lisp modes need their own mode-specific -@code{comment-indent-function}. The code to set these variables is the -rest of @code{lisp-mode-variables}. - -@smallexample -@group - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat page-delimiter "\\|$" )) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate paragraph-start) - @dots{} -@end group -@group - (make-local-variable 'comment-indent-function) - (setq comment-indent-function 'lisp-comment-indent)) - @dots{} -@end group -@end smallexample - - Each of the different Lisp modes has a slightly different keymap. For -example, Lisp mode binds @kbd{C-c C-z} to @code{run-lisp}, but the other -Lisp modes do not. However, all Lisp modes have some commands in -common. The following code sets up the common commands: - -@smallexample -@group -(defvar shared-lisp-mode-map () - "Keymap for commands shared by all sorts of Lisp modes.") - -;; @r{Putting this @code{if} after the @code{defvar} is an older style.} -(if shared-lisp-mode-map - () - (setq shared-lisp-mode-map (make-sparse-keymap)) - (define-key shared-lisp-mode-map "\e\C-q" 'indent-sexp) - (define-key shared-lisp-mode-map "\177" - 'backward-delete-char-untabify)) -@end group -@end smallexample - -@noindent -And here is the code to set up the keymap for Lisp mode: - -@smallexample -@group -(defvar lisp-mode-map () - "Keymap for ordinary Lisp mode...") - -(if lisp-mode-map - () - (setq lisp-mode-map (make-sparse-keymap)) - (set-keymap-parent lisp-mode-map shared-lisp-mode-map) - (define-key lisp-mode-map "\e\C-x" 'lisp-eval-defun) - (define-key lisp-mode-map "\C-c\C-z" 'run-lisp)) -@end group -@end smallexample - - Finally, here is the complete major mode function definition for -Lisp mode. - -@smallexample -@group -(defun lisp-mode () - "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. -Commands: -Delete converts tabs to spaces as it moves back. -Blank lines separate paragraphs. Semicolons start comments. -\\@{lisp-mode-map@} -Note that `run-lisp' may be used either to start an inferior Lisp job -or to switch back to an existing one. -@end group - -@group -Entry to this mode calls the value of `lisp-mode-hook' -if that value is non-nil." - (interactive) - (kill-all-local-variables) -@end group -@group - (use-local-map lisp-mode-map) ; @r{Select the mode's keymap.} - (setq major-mode 'lisp-mode) ; @r{This is how @code{describe-mode}} - ; @r{finds out what to describe.} - (setq mode-name "Lisp") ; @r{This goes into the mode line.} - (lisp-mode-variables t) ; @r{This defines various variables.} - (make-local-variable 'comment-start-skip) - (setq comment-start-skip - "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") - (make-local-variable 'font-lock-keywords-case-fold-search) - (setq font-lock-keywords-case-fold-search t) -@end group -@group - (setq imenu-case-fold-search t) - (set-syntax-table lisp-mode-syntax-table) - (run-mode-hooks 'lisp-mode-hook)) ; @r{This permits the user to use a} - ; @r{hook to customize the mode.} -@end group -@end smallexample - @node Auto Major Mode @subsection How Emacs Chooses a Major Mode @@ -1074,10 +802,9 @@ Do not write an @code{interactive} spec in the definition; @cindex generic mode @dfn{Generic modes} are simple major modes with basic support for -comment syntax and Font Lock mode. They are primarily useful for -configuration files. To define a generic mode, use the macro -@code{define-generic-mode}. See the file @file{generic-x.el} for some -examples of the use of @code{define-generic-mode}. +comment syntax and Font Lock mode. To define a generic mode, use the +macro @code{define-generic-mode}. See the file @file{generic-x.el} +for some examples of the use of @code{define-generic-mode}. @defmac define-generic-mode mode comment-list keyword-list font-lock-list auto-mode-list function-list &optional docstring This macro creates a new generic mode. The argument @var{mode} (an @@ -1171,6 +898,281 @@ as the very last thing it does, and the last thing @code{run-mode-hooks} does is run @code{after-change-major-mode-hook}. @end defvar +@node Example Major Modes +@subsection Major Mode Examples + + Text mode is perhaps the simplest mode besides Fundamental mode. +Here are excerpts from @file{text-mode.el} that illustrate many of +the conventions listed above: + +@smallexample +@group +;; @r{Create the syntax table for this mode.} +(defvar text-mode-syntax-table + (let ((st (make-syntax-table))) + (modify-syntax-entry ?\" ". " st) + (modify-syntax-entry ?\\ ". " st) + ;; Add `p' so M-c on `hello' leads to `Hello', not `hello'. + (modify-syntax-entry ?' "w p" st) + st) + "Syntax table used while in `text-mode'.") +@end group + +;; @r{Create the keymap for this mode.} +@group +(defvar text-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\e\t" 'ispell-complete-word) + (define-key map "\es" 'center-line) + (define-key map "\eS" 'center-paragraph) + map) + "Keymap for `text-mode'. +Many other modes, such as Mail mode, Outline mode +and Indented Text mode, inherit all the commands +defined in this map.") +@end group +@end smallexample + + Here is how the actual mode command is defined now: + +@smallexample +@group +(define-derived-mode text-mode nil "Text" + "Major mode for editing text written for humans to read. +In this mode, paragraphs are delimited only by blank or white lines. +You can thus get the full benefit of adaptive filling + (see the variable `adaptive-fill-mode'). +\\@{text-mode-map@} +Turning on Text mode runs the normal hook `text-mode-hook'." +@end group +@group + (make-local-variable 'text-mode-variant) + (setq text-mode-variant t) + ;; @r{These two lines are a feature added recently.} + (set (make-local-variable 'require-final-newline) + mode-require-final-newline) + (set (make-local-variable 'indent-line-function) 'indent-relative)) +@end group +@end smallexample + + But here is how it was defined formerly, before +@code{define-derived-mode} existed: + +@smallexample +@group +;; @r{This isn't needed nowadays, since @code{define-derived-mode} does it.} +(defvar text-mode-abbrev-table nil + "Abbrev table used while in text mode.") +(define-abbrev-table 'text-mode-abbrev-table ()) +@end group + +@group +(defun text-mode () + "Major mode for editing text intended for humans to read... + Special commands: \\@{text-mode-map@} +@end group +@group +Turning on text-mode runs the hook `text-mode-hook'." + (interactive) + (kill-all-local-variables) + (use-local-map text-mode-map) +@end group +@group + (setq local-abbrev-table text-mode-abbrev-table) + (set-syntax-table text-mode-syntax-table) +@end group +@group + ;; @r{These four lines are absent from the current version} + ;; @r{not because this is done some other way, but rather} + ;; @r{because nowadays Text mode uses the normal definition of paragraphs.} + (make-local-variable 'paragraph-start) + (setq paragraph-start (concat "[ \t]*$\\|" page-delimiter)) + (make-local-variable 'paragraph-separate) + (setq paragraph-separate paragraph-start) + (make-local-variable 'indent-line-function) + (setq indent-line-function 'indent-relative-maybe) +@end group +@group + (setq mode-name "Text") + (setq major-mode 'text-mode) + (run-mode-hooks 'text-mode-hook)) ; @r{Finally, this permits the user to} + ; @r{customize the mode with a hook.} +@end group +@end smallexample + +@cindex @file{lisp-mode.el} + The three Lisp modes (Lisp mode, Emacs Lisp mode, and Lisp +Interaction mode) have more features than Text mode and the code is +correspondingly more complicated. Here are excerpts from +@file{lisp-mode.el} that illustrate how these modes are written. + +@cindex syntax table example +@smallexample +@group +;; @r{Create mode-specific table variables.} +(defvar lisp-mode-syntax-table nil "") +(defvar lisp-mode-abbrev-table nil "") +@end group + +@group +(defvar emacs-lisp-mode-syntax-table + (let ((table (make-syntax-table))) + (let ((i 0)) +@end group + +@group + ;; @r{Set syntax of chars up to @samp{0} to say they are} + ;; @r{part of symbol names but not words.} + ;; @r{(The digit @samp{0} is @code{48} in the @acronym{ASCII} character set.)} + (while (< i ?0) + (modify-syntax-entry i "_ " table) + (setq i (1+ i))) + ;; @r{@dots{} similar code follows for other character ranges.} +@end group +@group + ;; @r{Then set the syntax codes for characters that are special in Lisp.} + (modify-syntax-entry ? " " table) + (modify-syntax-entry ?\t " " table) + (modify-syntax-entry ?\f " " table) + (modify-syntax-entry ?\n "> " table) +@end group +@group + ;; @r{Give CR the same syntax as newline, for selective-display.} + (modify-syntax-entry ?\^m "> " table) + (modify-syntax-entry ?\; "< " table) + (modify-syntax-entry ?` "' " table) + (modify-syntax-entry ?' "' " table) + (modify-syntax-entry ?, "' " table) +@end group +@group + ;; @r{@dots{}likewise for many other characters@dots{}} + (modify-syntax-entry ?\( "() " table) + (modify-syntax-entry ?\) ")( " table) + (modify-syntax-entry ?\[ "(] " table) + (modify-syntax-entry ?\] ")[ " table)) + table)) +@end group +@group +;; @r{Create an abbrev table for lisp-mode.} +(define-abbrev-table 'lisp-mode-abbrev-table ()) +@end group +@end smallexample + + Much code is shared among the three Lisp modes. The following +function sets various variables; it is called by each of the major Lisp +mode functions: + +@smallexample +@group +(defun lisp-mode-variables (lisp-syntax) + (when lisp-syntax + (set-syntax-table lisp-mode-syntax-table)) + (setq local-abbrev-table lisp-mode-abbrev-table) + @dots{} +@end group +@end smallexample + + Functions such as @code{forward-paragraph} use the value of the +@code{paragraph-start} variable. Since Lisp code is different from +ordinary text, the @code{paragraph-start} variable needs to be set +specially to handle Lisp. Also, comments are indented in a special +fashion in Lisp and the Lisp modes need their own mode-specific +@code{comment-indent-function}. The code to set these variables is the +rest of @code{lisp-mode-variables}. + +@smallexample +@group + (make-local-variable 'paragraph-start) + (setq paragraph-start (concat page-delimiter "\\|$" )) + (make-local-variable 'paragraph-separate) + (setq paragraph-separate paragraph-start) + @dots{} +@end group +@group + (make-local-variable 'comment-indent-function) + (setq comment-indent-function 'lisp-comment-indent)) + @dots{} +@end group +@end smallexample + + Each of the different Lisp modes has a slightly different keymap. For +example, Lisp mode binds @kbd{C-c C-z} to @code{run-lisp}, but the other +Lisp modes do not. However, all Lisp modes have some commands in +common. The following code sets up the common commands: + +@smallexample +@group +(defvar shared-lisp-mode-map () + "Keymap for commands shared by all sorts of Lisp modes.") + +;; @r{Putting this @code{if} after the @code{defvar} is an older style.} +(if shared-lisp-mode-map + () + (setq shared-lisp-mode-map (make-sparse-keymap)) + (define-key shared-lisp-mode-map "\e\C-q" 'indent-sexp) + (define-key shared-lisp-mode-map "\177" + 'backward-delete-char-untabify)) +@end group +@end smallexample + +@noindent +And here is the code to set up the keymap for Lisp mode: + +@smallexample +@group +(defvar lisp-mode-map () + "Keymap for ordinary Lisp mode...") + +(if lisp-mode-map + () + (setq lisp-mode-map (make-sparse-keymap)) + (set-keymap-parent lisp-mode-map shared-lisp-mode-map) + (define-key lisp-mode-map "\e\C-x" 'lisp-eval-defun) + (define-key lisp-mode-map "\C-c\C-z" 'run-lisp)) +@end group +@end smallexample + + Finally, here is the complete major mode function definition for +Lisp mode. + +@smallexample +@group +(defun lisp-mode () + "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. +Commands: +Delete converts tabs to spaces as it moves back. +Blank lines separate paragraphs. Semicolons start comments. +\\@{lisp-mode-map@} +Note that `run-lisp' may be used either to start an inferior Lisp job +or to switch back to an existing one. +@end group + +@group +Entry to this mode calls the value of `lisp-mode-hook' +if that value is non-nil." + (interactive) + (kill-all-local-variables) +@end group +@group + (use-local-map lisp-mode-map) ; @r{Select the mode's keymap.} + (setq major-mode 'lisp-mode) ; @r{This is how @code{describe-mode}} + ; @r{finds out what to describe.} + (setq mode-name "Lisp") ; @r{This goes into the mode line.} + (lisp-mode-variables t) ; @r{This defines various variables.} + (make-local-variable 'comment-start-skip) + (setq comment-start-skip + "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") + (make-local-variable 'font-lock-keywords-case-fold-search) + (setq font-lock-keywords-case-fold-search t) +@end group +@group + (setq imenu-case-fold-search t) + (set-syntax-table lisp-mode-syntax-table) + (run-mode-hooks 'lisp-mode-hook)) ; @r{This permits the user to use a} + ; @r{hook to customize the mode.} +@end group +@end smallexample + @node Minor Modes @section Minor Modes @cindex minor mode @@ -1533,16 +1535,14 @@ minor modes. @subsection Mode Line Basics @code{mode-line-format} is a buffer-local variable that holds a -@dfn{mode line construct}, a kind of template, which controls the -display the mode line of the current buffer. All windows for the same -buffer use the same @code{mode-line-format}, so their mode lines -appear the same---except for scrolling percentages, and line and -column numbers, since those depend on point and on how the window is -scrolled. The value of @code{header-line-format} specifies the -buffer's header line in the same way, with a mode line construct. +@dfn{mode line construct}, a kind of template, which controls what is +displayed on the mode line of the current buffer. The value of +@code{header-line-format} specifies the buffer's header line in the +same way. All windows for the same buffer use the same +@code{mode-line-format} and @code{header-line-format}. - For efficiency, Emacs does not recompute the mode line and header -line of a window in every redisplay. It does so when circumstances + For efficiency, Emacs does not continuously recompute the mode +line and header line of a window. It does so when circumstances appear to call for it---for instance, if you change the window configuration, switch buffers, narrow or widen the buffer, scroll, or change the buffer's modification status. If you modify any of the @@ -1552,7 +1552,6 @@ how text is displayed (@pxref{Display}), you may want to force an update of the mode line so as to display the new information or display it in the new way. -@c Emacs 19 feature @defun force-mode-line-update &optional all Force redisplay of the current buffer's mode line and header line. The next redisplay will update the mode line and header line based on @@ -1589,15 +1588,17 @@ defined to have mode-line constructs as their values. @table @code @cindex percent symbol in mode line @item @var{string} -A string as a mode-line construct appears verbatim in the mode line -except for @dfn{@code{%}-constructs} in it. These stand for -substitution of other data; see @ref{%-Constructs}. +A string as a mode-line construct appears verbatim except for +@dfn{@code{%}-constructs} in it. These stand for substitution of +other data; see @ref{%-Constructs}. -If the string has @code{face} properties, they are copied into the -mode line contents too (@pxref{Properties in Mode}). Any characters -in the mode line which have no @code{face} properties are displayed, -by default, in the face @code{mode-line} or @code{mode-line-inactive} -(@pxref{Standard Faces,,, emacs, The GNU Emacs Manual}). +If parts of the string have @code{face} properties, they control +display of the text just as they would text in the buffer. Any +characters which have no @code{face} properties are displayed, by +default, in the face @code{mode-line} or @code{mode-line-inactive} +(@pxref{Standard Faces,,, emacs, The GNU Emacs Manual}). The +@code{help-echo} and @code{local-map} properties in @var{string} have +special meanings. @xref{Properties in Mode}. @item @var{symbol} A symbol as a mode-line construct stands for its value. The value of @@ -1612,7 +1613,9 @@ Unless @var{symbol} is marked as ``risky'' (i.e., it has a non-@code{nil} @code{risky-local-variable} property), all text properties specified in @var{symbol}'s value are ignored. This includes the text properties of strings in @var{symbol}'s value, as -well as all @code{:eval} and @code{:propertize} forms in it. +well as all @code{:eval} and @code{:propertize} forms in it. (The +reason for this is security: non-risky variables could be set +automatically from file variables without prompting the user.) @item (@var{string} @var{rest}@dots{}) @itemx (@var{list} @var{rest}@dots{}) @@ -2055,10 +2058,10 @@ structure, and make @var{form} evaluate to a string that has a text property. @end enumerate - You use the @code{local-map} property to specify a keymap. Like any -keymap, it can bind character keys and function keys; but that has no -effect, since it is impossible to move point into the mode line. This -keymap can only take real effect for mouse clicks. + You can use the @code{local-map} property to specify a keymap. This +keymap only takes real effect for mouse clicks; binding character keys +and function keys to it has no effect, since it is impossible to move +point into the mode line. When the mode line refers to a variable which does not have a non-@code{nil} @code{risky-local-variable} property, any text @@ -2889,6 +2892,10 @@ Used (typically) for constant names. @vindex font-lock-preprocessor-face Used (typically) for preprocessor commands. +@item font-lock-negation-char-face +@vindex font-lock-negation-char-face +Used (typically) for easily-overlooked negation characters. + @item font-lock-warning-face @vindex font-lock-warning-face Used (typically) for constructs that are peculiar, or that greatly From aadb7f6f5a85ec0afc6c46798e59938701df569c Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 7 Aug 2006 13:40:32 +0000 Subject: [PATCH 045/153] Double-checked modes.texi. --- admin/FOR-RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 2cae3a71b1b..27404cbd20c 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -87,7 +87,7 @@ lispref/macros.texi "Luc Teirlinck" Chong Yidong lispref/maps.texi Chong Yidong Kim F. Storm lispref/markers.texi "Luc Teirlinck" Chong Yidong lispref/minibuf.texi "Luc Teirlinck" Chong Yidong -lispref/modes.texi Chong Yidong +lispref/modes.texi Chong Yidong (double-checked) lispref/nonascii.texi "Luc Teirlinck" Chong Yidong lispref/numbers.texi "Luc Teirlinck" Chong Yidong lispref/objects.texi "Luc Teirlinck" Chong Yidong From 614869993024153d5c7167ca78a9013cb0f95fc4 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 7 Aug 2006 16:39:36 +0000 Subject: [PATCH 046/153] (BASE_PURESIZE): Increase to 1120000. --- src/ChangeLog | 4 ++++ src/puresize.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2e0563e44a7..7c0408196aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-07 Andreas Schwab + + * puresize.h (BASE_PURESIZE): Increase to 1120000. + 2006-08-06 Chong Yidong * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. diff --git a/src/puresize.h b/src/puresize.h index bae7cbb6d6a..5dd374af207 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */ #endif #ifndef BASE_PURESIZE -#define BASE_PURESIZE (1102000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) +#define BASE_PURESIZE (1120000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) #endif /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ From 1402611cf2f7573544c420d79f08b624ec39b970 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 7 Aug 2006 17:42:36 +0000 Subject: [PATCH 047/153] (font-lock-extend-after-change-region-function, font-lock-extend-region-functions, font-lock-extend-jit-lock-region-after-change): Better comments. --- lisp/font-lock.el | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 0cad924f201..3496560cc71 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -976,7 +976,7 @@ The value of this variable is used when Font Lock mode is turned on." ;; multi-line strings and comments; regexps are not appropriate for the job.) (defvar font-lock-extend-after-change-region-function nil - "A function that determines the region to fontify after a change. + "A function that determines the region to refontify after a change. This variable is either nil, or is a function that determines the region to refontify after a change. @@ -985,7 +985,7 @@ Font-lock calls this function after each buffer change. The function is given three parameters, the standard BEG, END, and OLD-LEN from `after-change-functions'. It should return either a cons of the beginning -and end buffer positions \(in that order) of the region to fontify, or nil +and end buffer positions \(in that order) of the region to refontify, or nil \(which directs the caller to fontify a default region). This function should preserve the match-data. The region it returns may start or end in the middle of a line.") @@ -1044,6 +1044,12 @@ a very meaningful entity to highlight.") (defvar font-lock-beg) (defvar font-lock-end) (defvar font-lock-extend-region-functions '(font-lock-extend-region-wholelines + ;; This use of font-lock-multiline property is unreliable but is just + ;; a handy heuristic: in case you don't have a function that does + ;; /identification/ of multiline elements, you may still occasionally + ;; discover them by accident (or you may /identify/ them but not in all + ;; cases), in which case the font-lock-multiline property can help make + ;; sure you will properly *re*identify them during refontification. font-lock-extend-region-multiline) "Special hook run just before proceeding to fontify a region. This is used to allow major modes to help font-lock find safe buffer positions @@ -1177,6 +1183,12 @@ what properties to clear before refontifying a region.") end (max jit-lock-end (cdr region)))) ;; Then extend the region obeying font-lock-multiline properties, ;; indicating which part of the buffer needs to be refontified. + ;; !!! This is the *main* user of font-lock-multiline property !!! + ;; font-lock-after-change-function could/should also do that, but it + ;; doesn't need to because font-lock-default-fontify-region does + ;; it anyway. Here OTOH we have no guarantee that + ;; font-lock-default-fontify-region will be executed on this region + ;; any time soon. (when (and (> beg (point-min)) (get-text-property (1- beg) 'font-lock-multiline)) (setq beg (or (previous-single-property-change From 65c986aa9470183c3a546b21dbd1d14eae109626 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 7 Aug 2006 17:47:55 +0000 Subject: [PATCH 048/153] (font-lock-extend-jit-lock-region-after-change): Add docstring. --- lisp/font-lock.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 3496560cc71..ab80316ae6a 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1173,6 +1173,13 @@ what properties to clear before refontifying a region.") (defvar jit-lock-start) (defvar jit-lock-end) (defun font-lock-extend-jit-lock-region-after-change (beg end old-len) + "Function meant for `jit-lock-after-change-extend-region-functions'. +This function does 2 things: +- extend the region so that it not only includes the part that was modified + but also the surrounding text whose highlighting may change as a consequence. +- anticipate (part of) the region extension that will happen later in + `font-lock-default-fontify-region', in order to avoid the need for + double-redisplay in `jit-lock-fontify-now'." (save-excursion ;; First extend the region as font-lock-after-change-function would. (let ((region (if font-lock-extend-after-change-region-function @@ -1198,8 +1205,11 @@ what properties to clear before refontifying a region.") 'font-lock-multiline nil) (point-max))) ;; Finally, pre-enlarge the region to a whole number of lines, to try - ;; and predict what font-lock-default-fontify-region will do, so as to + ;; and anticipate what font-lock-default-fontify-region will do, so as to ;; avoid double-redisplay. + ;; We could just run `font-lock-extend-region-functions', but since + ;; the only purpose is to avoid the double-redisplay, we prefer to + ;; do here only the part that is cheap and most likely to be useful. (when (memq 'font-lock-extend-region-wholelines font-lock-extend-region-functions) (goto-char beg) From 4a63ceb8901f019161baa9f481b1b12f4134fea4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 7 Aug 2006 18:06:28 +0000 Subject: [PATCH 049/153] (PC-do-completion): Strip out completion-ignored-extensions before checking whether there are multiple completions. Don't use `list' unnecessarily when building completion tables. --- lisp/ChangeLog | 10 +++++-- lisp/complete.el | 73 +++++++++++++++++++++++------------------------- 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3f94298abca..ff97d539496 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-08-07 Stefan Monnier + + * complete.el (PC-do-completion): Strip out completion-ignored-extensions + before checking whether there are multiple completions. + Don't use `list' unnecessarily when building completion tables. + 2006-08-06 Richard Stallman * help.el (describe-mode): Make minor mode list more concise. @@ -672,8 +678,8 @@ 2006-07-10 Chong Yidong - * progmodes/cc-awk.el (defconst): Use eval-and-compile to avoid - compilation error. + * progmodes/cc-awk.el (c-awk-escaped-nls*): Use eval-and-compile to + avoid compilation error. * subr.el (sit-for): New function. diff --git a/lisp/complete.el b/lisp/complete.el index c49ad488536..90c1ceceb32 100644 --- a/lisp/complete.el +++ b/lisp/complete.el @@ -543,8 +543,8 @@ of `minibuffer-completion-table' and the minibuffer contents.") (let ((compl (all-completions (if env-on (file-name-nondirectory (substring str 0 p)) (substring str 0 p)) - table - pred))) + table + pred))) (setq p compl) (while p (and (string-match regex (car p)) @@ -553,6 +553,34 @@ of `minibuffer-completion-table' and the minibuffer contents.") (setq poss (cons (car p) poss)))) (setq p (cdr p))))) + ;; Handle completion-ignored-extensions + (and filename + (not (eq mode 'help)) + (let ((p2 poss)) + + ;; Build a regular expression representing the extensions list + (or (equal completion-ignored-extensions PC-ignored-extensions) + (setq PC-ignored-regexp + (concat "\\(" + (mapconcat + 'regexp-quote + (setq PC-ignored-extensions + completion-ignored-extensions) + "\\|") + "\\)\\'"))) + + ;; Check if there are any without an ignored extension. + ;; Also ignore `.' and `..'. + (setq p nil) + (while p2 + (or (string-match PC-ignored-regexp (car p2)) + (string-match "\\(\\`\\|/\\)[.][.]?/?\\'" (car p2)) + (setq p (cons (car p2) p))) + (setq p2 (cdr p2))) + + ;; If there are "good" names, use them + (and p (setq poss p)))) + ;; Now we have a list of possible completions (cond @@ -575,34 +603,6 @@ of `minibuffer-completion-table' and the minibuffer contents.") ((or (cdr (setq helpposs poss)) (memq mode '(help word))) - ;; Handle completion-ignored-extensions - (and filename - (not (eq mode 'help)) - (let ((p2 poss)) - - ;; Build a regular expression representing the extensions list - (or (equal completion-ignored-extensions PC-ignored-extensions) - (setq PC-ignored-regexp - (concat "\\(" - (mapconcat - 'regexp-quote - (setq PC-ignored-extensions - completion-ignored-extensions) - "\\|") - "\\)\\'"))) - - ;; Check if there are any without an ignored extension. - ;; Also ignore `.' and `..'. - (setq p nil) - (while p2 - (or (string-match PC-ignored-regexp (car p2)) - (string-match "\\(\\`\\|/\\)[.][.]?/?\\'" (car p2)) - (setq p (cons (car p2) p))) - (setq p2 (cdr p2))) - - ;; If there are "good" names, use them - (and p (setq poss p)))) - ;; Is the actual string one of the possible completions? (setq p (and (not (eq mode 'help)) poss)) (while (and p @@ -623,7 +623,8 @@ of `minibuffer-completion-table' and the minibuffer contents.") ;; Check if next few letters are the same in all cases (if (and (not (eq mode 'help)) - (setq prefix (try-completion (PC-chunk-after basestr skip) (mapcar 'list poss)))) + (setq prefix (try-completion (PC-chunk-after basestr skip) + poss))) (let ((first t) i) ;; Retain capitalization of user input even if ;; completion-ignore-case is set. @@ -669,13 +670,9 @@ of `minibuffer-completion-table' and the minibuffer contents.") (+ beg (length dirname)) end) skip) (mapcar - (function - (lambda (x) - (list - (and (string-match skip x) - (substring - x - (match-end 0)))))) + (lambda (x) + (when (string-match skip x) + (substring x (match-end 0)))) poss))) (or (> i 0) (> (length prefix) 0)) (or (not (eq mode 'word)) From 10412e6312cabf9265acbe32fd3743927038015f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 7 Aug 2006 18:24:25 +0000 Subject: [PATCH 050/153] (font-lock-extend-jit-lock-region-after-change): Better comment. --- lisp/font-lock.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index ab80316ae6a..b662a6735b0 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1196,6 +1196,10 @@ This function does 2 things: ;; it anyway. Here OTOH we have no guarantee that ;; font-lock-default-fontify-region will be executed on this region ;; any time soon. + ;; Note: contrary to font-lock-default-fontify-region, we do not do + ;; any loop here because we are not looking for a safe spot: we just + ;; mark the text whose appearance may need to change as a result of + ;; the buffer modification. (when (and (> beg (point-min)) (get-text-property (1- beg) 'font-lock-multiline)) (setq beg (or (previous-single-property-change From c0658ad46e4928ecdf6a14904073dc8a2fcfe862 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Tue, 8 Aug 2006 05:31:09 +0000 Subject: [PATCH 051/153] (terminal-init-xterm): Add more key bindings. --- lisp/ChangeLog | 4 ++++ lisp/term/xterm.el | 31 ++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ff97d539496..ceff0ca111a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-08-07 Dan Nicolaescu + + * term/xterm.el (terminal-init-xterm): Add more key bindings. + 2006-08-07 Stefan Monnier * complete.el (PC-do-completion): Strip out completion-ignored-extensions diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 7622f23752b..9ea51a2f774 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -228,8 +228,37 @@ (define-key map "\e[4~" [select]) (define-key map "\e[29~" [print]) - ;; These keys are available in xterm starting from version 214 + ;; These keys are available in xterm starting from version 216 ;; if the modifyOtherKeys resource is set to 1. + + (define-key map "\e[27;5;39~" [?\C-\']) + (define-key map "\e[27;5;45~" [?\C--]) + + (define-key map "\e[27;5;48~" [?\C-0]) + (define-key map "\e[27;5;49~" [?\C-1]) + ;; Not all C-DIGIT keys have a distinct binding. + (define-key map "\e[27;5;57~" [?\C-9]) + + (define-key map "\e[27;5;59~" [?\C-\;]) + (define-key map "\e[27;5;61~" [?\C-=]) + + + (define-key map "\e[27;6;33~" [?\C-!]) + (define-key map "\e[27;6;34~" [?\C-\"]) + (define-key map "\e[27;6;35~" [?\C-#]) + (define-key map "\e[27;6;36~" [?\C-$]) + (define-key map "\e[27;6;37~" [?\C-%]) + (define-key map "\e[27;6;38~" [(C-&)]) + (define-key map "\e[27;6;40~" [?\C-(]) + (define-key map "\e[27;6;41~" [?\C-)]) + (define-key map "\e[27;6;42~" [?\C-*]) + (define-key map "\e[27;6;43~" [?\C-+]) + + (define-key map "\e[27;6;58~" [?\C-:]) + (define-key map "\e[27;6;60~" [?\C-<]) + (define-key map "\e[27;6;62~" [?\C->]) + (define-key map "\e[27;6;63~" [(C-\?)]) + (define-key map "\e[27;5;9~" [C-tab]) (define-key map "\e[27;5;13~" [C-return]) (define-key map "\e[27;5;44~" [?\C-,]) From 878bf4b8602c8c08971c5d3beb778fd90c6bccf3 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Tue, 8 Aug 2006 08:06:08 +0000 Subject: [PATCH 052/153] (Marks vs Flags): Fix typo reported by Ari Roponen . --- man/ChangeLog | 5 +++++ man/dired.texi | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/man/ChangeLog b/man/ChangeLog index 1e5a9d23e89..df2d8536e0b 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2006-08-08 Romain Francoise + + * dired.texi (Marks vs Flags): Fix typo reported by Ari Roponen + . + 2006-08-05 Romain Francoise * faq.texi (New in Emacs 22): Expand. diff --git a/man/dired.texi b/man/dired.texi index 3bb32c1ac74..0281c6b0107 100644 --- a/man/dired.texi +++ b/man/dired.texi @@ -325,7 +325,7 @@ for @file{..} and typing @kbd{f} there. Instead of flagging a file with @samp{D}, you can @dfn{mark} the file with some other character (usually @samp{*}). Most Dired commands to operate on files use the files marked with @samp{*}. The -only command that operates on flagged flies is @kbd{x}, which expunges +only command that operates on flagged files is @kbd{x}, which expunges them. Here are some commands for marking with @samp{*}, for unmarking, and From 867cc23e444dd4fd25717f8df280b03718b99907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 8 Aug 2006 09:33:10 +0000 Subject: [PATCH 053/153] * etags.c (TEX_mode): Check getc retruns EOF. File ended without newline causes infinite loop. --- lib-src/ChangeLog | 5 +++++ lib-src/etags.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index f61188fb8d5..84b15459322 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-07 Masatake YAMATO + + * etags.c (TEX_mode): Check getc retruns EOF. + File ended without newline causes infinite loop. + 2002-07-30 Adrian Aichner (tiny change) * etags.c: It's XEmacs, not Xemacs: change all the occurences. diff --git a/lib-src/etags.c b/lib-src/etags.c index d60c12c2bcc..d455ddc276d 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -5165,7 +5165,7 @@ TEX_mode (inf) { /* Skip to next line if we hit the TeX comment char. */ if (c == '%') - while (c != '\n') + while (c != '\n' && c != EOF) c = getc (inf); else if (c == TEX_LESC || c == TEX_SESC ) break; From 1520a816ef390058c2afb984326cd6615e0487df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 8 Aug 2006 09:34:56 +0000 Subject: [PATCH 054/153] * etags.c (readline): expect sscanf returns 2, not 1. --- lib-src/ChangeLog | 5 +++++ lib-src/etags.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 84b15459322..ae6ddedf5f7 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-07 Masatake YAMATO + + * etags.c (readline): expect sscanf returns 2, + not 1. + 2006-08-07 Masatake YAMATO * etags.c (TEX_mode): Check getc retruns EOF. diff --git a/lib-src/etags.c b/lib-src/etags.c index d455ddc276d..50f7162ded0 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -6259,7 +6259,7 @@ readline (lbp, stream) int start, lno; if (DEBUG) start = 0; /* shut up the compiler */ - if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) == 1) + if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) == 2) { char *endp = lbp->buffer + start; From 4c7c5c7e48af8443102716b09b715047d49874c0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 8 Aug 2006 15:09:26 +0000 Subject: [PATCH 055/153] (sh-quoted-subshell): Make sure we don't mistake a closing " for an opening one. --- lisp/ChangeLog | 10 ++++++++-- lisp/progmodes/sh-script.el | 13 ++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ceff0ca111a..8abe7e99f71 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,11 +1,17 @@ +2006-08-08 Stefan Monnier + + * progmodes/sh-script.el (sh-quoted-subshell): Make sure we don't + mistake a closing " for an opening one. + 2006-08-07 Dan Nicolaescu * term/xterm.el (terminal-init-xterm): Add more key bindings. 2006-08-07 Stefan Monnier - * complete.el (PC-do-completion): Strip out completion-ignored-extensions - before checking whether there are multiple completions. + * complete.el (PC-do-completion): Filter out completions matching + completion-ignored-extensions before checking whether there are + multiple completions. Don't use `list' unnecessarily when building completion tables. 2006-08-06 Richard Stallman diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 6098c8be067..f828c36917b 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -986,7 +986,9 @@ subshells can nest." ;; FIXME: This can (and often does) match multiple lines, yet it makes no ;; effort to handle multiline cases correctly, so it ends up being ;; rather flakey. - (when (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t) + (when (and (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t) + ;; Make sure the " we matched is an opening quote. + (eq ?\" (nth 3 (syntax-ppss)))) ;; bingo we have a $( or a ` inside a "" (let ((char (char-after (point))) (continue t) @@ -1081,9 +1083,6 @@ This is used to flag quote characters in subshell constructs inside strings ("\\(\\\\\\)'" 1 ,sh-st-punc) ;; Make sure $@ and @? are correctly recognized as sexps. ("\\$\\([?@]\\)" 1 ,sh-st-symbol) - ;; highlight (possibly nested) subshells inside "" quoted regions correctly. - (sh-quoted-subshell - (1 (sh-apply-quoted-subshell) t t)) ;; Find HEREDOC starters and add a corresponding rule for the ender. (sh-font-lock-here-doc (2 (sh-font-lock-open-heredoc @@ -1093,7 +1092,11 @@ This is used to flag quote characters in subshell constructs inside strings (and (match-beginning 3) (/= (match-beginning 3) (match-end 3)))) nil t)) ;; Distinguish the special close-paren in `case'. - (")" 0 (sh-font-lock-paren (match-beginning 0))))) + (")" 0 (sh-font-lock-paren (match-beginning 0))) + ;; highlight (possibly nested) subshells inside "" quoted regions correctly. + ;; This should be at the very end because it uses syntax-ppss. + (sh-quoted-subshell + (1 (sh-apply-quoted-subshell) t t)))) (defun sh-font-lock-syntactic-face-function (state) (let ((q (nth 3 state))) From 08e5fcf12acce1b89b667e552a2d8f23e34c2423 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 8 Aug 2006 16:27:41 +0000 Subject: [PATCH 056/153] update from texinfo --- man/texinfo.tex | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/man/texinfo.tex b/man/texinfo.tex index d41d40084b0..36c1acad97c 100644 --- a/man/texinfo.tex +++ b/man/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2006-06-19.13} +\def\texinfoversion{2006-07-17.16} % % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free @@ -327,9 +327,9 @@ \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. - % (We lessened \vsize for it in \oddfootingxxx.) + % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. - \vskip 2\baselineskip + \vskip 24pt \unvbox\footlinebox \fi % @@ -2051,11 +2051,11 @@ % and arrange explicitly to hyphenate at a dash. % -- rms. { - \catcode`\-=\active - \catcode`\_=\active + \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active % \global\def\code{\begingroup - \catcode`\-=\active \catcode`\_=\active + \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active + \let'\singlequotechar \ifallowcodebreaks \let-\codedash \let_\codeunder @@ -2472,8 +2472,8 @@ % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. - \global\advance\pageheight by -\baselineskip - \global\advance\vsize by -\baselineskip + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} @@ -5042,7 +5042,7 @@ {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) -\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} +\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. @@ -5265,11 +5265,10 @@ % \maketwodispenvs {lisp}{example}{% \nonfillstart - \tt + \tt\quoteexpand \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } - % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenv {display}{% @@ -5397,6 +5396,22 @@ \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % \def\starttabbox{\setbox0=\hbox\bgroup} + +% Allow an option to not replace quotes with a regular directed right +% quote/apostrophe (char 0x27), but instead use the undirected quote +% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it +% the default, but it works for pasting with more pdf viewers (at least +% evince), the lilypond developers report. xpdf does work with the +% regular 0x27. +% +\def\singlequotechar{% + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else + \char'15 + \fi +} +% \begingroup \catcode`\^^I=\active \gdef\tabexpand{% @@ -5409,7 +5424,13 @@ \wd0=\dimen0 \box0 \starttabbox }% } + \catcode`\'=\active + \gdef\quoteexpand{% + \catcode`\'=\active + \def'{\singlequotechar} + }% \endgroup +% \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart @@ -5418,6 +5439,7 @@ \def\par{\leavevmode\egroup\box0\endgraf}% \catcode`\`=\active \tabexpand + \quoteexpand % Respect line breaks, % print special symbols as themselves, and % make each space count From 02a2b2ad4f23b253380485eca654bf4b338d0855 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 8 Aug 2006 17:39:08 +0000 Subject: [PATCH 057/153] Clean up wording in previous change. --- lispref/ChangeLog | 4 ++ lispref/modes.texi | 169 +++++++++++++++++++++------------------------ 2 files changed, 82 insertions(+), 91 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 8c963512d2f..318c00e84b6 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,7 @@ +2006-08-08 Richard Stallman + + * modes.texi: Clean up wording in previous change. + 2006-08-07 Chong Yidong * modes.texi (Hooks): Clarify. diff --git a/lispref/modes.texi b/lispref/modes.texi index e0953c403b2..f8afcd8a829 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi @@ -52,8 +52,8 @@ possible, so that you can use them in a uniform way. the @dfn{mode hook} as the one of the last steps of initialization. This makes it easy for a user to customize the behavior of the mode, by overriding the buffer-local variable assignments already made by -the mode. Most minor modes also run a mode hook at their end. But -hooks are used in other contexts too. For example, the hook +the mode. Most minor mode functions also run a mode hook at the end. +But hooks are used in other contexts too. For example, the hook @code{suspend-hook} runs just before Emacs suspends itself (@pxref{Suspending Emacs}). @@ -66,17 +66,16 @@ globally or buffer-locally with @code{add-hook}. @cindex abnormal hook If the hook variable's name does not end with @samp{-hook}, that -indicates it is probably an @dfn{abnormal hook}. Then you should look at its -documentation to see how to use the hook properly. +indicates it is probably an @dfn{abnormal hook}. That means the hook +functions are called with arguments, or their return values are used +in some way. The hook's documentation says how the functions are +called. You can use @code{add-hook} to add a function to an abnormal +hook, but you must write the function to follow the hook's calling +convention. - @dfn{Abnormal hooks} are hooks in which the functions are called -with arguments, or the return values are used in some way. By -convention, abnormal hook names end in @samp{-functions} or -@samp{-hooks}. You can use @code{add-hook} to add a function to the -list, but you must take care in writing the function. - - If the variable's name ends in @samp{-function}, then its value -is just a single function, not a list of functions. + By convention, abnormal hook names end in @samp{-functions} or +@samp{-hooks}. If the variable's name ends in @samp{-function}, then +its value is just a single function, not a list of functions. Here's an example that uses a mode hook to turn on Auto Fill mode when in Lisp Interaction mode: @@ -95,12 +94,12 @@ symbol that is a normal hook variable. These arguments are processed in the order specified. If a hook variable has a non-@code{nil} value, that value should be a -list of functions. Each function in this list is called, -consecutively, with no arguments. +list of functions. @code{run-hooks} calls all the functions, one by +one, with no arguments. -A hook variable can also be a single function (either a lambda -expression or a symbol with a function definition) to be called. This -use is considered obsolete. +The hook variable's value can also be a single function---either a +lambda expression or a symbol with a function definition---which +@code{run-hooks} calls. But this usage is obsolete. @end defun @defun run-hook-with-args hook &rest args @@ -357,9 +356,10 @@ letters and other printing characters as special commands. @item Major modes modes for editing text should not define @key{RET} to do -anything other than insert a newline. The command to insert a newline -and then indent is @kbd{C-j}. It is ok for more specialized modes, -such as Info mode, to redefine @key{RET} to something else. +anything other than insert a newline. However, it is ok for +specialized modes for text that users don't directly edit, such as +Dired and Info modes, to redefine @key{RET} to do something entirely +different. @item Major modes should not alter options that are primarily a matter of user @@ -801,101 +801,92 @@ Do not write an @code{interactive} spec in the definition; @subsection Generic Modes @cindex generic mode -@dfn{Generic modes} are simple major modes with basic support for + @dfn{Generic modes} are simple major modes with basic support for comment syntax and Font Lock mode. To define a generic mode, use the macro @code{define-generic-mode}. See the file @file{generic-x.el} for some examples of the use of @code{define-generic-mode}. @defmac define-generic-mode mode comment-list keyword-list font-lock-list auto-mode-list function-list &optional docstring -This macro creates a new generic mode. The argument @var{mode} (an -unquoted symbol) is the major mode command. The optional argument -@var{docstring} is the documentation for the mode command. If you do -not supply it, @code{define-generic-mode} uses a default documentation -string instead. +This macro defines a generic mode command named @var{mode} (a symbol, +not quoted). The optional argument @var{docstring} is the +documentation for the mode command. If you do not supply it, +@code{define-generic-mode} generates one by default. -@var{comment-list} is a list in which each element is either a -character, a string of one or two characters, or a cons cell. A -character or a string is set up in the mode's syntax table as a +The argument @var{comment-list} is a list in which each element is +either a character, a string of one or two characters, or a cons cell. +A character or a string is set up in the mode's syntax table as a ``comment starter.'' If the entry is a cons cell, the @sc{car} is set up as a ``comment starter'' and the @sc{cdr} as a ``comment ender.'' (Use @code{nil} for the latter if you want comments to end at the end -of the line.) Note that the syntax table has limitations about what -comment starters and enders are actually possible. @xref{Syntax -Tables}. +of the line.) Note that the syntax table mechanism has limitations +about what comment starters and enders are actually possible. +@xref{Syntax Tables}. -@var{keyword-list} is a list of keywords to highlight with -@code{font-lock-keyword-face}. Each keyword should be a string. -@var{font-lock-list} is a list of additional expressions to highlight. -Each element of this list should have the same form as an element of -@code{font-lock-keywords}. @xref{Search-based Fontification}. +The argument @var{keyword-list} is a list of keywords to highlight +with @code{font-lock-keyword-face}. Each keyword should be a string. +Meanwhile, @var{font-lock-list} is a list of additional expressions to +highlight. Each element of this list should have the same form as an +element of @code{font-lock-keywords}. @xref{Search-based +Fontification}. -@var{auto-mode-list} is a list of regular expressions to add to the -variable @code{auto-mode-alist}. These regular expressions are added -when Emacs runs the macro expansion. +The argument @var{auto-mode-list} is a list of regular expressions to +add to the variable @code{auto-mode-alist}. They are added by the execution +of the @code{define-generic-mode} form, not by expanding the macro call. -@var{function-list} is a list of functions to call to do some -additional setup. The mode command calls these functions just before -it runs the mode hook variable @code{@var{mode}-hook}. +Finally, @var{function-list} is a list of functions for the mode +command to call for additional setup. It calls these functions just +before it runs the mode hook variable @code{@var{mode}-hook}. @end defmac @node Mode Hooks @subsection Mode Hooks - The two last things a major mode function should do is run its mode -hook and finally the mode independent normal hook -@code{after-change-major-mode-hook}. If the major mode is a derived -mode, that is if it calls another major mode (the parent mode) in its -body, then the parent's mode hook is run just before the derived -mode's hook. Neither the parent's mode hook nor -@code{after-change-major-mode-hook} are run at the end of the actual -call to the parent mode. This applies recursively if the parent mode -has itself a parent. That is, the mode hooks of all major modes -called directly or indirectly by the major mode function are all run -in sequence at the end, just before -@code{after-change-major-mode-hook}. + Every major mode function should finish by running its mode hook and +the mode-independent normal hook @code{after-change-major-mode-hook}. +It does this by calling @code{run-mode-hooks}. If the major mode is a +derived mode, that is if it calls another major mode (the parent mode) +in its body, it should do this inside @code{delay-mode-hooks} so that +the parent won't run these hooks itself. Instead, the derived mode's +call to @code{run-mode-hooks} runs the parent's mode hook too. +@xref{Major Mode Conventions}. - These conventions are new in Emacs 22, and some major modes -implemented by users do not follow them yet. So if you put a function -onto @code{after-change-major-mode-hook}, keep in mind that some modes -will fail to run it. If a user complains about that, you can respond, -``That major mode fails to follow Emacs conventions, and that's why it -fails to work. Please fix the major mode.'' In most cases, that is -good enough, so go ahead and use @code{after-change-major-mode-hook}. -However, if a certain feature needs to be completely reliable, -it should not use @code{after-change-major-mode-hook} as of yet. + Emacs versions before Emacs 22 did not have @code{delay-mode-hooks}. +When user-implemented major modes have not been updated to use it, +they won't entirely follow these conventions: they may run the +parent's mode hook too early, or fail to run +@code{after-change-major-mode-hook}. If you encounter such a major +mode, please correct it to follow these conventions. When you defined a major mode using @code{define-derived-mode}, it automatically makes sure these conventions are followed. If you -define a major mode ``from scratch,'' not using -@code{define-derived-mode}, make sure the major mode command follows -these and other conventions. @xref{Major Mode Conventions}. You use -these functions to do it properly. +define a major mode ``by hand,'' not using @code{define-derived-mode}, +use the following functions to handle these conventions automatically. @defun run-mode-hooks &rest hookvars Major modes should run their mode hook using this function. It is similar to @code{run-hooks} (@pxref{Hooks}), but it also runs @code{after-change-major-mode-hook}. -When the call to this function is dynamically inside a -@code{delay-mode-hooks} form, this function does not run any hooks. +When this function is called during the execution of a +@code{delay-mode-hooks} form, it does not run the hooks immediately. Instead, it arranges for the next call to @code{run-mode-hooks} to run -@var{hookvars}. +them. @end defun @defmac delay-mode-hooks body@dots{} -This macro executes @var{body} like @code{progn}, but all calls to -@code{run-mode-hooks} inside @var{body} delay running their hooks. -They will be run by the first call to @code{run-mode-hooks} after exit -from @code{delay-mode-hooks}. This is the proper way for a major mode -command to invoke its parent mode. +When one major mode command calls another, it should do so inside of +@code{delay-mode-hooks}. + +This macro executes @var{body}, but tells all @code{run-mode-hooks} +calls during the execution of @var{body} to delay running their hooks. +The hooks will actually run during the next call to +@code{run-mode-hooks} after the end of the @code{delay-mode-hooks} +construct. @end defmac @defvar after-change-major-mode-hook -Every major mode function should run this normal hook at its very end. -It normally does not need to do so explicitly. Indeed, a major mode -function should normally run its mode hook with @code{run-mode-hooks} -as the very last thing it does, and the last thing -@code{run-mode-hooks} does is run @code{after-change-major-mode-hook}. +This is a normal hook run by @code{run-mode-hooks}. It is run at the +very end of every properly-written major mode function. @end defvar @node Example Major Modes @@ -1058,9 +1049,8 @@ correspondingly more complicated. Here are excerpts from @end group @end smallexample - Much code is shared among the three Lisp modes. The following -function sets various variables; it is called by each of the major Lisp -mode functions: + The three modes for Lisp share much of their code. For instance, +each calls the following function to set various variables: @smallexample @group @@ -1072,13 +1062,10 @@ mode functions: @end group @end smallexample - Functions such as @code{forward-paragraph} use the value of the -@code{paragraph-start} variable. Since Lisp code is different from -ordinary text, the @code{paragraph-start} variable needs to be set -specially to handle Lisp. Also, comments are indented in a special -fashion in Lisp and the Lisp modes need their own mode-specific -@code{comment-indent-function}. The code to set these variables is the -rest of @code{lisp-mode-variables}. + In Lisp and most programming languages, we want the paragraph +commands to treat only blank lines as paragraph separators. And the +modes should undestand the Lisp conventions for comments. The rest of +@code{lisp-mode-variables} sets this up: @smallexample @group From dc7ef9f02fdc4f992caea9a23e26f54a1ce48eac Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 8 Aug 2006 17:45:42 +0000 Subject: [PATCH 058/153] * info.el (Info-fontify-node): Handle preceding `in' for note reference hiding rules. --- lisp/ChangeLog | 5 +++++ lisp/info.el | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8abe7e99f71..c360d6c666f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-08 Chong Yidong + + * info.el (Info-fontify-node): Handle preceding `in' for note + reference hiding rules. + 2006-08-08 Stefan Monnier * progmodes/sh-script.el (sh-quoted-subshell): Make sure we don't diff --git a/lisp/info.el b/lisp/info.el index 87327d8656b..dc08557e28d 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -3805,6 +3805,8 @@ the variable `Info-file-list-for-emacs'." (setq other-tag (cond ((save-match-data (looking-back "\\ Date: Tue, 8 Aug 2006 20:53:10 +0000 Subject: [PATCH 059/153] Whitespace change. --- lisp/help.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/help.el b/lisp/help.el index af79bbcf57c..db76efb01a0 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -841,7 +841,7 @@ whose documentation describes the minor mode." (if (zerop (length indicator)) "no indicator" (format "indicator%s" - indicator)))) + indicator)))) (princ (documentation mode-function))) (insert-button pretty-minor-mode 'action (car help-button-cache) From dccee2cb1589448168edd0223256789b88f7f56f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 9 Aug 2006 01:11:44 +0000 Subject: [PATCH 060/153] (latexenc-find-file-coding-system): Fix for the case that the 2nd element of arg-list is a cons. --- lisp/international/latexenc.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/international/latexenc.el b/lisp/international/latexenc.el index 25d56c1e928..58e8d6c88e8 100644 --- a/lisp/international/latexenc.el +++ b/lisp/international/latexenc.el @@ -138,8 +138,14 @@ coding system names is determined from `latex-inputenc-coding-alist'." ((and (require 'code-pages nil t) (coding-system-p sym)) sym) (t 'undecided))) ;; else try to find it in the master/main file - (let ((default-directory (file-name-directory (nth 1 arg-list))) - latexenc-main-file) + + ;; Fixme: If the current file is in an archive (e.g. tar, + ;; zip), we should find the master file in that archive. + ;; But, that is not yet implemented. -- K.Handa + (let ((default-directory (if (stringp (nth 1 arg-list)) + (file-name-directory (nth 1 arg-list)) + default-directory)) + latexenc-main-file) ;; Is there a TeX-master or tex-main-file in the local variables ;; section? (unless latexenc-dont-use-TeX-master-flag From 2c53e699a1a9705755ca239da5acfdf32fd77ac9 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 9 Aug 2006 01:25:03 +0000 Subject: [PATCH 061/153] (syms_of_coding): Improve the docstring file-coding-system-alist. --- src/coding.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coding.c b/src/coding.c index 1af7b4c0d52..ae9f6749792 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7968,8 +7968,9 @@ the file contents. If VAL is a cons of coding systems, the car part is used for decoding, and the cdr part is used for encoding. If VAL is a function symbol, the function must return a coding system -or a cons of coding systems which are used as above. The function gets -the arguments with which `find-operation-coding-system' was called. +or a cons of coding systems which are used as above. The function is +called with an argument that is a list of the arguments with which +`find-operation-coding-system' was called. See also the function `find-operation-coding-system' and the variable `auto-coding-alist'. */); From bb0825cb7d70a290d61946d53f2a665ce8a4a14c Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 9 Aug 2006 01:25:59 +0000 Subject: [PATCH 062/153] *** empty log message *** --- lisp/ChangeLog | 5 +++++ src/ChangeLog | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c360d6c666f..06834b2ac49 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-09 Kenichi Handa + + * international/latexenc.el (latexenc-find-file-coding-system): + Fix for the case that the 2nd element of arg-list is a cons. + 2006-08-08 Chong Yidong * info.el (Info-fontify-node): Handle preceding `in' for note diff --git a/src/ChangeLog b/src/ChangeLog index 7c0408196aa..9d23a23e6a5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-09 Kenichi Handa + + * coding.c (syms_of_coding): Improve the docstring + file-coding-system-alist. + 2006-08-07 Andreas Schwab * puresize.h (BASE_PURESIZE): Increase to 1120000. From c2028ac64fab925570fa9ef7e1ed564f4aa3eb2c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 9 Aug 2006 04:55:10 +0000 Subject: [PATCH 063/153] (keyremap_step): No-op if fkey->parent = nil. (read_key_sequence): Always start fkey.start and fkey.end at 0, and likewise for keytran. --- src/ChangeLog | 6 ++++++ src/keyboard.c | 25 ++++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9d23a23e6a5..678078d3781 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-08-09 Richard Stallman + + * keyboard.c (keyremap_step): No-op if fkey->parent = nil. + (read_key_sequence): Always start fkey.start and fkey.end at 0, + and likewise for keytran. + 2006-08-09 Kenichi Handa * coding.c (syms_of_coding): Improve the docstring diff --git a/src/keyboard.c b/src/keyboard.c index 6f12994a1b8..ae3b78b04d2 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8385,7 +8385,15 @@ follow_key (key, nmaps, current, defs, next) such as Vfunction_key_map and Vkey_translation_map. */ typedef struct keyremap { - Lisp_Object map, parent; + /* This is the map originally specified for this use. */ + Lisp_Object parent; + /* This is a submap reached by looking up, in PARENT, + the events from START to END. */ + Lisp_Object map; + /* Positions [START, END) in the key sequence buffer + are the key that we have scanned so far. + Those events are the ones that we will replace + if PAREHT maps them into a key sequence. */ int start, end; } keyremap; @@ -8458,7 +8466,11 @@ keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt) Lisp_Object next, key; key = keybuf[fkey->end++]; - next = access_keymap_keyremap (fkey->map, key, prompt, doit); + + if (KEYMAPP (fkey->parent)) + next = access_keymap_keyremap (fkey->map, key, prompt, doit); + else + next = Qnil; /* If keybuf[fkey->start..fkey->end] is bound in the map and we're in a position to do the key remapping, replace it with @@ -8656,9 +8668,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, delayed_switch_frame = Qnil; fkey.map = fkey.parent = Vfunction_key_map; keytran.map = keytran.parent = Vkey_translation_map; - /* If there is no translation-map, turn off scanning. */ - fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; - keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; + fkey.start = fkey.end = 0; + keytran.start = keytran.end = 0; if (INTERACTIVE) { @@ -9486,8 +9497,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, keybuf[t - 1] = new_key; mock_input = max (t, mock_input); - fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; - keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; + fkey.start = fkey.end = 0; + keytran.start = keytran.end = 0; goto replay_sequence; } From 1f4edc37b89c6981092342ed44328bbdf7efd73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Wed, 9 Aug 2006 06:22:27 +0000 Subject: [PATCH 064/153] * etags.c (readline): expect sscanf returns >= 1. --- lib-src/ChangeLog | 4 ++++ lib-src/etags.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index ae6ddedf5f7..3e7d9efad31 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-09 Jan Dj,Ad(Brv + + * etags.c (readline): expect sscanf returns >= 1. + 2006-08-07 Masatake YAMATO * etags.c (readline): expect sscanf returns 2, diff --git a/lib-src/etags.c b/lib-src/etags.c index 50f7162ded0..c7d18d34849 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -6259,7 +6259,7 @@ readline (lbp, stream) int start, lno; if (DEBUG) start = 0; /* shut up the compiler */ - if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) == 2) + if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) >= 1) { char *endp = lbp->buffer + start; From ea90c5d3bdb03846cbe7845b65d5be1343eddbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Wed, 9 Aug 2006 06:56:16 +0000 Subject: [PATCH 065/153] (readline): Change position on %n and \" in sscanf. --- lib-src/ChangeLog | 1 + lib-src/etags.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 3e7d9efad31..3328f010846 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,6 +1,7 @@ 2006-08-09 Jan Dj,Ad(Brv * etags.c (readline): expect sscanf returns >= 1. + (readline): Change position on %n and \" in sscanf. 2006-08-07 Masatake YAMATO diff --git a/lib-src/etags.c b/lib-src/etags.c index c7d18d34849..b02268ac218 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -6259,9 +6259,10 @@ readline (lbp, stream) int start, lno; if (DEBUG) start = 0; /* shut up the compiler */ - if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) >= 1) + if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1 + && inp[start] == '"') { - char *endp = lbp->buffer + start; + char *endp = lbp->buffer + ++start; assert (start > 0); while ((endp = etags_strchr (endp, '"')) != NULL From ae587d1d0cc496d38a369db44dfa0d2d1598d1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Wed, 9 Aug 2006 06:56:38 +0000 Subject: [PATCH 066/153] Fix previous change. --- lib-src/etags.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib-src/etags.c b/lib-src/etags.c index b02268ac218..49a18be1df5 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -6260,7 +6260,7 @@ readline (lbp, stream) if (DEBUG) start = 0; /* shut up the compiler */ if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1 - && inp[start] == '"') + && lbp->buffer[start] == '"') { char *endp = lbp->buffer + ++start; From d070a65d0ec72e272c6688163db9c5e9c25c8359 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 9 Aug 2006 11:50:27 +0000 Subject: [PATCH 067/153] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 06834b2ac49..ed5bab6cc8a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-08-09 John Wiegley + + * calendar/timeclock.el (timeclock-use-elapsed): Added a new + variable, which causes timeclock to report elapsed time worked, + instead of just work remaining. + 2006-08-09 Kenichi Handa * international/latexenc.el (latexenc-find-file-coding-system): From 43f5aea1d8eed1254c65383f5bbcadf6f7ebd989 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 9 Aug 2006 11:51:57 +0000 Subject: [PATCH 068/153] (timeclock-use-elapsed): Added a new variable, which causes timeclock to report elapsed time worked, instead of just work remaining. --- lisp/calendar/timeclock.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 3f2697509f3..13b3671e16a 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -95,7 +95,7 @@ :group 'timeclock) (defcustom timeclock-relative t - "*Whether to maken reported time relative to `timeclock-workday'. + "*Whether to make reported time relative to `timeclock-workday'. For example, if the length of a normal workday is eight hours, and you work four hours on Monday, then the amount of time \"remaining\" on Tuesday is twelve hours -- relative to an averaged work period of @@ -251,7 +251,10 @@ each day.") This value is not accurate enough to be useful by itself. Rather, call `timeclock-workday-elapsed', to determine how much time has been worked so far today. Also, if `timeclock-relative' is nil, this value -will be the same as `timeclock-discrepancy'.") ; ? gm +will be the same as `timeclock-discrepancy'.") + +(defvar timeclock-use-elapsed nil + "Non-nil if the modeline should display time elapsed, not remaining.") (defvar timeclock-last-period nil "Integer representing the number of seconds in the last period. @@ -424,7 +427,9 @@ If SHOW-SECONDS is non-nil, display second resolution. If TODAY-ONLY is non-nil, the display will be relative only to time worked today, ignoring the time worked on previous days." (interactive "P") - (let ((remainder (timeclock-workday-remaining)) ; today-only? + (let ((remainder (timeclock-workday-remaining + (or today-only + (not timeclock-relative)))) (last-in (equal (car timeclock-last-event) "i")) status) (setq status @@ -619,7 +624,10 @@ relative only to the time worked today, and not to past time." The value of `timeclock-relative' affects the display as described in that variable's documentation." (interactive) - (let ((remainder (timeclock-workday-remaining (not timeclock-relative))) + (let ((remainder + (if timeclock-use-elapsed + (timeclock-workday-elapsed) + (timeclock-workday-remaining (not timeclock-relative)))) (last-in (equal (car timeclock-last-event) "i"))) (when (and (< remainder 0) (not (and timeclock-day-over From 541a0de1e2dedd333a586886bd8cea35082133a4 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 9 Aug 2006 19:10:13 +0000 Subject: [PATCH 069/153] Don't say which side scroll bar is on. --- etc/ChangeLog | 4 ++++ etc/TUTORIAL | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index f144dd17954..b708594aa32 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2006-08-09 Richard Stallman + + * TUTORIAL: Don't say which side scroll bar is on. + 2006-08-06 Nick Roberts * DEBUG (Note): Add note about following a longjmp call. diff --git a/etc/TUTORIAL b/etc/TUTORIAL index 5748d0d4e5e..630cc4f9765 100644 --- a/etc/TUTORIAL +++ b/etc/TUTORIAL @@ -217,7 +217,7 @@ This should have scrolled the screen up by 8 lines. If you would like to scroll it down again, you can give an argument to M-v. If you are using a windowed display, such as X11 or MS-Windows, there -should be a tall rectangular area called a scroll bar at the left hand +should be a tall rectangular area called a scroll bar at the side of the Emacs window. You can scroll the text by clicking the mouse in the scroll bar. From 38ceb48f7f509590630c79c0709d3ecafd2c63e1 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 10 Aug 2006 03:37:29 +0000 Subject: [PATCH 070/153] * avoid.el (mouse-avoidance-animating-pointer): New var. (mouse-avoidance-nudge-mouse): Use it. (mouse-avoidance-banish): Rename from mouse-avoidance-banish-hook. (mouse-avoidance-exile): Rename from mouse-avoidance-exile-hook (mouse-avoidance-fancy): Rename from mouse-avoidance-fancy-hook. Don't activate if currently animating. All callers changed. --- lisp/ChangeLog | 9 +++++++++ lisp/avoid.el | 25 +++++++++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ed5bab6cc8a..8f2ee7d31d7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2006-08-09 Chong Yidong + + * avoid.el (mouse-avoidance-animating-pointer): New var. + (mouse-avoidance-nudge-mouse): Use it. + (mouse-avoidance-banish): Rename from mouse-avoidance-banish-hook. + (mouse-avoidance-exile): Rename from mouse-avoidance-exile-hook + (mouse-avoidance-fancy): Rename from mouse-avoidance-fancy-hook. + Don't activate if currently animating. All callers changed. + 2006-08-09 John Wiegley * calendar/timeclock.el (timeclock-use-elapsed): Added a new diff --git a/lisp/avoid.el b/lisp/avoid.el index 1868707720e..b497c2007bd 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el @@ -124,6 +124,7 @@ Only applies in mouse-avoidance-modes `animate' and `jump'." (defvar mouse-avoidance-pointer-shapes nil) (defvar mouse-avoidance-n-pointer-shapes 0) (defvar mouse-avoidance-old-pointer-shape nil) +(defvar mouse-avoidance-animating-pointer nil) ;; This timer is used to run something when Emacs is idle. (defvar mouse-avoidance-timer nil) @@ -243,16 +244,19 @@ You can redefine this if you want the mouse banished to a different corner." (+ (cdr mouse-avoidance-state) deltay))) (if (or (eq mouse-avoidance-mode 'animate) (eq mouse-avoidance-mode 'proteus)) - (let ((i 0.0)) + (let ((i 0.0) + (incr (max .1 (/ 1.0 mouse-avoidance-nudge-dist)))) + (setq mouse-avoidance-animating-pointer t) (while (<= i 1) (mouse-avoidance-set-mouse-position (cons (+ (car cur-pos) (round (* i deltax))) (+ (cdr cur-pos) (round (* i deltay))))) - (setq i (+ i (max .1 (/ 1.0 mouse-avoidance-nudge-dist)))) + (setq i (+ i incr)) (if (eq mouse-avoidance-mode 'proteus) (mouse-avoidance-set-pointer-shape (mouse-avoidance-random-shape))) - (sit-for mouse-avoidance-animation-delay))) + (sit-for mouse-avoidance-animation-delay)) + (setq mouse-avoidance-animating-pointer nil)) (mouse-avoidance-set-mouse-position (cons (+ (car (cdr cur)) deltax) (+ (cdr (cdr cur)) deltay)))))) @@ -294,11 +298,11 @@ redefine this function to suit your own tastes." (memq 'drag modifiers) (memq 'down modifiers))))))) -(defun mouse-avoidance-banish-hook () +(defun mouse-avoidance-banish () (if (not (mouse-avoidance-ignore-p)) (mouse-avoidance-banish-mouse))) -(defun mouse-avoidance-exile-hook () +(defun mouse-avoidance-exile () ;; 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 (not (mouse-avoidance-ignore-p)) @@ -317,9 +321,10 @@ redefine this function to suit your own tastes." ;; but clear state anyway, to be ready for another move (setq mouse-avoidance-state nil)))))) -(defun mouse-avoidance-fancy-hook () +(defun mouse-avoidance-fancy () ;; Used for the "fancy" modes, ie jump et al. - (if (and (not (mouse-avoidance-ignore-p)) + (if (and (not mouse-avoidance-animating-pointer) + (not (mouse-avoidance-ignore-p)) (mouse-avoidance-too-close-p (mouse-position))) (let ((old-pos (mouse-position))) (mouse-avoidance-nudge-mouse) @@ -375,14 +380,14 @@ definition of \"random distance\".)" (eq mode 'animate) (eq mode 'proteus)) (setq mouse-avoidance-timer - (run-with-idle-timer 0.1 t 'mouse-avoidance-fancy-hook)) + (run-with-idle-timer 0.1 t 'mouse-avoidance-fancy)) (setq mouse-avoidance-mode mode mouse-avoidance-state (cons 0 0) mouse-avoidance-old-pointer-shape (and (boundp 'x-pointer-shape) x-pointer-shape))) ((eq mode 'exile) (setq mouse-avoidance-timer - (run-with-idle-timer 0.1 t 'mouse-avoidance-exile-hook)) + (run-with-idle-timer 0.1 t 'mouse-avoidance-exile)) (setq mouse-avoidance-mode mode mouse-avoidance-state nil)) ((or (eq mode 'banish) @@ -390,7 +395,7 @@ definition of \"random distance\".)" (and (null mode) (null mouse-avoidance-mode)) (and mode (> (prefix-numeric-value mode) 0))) (setq mouse-avoidance-timer - (run-with-idle-timer 0.1 t 'mouse-avoidance-banish-hook)) + (run-with-idle-timer 0.1 t 'mouse-avoidance-banish)) (setq mouse-avoidance-mode 'banish)) (t (setq mouse-avoidance-mode nil))) (force-mode-line-update)) From cd7890bd1af96ddbdaebccb45291f72d94d18941 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 10 Aug 2006 04:00:34 +0000 Subject: [PATCH 071/153] (facemenu-add-face): Pass frame to facemenu-active-faces. (facemenu-set-face): Doc fix. --- lisp/facemenu.el | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/lisp/facemenu.el b/lisp/facemenu.el index a8d8ea9a4b5..3c43bfbad7a 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -320,19 +320,24 @@ variables." ;;;###autoload (defun facemenu-set-face (face &optional start end) - "Add FACE to the region or next character typed. -This adds FACE to the top of the face list; any faces lower on the list that -will not show through at all will be removed. + "Apply FACE to the region or next character typed. -Interactively, reads the face name with the minibuffer. +If the region is active (normally true except in Transient +Mark mode) and nonempty, and there is no prefix argument, +this command applies FACE to the region. Otherwise, it applies FACE +to the faces to use for the next character +inserted. (Moving point or switching buffers before typing +a character to insert cancels the specification.) -If the region is active (normally true except in Transient Mark mode) -and there is no prefix argument, this command sets the region to the -requested face. +If FACE is `default', to \"apply\" it means clearing +the list of faces to be used. For any other value of FACE, +to \"apply\" it means putting FACE at the front of the list +of faces to be used, and removing any faces further +along in the list that would be completely overridden by +preceding faces (including FACE). -Otherwise, this command specifies the face for the next character -inserted. Moving point or switching buffers before -typing a character to insert cancels the specification." +This command can also add FACE to the menu of faces, +if `facemenu-listed-faces' says to do that." (interactive (list (progn (barf-if-buffer-read-only) (read-face-name "Use face")) @@ -612,7 +617,12 @@ effect. See `facemenu-remove-face-function'." (cons face (if (listp prev) prev - (list prev))))))) + (list prev))) + ;; Specify the selected frame + ;; because nil would mean to use + ;; the new-frame default settings, + ;; and those are usually nil. + (selected-frame))))) (setq part-start part-end))) (setq self-insert-face (if (eq last-command self-insert-face-command) (cons face (if (listp self-insert-face) @@ -655,9 +665,8 @@ use the selected frame. If t, then the global, non-frame faces are used." (nreverse active-list))) (defun facemenu-add-new-face (face) - "Add FACE (a face) to the Face menu. - -This is called whenever you create a new face." + "Add FACE (a face) to the Face menu if `facemenu-listed-faces' says so. +This is called whenever you create a new face, and at other times." (let* (name symbol menu docstring From 5667ecd2caf9e6f70eaf775a28668e6130a525e3 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 10 Aug 2006 04:19:57 +0000 Subject: [PATCH 072/153] (Format Faces): Substantial rewrites to deal with face merging. Empty regions don't count. Clarify face property inheritance. --- lisp/ChangeLog | 5 ++++ man/text.texi | 64 ++++++++++++++++++++++++++------------------------ 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8f2ee7d31d7..f584383ec23 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-10 Richard Stallman + + * facemenu.el (facemenu-add-face): Pass frame to facemenu-active-faces. + (facemenu-set-face): Doc fix. + 2006-08-09 Chong Yidong * avoid.el (mouse-avoidance-animating-pointer): New var. diff --git a/man/text.texi b/man/text.texi index 3a166174fda..b764a83d8db 100644 --- a/man/text.texi +++ b/man/text.texi @@ -2067,59 +2067,61 @@ Display a list of all the defined colors (@code{list-colors-display}). @subsection Faces in Formatted Text The Faces submenu lists various Emacs faces including @code{bold}, -@code{italic}, and @code{underline}. Selecting one of these adds the -chosen face to the region. @xref{Faces}. You can also specify a face -with these keyboard commands: +@code{italic}, and @code{underline} (@pxref{Faces}). These menu items +operate on the region if it is active and nonempty. Otherwise, they +specify to use that face for an immediately following self-inserting +character. Instead of the menu, you can use these keyboard commands: @table @kbd @kindex M-o d @r{(Enriched mode)} @findex facemenu-set-default @item M-o d -Set the region, or the next inserted character, to the @code{default} face -(@code{facemenu-set-default}). +Remove all @code{face} properties from the region (which includes +specified colors), or force the following inserted character to have no +@code{face} property (@code{facemenu-set-default}). @kindex M-o b @r{(Enriched mode)} @findex facemenu-set-bold @item M-o b -Set the region, or the next inserted character, to the @code{bold} face -(@code{facemenu-set-bold}). +Add the face @code{bold} to the region or to the following inserted +character (@code{facemenu-set-bold}). @kindex M-o i @r{(Enriched mode)} @findex facemenu-set-italic @item M-o i -Set the region, or the next inserted character, to the @code{italic} face -(@code{facemenu-set-italic}). +Add the face @code{italic} to the region or to the following inserted +character (@code{facemenu-set-italic}). @kindex M-o l @r{(Enriched mode)} @findex facemenu-set-bold-italic @item M-o l -Set the region, or the next inserted character, to the @code{bold-italic} face -(@code{facemenu-set-bold-italic}). +Add the face @code{bold-italic} to the region or to the following +inserted character (@code{facemenu-set-bold-italic}). @kindex M-o u @r{(Enriched mode)} @findex facemenu-set-underline @item M-o u -Set the region, or the next inserted character, to the @code{underline} face -(@code{facemenu-set-underline}). +Add the face @code{underline} to the region or to the following inserted +character (@code{facemenu-set-underline}). @kindex M-o o @r{(Enriched mode)} @findex facemenu-set-face @item M-o o @var{face} @key{RET} -Set the region, or the next inserted character, to the face @var{face} -(@code{facemenu-set-face}). +Add the face @var{face} to the region or to the following inserted +character (@code{facemenu-set-face}). @end table - If you use these commands with a prefix argument---or, in Transient Mark -mode, if the region is not active---then these commands specify a face -to use for any immediately following self-inserting input. -@xref{Transient Mark}. This applies to both the keyboard commands and -the menu commands. + With a prefix argument, all these commands apply to an immediately +following self-inserting character, disregarding the region. - Specifying the @code{default} face also resets foreground and -background color to their defaults.(@pxref{Format Colors}). + A self-inserting character normally inherits the @code{face} +property (and most other text properties) from the preceding character +in the buffer. If you use the above commands to specify face for the +next self-inserting character, or the next section's commands to +specify a foreground or background color for it, then it does not +inherit the @code{face} property from the preceding character; instead +it uses whatever you specified. It will still inherit other text +properties, though. - Any self-inserting character you type inherits, by default, the face -properties (as well as most other text properties) of the preceding -character. Specifying any face property, including foreground or -background color, for your next self-inserting character will prevent -it from inheriting any face properties from the preceding character, -although it will still inherit other text properties. Characters -inserted by yanking do not inherit text properties. + Strictly speaking, these commands apply only to the first following +self-inserting character that you type. But if you insert additional +characters after it, they will inherit from the first one. So it +appears that these commands apply to all of them. Enriched mode defines two additional faces: @code{excerpt} and @code{fixed}. These correspond to codes used in the text/enriched file @@ -2157,8 +2159,8 @@ colors that you have used in Enriched mode in the current Emacs session. If you specify a color with a prefix argument---or, in Transient Mark mode, if the region is not active---then it applies to any -immediately following self-inserting input. @xref{Transient Mark}. -Otherwise, the command applies to the region. +immediately following self-inserting input. Otherwise, the command +applies to the region. Each color menu contains one additional item: @samp{Other}. You can use this item to specify a color that is not listed in the menu; it reads From d7beaf538263b68d20df6eb01e693c31d27ea537 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 10 Aug 2006 04:31:21 +0000 Subject: [PATCH 073/153] (facemenu-listed-faces): Doc fix. --- lisp/facemenu.el | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 3c43bfbad7a..eaaf4dacd72 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -134,18 +134,24 @@ just before \"Other\" at the end." (defcustom facemenu-listed-faces nil "*List of faces to include in the Face menu. -Each element should be a symbol, which is the name of a face. +Each element should be a symbol, the name of a face. The \"basic \" faces in `facemenu-keybindings' are automatically -added to the Face menu, and are not included in this list. +added to the Face menu, and need not be in this list. -You can set this list before loading facemenu.el, or add a face to it before -creating that face if you want it to be listed. If you change the -variable so as to eliminate faces that have already been added to the menu, -call `facemenu-update' to recalculate the menu contents. +This value takes effect when you load facemenu.el. If the +list includes symbols which are not defined as faces, they +are ignored; however, subsequently defining or creating +those faces adds them to the menu then. You can call +`facemenu-update' to recalculate the menu contents, such as +if you change the value of this variable, -If this variable is t, all faces will be added to the menu. This -is useful for setting temporarily if you want to add faces to the -menu when they are created." +If this variable is t, all faces that you apply to text +using the face menu commands (even by name), and all faces +that you define or create, are added to the menu. You may +find it useful to set this variable to t temporarily while +you define some faces, so that they will be added. However, +if the value is no longer t and you call `facemenu-update', +it will remove any faces not explicitly in the list." :type '(choice (const :tag "List all faces" t) (const :tag "None" nil) (repeat symbol)) From 38cdf40b3ccebb28c9d94dcd36b3457b87e16918 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 10 Aug 2006 04:31:27 +0000 Subject: [PATCH 074/153] *** empty log message *** --- lisp/ChangeLog | 1 + man/ChangeLog | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f584383ec23..9d22cf958a7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * facemenu.el (facemenu-add-face): Pass frame to facemenu-active-faces. (facemenu-set-face): Doc fix. + (facemenu-listed-faces): Doc fix. 2006-08-09 Chong Yidong diff --git a/man/ChangeLog b/man/ChangeLog index df2d8536e0b..8d252755de6 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,9 @@ +2006-08-10 Richard Stallman + + * text.texi (Format Faces): Substantial rewrites to deal + with face merging. Empty regions don't count. Clarify + face property inheritance. + 2006-08-08 Romain Francoise * dired.texi (Marks vs Flags): Fix typo reported by Ari Roponen From 0e94a24a871c7032b29bb971abdd0353d5ace084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 10 Aug 2006 06:06:48 +0000 Subject: [PATCH 075/153] * keyboard.h: Declare in_sighandler. --- src/keyboard.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/keyboard.h b/src/keyboard.h index 96ac7d2e856..f8d8f789c08 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -190,6 +190,9 @@ extern EMACS_INT num_nonmacro_input_events; /* Nonzero means polling for input is temporarily suppressed. */ extern int poll_suppress_count; +/* Nonzero if we are executing from the SIGIO signal handler. */ +extern int in_sighandler; + /* Keymap mapping ASCII function key sequences onto their preferred forms. Initialized by the terminal-specific lisp files. */ extern Lisp_Object Vfunction_key_map; From 90b03d58966b9bb4f8de4f4b5fcbb24cec70b45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 10 Aug 2006 06:07:15 +0000 Subject: [PATCH 076/153] * keyboard.c: Define in_sighandler. (input_available_signal): Set in_sighandler. --- src/keyboard.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index ae3b78b04d2..c715eadeb80 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -100,6 +100,9 @@ int interrupt_input_pending; /* File descriptor to use for input. */ extern int input_fd; +/* Nonzero if we are executing from the SIGIO signal handler. */ +int in_sighandler; + #ifdef HAVE_WINDOW_SYSTEM /* Make all keyboard buffers much bigger when using X windows. */ #ifdef MAC_OS8 @@ -6924,6 +6927,8 @@ input_available_signal (signo) SIGNAL_THREAD_CHECK (signo); #endif + in_sighandler = 1; + if (input_available_clear_time) EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); @@ -6935,6 +6940,7 @@ input_available_signal (signo) sigfree (); #endif errno = old_errno; + in_sighandler = 0; } #endif /* SIGIO */ @@ -10802,6 +10808,7 @@ init_keyboard () do_mouse_tracking = Qnil; #endif input_pending = 0; + in_sighandler = 0; /* This means that command_loop_1 won't try to select anything the first time through. */ From 0d3e774694d20e3cf496204fad3447bac9f13d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 10 Aug 2006 06:09:30 +0000 Subject: [PATCH 077/153] * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler to check if mutex should be locked or not. --- src/alloc.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index eb7acfd649f..192b974196f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -130,17 +130,27 @@ static pthread_mutex_t alloc_mutex; #define BLOCK_INPUT_ALLOC \ do \ { \ - pthread_mutex_lock (&alloc_mutex); \ - if (pthread_self () == main_thread) \ - BLOCK_INPUT; \ + if (!in_sighandler) \ + { \ + pthread_mutex_lock (&alloc_mutex); \ + if (pthread_self () == main_thread) \ + BLOCK_INPUT; \ + else \ + sigblock (sigmask (SIGIO)); \ + } \ } \ while (0) #define UNBLOCK_INPUT_ALLOC \ do \ { \ - if (pthread_self () == main_thread) \ - UNBLOCK_INPUT; \ - pthread_mutex_unlock (&alloc_mutex); \ + if (!in_sighandler) \ + { \ + pthread_mutex_unlock (&alloc_mutex); \ + if (pthread_self () == main_thread) \ + UNBLOCK_INPUT; \ + else \ + sigunblock (sigmask (SIGIO)); \ + } \ } \ while (0) From abef1dd799261ccb87282c30ad61b87e31b4dadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 10 Aug 2006 06:09:57 +0000 Subject: [PATCH 078/153] * keyboard.c: Define in_sighandler. (input_available_signal): Set in_sighandler. (init_keyboard): Initialize in_sighandler. * keyboard.h: Declare in_sighandler. * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler to check if mutex should be locked or not. --- src/ChangeLog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 678078d3781..abd06ed521c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2006-08-10 Jan Dj,Ad(Brv + + * keyboard.c: Define in_sighandler. + (input_available_signal): Set in_sighandler. + (init_keyboard): Initialize in_sighandler. + + * keyboard.h: Declare in_sighandler. + + * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler + to check if mutex should be locked or not. + 2006-08-09 Richard Stallman * keyboard.c (keyremap_step): No-op if fkey->parent = nil. From 3a799327579db6f05aeaf4a9cf6f9ae73e8cae88 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 10 Aug 2006 15:27:41 +0000 Subject: [PATCH 079/153] * emacs-lisp/edebug.el (edebug-recursive-edit): Don't save and restore unread-command-events here. (edebug-display): Do it here, to detect sit-for interruptions. --- lisp/emacs-lisp/edebug.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 8645ec5a6ed..e7f5a736ded 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2556,6 +2556,7 @@ MSG is printed after `::::} '." (edebug-outside-buffer (current-buffer)) (edebug-outside-point (point)) (edebug-outside-mark (edebug-mark)) + (edebug-outside-unread-command-events unread-command-events) edebug-outside-windows ; window or screen configuration edebug-buffer-points @@ -2574,6 +2575,7 @@ MSG is printed after `::::} '." (overlay-arrow-string overlay-arrow-string) (cursor-in-echo-area nil) (default-cursor-in-non-selected-windows t) + (unread-command-events nil) ;; any others?? ) (if (not (buffer-name edebug-buffer)) @@ -2681,8 +2683,7 @@ MSG is printed after `::::} '." ((eq edebug-execution-mode 'trace) (edebug-sit-for edebug-sit-for-seconds)) ; Force update and pause. ((eq edebug-execution-mode 'Trace-fast) - (edebug-sit-for 0)) ; Force update and continue. - ) + (edebug-sit-for 0))) ; Force update and continue. (unwind-protect (if (or edebug-stop @@ -2778,6 +2779,7 @@ MSG is printed after `::::} '." (with-timeout-unsuspend edebug-with-timeout-suspend) ;; Reset global variables to outside values in case they were changed. (setq + unread-command-events edebug-outside-unread-command-events overlay-arrow-position edebug-outside-o-a-p overlay-arrow-string edebug-outside-o-a-s cursor-in-echo-area edebug-outside-c-i-e-a @@ -2868,7 +2870,6 @@ MSG is printed after `::::} '." (edebug-outside-last-input-event last-input-event) (edebug-outside-last-command-event last-command-event) - (edebug-outside-unread-command-events unread-command-events) (edebug-outside-last-event-frame last-event-frame) (edebug-outside-last-nonmenu-event last-nonmenu-event) (edebug-outside-track-mouse track-mouse) @@ -2890,7 +2891,6 @@ MSG is printed after `::::} '." ;; More for Emacs 19 (last-input-event nil) (last-command-event nil) - (unread-command-events nil) (last-event-frame nil) (last-nonmenu-event nil) (track-mouse nil) @@ -2950,7 +2950,6 @@ MSG is printed after `::::} '." last-command edebug-outside-last-command this-command edebug-outside-this-command unread-command-char edebug-outside-unread-command-char - unread-command-events edebug-outside-unread-command-events current-prefix-arg edebug-outside-current-prefix-arg last-input-char edebug-outside-last-input-char last-input-event edebug-outside-last-input-event From 87c9ab0c7a97880e3303ad67692b3c627561bb1e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 10 Aug 2006 15:30:17 +0000 Subject: [PATCH 080/153] *** empty log message *** --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9d22cf958a7..213f5939f62 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-10 John Wiegley + + * eshell/em-glob.el (eshell-glob-chars-list) + (eshell-glob-translate-alist): Add support for [^g] in character globs. + 2006-08-10 Richard Stallman * facemenu.el (facemenu-add-face): Pass frame to facemenu-active-faces. From f80c9382efe996857f34ddd36ddfc7513dc08eb0 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 10 Aug 2006 15:30:56 +0000 Subject: [PATCH 081/153] (eshell-glob-chars-list) (eshell-glob-translate-alist): Add support for [^g] in character globs. --- lisp/eshell/em-glob.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el index 76bde7784dc..c700d5d7f6e 100644 --- a/lisp/eshell/em-glob.el +++ b/lisp/eshell/em-glob.el @@ -97,7 +97,7 @@ This option slows down recursive glob processing by quite a bit." :type 'boolean :group 'eshell-glob) -(defcustom eshell-glob-chars-list '(?\] ?\[ ?* ?? ?~ ?\( ?\) ?| ?#) +(defcustom eshell-glob-chars-list '(?\] ?\[ ?* ?? ?~ ?\( ?\) ?| ?# ?^) "*List of additional characters used in extended globbing." :type '(repeat character) :group 'eshell-glob) @@ -105,6 +105,7 @@ This option slows down recursive glob processing by quite a bit." (defcustom eshell-glob-translate-alist '((?\] . "]") (?\[ . "[") + (?^ . "^") (?? . ".") (?* . ".*") (?~ . "~") From 65b13f4bc0c6821e03a3d3be0f2ba4ad70001976 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 10 Aug 2006 16:07:43 +0000 Subject: [PATCH 082/153] Minor fix to last change. --- lisp/emacs-lisp/edebug.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index e7f5a736ded..5107ee60274 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2575,7 +2575,7 @@ MSG is printed after `::::} '." (overlay-arrow-string overlay-arrow-string) (cursor-in-echo-area nil) (default-cursor-in-non-selected-windows t) - (unread-command-events nil) + (unread-command-events unread-command-events) ;; any others?? ) (if (not (buffer-name edebug-buffer)) @@ -2664,6 +2664,7 @@ MSG is printed after `::::} '." (t (message ""))) + (setq unread-command-events nil) (if (eq 'after edebug-arg-mode) (progn ;; Display result of previous evaluation. From 43901444a44d09f2fab59a1127e2659426dcd53e Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 10 Aug 2006 18:43:55 +0000 Subject: [PATCH 083/153] (Recognize Coding, Text Coding): Fix typos. --- man/ChangeLog | 20 ++++++++++++-------- man/mule.texi | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 8d252755de6..6b14690768a 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2006-08-10 Sven Joachim (tiny change) + + * mule.texi (Recognize Coding, Text Coding): Fix typos. + 2006-08-10 Richard Stallman * text.texi (Format Faces): Substantial rewrites to deal @@ -51,7 +55,7 @@ * building.texi (GDB commands in Fringe): Rename to... (Source Buffers): ..this and move forward. Describe hollow arrow and new option gdb-find-source-frame. - + 2006-07-29 Richard Stallman * dired.texi (Operating on Files): Simplify previous change @@ -65,7 +69,7 @@ 2006-07-28 Richard Stallman * mark.texi (Transient Mark): Clarify that region never disappears - when Transient Mark mode is off, and not when it is on. + when Transient Mark mode is off, and not when it is on. 2006-07-27 Richard Stallman @@ -75,15 +79,15 @@ * xresources.texi (GTK styles): Fix texinfo usage. - * pgg.texi, org.texi, info.texi, forms.texi, flymake.texi: + * pgg.texi, org.texi, info.texi, forms.texi, flymake.texi: * faq.texi: Move periods and commas inside quotes. * commands.texi (User Input): Explain why we teach keyboard cmds. - - * xresources.texi, xresmini.texi, search.texi, programs.texi: - * misc.texi, kmacro.texi, killing.texi, glossary.texi: - * fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi: - * doclicense.texi, display.texi, dired.texi, basic.texi: + + * xresources.texi, xresmini.texi, search.texi, programs.texi: + * misc.texi, kmacro.texi, killing.texi, glossary.texi: + * fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi: + * doclicense.texi, display.texi, dired.texi, basic.texi: * anti.texi, ack.texi: Move periods and commas inside quotes. 2006-07-22 Eli Zaretskii diff --git a/man/mule.texi b/man/mule.texi index a49478dfe02..9437e30f485 100644 --- a/man/mule.texi +++ b/man/mule.texi @@ -785,7 +785,7 @@ file. The variable @code{file-coding-system-alist} specifies this correspondence. There is a special function @code{modify-coding-system-alist} for adding elements to this list. For example, to read and write all @samp{.txt} files using the coding system -@code{china-iso-8bit}, you can execute this Lisp expression: +@code{chinese-iso-8bit}, you can execute this Lisp expression: @smallexample (modify-coding-system-alist 'file "\\.txt\\'" 'chinese-iso-8bit) @@ -1003,7 +1003,7 @@ of with @kbd{C-x @key{RET} f}, there is no warning if the buffer contains characters that the coding system cannot handle. Other file commands affected by a specified coding system include -@kbd{C-x C-i} and @kbd{C-x C-v}, as well as the other-window variants +@kbd{C-x i} and @kbd{C-x C-v}, as well as the other-window variants of @kbd{C-x C-f}. @kbd{C-x @key{RET} c} also affects commands that start subprocesses, including @kbd{M-x shell} (@pxref{Shell}). If the immediately following command does not use the coding system, then From c40408fbe7d325d81ebe784f9565edb39ca23d9f Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Thu, 10 Aug 2006 20:06:19 +0000 Subject: [PATCH 084/153] * textmodes/dns-mode.el: Alias `zone-mode' to `dns-mode'. (dns-mode-soa-auto-increment-serial): New user option. (dns-mode-soa-maybe-increment-serial): New function. (dns-mode): Add the latter to `write-contents-functions'. * obsolete/zone-mode.el: Move to obsolete/ from net/. Delete autoload cookies. --- lisp/ChangeLog | 10 ++++++++++ lisp/{net => obsolete}/zone-mode.el | 2 -- lisp/textmodes/dns-mode.el | 29 +++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) rename lisp/{net => obsolete}/zone-mode.el (99%) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 213f5939f62..a994da42625 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2006-08-10 Romain Francoise + + * textmodes/dns-mode.el: Alias `zone-mode' to `dns-mode'. + (dns-mode-soa-auto-increment-serial): New user option. + (dns-mode-soa-maybe-increment-serial): New function. + (dns-mode): Add the latter to `write-contents-functions'. + + * obsolete/zone-mode.el: Move to obsolete/ from net/. + Delete autoload cookies. + 2006-08-10 John Wiegley * eshell/em-glob.el (eshell-glob-chars-list) diff --git a/lisp/net/zone-mode.el b/lisp/obsolete/zone-mode.el similarity index 99% rename from lisp/net/zone-mode.el rename to lisp/obsolete/zone-mode.el index 441ef143f9c..d8bfefc1e87 100644 --- a/lisp/net/zone-mode.el +++ b/lisp/obsolete/zone-mode.el @@ -64,7 +64,6 @@ (error "Serial numbers want to move backwards from %s to %s" old-serial new-serial) (replace-match (concat cur-date new-seq old-flag) t t)))))) -;;;###autoload (defun zone-mode-update-serial-hook () "Update the serial number in a zone if the file was modified." (interactive) @@ -82,7 +81,6 @@ (modify-syntax-entry ?\; "<" zone-mode-syntax-table) (modify-syntax-entry ?\n ">" zone-mode-syntax-table)) -;;;###autoload (define-derived-mode zone-mode fundamental-mode "zone" "A mode for editing DNS zone files. diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el index a323d4c4468..78be0f888a3 100644 --- a/lisp/textmodes/dns-mode.el +++ b/lisp/textmodes/dns-mode.el @@ -90,6 +90,18 @@ :type 'sexp :group 'dns-mode) +(defcustom dns-mode-soa-auto-increment-serial t + "Whether to increment the SOA serial number automatically. + +If this variable is t, the serial number is incremented upon each save of +the file. If it is `ask', Emacs asks for confirmation whether it should +increment the serial upon saving. If nil, serials must be incremented +manually with \\[dns-mode-soa-increment-serial]." + :type '(choice (const :tag "Always" t) + (const :tag "Ask" ask) + (const :tag "Never" nil)) + :group 'dns-mode) + ;; Syntax table. (defvar dns-mode-syntax-table @@ -135,8 +147,12 @@ Turning on DNS mode runs `dns-mode-hook'." (unless (featurep 'xemacs) (set (make-local-variable 'font-lock-defaults) '(dns-mode-font-lock-keywords nil nil ((?_ . "w"))))) + (add-hook 'write-contents-functions 'dns-mode-soa-maybe-increment-serial + nil t) (easy-menu-add dns-mode-menu dns-mode-map)) +;;;###autoload (defalias 'zone-mode 'dns-mode) + ;; Tools. ;;;###autoload @@ -192,6 +208,19 @@ Turning on DNS mode runs `dns-mode-hook'." (message "Replaced old serial %s with %s" serial new)) (error "Cannot locate serial number in SOA record")))))) +(defun dns-mode-soa-maybe-increment-serial () + "Increment SOA serial if needed. + +This function is run from `write-contents-functions'." + (when (and (buffer-modified-p) + dns-mode-soa-auto-increment-serial + (or (eq dns-mode-soa-auto-increment-serial t) + (y-or-n-p "Increment SOA serial? "))) + ;; We must return nil. If `dns-mode-soa-increment-serial' signals + ;; an error saving will fail but that probably means that the + ;; serial should be fixed to comply with the RFC anyway! -rfr + (progn (dns-mode-soa-increment-serial) nil))) + ;;;###autoload(add-to-list 'auto-mode-alist '("\\.soa\\'" . dns-mode)) (provide 'dns-mode) From 82a33a215e1556251d6e0d8c1789d78ede98a88d Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Thu, 10 Aug 2006 20:07:08 +0000 Subject: [PATCH 085/153] Mention that zone-mode.el is now obsolete. --- etc/ChangeLog | 4 ++++ etc/NEWS | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index b708594aa32..c900ed296da 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2006-08-10 Romain Francoise + + * NEWS: Mention that zone-mode.el is now obsolete. + 2006-08-09 Richard Stallman * TUTORIAL: Don't say which side scroll bar is on. diff --git a/etc/NEWS b/etc/NEWS index 3f986846f17..0a8adc534be 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1771,9 +1771,8 @@ type "C-h i m org RET" to read that manual. A reference card is available in `etc/orgcard.tex' and `etc/orgcard.ps'. +++ -** The new package dns-mode.el add syntax highlight of DNS master files. -The key binding C-c C-s (`dns-mode-soa-increment-serial') can be used -to increment the SOA serial. +** The new package dns-mode.el adds syntax highlighting of DNS master files. +It is a modern replacement for zone-mode.el, which is now obsolete. --- ** The new global minor mode `file-name-shadow-mode' modifies the way @@ -3512,6 +3511,9 @@ variable `calculator-radix-grouping-mode'. --- ** iso-acc.el is now obsolete. Use one of the latin input methods instead. +--- +** zone-mode.el is now obsolete. Use dns-mode.el instead. + --- ** cplus-md.el has been deleted. From 9fc68699c62e1efe177e4dcce268ef74eef4dde9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 11 Aug 2006 07:30:14 +0000 Subject: [PATCH 086/153] * xselect.c (Fx_register_dnd_atom): New function. (syms_of_xselect): Defsubr it. (x_handle_dnd_message): Check that message_type is in dpyinfo->x_dnd_atoms before generating lisp event. --- src/xselect.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/src/xselect.c b/src/xselect.c index fcac2860359..013a52dbdb1 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -2677,8 +2677,48 @@ If the value is 0 or the atom is not known, return the empty string. */) return ret; } -/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. - TODO: Check if this client event really is a DND event? */ +DEFUN ("x-register-dnd-atom", Fx_register_dnd_atom, + Sx_register_dnd_atom, 1, 2, 0, + doc: /* Request that dnd events are made for ClientMessages with ATOM. +ATOM can be a symbol or a string. The ATOM is interned on the display that +FRAME is on. If FRAME is nil, the selected frame is used. */) + (atom, frame) + Lisp_Object atom, frame; +{ + Atom x_atom; + struct frame *f = check_x_frame (frame); + size_t i; + struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + + + if (SYMBOLP (atom)) + x_atom = symbol_to_x_atom (dpyinfo, FRAME_X_DISPLAY (f), atom); + else if (STRINGP (atom)) + { + BLOCK_INPUT; + x_atom = XInternAtom (FRAME_X_DISPLAY (f), (char *) SDATA (atom), False); + UNBLOCK_INPUT; + } + else + error ("ATOM must be a symbol or a string"); + + for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) + if (dpyinfo->x_dnd_atoms[i] == x_atom) + return Qnil; + + if (dpyinfo->x_dnd_atoms_length == dpyinfo->x_dnd_atoms_size) + { + dpyinfo->x_dnd_atoms_size *= 2; + dpyinfo->x_dnd_atoms = xrealloc (dpyinfo->x_dnd_atoms, + sizeof (*dpyinfo->x_dnd_atoms) + * dpyinfo->x_dnd_atoms_size); + } + + dpyinfo->x_dnd_atoms[dpyinfo->x_dnd_atoms_length++] = x_atom; + return Qnil; +} + +/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. */ int x_handle_dnd_message (f, event, dpyinfo, bufp) @@ -2694,6 +2734,12 @@ x_handle_dnd_message (f, event, dpyinfo, bufp) int x, y; unsigned char *data = (unsigned char *) event->data.b; int idata[5]; + size_t i; + + for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) + if (dpyinfo->x_dnd_atoms[i] == event->message_type) break; + + if (i == dpyinfo->x_dnd_atoms_length) return 0; XSETFRAME (frame, f); @@ -2867,6 +2913,7 @@ syms_of_xselect () defsubr (&Sx_get_atom_name); defsubr (&Sx_send_client_message); + defsubr (&Sx_register_dnd_atom); reading_selection_reply = Fcons (Qnil, Qnil); staticpro (&reading_selection_reply); From 9f562c51d616d1e534771600368e16705269c625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 11 Aug 2006 07:30:36 +0000 Subject: [PATCH 087/153] * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track of drag and drop Atoms. --- src/xterm.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xterm.h b/src/xterm.h index 10a9aaa2961..9aa1d8fcacb 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -389,6 +389,12 @@ struct x_display_info X_WMTYPE_A, X_WMTYPE_B } wm_type; + + + /* Atoms that are drag and drop atoms */ + Atom *x_dnd_atoms; + size_t x_dnd_atoms_size; + size_t x_dnd_atoms_length; }; #ifdef HAVE_X_I18N From 93acf8f34d3cdbe9e23f0207ff6285c759c67bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 11 Aug 2006 07:30:56 +0000 Subject: [PATCH 088/153] * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms* --- src/xterm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index 4203411e888..6fb9ee28f42 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10584,6 +10584,11 @@ x_term_init (display_name, xrm_option, resource_name) dpyinfo->cut_buffers_initialized = 0; + dpyinfo->x_dnd_atoms_size = 8; + dpyinfo->x_dnd_atoms_length = 0; + dpyinfo->x_dnd_atoms = xmalloc (sizeof (*dpyinfo->x_dnd_atoms) + * dpyinfo->x_dnd_atoms_size); + connection = ConnectionNumber (dpyinfo->display); dpyinfo->connection = connection; From 0c584069b6212a25be12aa9edf2f713b03f54f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 11 Aug 2006 07:31:14 +0000 Subject: [PATCH 089/153] * xselect.c (Fx_register_dnd_atom): New function. (syms_of_xselect): Defsubr it. (x_handle_dnd_message): Check that message_type is in dpyinfo->x_dnd_atoms before generating lisp event. * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track of drag and drop Atoms. * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms* --- src/ChangeLog | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index abd06ed521c..b4016b546c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2006-08-11 Jan Dj,Ad(Brv + + * xselect.c (Fx_register_dnd_atom): New function. + (syms_of_xselect): Defsubr it. + (x_handle_dnd_message): Check that message_type is in + dpyinfo->x_dnd_atoms before generating lisp event. + + * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track + of drag and drop Atoms. + + * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms* + + 2006-08-10 Jan Dj,Ad(Brv * keyboard.c: Define in_sighandler. From 2f2f340fb561971fef6a846ff4621c69dab0a969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 11 Aug 2006 07:32:39 +0000 Subject: [PATCH 090/153] * x-dnd.el (x-dnd-init-frame): Call x-register-dnd-atom. --- lisp/ChangeLog | 4 ++++ lisp/x-dnd.el | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a994da42625..ada27d2c275 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-08-11 Jan Dj,Ad(Brv + + * x-dnd.el (x-dnd-init-frame): Call x-register-dnd-atom. + 2006-08-10 Romain Francoise * textmodes/dns-mode.el: Alias `zone-mode' to `dns-mode'. diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index 693a2d7fa4b..81fe9a8e868 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -121,6 +121,12 @@ any protocol specific data.") (defun x-dnd-init-frame (&optional frame) "Setup drag and drop for FRAME (i.e. create appropriate properties)." + (x-register-dnd-atom "DndProtocol" frame) + (x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame) + (x-register-dnd-atom "XdndEnter" frame) + (x-register-dnd-atom "XdndPosition" frame) + (x-register-dnd-atom "XdndLeave" frame) + (x-register-dnd-atom "XdndDrop" frame) (x-dnd-init-xdnd-for-frame frame) (x-dnd-init-motif-for-frame frame)) From bad03cfc8030793473927dff7f8c87bc45fc4bbe Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 11 Aug 2006 09:28:44 +0000 Subject: [PATCH 091/153] (bindat-ip-to-string): Use `format-network-address' if possible. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/bindat.el | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ada27d2c275..a6ee985c659 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-11 Thien-Thi Nguyen + + * emacs-lisp/bindat.el (bindat-ip-to-string): + Use `format-network-address' if possible. + 2006-08-11 Jan Dj,Ad(Brv * x-dnd.el (x-dnd-init-frame): Call x-register-dnd-atom. diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index d05eed2c4a2..1b37f3f772f 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -619,9 +619,12 @@ If optional second arg SEP is a string, use that as separator." (bindat-format-vector vect "%02x" (if (stringp sep) sep ":"))) (defun bindat-ip-to-string (ip) - "Format vector IP as an ip address in dotted notation." - (format "%d.%d.%d.%d" - (aref ip 0) (aref ip 1) (aref ip 2) (aref ip 3))) + "Format vector IP as an ip address in dotted notation. +The port (if any) is omitted. IP can be a string, as well." + (if (vectorp ip) + (format-network-address ip t) + (format "%d.%d.%d.%d" + (aref ip 0) (aref ip 1) (aref ip 2) (aref ip 3)))) (provide 'bindat) From aa7adb2ada9a42f088c2edb234248d7e078d19c6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 11 Aug 2006 13:56:50 +0000 Subject: [PATCH 092/153] (dns-mode): Use before-save-hook. --- lisp/ChangeLog | 4 ++++ lisp/textmodes/dns-mode.el | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a6ee985c659..7bb97d09b86 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2006-08-11 Stefan Monnier + + * textmodes/dns-mode.el (dns-mode): Use before-save-hook. + 2006-08-11 Thien-Thi Nguyen * emacs-lisp/bindat.el (bindat-ip-to-string): diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el index 78be0f888a3..8ee69f03d7b 100644 --- a/lisp/textmodes/dns-mode.el +++ b/lisp/textmodes/dns-mode.el @@ -147,7 +147,7 @@ Turning on DNS mode runs `dns-mode-hook'." (unless (featurep 'xemacs) (set (make-local-variable 'font-lock-defaults) '(dns-mode-font-lock-keywords nil nil ((?_ . "w"))))) - (add-hook 'write-contents-functions 'dns-mode-soa-maybe-increment-serial + (add-hook 'before-save-hook 'dns-mode-soa-maybe-increment-serial nil t) (easy-menu-add dns-mode-menu dns-mode-map)) @@ -211,15 +211,17 @@ Turning on DNS mode runs `dns-mode-hook'." (defun dns-mode-soa-maybe-increment-serial () "Increment SOA serial if needed. -This function is run from `write-contents-functions'." +This function is run from `before-save-hook'." (when (and (buffer-modified-p) dns-mode-soa-auto-increment-serial (or (eq dns-mode-soa-auto-increment-serial t) (y-or-n-p "Increment SOA serial? "))) - ;; We must return nil. If `dns-mode-soa-increment-serial' signals + ;; If `dns-mode-soa-increment-serial' signals ;; an error saving will fail but that probably means that the ;; serial should be fixed to comply with the RFC anyway! -rfr - (progn (dns-mode-soa-increment-serial) nil))) + (progn (dns-mode-soa-increment-serial) + ;; We return nil in case this is used in write-contents-functions. + nil))) ;;;###autoload(add-to-list 'auto-mode-alist '("\\.soa\\'" . dns-mode)) From b3302d9b0af367b9ef4e7f6663d5cb8f58725173 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 11 Aug 2006 14:11:10 +0000 Subject: [PATCH 093/153] * emacs-lisp/edebug.el (edebug-recursive-edit): Don't save and restore unread-command-events here. (edebug-display): Do it here, to detect sit-for interruptions. --- lisp/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7bb97d09b86..775b5dcfd05 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-08-10 Chong Yidong + + * emacs-lisp/edebug.el (edebug-recursive-edit): Don't save and + restore unread-command-events here. + (edebug-display): Do it here, to detect sit-for interruptions. + 2006-08-11 Stefan Monnier * textmodes/dns-mode.el (dns-mode): Use before-save-hook. From 08eedb79230d76e2faa005e8c343f744d0489a33 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Fri, 11 Aug 2006 14:11:24 +0000 Subject: [PATCH 094/153] Fix formatting/indentation. --- lisp/textmodes/dns-mode.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el index 8ee69f03d7b..21fe137118f 100644 --- a/lisp/textmodes/dns-mode.el +++ b/lisp/textmodes/dns-mode.el @@ -216,12 +216,12 @@ This function is run from `before-save-hook'." dns-mode-soa-auto-increment-serial (or (eq dns-mode-soa-auto-increment-serial t) (y-or-n-p "Increment SOA serial? "))) - ;; If `dns-mode-soa-increment-serial' signals - ;; an error saving will fail but that probably means that the - ;; serial should be fixed to comply with the RFC anyway! -rfr + ;; If `dns-mode-soa-increment-serial' signals an error saving will + ;; fail but that probably means that the serial should be fixed to + ;; comply with the RFC anyway! -rfr (progn (dns-mode-soa-increment-serial) - ;; We return nil in case this is used in write-contents-functions. - nil))) + ;; We return nil in case this is used in write-contents-functions. + nil))) ;;;###autoload(add-to-list 'auto-mode-alist '("\\.soa\\'" . dns-mode)) From 946c199400a4eb2fa4a2d0889f1a6db5cb812a44 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Fri, 11 Aug 2006 15:42:48 +0000 Subject: [PATCH 095/153] Delete zone-mode.el. --- lisp/ChangeLog | 12 ++-- lisp/obsolete/zone-mode.el | 118 ------------------------------------- 2 files changed, 8 insertions(+), 122 deletions(-) delete mode 100644 lisp/obsolete/zone-mode.el diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 775b5dcfd05..ba902ce657f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,8 +1,6 @@ -2006-08-10 Chong Yidong +2006-08-11 Romain Francoise - * emacs-lisp/edebug.el (edebug-recursive-edit): Don't save and - restore unread-command-events here. - (edebug-display): Do it here, to detect sit-for interruptions. + * obsolete/zone-mode.el: Delete. 2006-08-11 Stefan Monnier @@ -17,6 +15,12 @@ * x-dnd.el (x-dnd-init-frame): Call x-register-dnd-atom. +2006-08-10 Chong Yidong + + * emacs-lisp/edebug.el (edebug-recursive-edit): Don't save and + restore unread-command-events here. + (edebug-display): Do it here, to detect sit-for interruptions. + 2006-08-10 Romain Francoise * textmodes/dns-mode.el: Alias `zone-mode' to `dns-mode'. diff --git a/lisp/obsolete/zone-mode.el b/lisp/obsolete/zone-mode.el deleted file mode 100644 index d8bfefc1e87..00000000000 --- a/lisp/obsolete/zone-mode.el +++ /dev/null @@ -1,118 +0,0 @@ -;;; zone-mode.el --- major mode for editing DNS zone files - -;; Copyright (C) 1998, 2002, 2003, 2004, 2005, -;; 2006 Free Software Foundation, Inc. - -;; Author: John Heidemann -;; Keywords: DNS, languages - -;; 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., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. - -;;; Commentary: - -;;; -;;; See the comments in ``define-derived-mode zone-mode'' -;;; (the last function in this file) -;;; for what this mode is and how to use it automatically. -;;; - -;;; -;;; Credits: -;;; Zone-mode was written by John Heidemann , -;;; with bug fixes from Simon Leinen . -;;; - -;;; Code: - -(defun zone-mode-update-serial () - "Update the serial number in a zone." - (interactive) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward "\\b\\([0-9]+\\)\\([0-9][0-9]\\)\\([ \t]+;[ \t]+[Ss]erial\\)" (point-max) t) - (let* ((old-date (match-string 1)) - (old-seq (match-string 2)) - (old-seq-num (string-to-number (match-string 2))) - (old-flag (match-string 3)) - (cur-date (format-time-string "%Y%m%d")) - (new-seq - (cond - ((not (string= old-date cur-date)) - "00") ;; reset sequence number - ((>= old-seq-num 99) - (error "Serial number's sequence cannot increment beyond 99")) - (t - (format "%02d" (1+ old-seq-num))))) - (old-serial (concat old-date old-seq)) - (new-serial (concat cur-date new-seq))) - (if (string-lessp new-serial old-serial) - (error "Serial numbers want to move backwards from %s to %s" old-serial new-serial) - (replace-match (concat cur-date new-seq old-flag) t t)))))) - -(defun zone-mode-update-serial-hook () - "Update the serial number in a zone if the file was modified." - (interactive) - (if (buffer-modified-p (current-buffer)) - (zone-mode-update-serial)) - nil ;; so we can run from write-file-hooks - ) - -(defvar zone-mode-syntax-table nil - "Zone-mode's syntax table.") - -(defun zone-mode-load-time-setup () - "Initialize `zone-mode' stuff." - (setq zone-mode-syntax-table (make-syntax-table)) - (modify-syntax-entry ?\; "<" zone-mode-syntax-table) - (modify-syntax-entry ?\n ">" zone-mode-syntax-table)) - -(define-derived-mode zone-mode fundamental-mode "zone" - "A mode for editing DNS zone files. - -Zone-mode does two things: - - - automatically update the serial number for a zone - when saving the file - - - fontification" - - (add-hook 'write-file-functions 'zone-mode-update-serial-hook nil t) - - (if (null zone-mode-syntax-table) - (zone-mode-load-time-setup)) ;; should have been run at load-time - - ;; font-lock support: - (set-syntax-table zone-mode-syntax-table) - (make-local-variable 'comment-start) - (setq comment-start ";") - (make-local-variable 'comment-start-skip) - ;; Look within the line for a ; following an even number of backslashes - ;; after either a non-backslash or the line beginning. - (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*") - (make-local-variable 'comment-column) - (setq comment-column 40) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults - '(nil nil nil nil beginning-of-line))) - -(zone-mode-load-time-setup) - -(provide 'zone-mode) - -;;; arch-tag: 6a2940ef-fd4f-4de7-b979-b027b09821fe -;;; zone-mode.el ends here From d5e5361f9fbc64540b42cefb819efec84fa910b3 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Fri, 11 Aug 2006 15:43:40 +0000 Subject: [PATCH 096/153] (Acknowledgments): Delete mention to zone-mode.el. --- man/ChangeLog | 4 ++++ man/ack.texi | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 6b14690768a..ca5ad50bacd 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2006-08-11 Romain Francoise + + * ack.texi (Acknowledgments): Delete mention to zone-mode.el. + 2006-08-10 Sven Joachim (tiny change) * mule.texi (Recognize Coding, Text Coding): Fix typos. diff --git a/man/ack.texi b/man/ack.texi index 7294cdc3350..67c731d6174 100644 --- a/man/ack.texi +++ b/man/ack.texi @@ -419,8 +419,6 @@ them. @item John Heidemann wrote @file{mouse-copy.el} and @file{mouse-drag.el}, which provide alternative mouse-based editing and scrolling features. -He also contributed @file{zone-mode.el}, a major mode for editing DNS -zone files. @item Jon K Hellan wrote @file{utf7.el}, support for mail-safe transformation From d0cd961e58fb5e421377fad88b1037546e9bec93 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 11:36:15 +0000 Subject: [PATCH 097/153] (Fmouse_position, Fmouse_pixel_position) (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix. --- src/frame.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/frame.c b/src/frame.c index 1fdeb129f89..82a016be69e 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1429,7 +1429,8 @@ The functions are run with one arg, the frame to be deleted. */) DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. The position is given in character cells, where (0, 0) is the -upper-left corner. +upper-left corner of the frame, X is the horizontal offset, and Y is +the vertical offset. If Emacs is running on a mouseless terminal or hasn't been programmed to read the mouse position, it returns the selected frame for FRAME and nil for X and Y. @@ -1477,7 +1478,8 @@ DEFUN ("mouse-pixel-position", Fmouse_pixel_position, Smouse_pixel_position, 0, 0, 0, doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. The position is given in pixel units, where (0, 0) is the -upper-left corner. +upper-left corner of the frame, X is the horizontal offset, and Y is +the vertical offset. If Emacs is running on a mouseless terminal or hasn't been programmed to read the mouse position, it returns the selected frame for FRAME and nil for X and Y. */) @@ -1510,6 +1512,10 @@ Coordinates are relative to the frame, not a window, so the coordinates of the top left character in the frame may be nonzero due to left-hand scroll bars or the menu bar. +The position is given in character cells, where (0, 0) is the +upper-left corner of the frame, X is the horizontal offset, and Y is +the vertical offset. + This function is a no-op for an X frame that is not visible. If you have just created a frame, you must wait for it to become visible before calling this function on it, like this. @@ -1542,6 +1548,9 @@ before calling this function on it, like this. DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, Sset_mouse_pixel_position, 3, 3, 0, doc: /* Move the mouse pointer to pixel position (X,Y) in FRAME. +The position is given in pixels, where (0, 0) is the upper-left corner +of the frame, X is the horizontal offset, and Y is the vertical offset. + Note, this is a no-op for an X frame that is not visible. If you have just created a frame, you must wait for it to become visible before calling this function on it, like this. From 5bfef96c0fc21d566a752a2c0fbd512811b7c84e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 12:00:30 +0000 Subject: [PATCH 098/153] (Saving Emacs Sessions): Clarify when desktop is restored on startup. --- man/misc.texi | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/man/misc.texi b/man/misc.texi index 6f6d448bc7d..33c85a9fc8b 100644 --- a/man/misc.texi +++ b/man/misc.texi @@ -1999,9 +1999,10 @@ subsequent Emacs sessions reload the saved desktop. @vindex desktop-save-mode You can save the desktop manually with the command @kbd{M-x desktop-save}. You can also enable automatic desktop saving when -you exit Emacs: use the Customization buffer (@pxref{Easy -Customization}) to set @code{desktop-save-mode} to @code{t} for future -sessions, or add this line in your @file{~/.emacs} file: +you exit Emacs and its restoring when Emacs starts: use the +Customization buffer (@pxref{Easy Customization}) to set +@code{desktop-save-mode} to @code{t} for future sessions, or add this +line in your @file{~/.emacs} file: @example (desktop-save-mode 1) @@ -2009,7 +2010,8 @@ sessions, or add this line in your @file{~/.emacs} file: @findex desktop-change-dir @findex desktop-revert - When Emacs starts, it looks for a saved desktop in the current + If you turn on @code{desktop-save-mode} in your @file{~/.emacs}, +then when Emacs starts, it looks for a saved desktop in the current directory. Thus, you can have separate saved desktops in different directories, and the starting directory determines which one Emacs reloads. You can save the current desktop and reload one saved in @@ -2018,7 +2020,10 @@ another directory by typing @kbd{M-x desktop-change-dir}. Typing Specify the option @samp{--no-desktop} on the command line when you don't want it to reload any saved desktop. This turns off -@code{desktop-save-mode} for the current session. +@code{desktop-save-mode} for the current session. Starting Emacs with +the @samp{--no-init-file} option also disables desktop reloading, +since it bypasses the @file{.emacs} init file, where +@code{desktop-save-mode} is usually turned on. @vindex desktop-restore-eager By default, all the buffers in the desktop are restored at one go. From c97f19653b493b272845daf68798c3e96ad6f3d1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 12:04:04 +0000 Subject: [PATCH 099/153] Clarify that bootstrap and the shorter procedure are alternatives. --- INSTALL.CVS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.CVS b/INSTALL.CVS index ce3fa9f2627..3716930eccc 100644 --- a/INSTALL.CVS +++ b/INSTALL.CVS @@ -12,8 +12,8 @@ The bootstrap process makes sure all necessary files are rebuilt before it builds the final Emacs binary. Normally, it is not necessary to use "make bootstrap" after every CVS -update. Unless there are problems, we suggest the following -procedure: +update. Unless there are problems, we suggest to use the following +alternative procedure, after you did "make bootstrap" at least once: $ ./configure $ make From 48bd8440bc61d1d994f6139735270b1e7ca37035 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 12:33:32 +0000 Subject: [PATCH 100/153] (allout-prior-bindings, allout-added-bindings): Remove, after long deprecation. (allout-beginning-of-line-cycles, allout-end-of-line-cycles): Add customization vars controlling allout-beginning-of-line and allout-end-of-line conveniences. (allout-header-prefix, allout-use-mode-specific-leader) (allout-use-mode-specific-leader, allout-mode-leaders): Revised docstrings. (allout-infer-header-lead): Change to be an alias for allout-infer-header-lead-and-primary-bullet. (allout-infer-header-lead-and-primary-bullet): New version of allout-infer-header-lead which assigns the primary bullet to the same as the header lead, when its being changed. (allout-infer-body-reindent): Apply regexp-quote instead of unconditionally prepending "\\", so that all literal allout-header-prefix and allout-primary-bullet strings are properly handled. (allout-add-resumptions): Add optional qualifier for extending or appending to existing values, rather than replacing them. (allout-view-change-hook): Clarify docstring. (allout-exposure-change-hook): Take explicit arguments, via run-hook-with-args. (allout-structure-added-hook, allout-structure-deleted-hook) (allout-structure-shifted-hook): New hooks analogous to allout-exposure-change-hook for other kinds of structural outline edits. (allout-encryption-plaintext-sanitization-regexps): New encryption customization variable, by which cooperating modes can provde massage of the plaintext without actually being passed it. (allout-encryption-ciphertext-rejection-regexps) (allout-encryption-ciphertext-rejection-ceiling): New encryption customization variables, by which cooperating modes can prohibit rare but possible ciphertext patterns from fouling their operation, with actually being passed the ciphertext. (allout-mode): Run activation and deactivation hooks after the minor-mode variable has been toggled, to clarify the mode disposition. The new encryption ciphertext rejection variable is used to ensure that the ciphertext does not contain text that would be recognized as outline structural elements by allout. Substite allout-beginning-of-line and allout-end-of-line for conventionall beginning-of-line and end-of-line bindings. If allout-old-style-prefixes is non-nil, don't nullify it on mode activation! (allout-beginning-of-line): Respect `allout-beginning-of-line-cycles'. (allout-end-of-line): Respect `allout-end-of-line-cycles'. (allout-chart-subtree): Implement new mode, charting only the visible items in the subtree, when new 'visible' parameter is non-nil. (allout-end-of-subtree): Properly handle the last item in the buffer. (allout-pre-command-business, allout-command-counter): Increment an advertised counter so that cooperating enhancements can track revisions of items. (allout-open-topic): Run allout-structure-added-hook with suitable arguments. (allout-shift-in): Run allout-structure-shifted-hook with suitable arguments. (allout-shift-out): Fix doubling for negative args and ensure call of allout-structure-shifted-hook by solely using allout-shift-in. (allout-kill-line, allout-kill-topic): Run allout-structure-deleted-hook with suitable arguments. (allout-yank-processing): Run allout-structure-added-hook with proper arguments. (allout-yank): Enclose activity in allout-unprotected. (allout-flag-region): Run allout-exposure-change-hook with suitable arguments, instead of making the callee infer the arguments. (allout-encrypt-string): Support allout-encryption-plaintext-sanitization-regexps, allout-encryption-ciphertext-rejection-regexps, and allout-encryption-ciphertext-rejection-ceiling. Indicate correct en/decryption mode in symmetric encryption failure message. (allout-obtain-passphrase): Use copy-sequence to get a distinct copy of the passphrase, and don't zero it or we'll corrupt the stashed copy. (allout-create-encryption-passphrase-verifier) (allout-verify-passphrase): Respect the new signature for allout-encrypt-string. (allout-get-configvar-values): Convenience for getting a configuration variable value and handling its absence gracefully. --- lisp/allout.el | 811 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 571 insertions(+), 240 deletions(-) diff --git a/lisp/allout.el b/lisp/allout.el index f1f262c70b7..379f664d092 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -213,15 +213,73 @@ just the header." (put 'allout-show-bodies 'safe-local-variable (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil))))) +;;;_ = allout-beginning-of-line-cycles +(defcustom allout-beginning-of-line-cycles t + "*If non-nil, \\[allout-beginning-of-line] will cycle through smart-placement options. + +Cycling only happens on when the command is repeated, not when it +follows a different command. + +Smart-placement means that repeated calls to this function will +advance as follows: + + - if the cursor is on a non-headline body line and not on the first column: + then it goes to the first column + - if the cursor is on the first column of a non-headline body line: + then it goes to the start of the headline within the item body + - if the cursor is on the headline and not the start of the headline: + then it goes to the start of the headline + - if the cursor is on the start of the headline: + then it goes to the bullet character \(for hotspot navigation\) + - if the cursor is on the bullet character: + then it goes to the first column of that line \(the headline\) + - if the cursor is on the first column of the headline: + then it goes to the start of the headline within the item body. + +In this fashion, you can use the beginning-of-line command to do +its normal job and then, when repeated, advance through the +entry, cycling back to start. + +If this configuration variable is nil, then the cursor is just +advanced to the beginning of the line and remains there on +repeated calls." + :type 'boolean :group 'allout) +;;;_ = allout-end-of-line-cycles +(defcustom allout-end-of-line-cycles t + "*If non-nil, \\[allout-end-of-line] will cycle through smart-placement options. + +Cycling only happens on when the command is repeated, not when it +follows a different command. + +Smart-placement means that repeated calls to this function will +advance as follows: + + - if the cursor is not on the end-of-line, + then it goes to the end-of-line + - if the cursor is on the end-of-line but not the end-of-entry, + then it goes to the end-of-entry, exposing it if necessary + - if the cursor is on the end-of-entry, + then it goes to the end of the head line + +In this fashion, you can use the end-of-line command to do its +normal job and then, when repeated, advance through the entry, +cycling back to start. + +If this configuration variable is nil, then the cursor is just +advanced to the end of the line and remains there on repeated +calls." + :type 'boolean :group 'allout) + ;;;_ = allout-header-prefix (defcustom allout-header-prefix "." +;; this string is treated as literal match. it will be `regexp-quote'd, so +;; one cannot use regular expressions to match varying header prefixes. "*Leading string which helps distinguish topic headers. Outline topic header lines are identified by a leading topic header prefix, which mostly have the value of this var at their front. -\(Level 1 topics are exceptions. They consist of only a single -character, which is typically set to the `allout-primary-bullet'. Many -outlines start at level 2 to avoid this discrepancy." +Level 1 topics are exceptions. They consist of only a single +character, which is typically set to the `allout-primary-bullet'." :type 'string :group 'allout) (make-variable-buffer-local 'allout-header-prefix) @@ -300,11 +358,13 @@ strings." (defcustom allout-use-mode-specific-leader t "*When non-nil, use mode-specific topic-header prefixes. -Allout outline mode will use the mode-specific `allout-mode-leaders' -and/or comment-start string, if any, to lead the topic prefix string, -so topic headers look like comments in the programming language. +Allout outline mode will use the mode-specific `allout-mode-leaders' or +comment-start string, if any, to lead the topic prefix string, so topic +headers look like comments in the programming language. It will also use +the comment-start string, with an '_' appended, for `allout-primary-bullet'. -String values are used as they stand. +String values are used as literals, not regular expressions, so +do not escape any regulare-expression characters. Value t means to first check for assoc value in `allout-mode-leaders' alist, then use comment-start string, if any, then use default \(`.'). @@ -313,15 +373,17 @@ alist, then use comment-start string, if any, then use default \(`.'). Set to the symbol for either of `allout-mode-leaders' or `comment-start' to use only one of them, respectively. -Value nil means to always use the default \(`.'). +Value nil means to always use the default \(`.') and leave +`allout-primary-bullet' unaltered. -comment-start strings that do not end in spaces are tripled, and an -`_' underscore is tacked on the end, to distinguish them from regular -comment strings. comment-start strings that do end in spaces are not -tripled, but an underscore is substituted for the space. [This -presumes that the space is for appearance, not comment syntax. You -can use `allout-mode-leaders' to override this behavior, when -incorrect.]" +comment-start strings that do not end in spaces are tripled in +the header-prefix, and an `_' underscore is tacked on the end, to +distinguish them from regular comment strings. comment-start +strings that do end in spaces are not tripled, but an underscore +is substituted for the space. [This presumes that the space is +for appearance, not comment syntax. You can use +`allout-mode-leaders' to override this behavior, when +undesired.]" :type '(choice (const t) (const nil) string (const allout-mode-leaders) (const comment-start)) @@ -334,13 +396,14 @@ incorrect.]" (defvar allout-mode-leaders '() "Specific allout-prefix leading strings per major modes. -Entries will be used instead or in lieu of mode-specific -comment-start strings. See also `allout-use-mode-specific-leader'. +Use this if the mode's comment-start string isn't what you +prefer, or if the mode lacks a comment-start string. See +`allout-use-mode-specific-leader' for more details. If you're constructing a string that will comment-out outline structuring so it can be included in program code, append an extra character, like an \"_\" underscore, to distinguish the lead string -from regular comments that start at bol.") +from regular comments that start at the beginning-of-line.") ;;;_ = allout-old-style-prefixes (defcustom allout-old-style-prefixes nil @@ -828,9 +891,9 @@ language comments. Returns the leading string." (setq allout-reindent-bodies nil) (allout-reset-header-lead header-lead) header-lead) -;;;_ > allout-infer-header-lead () -(defun allout-infer-header-lead () - "Determine appropriate `allout-header-prefix'. +;;;_ > allout-infer-header-lead-and-primary-bullet () +(defun allout-infer-header-lead-and-primary-bullet () + "Determine appropriate `allout-header-prefix' and `allout-primary-bullet'. Works according to settings of: @@ -874,10 +937,14 @@ invoking it directly." "_"))))))) (if (not leader) nil - (if (string= leader allout-header-prefix) - nil ; no change, nothing to do. - (setq allout-header-prefix leader) - allout-header-prefix)))) + (setq allout-header-prefix leader) + (if (not allout-old-style-prefixes) + ;; setting allout-primary-bullet makes the top level topics use - + ;; actually, be - the special prefix: + (setq allout-primary-bullet leader)) + allout-header-prefix))) +(defalias 'allout-infer-header-lead + 'allout-infer-header-lead-and-primary-bullet) ;;;_ > allout-infer-body-reindent () (defun allout-infer-body-reindent () "Determine proper setting for `allout-reindent-bodies'. @@ -930,13 +997,13 @@ Works with respect to `allout-plain-bullets-string' and (setq allout-plain-bullets-string-len (length allout-plain-bullets-string)) (setq allout-header-subtraction (1- (length allout-header-prefix))) ;; Produce the new allout-regexp: - (setq allout-regexp (concat "\\(\\" - allout-header-prefix - "[ \t]*[" - allout-bullets-string - "]\\)\\|\\" - allout-primary-bullet - "+\\|\^l")) + (setq allout-regexp (concat "\\(" + (regexp-quote allout-header-prefix) + "[ \t]*[" + allout-bullets-string + "]\\)\\|" + (regexp-quote allout-primary-bullet) + "+\\|\^l")) (setq allout-line-boundary-regexp (concat "\\(\n\\)\\(" allout-regexp "\\)")) (setq allout-bob-regexp @@ -965,16 +1032,6 @@ See doc string for allout-keybindings-list for format of binding list." (car (cdr cell))))))) keymap-list) map)) -;;;_ = allout-prior-bindings - being deprecated. -(defvar allout-prior-bindings nil - "Variable for use in V18, with allout-added-bindings, for -resurrecting, on mode deactivation, bindings that existed before -activation. Being deprecated.") -;;;_ = allout-added-bindings - being deprecated -(defvar allout-added-bindings nil - "Variable for use in V18, with allout-prior-bindings, for -resurrecting, on mode deactivation, bindings that existed before -activation. Being deprecated.") ;;;_ : Menu bar (defvar allout-mode-exposure-menu) (defvar allout-mode-editing-menu) @@ -1050,43 +1107,65 @@ See `allout-add-resumptions' and `allout-do-resumptions'.") (make-variable-buffer-local 'allout-mode-prior-settings) ;;;_ > allout-add-resumptions (&rest pairs) (defun allout-add-resumptions (&rest pairs) - "Set name/value pairs. + "Set name/value PAIRS. Old settings are preserved for later resumption using `allout-do-resumptions'. +The new values are set as a buffer local. On resumption, the prior buffer +scope of the variable is restored along with its value. If it was a void +buffer-local value, then it is left as nil on resumption. + The pairs are lists whose car is the name of the variable and car of the -cdr is the new value: '(some-var some-value)'. +cdr is the new value: '(some-var some-value)'. The pairs can actually be +triples, where the third element qualifies the disposition of the setting, +as described further below. -The new value is set as a buffer local. +If the optional third element is the symbol 'extend, then the new value +created by `cons'ing the second element of the pair onto the front of the +existing value. -If the variable was not previously buffer-local, then that is noted and the -`allout-do-resumptions' will just `kill-local-variable' of that binding. +If the optional third element is the symbol 'append, then the new value is +extended from the existing one by `append'ing a list containing the second +element of the pair onto the end of the existing value. -If it previously was buffer-local, the old value is noted and resurrected -by `allout-do-resumptions'. \(If the local value was previously void, then -it is left as nil on resumption.\) +Extension, and resumptions in general, should not be used for hook +functions - use the 'local mode of `add-hook' for that, instead. The settings are stored on `allout-mode-prior-settings'." (while pairs (let* ((pair (pop pairs)) (name (car pair)) - (value (cadr pair))) + (value (cadr pair)) + (qualifier (if (> (length pair) 2) + (caddr pair))) + prior-value) (if (not (symbolp name)) (error "Pair's name, %S, must be a symbol, not %s" name (type-of name))) + (setq prior-value (condition-case err + (symbol-value name) + (void-variable nil))) (when (not (assoc name allout-mode-prior-settings)) ;; Not already added as a resumption, create the prior setting entry. (if (local-variable-p name) ;; is already local variable - preserve the prior value: - (push (list name (condition-case err - (symbol-value name) - (void-variable nil))) - allout-mode-prior-settings) + (push (list name prior-value) allout-mode-prior-settings) ;; wasn't local variable, indicate so for resumption by killing ;; local value, and make it local: (push (list name) allout-mode-prior-settings) (make-local-variable name))) - (set name value)))) + (if qualifier + (cond ((eq qualifier 'extend) + (if (not (listp prior-value)) + (error "extension of non-list prior value attempted") + (set name (cons value prior-value)))) + ((eq qualifier 'append) + (if (not (listp prior-value)) + (error "appending of non-list prior value attempted") + (set name (append prior-value (list value))))) + (t (error "unrecognized setting qualifier `%s' encountered" + qualifier))) + (set name value))))) ;;;_ > allout-do-resumptions () (defun allout-do-resumptions () "Resume all name/value settings registered by `allout-add-resumptions'. @@ -1121,18 +1200,67 @@ their settings before allout-mode was started." "Symbol for use as allout invisible-text overlay category.") ;;;_ x allout-view-change-hook (defvar allout-view-change-hook nil - "*\(Deprecated\) Hook that's run after allout outline exposure changes. + "*\(Deprecated\) A hook run after allout outline exposure changes. -Switch to using `allout-exposure-change-hook' instead. Both -variables are currently respected, but this one will be ignored -in a subsequent allout version.") +Switch to using `allout-exposure-change-hook' instead. Both hooks are +currently respected, but the other conveys the details of the exposure +change via explicit parameters, and this one will eventually be disabled in +a subsequent allout version.") ;;;_ = allout-exposure-change-hook (defvar allout-exposure-change-hook nil - "*Hook that's run after allout outline exposure changes. + "*Hook that's run after allout outline subtree exposure changes. -This variable will replace `allout-view-change-hook' in a subsequent allout -version, though both are currently respected.") +It is run at the conclusion of `allout-flag-region'. +Functions on the hook must take three arguments: + + - from - integer indicating the point at the start of the change. + - to - integer indicating the point of the end of the change. + - flag - change mode: nil for exposure, otherwise concealment. + +This hook might be invoked multiple times by a single command. + +This hook is replacing `allout-view-change-hook', which is being deprecated +and eventually will not be invoked.") +;;;_ = allout-structure-added-hook +(defvar allout-structure-added-hook nil + "*Hook that's run after addition of items to the outline. + +Functions on the hook should take two arguments: + + - new-start - integer indicating the point at the start of the first new item. + - new-end - integer indicating the point of the end of the last new item. + +Some edits that introduce new items may missed by this hook - +specifically edits that native allout routines do not control. + +This hook might be invoked multiple times by a single command.") +;;;_ = allout-structure-deleted-hook +(defvar allout-structure-deleted-hook nil + "*Hook that's run after disciplined deletion of subtrees from the outline. + +Functions on the hook must take two arguments: + + - depth - integer indicating the depth of the subtree that was deleted. + - removed-from - integer indicating the point where the subtree was removed. + +Some edits that remove or invalidate items may missed by this hook - +specifically edits that native allout routines do not control. + +This hook might be invoked multiple times by a single command.") +;;;_ = allout-structure-shifted-hook +(defvar allout-structure-shifted-hook nil + "*Hook that's run after shifting of items in the outline. + +Functions on the hook should take two arguments: + + - depth-change - integer indicating depth increase, negative for decrease + - start - integer indicating the start point of the shifted parent item. + +Some edits that shift items can be missed by this hook - specifically edits +that native allout routines do not control. + +This hook might be invoked multiple times by a single command.") ;;;_ = allout-outside-normal-auto-fill-function (defvar allout-outside-normal-auto-fill-function nil "Value of normal-auto-fill-function outside of allout mode. @@ -1186,6 +1314,42 @@ state, if file variable adjustments are enabled. See This is used to decrypt the topic that was currently being edited, if it was encrypted automatically as part of a file write or autosave.") (make-variable-buffer-local 'allout-after-save-decrypt) +;;;_ = allout-encryption-plaintext-sanitization-regexps +(defvar allout-encryption-plaintext-sanitization-regexps nil + "List of regexps whose matches are removed from plaintext before encryption. + +This is for the sake of removing artifacts, like escapes, that are added on +and not actually part of the original plaintext. The removal is done just +prior to encryption. + +Entries must be symbols that are bound to the desired values. + +Each value can be a regexp or a list with a regexp followed by a +substitution string. If it's just a regexp, all its matches are removed +before the text is encrypted. If it's a regexp and a substitution, the +substition is used against the regexp matches, a la `replace-match'.") +(make-variable-buffer-local 'allout-encryption-text-removal-regexps) +;;;_ = allout-encryption-ciphertext-rejection-regexps +(defvar allout-encryption-ciphertext-rejection-regexps nil + "Variable for regexps matching plaintext to remove before encryption. + +This is for the sake of redoing encryption in cases where the ciphertext +incidentally contains strings that would disrupt mode operation - +for example, a line that happens to look like an allout-mode topic prefix. + +Entries must be symbols that are bound to the desired regexp values. + +The encryption will be retried up to +`allout-encryption-ciphertext-rejection-limit' times, after which an error +is raised.") + +(make-variable-buffer-local 'allout-encryption-ciphertext-rejection-regexps) +;;;_ = allout-encryption-ciphertext-rejection-ceiling +(defvar allout-encryption-ciphertext-rejection-ceiling 5 + "Limit on number of times encryption ciphertext is rejected. + +See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.") +(make-variable-buffer-local 'allout-encryption-ciphertext-rejection-ceiling) ;;;_ > allout-mode-p () ;; Must define this macro above any uses, or byte compilation will lack ;; proper def, if file isn't loaded - eg, during emacs build! @@ -1637,16 +1801,15 @@ OPEN: A topic that is not closed, though its offspring or body may be." (remove-overlays (point-min) (point-max) 'category 'allout-exposure-category) - (run-hooks 'allout-mode-deactivate-hook) - (setq allout-mode nil)) + (setq allout-mode nil) + (run-hooks 'allout-mode-deactivate-hook)) ;; Activation: ((not active) (setq allout-explicitly-deactivated nil) (if allout-old-style-prefixes ;; Inhibit all the fancy formatting: - (allout-add-resumptions '((allout-primary-bullet "*") - (allout-old-style-prefixes ())))) + (allout-add-resumptions '(allout-primary-bullet "*"))) (allout-overlay-preparations) ; Doesn't hurt to redo this. @@ -1654,15 +1817,28 @@ OPEN: A topic that is not closed, though its offspring or body may be." (allout-infer-body-reindent) (set-allout-regexp) + (allout-add-resumptions + '(allout-encryption-ciphertext-rejection-regexps + allout-line-boundary-regexp + extend) + '(allout-encryption-ciphertext-rejection-regexps + allout-bob-regexp + extend)) ;; Produce map from current version of allout-keybindings-list: (setq allout-mode-map (produce-allout-mode-map allout-keybindings-list)) (substitute-key-definition 'beginning-of-line - 'move-beginning-of-line + 'allout-beginning-of-line + allout-mode-map global-map) + (substitute-key-definition 'move-beginning-of-line + 'allout-beginning-of-line allout-mode-map global-map) (substitute-key-definition 'end-of-line - 'move-end-of-line + 'allout-end-of-line + allout-mode-map global-map) + (substitute-key-definition 'move-end-of-line + 'allout-end-of-line allout-mode-map global-map) (produce-allout-mode-menubar-entries) (fset 'allout-mode-map allout-mode-map) @@ -1717,8 +1893,8 @@ OPEN: A topic that is not closed, though its offspring or body may be." (if allout-layout (setq do-layout t)) - (run-hooks 'allout-mode-hook) - (setq allout-mode t)) + (setq allout-mode t) + (run-hooks 'allout-mode-hook)) ;; Reactivation: ((setq do-layout t) @@ -2044,6 +2220,52 @@ Outermost is first." (while (allout-hidden-p) (end-of-line) (if (allout-hidden-p) (forward-char 1))))) +;;;_ > allout-beginning-of-line () +(defun allout-beginning-of-line () + "Beginning-of-line with `allout-beginning-of-line-cycles' behavior, if set." + + (interactive) + + (if (or (not allout-beginning-of-line-cycles) + (not (equal last-command this-command))) + (move-beginning-of-line 1) + (let ((beginning-of-body (save-excursion + (allout-beginning-of-current-entry) + (point)))) + (cond ((= (current-column) 0) + (allout-beginning-of-current-entry)) + ((< (point) beginning-of-body) + (allout-beginning-of-current-line)) + ((= (point) beginning-of-body) + (goto-char (allout-current-bullet-pos))) + (t (allout-beginning-of-current-line) + (if (< (point) beginning-of-body) + ;; we were on the headline after its start: + (allout-beginning-of-current-entry))))))) +;;;_ > allout-end-of-line () +(defun allout-end-of-line () + "End-of-line with `allout-end-of-line-cycles' behavior, if set." + + (interactive) + + (if (or (not allout-end-of-line-cycles) + (not (equal last-command this-command))) + (allout-end-of-current-line) + (let ((end-of-entry (save-excursion + (allout-end-of-entry) + (point)))) + (cond ((not (eolp)) + (allout-end-of-current-line)) + ((or (allout-hidden-p) (save-excursion + (forward-char -1) + (allout-hidden-p))) + (allout-back-to-current-heading) + (allout-show-current-entry) + (allout-end-of-entry)) + ((>= (point) end-of-entry) + (allout-back-to-current-heading) + (allout-end-of-current-line)) + (t (allout-end-of-entry)))))) ;;;_ > allout-next-heading () (defsubst allout-next-heading () "Move to the heading for the topic \(possibly invisible) after this one. @@ -2108,13 +2330,17 @@ Return the location of the beginning of the heading, or nil if not found." ;;; for assessment or adjustment of the subtree, without redundant ;;; traversal of the structure. -;;;_ > allout-chart-subtree (&optional levels orig-depth prev-depth) -(defun allout-chart-subtree (&optional levels orig-depth prev-depth) +;;;_ > allout-chart-subtree (&optional levels visible orig-depth prev-depth) +(defun allout-chart-subtree (&optional levels visible orig-depth prev-depth) "Produce a location \"chart\" of subtopics of the containing topic. Optional argument LEVELS specifies the depth \(relative to start -depth) for the chart. Subsequent optional args are not for public -use. +depth) for the chart. + +When optional argument VISIBLE is non-nil, the chart includes +only the visible subelements of the charted subjects. + +The remaining optional args are not for internal use by the function. Point is left at the end of the subtree. @@ -2141,7 +2367,9 @@ starting point, and PREV-DEPTH is depth of prior topic." ; position to first offspring: (progn (setq orig-depth (allout-depth)) (or prev-depth (setq prev-depth (1+ orig-depth))) - (allout-next-heading))) + (if visible + (allout-next-visible-heading 1) + (allout-next-heading)))) ;; Loop over the current levels' siblings. Besides being more ;; efficient than tail-recursing over a level, it avoids exceeding @@ -2163,8 +2391,12 @@ starting point, and PREV-DEPTH is depth of prior topic." ;; next heading at lesser depth: (while (and (<= curr-depth (allout-recent-depth)) - (allout-next-heading)))) - (allout-next-heading))) + (if visible + (allout-next-visible-heading 1) + (allout-next-heading))))) + (if visible + (allout-next-visible-heading 1) + (allout-next-heading)))) ((and (< prev-depth curr-depth) (or (not levels) @@ -2173,8 +2405,9 @@ starting point, and PREV-DEPTH is depth of prior topic." (setq chart (cons (allout-chart-subtree (and levels (1- levels)) - orig-depth - curr-depth) + visible + orig-depth + curr-depth) chart)) ;; ... then continue with this one. ) @@ -2369,7 +2602,9 @@ Returns the value of point." (while (and (not (eobp)) (> (allout-recent-depth) level)) (allout-next-heading)) - (and (not (eobp)) (forward-char -1)) + (if (eobp) + (allout-end-of-entry) + (forward-char -1)) (if (and (not include-trailing-blank) (= ?\n (preceding-char))) (forward-char -1)) (setq allout-recent-end-of-subtree (point)))) @@ -2675,6 +2910,13 @@ hot-spot operation, where literal characters typed over a topic bullet are mapped to the command of the corresponding control-key on the `allout-mode-map'.") (make-variable-buffer-local 'allout-post-goto-bullet) +;;;_ = allout-command-counter +(defvar allout-command-counter 0 + "Counter that monotonically increases in allout-mode buffers. + +Set by `allout-pre-command-business', to support allout addons in +coordinating with allout activity.") +(make-variable-buffer-local 'allout-command-counter) ;;;_ > allout-post-command-business () (defun allout-post-command-business () "Outline `post-command-hook' function. @@ -2692,7 +2934,7 @@ are mapped to the command of the corresponding control-key on the allout-after-save-decrypt) (allout-after-saves-handler)) - ;; Implement -post-goto-bullet, if set: + ;; Implement allout-post-goto-bullet, if set: (if (and allout-post-goto-bullet (allout-current-bullet-pos)) (progn (goto-char (allout-current-bullet-pos)) @@ -2701,7 +2943,9 @@ are mapped to the command of the corresponding control-key on the ;;;_ > allout-pre-command-business () (defun allout-pre-command-business () "Outline `pre-command-hook' function for outline buffers. -Implements special behavior when cursor is on bullet character. + +Among other things, implements special behavior when the cursor is on the +topic bullet character. When the cursor is on the bullet character, self-insert characters are reinterpreted as the corresponding control-character in the @@ -2709,7 +2953,7 @@ reinterpreted as the corresponding control-character in the the cursor which has moved as a result of such reinterpretation is positioned on the bullet character of the destination topic. -The upshot is that you can get easy, single (ie, unmodified) key +The upshot is that you can get easy, single \(ie, unmodified\) key outline maneuvering operations by positioning the cursor on the bullet char. When in this mode you can use regular cursor-positioning command/keystrokes to relocate the cursor off of a bullet character to @@ -2717,6 +2961,9 @@ return to regular interpretation of self-insert characters." (if (not (allout-mode-p)) nil + ;; Increment allout-command-counter + (setq allout-command-counter (1+ allout-command-counter)) + ;; Do hot-spot navigation. (if (and (eq this-command 'self-insert-command) (eq (point)(allout-current-bullet-pos))) (allout-hotspot-key-handler)))) @@ -2990,6 +3237,8 @@ case.) If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling. +Runs + Nuances: - Creation of new topics is with respect to the visible topic @@ -3040,7 +3289,8 @@ Nuances: allout-numbered-bullet)))) (point))) dbl-space - doing-beginning) + doing-beginning + start end) (if (not opening-on-blank) ; Positioning and vertical @@ -3141,8 +3391,10 @@ Nuances: (not (bolp))) (forward-char 1)))) )) + (setq start (point)) (insert (concat (allout-make-topic-prefix opening-numbered t depth) " ")) + (setq end (1+ (point))) (allout-rebullet-heading (and offer-recent-bullet ref-bullet) depth nil nil t) @@ -3150,6 +3402,8 @@ Nuances: (save-excursion (goto-char ref-topic) (allout-show-children))) (end-of-line) + + (run-hook-with-args 'allout-structure-added-hook start end) ) ) ;;;_ > allout-open-subtopic (arg) @@ -3548,6 +3802,7 @@ discontinuity. The first topic in the file can be adjusted to any positive depth, however." (interactive "p") (if (> arg 0) + ;; refuse to create a containment discontinuity: (save-excursion (allout-back-to-current-heading) (if (not (bobp)) @@ -3564,7 +3819,20 @@ depth, however." (1+ predecessor-depth))) (error (concat "Disallowed shift deeper than" " containing topic's children."))))))) - (allout-rebullet-topic arg)) + (let ((where (point)) + has-successor) + (if (and (< arg 0) + (allout-current-topic-collapsed-p) + (save-excursion (allout-next-sibling))) + (setq has-successor t)) + (allout-rebullet-topic arg) + (when (< arg 0) + (save-excursion + (if (allout-ascend) + (allout-show-children))) + (if has-successor + (allout-show-children))) + (run-hook-with-args 'allout-structure-shifted-hook arg where))) ;;;_ > allout-shift-out (arg) (defun allout-shift-out (arg) "Decrease depth of current heading and any topics collapsed within it. @@ -3574,9 +3842,7 @@ one level greater than the immediately previous topic, to avoid containment discontinuity. The first topic in the file can be adjusted to any positive depth, however." (interactive "p") - (if (< arg 0) - (allout-shift-in (* arg -1))) - (allout-rebullet-topic (* arg -1))) + (allout-shift-in (* arg -1))) ;;;_ : Surgery (kill-ring) functions with special provisions for outlines: ;;;_ > allout-kill-line (&optional arg) (defun allout-kill-line (&optional arg) @@ -3610,7 +3876,8 @@ depth, however." (save-excursion ; Renumber subsequent topics if needed: (if (not (looking-at allout-regexp)) (allout-next-heading)) - (allout-renumber-to-depth depth)))))) + (allout-renumber-to-depth depth))) + (run-hook-with-args 'allout-structure-deleted-hook depth (point))))) ;;;_ > allout-kill-topic () (defun allout-kill-topic () "Kill topic together with subtopics. @@ -3656,7 +3923,8 @@ when yank with allout-yank into an outline as a heading." (allout-unprotected (kill-region beg (point))) (sit-for 0) (save-excursion - (allout-renumber-to-depth depth)))) + (allout-renumber-to-depth depth)) + (run-hook-with-args 'allout-structure-deleted-hook depth (point)))) ;;;_ > allout-yank-processing () (defun allout-yank-processing (&optional arg) @@ -3683,112 +3951,113 @@ however, are left exactly like normal, non-allout-specific yanks." ; region around subject: (if (< (allout-mark-marker t) (point)) (exchange-point-and-mark)) - (let* ((inhibit-field-text-motion t) - (subj-beg (point)) - (into-bol (bolp)) - (subj-end (allout-mark-marker t)) - (was-collapsed (get-text-property subj-beg 'allout-was-collapsed)) - ;; 'resituate' if yanking an entire topic into topic header: - (resituate (and (allout-e-o-prefix-p) - (looking-at (concat "\\(" allout-regexp "\\)")) - (allout-prefix-data (match-beginning 1) + (allout-unprotected + (let* ((subj-beg (point)) + (into-bol (bolp)) + (subj-end (allout-mark-marker t)) + (was-collapsed (get-text-property subj-beg 'allout-was-collapsed)) + ;; 'resituate' if yanking an entire topic into topic header: + (resituate (and (allout-e-o-prefix-p) + (looking-at (concat "\\(" allout-regexp "\\)")) + (allout-prefix-data (match-beginning 1) (match-end 1)))) - ;; `rectify-numbering' if resituating (where several topics may - ;; be resituating) or yanking a topic into a topic slot (bol): - (rectify-numbering (or resituate - (and into-bol (looking-at allout-regexp))))) - (if resituate + ;; `rectify-numbering' if resituating (where several topics may + ;; be resituating) or yanking a topic into a topic slot (bol): + (rectify-numbering (or resituate + (and into-bol (looking-at allout-regexp))))) + (if resituate ; The yanked stuff is a topic: - (let* ((prefix-len (- (match-end 1) subj-beg)) - (subj-depth (allout-recent-depth)) - (prefix-bullet (allout-recent-bullet)) - (adjust-to-depth - ;; Nil if adjustment unnecessary, otherwise depth to which - ;; adjustment should be made: - (save-excursion - (and (goto-char subj-end) - (eolp) - (goto-char subj-beg) - (and (looking-at allout-regexp) - (progn - (beginning-of-line) - (not (= (point) subj-beg))) - (looking-at allout-regexp) - (allout-prefix-data (match-beginning 0) + (let* ((prefix-len (- (match-end 1) subj-beg)) + (subj-depth (allout-recent-depth)) + (prefix-bullet (allout-recent-bullet)) + (adjust-to-depth + ;; Nil if adjustment unnecessary, otherwise depth to which + ;; adjustment should be made: + (save-excursion + (and (goto-char subj-end) + (eolp) + (goto-char subj-beg) + (and (looking-at allout-regexp) + (progn + (beginning-of-line) + (not (= (point) subj-beg))) + (looking-at allout-regexp) + (allout-prefix-data (match-beginning 0) (match-end 0))) - (allout-recent-depth)))) - (more t)) - (setq rectify-numbering allout-numbered-bullet) - (if adjust-to-depth + (allout-recent-depth)))) + (more t)) + (setq rectify-numbering allout-numbered-bullet) + (if adjust-to-depth ; Do the adjustment: - (progn - (message "... yanking") (sit-for 0) - (save-restriction - (narrow-to-region subj-beg subj-end) + (progn + (message "... yanking") (sit-for 0) + (save-restriction + (narrow-to-region subj-beg subj-end) ; Trim off excessive blank ; line at end, if any: - (goto-char (point-max)) - (if (looking-at "^$") - (allout-unprotected (delete-char -1))) + (goto-char (point-max)) + (if (looking-at "^$") + (allout-unprotected (delete-char -1))) ; Work backwards, with each ; shallowest level, ; successively excluding the ; last processed topic from ; the narrow region: - (while more - (allout-back-to-current-heading) + (while more + (allout-back-to-current-heading) ; go as high as we can in each bunch: - (while (allout-ascend-to-depth (1- (allout-depth)))) - (save-excursion - (allout-rebullet-topic-grunt (- adjust-to-depth + (while (allout-ascend-to-depth (1- (allout-depth)))) + (save-excursion + (allout-rebullet-topic-grunt (- adjust-to-depth subj-depth)) - (allout-depth)) - (if (setq more (not (bobp))) - (progn (widen) - (forward-char -1) - (narrow-to-region subj-beg (point)))))) - (message "") - ;; Preserve new bullet if it's a distinctive one, otherwise - ;; use old one: - (if (string-match (regexp-quote prefix-bullet) - allout-distinctive-bullets-string) + (allout-depth)) + (if (setq more (not (bobp))) + (progn (widen) + (forward-char -1) + (narrow-to-region subj-beg (point)))))) + (message "") + ;; Preserve new bullet if it's a distinctive one, otherwise + ;; use old one: + (if (string-match (regexp-quote prefix-bullet) + allout-distinctive-bullets-string) ; Delete from bullet of old to ; before bullet of new: - (progn - (beginning-of-line) - (delete-region (point) subj-beg) - (set-marker (allout-mark-marker t) subj-end) - (goto-char subj-beg) - (allout-end-of-prefix)) + (progn + (beginning-of-line) + (delete-region (point) subj-beg) + (set-marker (allout-mark-marker t) subj-end) + (goto-char subj-beg) + (allout-end-of-prefix)) ; Delete base subj prefix, ; leaving old one: - (delete-region (point) (+ (point) - prefix-len - (- adjust-to-depth subj-depth))) + (delete-region (point) (+ (point) + prefix-len + (- adjust-to-depth subj-depth))) ; and delete residual subj ; prefix digits and space: - (while (looking-at "[0-9]") (delete-char 1)) - (if (looking-at " ") (delete-char 1)))) - (exchange-point-and-mark)))) - (if rectify-numbering - (progn - (save-excursion + (while (looking-at "[0-9]") (delete-char 1)) + (if (looking-at " ") (delete-char 1)))) + (exchange-point-and-mark)))) + (if rectify-numbering + (progn + (save-excursion ; Give some preliminary feedback: - (message "... reconciling numbers") (sit-for 0) + (message "... reconciling numbers") (sit-for 0) ; ... and renumber, in case necessary: - (goto-char subj-beg) - (if (allout-goto-prefix) - (allout-rebullet-heading nil ;;; solicit + (goto-char subj-beg) + (if (allout-goto-prefix) + (allout-rebullet-heading nil ;;; solicit (allout-depth) ;;; depth - nil ;;; number-control - nil ;;; index + nil ;;; number-control + nil ;;; index t)) - (message "")))) - (when (and (or into-bol resituate) was-collapsed) - (remove-text-properties subj-beg (1+ subj-beg) '(allout-was-collapsed)) - (allout-hide-current-subtree)) - (if (not resituate) - (exchange-point-and-mark)))) + (message "")))) + (when (and (or into-bol resituate) was-collapsed) + (remove-text-properties subj-beg (1+ subj-beg) '(allout-was-collapsed)) + (allout-hide-current-subtree)) + (if (not resituate) + (exchange-point-and-mark)) + (run-hook-with-args 'allout-structure-added-hook subj-beg subj-end)))) ;;;_ > allout-yank (&optional arg) (defun allout-yank (&optional arg) "`allout-mode' yank, with depth and numbering adjustment of yanked topics. @@ -3820,10 +4089,10 @@ works with normal `yank' in non-outline buffers." (interactive "*P") (setq this-command 'yank) - (yank arg) + (allout-unprotected + (yank arg)) (if (allout-mode-p) - (allout-yank-processing)) -) + (allout-yank-processing))) ;;;_ > allout-yank-pop (&optional arg) (defun allout-yank-pop (&optional arg) "Yank-pop like `allout-yank' when popping to bare outline prefixes. @@ -3882,9 +4151,13 @@ by pops to non-distinctive yanks. Bug..." ;;;_ - Fundamental ;;;_ > allout-flag-region (from to flag) (defun allout-flag-region (from to flag) - "Conceal text from FROM to TO if FLAG is non-nil, else reveal it. + "Conceal text between FROM and TO if FLAG is non-nil, else reveal it. + +Exposure-change hook `allout-exposure-change-hook' is run with the same +arguments as this function, after the exposure changes are made. \(The old +`allout-view-change-hook' is being deprecated, and eventually will not be +invoked.\)" -Text is shown if flag is nil and hidden otherwise." ;; We use outline invisibility spec. (remove-overlays from to 'category 'allout-exposure-category) (when flag @@ -3895,7 +4168,7 @@ Text is shown if flag is nil and hidden otherwise." (while props (overlay-put o (pop props) (pop props))))))) (run-hooks 'allout-view-change-hook) - (run-hooks 'allout-exposure-change-hook)) + (run-hook-with-args 'allout-exposure-change-hook from to flag)) ;;;_ > allout-flag-current-subtree (flag) (defun allout-flag-current-subtree (flag) "Conceal currently-visible topic's subtree if FLAG non-nil, else reveal it." @@ -4071,10 +4344,12 @@ true, then single-line topics are considered to be collapsed. By default, they are treated as being uncollapsed." (save-excursion (and - (= (progn (allout-back-to-current-heading) - (move-end-of-line 1) - (point)) - (allout-end-of-current-subtree (not (looking-at "\n\n")))) + ;; Is the topic all on one line (allowing for trailing blank line)? + (>= (progn (allout-back-to-current-heading) + (move-end-of-line 1) + (point)) + (allout-end-of-current-subtree (not (looking-at "\n\n")))) + (or include-single-liners (progn (backward-char 1) (allout-hidden-p)))))) ;;;_ > allout-hide-current-subtree (&optional just-close) @@ -5097,8 +5372,8 @@ See `allout-toggle-current-subtree-encryption' for more details." ;;; fetch-pass &optional retried verifying ;;; passphrase) (defun allout-encrypt-string (text decrypt allout-buffer key-type for-key - fetch-pass &optional retried verifying - passphrase) + fetch-pass &optional retried rejected + verifying passphrase) "Encrypt or decrypt message TEXT. If DECRYPT is true (default false), then decrypt instead of encrypt. @@ -5116,6 +5391,11 @@ that have been solicited in sequence leading to this current call. Optional PASSPHRASE enables explicit delivery of the decryption passphrase, for verification purposes. +Optional REJECTED is for internal use - conveys the number of +rejections due to matches against +`allout-encryption-ciphertext-rejection-regexps', as limited by +`allout-encryption-ciphertext-rejection-ceiling'. + Returns the resulting string, or nil if the transformation fails." (require 'pgg) @@ -5141,6 +5421,17 @@ Returns the resulting string, or nil if the transformation fails." target-prompt-id (or (buffer-file-name allout-buffer) target-prompt-id)))) + (strip-plaintext-regexps + (if (not decrypt) + (allout-get-configvar-values + 'allout-encryption-plaintext-sanitization-regexps))) + (reject-ciphertext-regexps + (if (not decrypt) + (allout-get-configvar-values + 'allout-encryption-ciphertext-rejection-regexps))) + (rejected (or rejected 0)) + (rejections-left (- allout-encryption-ciphertext-rejection-ceiling + rejected)) result-text status) (if (and fetch-pass (not passphrase)) @@ -5161,10 +5452,19 @@ Returns the resulting string, or nil if the transformation fails." key-type allout-buffer retried fetch-pass))) + (with-temp-buffer (insert text) + (when (and strip-plaintext-regexps (not decrypt)) + (dolist (re strip-plaintext-regexps) + (let ((re (if (listp re) (car re) re)) + (replacement (if (listp re) (cadr re) ""))) + (goto-char (point-min)) + (while (re-search-forward re nil t) + (replace-match replacement nil nil))))) + (cond ;; symmetric: @@ -5183,7 +5483,8 @@ Returns the resulting string, or nil if the transformation fails." (if verifying (throw 'encryption-failed nil) (pgg-remove-passphrase-from-cache target-cache-id t) - (error "Symmetric-cipher encryption failed - %s" + (error "Symmetric-cipher %scryption failed - %s" + (if decrypt "de" "en") "try again with different passphrase.")))) ;; encrypt 'keypair: @@ -5208,48 +5509,68 @@ Returns the resulting string, or nil if the transformation fails." (if status (pgg-situate-output (point-min) (point-max)) (error (pgg-remove-passphrase-from-cache target-cache-id t) - (error "decryption failed")))) - ) + (error "decryption failed"))))) (setq result-text (buffer-substring 1 (- (point-max) (if decrypt 0 1)))) - - ;; validate result - non-empty - (cond ((not result-text) - (if verifying - nil - ;; transform was fruitless, retry w/new passphrase. - (pgg-remove-passphrase-from-cache target-cache-id t) - (allout-encrypt-string text allout-buffer decrypt nil - (if retried (1+ retried) 1) - passphrase))) - - ;; Barf if encryption yields extraordinary control chars: - ((and (not decrypt) - (string-match "[\C-a\C-k\C-o-\C-z\C-@]" - result-text)) - (error (concat "encryption produced unusable" - " non-armored text - reconfigure!"))) - - ;; valid result and just verifying or non-symmetric: - ((or verifying (not (equal key-type 'symmetric))) - (if (or verifying decrypt) - (pgg-add-passphrase-to-cache target-cache-id - passphrase t)) - result-text) - - ;; valid result and regular symmetric - "register" - ;; passphrase with mnemonic aids/cache. - (t - (set-buffer allout-buffer) - (if passphrase - (pgg-add-passphrase-to-cache target-cache-id - passphrase t)) - (allout-update-passphrase-mnemonic-aids for-key passphrase - allout-buffer) - result-text) - ) ) + + ;; validate result - non-empty + (cond ((not result-text) + (if verifying + nil + ;; transform was fruitless, retry w/new passphrase. + (pgg-remove-passphrase-from-cache target-cache-id t) + (allout-encrypt-string text decrypt allout-buffer + key-type for-key nil + (if retried (1+ retried) 1) + rejected verifying nil))) + + ;; Retry (within limit) if ciphertext contains rejections: + ((and (not decrypt) + ;; Check for disqualification of this ciphertext: + (let ((regexps reject-ciphertext-regexps) + reject-it) + (while (and regexps (not reject-it)) + (setq reject-it (string-match (car regexps) + result-text)) + (pop regexps)) + reject-it)) + (setq rejections-left (1- rejections-left)) + (if (<= rejections-left 0) + (error (concat "Ciphertext rejected too many times" + " (%s), per `%s'") + allout-encryption-ciphertext-rejection-ceiling + 'allout-encryption-ciphertext-rejection-regexps) + (allout-encrypt-string text decrypt allout-buffer + key-type for-key nil + retried (1+ rejected) + verifying passphrase))) + ;; Barf if encryption yields extraordinary control chars: + ((and (not decrypt) + (string-match "[\C-a\C-k\C-o-\C-z\C-@]" + result-text)) + (error (concat "Encryption produced non-armored text, which" + "conflicts with allout mode - reconfigure!"))) + + ;; valid result and just verifying or non-symmetric: + ((or verifying (not (equal key-type 'symmetric))) + (if (or verifying decrypt) + (pgg-add-passphrase-to-cache target-cache-id + passphrase t)) + result-text) + + ;; valid result and regular symmetric - "register" + ;; passphrase with mnemonic aids/cache. + (t + (set-buffer allout-buffer) + (if passphrase + (pgg-add-passphrase-to-cache target-cache-id + passphrase t)) + (allout-update-passphrase-mnemonic-aids for-key passphrase + allout-buffer) + result-text) + ) ) ) ) @@ -5313,7 +5634,6 @@ of the availability of a cached copy." (pgg-read-passphrase-from-cache cache-id t))) (got-pass (or cached (pgg-read-passphrase full-prompt cache-id t))) - confirmation) (if (not got-pass) @@ -5321,14 +5641,14 @@ of the availability of a cached copy." ;; Duplicate our handle on the passphrase so it's not clobbered by ;; deactivate-passwd memory clearing: - (setq got-pass (format "%s" got-pass)) + (setq got-pass (copy-sequence got-pass)) (cond (verifier-string (save-window-excursion (if (allout-encrypt-string verifier-string 'decrypt allout-buffer 'symmetric - for-key nil 0 'verifying - got-pass) + for-key nil 0 0 'verifying + (copy-sequence got-pass)) (setq confirmation (format "%s" got-pass)))) (if (and (not confirmation) @@ -5365,15 +5685,7 @@ of the availability of a cached copy." ;; recurse to this routine: (pgg-read-passphrase prompt-sans-hint cache-id t)) (pgg-remove-passphrase-from-cache cache-id t) - (error "Confirmation failed."))) - ;; reduce opportunity for memory cherry-picking by zeroing duplicate: - (dotimes (i (length got-pass)) - (aset got-pass i 0)) - ) - ) - ) - ) - ) + (error "Confirmation failed.")))))))) ;;;_ > allout-encrypted-topic-p () (defun allout-encrypted-topic-p () "True if the current topic is encryptable and encrypted." @@ -5426,7 +5738,7 @@ An error is raised if the text is not encrypted." (dotimes (i (length spew)) (aset spew i (1+ (random 254)))) (allout-encrypt-string spew nil (current-buffer) 'symmetric - nil nil 0 passphrase)) + nil nil 0 0 passphrase)) ) ;;;_ > allout-update-passphrase-mnemonic-aids (for-key passphrase ;;; outline-buffer) @@ -5505,7 +5817,7 @@ Derived from value of `allout-passphrase-verifier-string'." allout-passphrase-verifier-string (allout-encrypt-string (allout-get-encryption-passphrase-verifier) 'decrypt allout-buffer 'symmetric - key nil 0 'verifying passphrase) + key nil 0 0 'verifying passphrase) t))) ;;;_ > allout-next-topic-pending-encryption (&optional except-mark) (defun allout-next-topic-pending-encryption (&optional except-mark) @@ -5808,6 +6120,25 @@ If BEG is bigger than END we return 0." (goto-char (1+ (match-beginning 0))) (setq count (1+ count))) count)))) +;;;_ > allout-get-configvar-values (varname) +(defun allout-get-configvar-values (configvar-name) + "Return a list of values of the symbols in list bound to CONFIGVAR-NAME. + +The user is prompted for removal of symbols that are unbound, and they +otherwise are ignored. + +CONFIGVAR-NAME should be the name of the configuration variable, +not its value." + + (let ((configvar-value (symbol-value configvar-name)) + got) + (dolist (sym configvar-value) + (if (not (boundp sym)) + (if (yes-or-no-p (format "%s entry `%s' is unbound - remove it? " + configvar-name sym)) + (delq sym (symbol-value configvar-name))) + (push (symbol-value sym) got))) + (reverse got))) ;;;_ > allout-mark-marker to accommodate divergent emacsen: (defun allout-mark-marker (&optional force buffer) "Accommodate the different signature for `mark-marker' across Emacsen. From e6b8d6628244c1978544b016006b9eac0310ef1f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 12:34:47 +0000 Subject: [PATCH 101/153] *** empty log message *** --- lisp/ChangeLog | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++ man/ChangeLog | 5 +++ src/ChangeLog | 5 +++ 3 files changed, 94 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ba902ce657f..b4c654506b7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,87 @@ +2006-08-12 Ken Manheimer + + * allout.el (allout-prior-bindings, allout-added-bindings): + Remove, after long deprecation. + (allout-beginning-of-line-cycles, allout-end-of-line-cycles): + Add customization vars controlling allout-beginning-of-line and + allout-end-of-line conveniences. + (allout-header-prefix, allout-use-mode-specific-leader) + (allout-use-mode-specific-leader, allout-mode-leaders): Revised + docstrings. + (allout-infer-header-lead): Change to be an alias for + allout-infer-header-lead-and-primary-bullet. + (allout-infer-header-lead-and-primary-bullet): New version of + allout-infer-header-lead which assigns the primary bullet to the + same as the header lead, when its being changed. + (allout-infer-body-reindent): Apply regexp-quote instead of + unconditionally prepending "\\", so that all literal + allout-header-prefix and allout-primary-bullet strings are + properly handled. + (allout-add-resumptions): Add optional qualifier for extending or + appending to existing values, rather than replacing them. + (allout-view-change-hook): Clarify docstring. + (allout-exposure-change-hook): Take explicit arguments, via + run-hook-with-args. + (allout-structure-added-hook) + (allout-structure-deleted-hook) + (allout-structure-shifted-hook): New hooks analogous to + allout-exposure-change-hook for other kinds of structural outline + edits. + (allout-encryption-plaintext-sanitization-regexps): New encryption + customization variable, by which cooperating modes can provde + massage of the plaintext without actually being passed it. + (allout-encryption-ciphertext-rejection-regexps) + (allout-encryption-ciphertext-rejection-ceiling): New encryption + customization variables, by which cooperating modes can prohibit + rare but possible ciphertext patterns from fouling their + operation, with actually being passed the ciphertext. + (allout-mode): Run activation and deactivation hooks after the + minor-mode variable has been toggled, to clarify the mode + disposition. The new encryption ciphertext rejection variable is + used to ensure that the ciphertext does not contain text that + would be recognized as outline structural elements by allout. + Substite allout-beginning-of-line and allout-end-of-line for + conventionall beginning-of-line and end-of-line bindings. + If allout-old-style-prefixes is non-nil, don't nullify it on mode + activation! + (allout-beginning-of-line): Respect `allout-beginning-of-line-cycles'. + (allout-end-of-line): Respect `allout-end-of-line-cycles'. + (allout-chart-subtree): Implement new mode, charting only the + visible items in the subtree, when new 'visible' parameter is + non-nil. + (allout-end-of-subtree): Properly handle the last item in the + buffer. + (allout-pre-command-business, allout-command-counter): Increment + an advertised counter so that cooperating enhancements can track + revisions of items. + (allout-open-topic): Run allout-structure-added-hook with suitable + arguments. + (allout-shift-in): Run allout-structure-shifted-hook with suitable + arguments. + (allout-shift-out): Fix doubling for negative args and ensure call + of allout-structure-shifted-hook by solely using allout-shift-in. + (allout-kill-line, allout-kill-topic): Run + allout-structure-deleted-hook with suitable arguments. + (allout-yank-processing): Run allout-structure-added-hook with + proper arguments. + (allout-yank): Enclose activity in allout-unprotected. + (allout-flag-region): Run allout-exposure-change-hook with + suitable arguments, instead of making the callee infer the + arguments. + (allout-encrypt-string): Support + allout-encryption-plaintext-sanitization-regexps, + allout-encryption-ciphertext-rejection-regexps, and + allout-encryption-ciphertext-rejection-ceiling. Indicate correct + en/de cryption mode in symmetric encryption failure message. + (allout-obtain-passphrase): Use copy-sequence to get a distinct + copy of the passphrase, and don't zero it or we'll corrupt the + stashed copy. + (allout-create-encryption-passphrase-verifier) + (allout-verify-passphrase): Respect the new signature for + allout-encrypt-string. + (allout-get-configvar-values): Convenience for getting a + configuration variable value and handling its absence gracefully. + 2006-08-11 Romain Francoise * obsolete/zone-mode.el: Delete. diff --git a/man/ChangeLog b/man/ChangeLog index ca5ad50bacd..3aee6eeae72 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2006-08-12 Eli Zaretskii + + * misc.texi (Saving Emacs Sessions): Clarify when desktop is restored + on startup. + 2006-08-11 Romain Francoise * ack.texi (Acknowledgments): Delete mention to zone-mode.el. diff --git a/src/ChangeLog b/src/ChangeLog index b4016b546c0..7f0932a4206 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-12 Eli Zaretskii + + * frame.c (Fmouse_position, Fmouse_pixel_position) + (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix. + 2006-08-11 Jan Dj,Ad(Brv * xselect.c (Fx_register_dnd_atom): New function. From 2d33a4790ac8139f865fa16577135c45a1420fab Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 12:38:38 +0000 Subject: [PATCH 102/153] Update the Allout entries. --- etc/NEWS | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 0a8adc534be..570db4a7656 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1993,6 +1993,7 @@ using hi-lock-mode in an initialization file will turn on Hi Lock in all buffers and no warning will be issued (for compatibility with the behavior in older versions of Emacs). +--- ** Changes in Allout *** Topic cryptography added, enabling easy gpg topic encryption and @@ -2001,11 +2002,19 @@ clear-text within a single file to your heart's content, using symmetric and/or public key modes. Time-limited key caching, user-provided symmetric key hinting and consistency verification, auto-encryption of pending topics on save, and more, make it easy to use encryption in -powerful ways. +powerful ways. Encryption behavior customization is collected in the +allout-encryption customization group. *** `allout-view-change-hook' marked as being deprecated - use -`allout-exposure-change-hook' instead. Both are currently being used, but -`allout-view-change-hook' will be ignored in a subsequent allout version. +`allout-exposure-change-hook' instead. Both are still invoked, but +`allout-view-change-hook' will eventually be ignored. The new +`allout-exposure-change-hook' is called with args that were passed to +`allout-flag-region', making it easier to use. + +*** Other allout functions which change the outline structure also have +hooks, enabling cooperative allout enhancements. See +`allout-structure-added-hook', `allout-structure-deleted-hook', and +`allout-structure-shifted-hook'. *** Default command prefix changed to "\C-c " (control-c space), to avoid intruding on user's keybinding space. Customize the @@ -2016,23 +2025,43 @@ concealed text, instead of selective-display. This simplifies the code, in particular avoiding the need for kludges for isearch dynamic-display, discretionary handling of edits of concealed text, undo concerns, etc. +*** Some previously rough topic-header format edge cases are reconciled. +Level 1 topics use the mode's comment format, and lines starting with the +asterisk - for instance, the comment close of some languages (eg, c's "*/" +or mathematica's "*)") - at the beginning of line are no longer are +interpreted as level 1 topics in those modes. (Yay!) + *** Many substantial fixes and refinements, including: - - repaired inhibition of inadvertent edits to concealed text - - repaired retention of topic body hanging indent upon topic depth shifts + - repaired regexp-quoting of custom header prefixes, so any literals + will now work (for instance, mathematica's "(*" is now properly + accepted). + - repaired inhibition of inadvertent edits to concealed text. - refuse to create "containment discontinuities", where a topic is shifted deeper than the offspring-depth of its' container - auto-fill-mode is now left inactive when allout-mode starts, if it already was inactive. also, `allout-inhibit-auto-fill' custom configuration variable makes it easy to disable auto fill in allout outlines in general or on a per-buffer basis. - - new hook `allout-mode-deactivate-hook', for coordinating with - deactivation of allout-mode. + - mode hook changes: new hook `allout-mode-deactivate-hook', for + coordinating with deactivation of allout-mode. `allout-mode-hook' is + now run after the `allout-mode' variable is changed, as is the new + `allout-mode-deactivate-hook'. + - allout now tolerates fielded text in outlines without disruption. + - hot-spot navigation now is modularized with a new function, + `allout-hotspot-key-handler', enabling easier articulation and + enhancement of the functionality by allout addons. + - topic body navigation is easier, where repeated beginning of line and + end of line key commands cycle through the actually beginning/end of + line and then beginning/end of topic, etc. see new customization vars + `allout-beginning-of-line-cycles' and `allout-end-of-line-cycles'. + - repaired retention of topic body hanging indent upon topic depth shifts - bulleting variation is simpler and more accommodating, both in the default behavior and in ability to vary when creating new topics - mode deactivation now does cleans up effectively, more properly restoring affected variables and hooks to former state, removing - overlays, etc. + overlays, etc. see `allout-add-resumptions' and + `allout-do-resumptions', which replace the old `allout-resumptions'. - included a few unit-tests for interior functionality. developers can have them automatically run at the end of module load by customizing the option `allout-run-unit-tests-on-load'. From 78e5d54902a455900943b3cb9327104cfd8f7cb4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 12:55:07 +0000 Subject: [PATCH 103/153] (Time Parsing): Add %z to format-time-string, per docstring. Add cross reference to glibc manual for strftime. --- lispref/os.texi | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lispref/os.texi b/lispref/os.texi index 30f66889387..ab277afdce6 100644 --- a/lispref/os.texi +++ b/lispref/os.texi @@ -1256,7 +1256,9 @@ This stands for the year without century (00-99). @item %Y This stands for the year with century. @item %Z -This stands for the time zone abbreviation. +This stands for the time zone abbreviation (e.g., @samp{EST}). +@item %z +This stands for the time zone numerical offset (e.g., @samp{-0500}). @end table You can also specify the field width and type of padding for any of @@ -1286,12 +1288,14 @@ If @var{universal} is non-@code{nil}, that means to describe the time as Universal Time; @code{nil} means describe it using what Emacs believes is the local time zone (see @code{current-time-zone}). -This function uses the C library function @code{strftime} to do most of -the work. In order to communicate with that function, it first encodes -its argument using the coding system specified by -@code{locale-coding-system} (@pxref{Locales}); after @code{strftime} -returns the resulting string, @code{format-time-string} decodes the -string using that same coding system. +This function uses the C library function @code{strftime} +(@pxref{Formatting Calendar Time,,, libc, The GNU C Library Reference +Manual}) to do most of the work. In order to communicate with that +function, it first encodes its argument using the coding system +specified by @code{locale-coding-system} (@pxref{Locales}); after +@code{strftime} returns the resulting string, +@code{format-time-string} decodes the string using that same coding +system. @end defun @defun seconds-to-time seconds From 01892a52008a2e04ae271f06eb406356ff9194ad Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 13:04:44 +0000 Subject: [PATCH 104/153] : Move to the `indent' customization group. --- lisp/cus-start.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/cus-start.el b/lisp/cus-start.el index bc0e2e7915b..8b68ede83a1 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -175,7 +175,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of ;; fringe.c (overflow-newline-into-fringe fringe boolean) ;; indent.c - (indent-tabs-mode fill boolean) + (indent-tabs-mode indent boolean) ;; keyboard.c (meta-prefix-char keyboard character) (auto-save-interval auto-save integer) From 0c80afbd3a0143126ee8c0c147eeaa6c0ae060ce Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 13:05:36 +0000 Subject: [PATCH 105/153] *** empty log message *** --- lisp/ChangeLog | 5 +++++ lispref/ChangeLog | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b4c654506b7..ccfffa13fa8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-12 Robert Thorpe (tiny change) + + * cus-start.el : Move to the `indent' + customization group. + 2006-08-12 Ken Manheimer * allout.el (allout-prior-bindings, allout-added-bindings): diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 318c00e84b6..8a7dffab75a 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,9 @@ +2006-08-12 Kevin Ryde + + * os.texi (Time Parsing): Add %z to description of + format-time-string, as per docstring. Add cross reference to + glibc manual for strftime. + 2006-08-08 Richard Stallman * modes.texi: Clean up wording in previous change. From d32a9a8c565b969382e75ef2f467db0358b9f19d Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sat, 12 Aug 2006 13:28:29 +0000 Subject: [PATCH 106/153] *** empty log message *** --- lisp/ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ccfffa13fa8..1699a2c785a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2006-08-13 Nick Roberts + + * progmodes/gdb-ui.el (gdb-frame-separate-io-buffer) + (gdb-use-separate-io-buffer, menu): Avoid using `inferior' in text. + (gdb-memory-mode, gdb-locals-watch-map): Don't quote lambda + expressions. + (gdb-info-breakpoints-custom): Only search till end of line. + Add face to function names in case of no filename. + 2006-08-12 Robert Thorpe (tiny change) * cus-start.el : Move to the `indent' From 4bf152406e35a9ee5c473da2f511037f89a7c328 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 14:14:23 +0000 Subject: [PATCH 107/153] (How to add fonts): New node. --- man/ChangeLog | 2 + man/faq.texi | 127 ++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 126 insertions(+), 3 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 3aee6eeae72..c82bdc48c88 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,5 +1,7 @@ 2006-08-12 Eli Zaretskii + * faq.texi (How to add fonts): New node. + * misc.texi (Saving Emacs Sessions): Clarify when desktop is restored on startup. diff --git a/man/faq.texi b/man/faq.texi index 5c3bff470a3..54be5f38a65 100644 --- a/man/faq.texi +++ b/man/faq.texi @@ -4873,6 +4873,7 @@ You can get the old behavior by binding @kbd{SPC} to * Inputting eight-bit characters:: * Kanji and Chinese characters:: * Right-to-left alphabets:: +* How to add fonts:: @end menu @node Emacs does not display 8-bit characters, Inputting eight-bit characters, Alternate character sets, Alternate character sets @@ -4912,7 +4913,7 @@ Emacs 20 and later includes many of the features of MULE, the MULtilingual Enhancement to Emacs. @xref{Installing Emacs}, for information on where to find and download the latest version of Emacs. -@node Right-to-left alphabets, , Kanji and Chinese characters, Alternate character sets +@node Right-to-left alphabets, How to add fonts, Kanji and Chinese characters, Alternate character sets @section Where is an Emacs that can handle Semitic (right-to-left) alphabets? @cindex Right-to-left alphabets @cindex Hebrew, handling with Emacs @@ -4932,8 +4933,128 @@ Emacs 18. Write to Joel if you want the patches or package. @file{hebrew.el} requires a Hebrew screen font, but no other hardware support. Joel has a screen font for PCs running MS-DOS or GNU/Linux. -You might also try to query archie for files named with @file{hebrew}; -several ftp sites in Israel may also have the necessary files. +You might also try querying @code{archie} for files named with +@file{hebrew}; several ftp sites in Israel may also have the necessary +files. + +@node How to add fonts, , Right-to-left alphabets, Alternate character sets +@section How do I add fonts for use with Emacs? +@cindex add fonts for use with Emacs +@cindex intlfonts + +First, download and install the BDF font files and any auxiliary +packages they need. The GNU Intlfonts distribution can be found on +@uref{http://directory.fsf.org/localization/intlfonts.html, the GNU +Software Directory Web site}. + +Next, if you are on X Window system, issue the following two commands +from the shell's prompt: + +@example + xset +fp /usr/local/share/emacs/fonts + xset fp rehash +@end example + +@noindent +(Modify the first command if you installed the fonts in a directory +that is not @file{/usr/local/share/emacs/fonts}.) You also need to +arrange for these two commands to run whenever you log in, e.g., by +adding them to your window-system startup file, such as +@file{~/.xsessionrc} or @file{~/.gnomerc}. + +Now, add the following line to your @file{~/.emacs} init file: + +@lisp + (add-to-list 'bdf-directory-list "/usr/share/emacs/fonts/bdf") +@end lisp + +@noindent +(Again, modify the file name if you installed the fonts elsewhere.) + +Finally, if you wish to use the installed fonts with @code{ps-print}, +add the following line to your @file{~/.emacs}: + +@lisp + (setq ps-multibyte-buffer 'bdf-font-except-latin) +@end lisp + +A few additional steps are necessary for MS-Windows; they are listed +below. + +First, make sure @emph{all} the directories with BDF font files are +mentioned in @code{bdf-directory-list}. On Unix and GNU/Linux +systems, one normally runs @kbd{make install} to install the BDF fonts +in the same directory. By contrast, Windows users typically don't run +the Intlfonts installation command, but unpack the distribution in +some directory, which leaves the BDF fonts in its subdirectories. For +example, assume that you unpacked Intlfonts in @file{C:/Intlfonts}; +then you should set @code{bdf-directory-list} as follows: + +@lisp + (setq bdf-directory-list + '("C:/Intlfonts/Asian" + "C:/Intlfonts/Chinese" "C:/Intlfonts/Chinese.X" + "C:/Intlfonts/Chinese.BIG" "C:/Intlfonts/Ethiopic" + "C:/Intlfonts/European" "C:/Intlfonts/European.BIG" + "C:/Intlfonts/Japanese" "C:/Intlfonts/Japanese.X" + "C:/Intlfonts/Japanese.BIG" "C:/Intlfonts/Korean.X" + "C:/Intlfonts/Misc")) +@end lisp + +@cindex @code{w32-bdf-filename-alist} +@cindex @code{w32-find-bdf-fonts} +Next, you need to set up the variable @code{w32-bdf-filename-alist} to +an alist of the BDF fonts and their corresponding file names. +Assuming you have set @code{bdf-directory-list} to name all the +directories with the BDF font files, the following Lisp snippet will +set up @code{w32-bdf-filename-alist}: + +@lisp + (setq w32-bdf-filename-alist + (w32-find-bdf-fonts bdf-directory-list)) +@end lisp + +Now, create fontsets for the BDF fonts: + +@lisp + (create-fontset-from-fontset-spec + "-*-fixed-medium-r-normal-*-16-*-*-*-c-*-fontset-bdf, + japanese-jisx0208:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1983-*, + katakana-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*, + latin-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*, + japanese-jisx0208-1978:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1978-*, + thai-tis620:-misc-fixed-medium-r-normal--16-160-72-72-m-80-tis620.2529-1, + lao:-misc-fixed-medium-r-normal--16-160-72-72-m-80-MuleLao-1, + tibetan-1-column:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-80-MuleTibetan-1, + ethiopic:-Admas-Ethiomx16f-Medium-R-Normal--16-150-100-100-M-160-Ethiopic-Unicode, + tibetan:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-160-MuleTibetan-0") +@end lisp + +Many of the international bdf fonts from Intlfonts are type 0, and +therefore need to be added to font-encoding-alist: + +@lisp + (setq font-encoding-alist + (append '(("MuleTibetan-0" (tibetan . 0)) + ("GB2312" (chinese-gb2312 . 0)) + ("JISX0208" (japanese-jisx0208 . 0)) + ("JISX0212" (japanese-jisx0212 . 0)) + ("VISCII" (vietnamese-viscii-lower . 0)) + ("KSC5601" (korean-ksc5601 . 0)) + ("MuleArabic-0" (arabic-digit . 0)) + ("MuleArabic-1" (arabic-1-column . 0)) + ("MuleArabic-2" (arabic-2-column . 0))) + font-encoding-alist)) +@end lisp + +You can now use the Emacs font menu to select the @samp{bdf: 16-dot medium} +fontset, or you can select it by setting the default font in your +@file{~/.emacs}: + +@lisp + (set-default-font "fontset-bdf") +@end lisp + @c ------------------------------------------------------------ @node Mail and news, Concept index, Alternate character sets, Top From 9ae1fac166b215aadbac919ec50a3708d61a063c Mon Sep 17 00:00:00 2001 From: Werner LEMBERG Date: Sat, 12 Aug 2006 17:32:00 +0000 Subject: [PATCH 108/153] * TUTORIAL.de: Synchronize with TUTORIAL. --- etc/ChangeLog | 4 ++++ etc/TUTORIAL.de | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index c900ed296da..08eda1c1fc6 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2006-08-12 Werner Lemberg + + * TUTORIAL.de: Synchronize with TUTORIAL. + 2006-08-10 Romain Francoise * NEWS: Mention that zone-mode.el is now obsolete. diff --git a/etc/TUTORIAL.de b/etc/TUTORIAL.de index 4ccdd88523c..c181d596065 100644 --- a/etc/TUTORIAL.de +++ b/etc/TUTORIAL.de @@ -285,8 +285,8 @@ sein. Wollen Sie ihn nach unten verschieben, dann geben Sie M-v mit einem numerischen Argument ein. Wenn Sie eine graphische Oberfläche wie X oder MS-Windows verwenden, -dann befindet sich ein schmaler, langgezogener rechteckiger Bereich im -Regelfall auf der linken Seite des Emacs-Fensters. Dieser Bereich +dann befindet sich ein schmaler, langgezogener rechteckiger Bereich auf +der linken oder rechten Seite des Emacs-Fensters. Dieser Bereich wird Scrollbar genannt (`Verschiebungsbalken'). Sie können Text verschieben, indem Sie mit der Maus auf den Scrollbar klicken. From e96b005100958dcea4bf850e66a965ae05d5469d Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Sat, 12 Aug 2006 22:24:37 +0000 Subject: [PATCH 109/153] (Configuration): Use correct variable in rcirc-authinfo example. --- man/rcirc.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/rcirc.texi b/man/rcirc.texi index fb24a681b7f..606e6beea06 100644 --- a/man/rcirc.texi +++ b/man/rcirc.texi @@ -501,7 +501,7 @@ by the arguments this method requires. Here is an example to illustrate how you would set it: @example -(setq rcirc-startup-channels-alist +(setq rcirc-authinfo '(("freenode" nickserv "bob" "p455w0rd") ("freenode" chanserv "bob" "#bobland" "passwd99") ("bitlbee" bitlbee "robert" "sekrit"))) From ea25d374fdfba293af4d44262e02f6291edf8c4b Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Sun, 13 Aug 2006 00:07:07 +0000 Subject: [PATCH 110/153] *** empty log message *** --- man/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/man/ChangeLog b/man/ChangeLog index c82bdc48c88..d706cf8007b 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2006-08-13 Alex Schroeder + + * rcirc.texi (Configuration): Use correct variable in rcirc-authinfo + example. + 2006-08-12 Eli Zaretskii * faq.texi (How to add fonts): New node. From 4fc3133c50147911ab51833927cbce6a8d9e33e2 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sun, 13 Aug 2006 01:08:48 +0000 Subject: [PATCH 111/153] *** empty log message *** --- lisp/ChangeLog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1699a2c785a..8c9cfaff72a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,8 +4,10 @@ (gdb-use-separate-io-buffer, menu): Avoid using `inferior' in text. (gdb-memory-mode, gdb-locals-watch-map): Don't quote lambda expressions. - (gdb-info-breakpoints-custom): Only search till end of line. + (gdb-info-breakpoints-custom): Use gdb-breakpoint-regexp. + Only search till end of line. Add face to function names in case of no filename. + Add face to variable names of watchpoints. 2006-08-12 Robert Thorpe (tiny change) From 7443a6384579ad54709095b5944fb90d491954e2 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sun, 13 Aug 2006 01:09:11 +0000 Subject: [PATCH 112/153] (gdb-frame-separate-io-buffer) (gdb-use-separate-io-buffer, menu): Avoid using `inferior' in text. (gdb-memory-mode, gdb-locals-watch-map): Don't quote lambda expressions. (gdb-info-breakpoints-custom): Use gdb-breakpoint-regexp. Only search till end of line. Add face to function names in case of no filename. Add face to variable names of watchpoints. --- lisp/progmodes/gdb-ui.el | 145 +++++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 67 deletions(-) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index e6c6380bf88..e1378f0e07e 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -321,7 +321,7 @@ of the inferior. Non-nil means display the layout shown for :version "22.1") (defcustom gdb-use-separate-io-buffer nil - "Non-nil means display output from the inferior in a separate buffer." + "Non-nil means display output from the debugged program in a separate buffer." :type 'boolean :group 'gud :version "22.1") @@ -353,14 +353,14 @@ With arg, display additional buffers iff arg is positive." (error nil)))) (defun gdb-use-separate-io-buffer (arg) - "Toggle separate IO for inferior. + "Toggle separate IO for debugged program. With arg, use separate IO iff arg is positive." (interactive "P") (setq gdb-use-separate-io-buffer (if (null arg) (not gdb-use-separate-io-buffer) (> (prefix-numeric-value arg) 0))) - (message (format "Separate inferior IO %sabled" + (message (format "Separate IO %sabled" (if gdb-use-separate-io-buffer "en" "dis"))) (if (and gud-comint-buffer (buffer-name gud-comint-buffer)) @@ -1030,7 +1030,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." (minibuffer . nil))) (defun gdb-frame-separate-io-buffer () - "Display IO of inferior in a new frame." + "Display IO of debugged program in a new frame." (interactive) (if gdb-use-separate-io-buffer (let ((special-display-regexps (append special-display-regexps '(".*"))) @@ -1776,9 +1776,8 @@ static char *magick[] = { (goto-char (point-min)) (while (< (point) (- (point-max) 1)) (forward-line 1) - (if (looking-at "[^\t].*?breakpoint") + (if (looking-at gdb-breakpoint-regexp) (progn - (looking-at "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)") (setq bptno (match-string 1)) (setq flag (char-after (match-beginning 2))) (add-text-properties @@ -1786,43 +1785,55 @@ static char *magick[] = { (if (eq flag ?y) '(face font-lock-warning-face) '(face font-lock-type-face))) - (beginning-of-line) - (if (re-search-forward " in \\(.*\\) at\\s-+" nil t) - (progn + (let ((bl (point)) + (el (line-end-position))) + (if (re-search-forward " in \\(.*\\) at\\s-+" el t) + (progn + (add-text-properties + (match-beginning 1) (match-end 1) + '(face font-lock-function-name-face)) + (looking-at "\\(\\S-+\\):\\([0-9]+\\)") + (let ((line (match-string 2)) + (file (match-string 1))) + (add-text-properties bl el + '(mouse-face highlight + help-echo "mouse-2, RET: visit breakpoint")) + (unless (file-exists-p file) + (setq file (cdr (assoc bptno gdb-location-alist)))) + (if (and file + (not (string-equal file "File not found"))) + (with-current-buffer + (find-file-noselect file 'nowarn) + (set (make-local-variable 'gud-minor-mode) + 'gdba) + (set (make-local-variable 'tool-bar-map) + gud-tool-bar-map) + ;; Only want one breakpoint icon at each + ;; location. + (save-excursion + (goto-line (string-to-number line)) + (gdb-put-breakpoint-icon (eq flag ?y) bptno))) + (gdb-enqueue-input + (list + (concat gdb-server-prefix "list " + (match-string-no-properties 1) ":1\n") + 'ignore)) + (gdb-enqueue-input + (list (concat gdb-server-prefix "info source\n") + `(lambda () (gdb-get-location + ,bptno ,line ,flag))))))) + (if (re-search-forward + "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" + el t) + (add-text-properties + (match-beginning 1) (match-end 1) + '(face font-lock-function-name-face)) + (end-of-line) + (re-search-backward "\\s-\\(\\S-*\\)" + bl t) (add-text-properties (match-beginning 1) (match-end 1) - '(face font-lock-function-name-face)) - (looking-at "\\(\\S-+\\):\\([0-9]+\\)") - (let ((line (match-string 2)) - (file (match-string 1))) - (add-text-properties (line-beginning-position) - (line-end-position) - '(mouse-face highlight - help-echo "mouse-2, RET: visit breakpoint")) - (unless (file-exists-p file) - (setq file (cdr (assoc bptno gdb-location-alist)))) - (if (and file - (not (string-equal file "File not found"))) - (with-current-buffer - (find-file-noselect file 'nowarn) - (set (make-local-variable 'gud-minor-mode) - 'gdba) - (set (make-local-variable 'tool-bar-map) - gud-tool-bar-map) - ;; Only want one breakpoint icon at each - ;; location. - (save-excursion - (goto-line (string-to-number line)) - (gdb-put-breakpoint-icon (eq flag ?y) bptno))) - (gdb-enqueue-input - (list - (concat gdb-server-prefix "list " - (match-string-no-properties 1) ":1\n") - 'ignore)) - (gdb-enqueue-input - (list (concat gdb-server-prefix "info source\n") - `(lambda () (gdb-get-location - ,bptno ,line ,flag)))))))))) + '(face font-lock-variable-name-face))))))) (end-of-line)))))) (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) @@ -2549,18 +2560,18 @@ corresponding to the mode line clicked." 'local-map (gdb-make-header-line-mouse-map 'mouse-1 - #'(lambda () (interactive) - (let ((gdb-memory-address - ;; Let GDB do the arithmetic. - (concat - gdb-memory-address " - " - (number-to-string - (* gdb-memory-repeat-count - (cond ((string= gdb-memory-unit "b") 1) - ((string= gdb-memory-unit "h") 2) - ((string= gdb-memory-unit "w") 4) - ((string= gdb-memory-unit "g") 8))))))) - (gdb-invalidate-memory))))) + (lambda () (interactive) + (let ((gdb-memory-address + ;; Let GDB do the arithmetic. + (concat + gdb-memory-address " - " + (number-to-string + (* gdb-memory-repeat-count + (cond ((string= gdb-memory-unit "b") 1) + ((string= gdb-memory-unit "h") 2) + ((string= gdb-memory-unit "w") 4) + ((string= gdb-memory-unit "g") 8))))))) + (gdb-invalidate-memory))))) "|" (propertize "+" 'face font-lock-warning-face @@ -2568,9 +2579,9 @@ corresponding to the mode line clicked." 'mouse-face 'mode-line-highlight 'local-map (gdb-make-header-line-mouse-map 'mouse-1 - #'(lambda () (interactive) - (let ((gdb-memory-address nil)) - (gdb-invalidate-memory))))) + (lambda () (interactive) + (let ((gdb-memory-address nil)) + (gdb-invalidate-memory))))) "]: " (propertize gdb-memory-address 'face font-lock-warning-face @@ -2635,13 +2646,13 @@ corresponding to the mode line clicked." (defvar gdb-locals-watch-map (let ((map (make-sparse-keymap))) - (define-key map "\r" '(lambda () (interactive) - (beginning-of-line) - (gud-watch))) - (define-key map [mouse-2] '(lambda (event) (interactive "e") - (mouse-set-point event) - (beginning-of-line) - (gud-watch))) + (define-key map "\r" (lambda () (interactive) + (beginning-of-line) + (gud-watch))) + (define-key map [mouse-2] (lambda (event) (interactive "e") + (mouse-set-point event) + (beginning-of-line) + (gud-watch))) map) "Keymap to create watch expression of a complex data type local variable.") @@ -2764,7 +2775,7 @@ corresponding to the mode line clicked." (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer)) (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) (define-key menu [inferior] - '(menu-item "Inferior IO" gdb-display-separate-io-buffer + '(menu-item "Separate IO" gdb-display-separate-io-buffer :enable gdb-use-separate-io-buffer)) (define-key menu [memory] '("Memory" . gdb-display-memory-buffer)) (define-key menu [registers] '("Registers" . gdb-display-registers-buffer)) @@ -2783,7 +2794,7 @@ corresponding to the mode line clicked." (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer)) (define-key menu [inferior] - '(menu-item "Inferior IO" gdb-frame-separate-io-buffer + '(menu-item "Separate IO" gdb-frame-separate-io-buffer :enable gdb-use-separate-io-buffer)) (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer)) @@ -2802,9 +2813,9 @@ corresponding to the mode line clicked." :help "Toggle look for source frame." :button (:toggle . gdb-find-source-frame))) (define-key menu [gdb-use-separate-io] - '(menu-item "Separate Inferior IO" gdb-use-separate-io-buffer + '(menu-item "Separate IO" gdb-use-separate-io-buffer :visible (eq gud-minor-mode 'gdba) - :help "Toggle separate IO for inferior." + :help "Toggle separate IO for debugged program." :button (:toggle . gdb-use-separate-io-buffer))) (define-key menu [gdb-many-windows] '(menu-item "Display Other Windows" gdb-many-windows From b8f5396ad1a88f7cebe3635dc4b4e2cf17a7e089 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 13 Aug 2006 03:12:43 +0000 Subject: [PATCH 113/153] * text.texi (Near Point): Say "cursor" not "terminal cursor". (Commands for Insertion): Removed split-line since it's not relevant for Lisp programming. (Yank Commands): Rewrite introduction. (Undo): Clarify. (Maintaining Undo): Clarify. Document undo-ask-before-discard. (Filling): Remove redundant comment. Clarify return value of current-justification. (Margins): Minor clarifications. (Adaptive Fill): Update default value of adaptive-fill-regexp. (Sorting): Update definition of sort-lines. (Columns): Clarify behavior of sort-columns. (Indent Tabs): Link to Tab Stops in Emacs manual. (Special Properties): Clarify. (Clickable Text): Mention Buttons package. --- lispref/ChangeLog | 18 +++++++ lispref/text.texi | 126 +++++++++++++++++++++++++++------------------- 2 files changed, 91 insertions(+), 53 deletions(-) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 8a7dffab75a..6303c1c4563 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,21 @@ +2006-08-12 Chong Yidong + + * text.texi (Near Point): Say "cursor" not "terminal cursor". + (Commands for Insertion): Removed split-line since it's not + relevant for Lisp programming. + (Yank Commands): Rewrite introduction. + (Undo): Clarify. + (Maintaining Undo): Clarify. Document undo-ask-before-discard. + (Filling): Remove redundant comment. Clarify return value of + current-justification. + (Margins): Minor clarifications. + (Adaptive Fill): Update default value of adaptive-fill-regexp. + (Sorting): Update definition of sort-lines. + (Columns): Clarify behavior of sort-columns. + (Indent Tabs): Link to Tab Stops in Emacs manual. + (Special Properties): Clarify. + (Clickable Text): Mention Buttons package. + 2006-08-12 Kevin Ryde * os.texi (Time Parsing): Add %z to description of diff --git a/lispref/text.texi b/lispref/text.texi index 08e55f18f05..4d2f278bee8 100644 --- a/lispref/text.texi +++ b/lispref/text.texi @@ -103,9 +103,9 @@ This function returns the character following point in the current buffer. This is similar to @code{(char-after (point))}. However, if point is at the end of the buffer, then @code{following-char} returns 0. -Remember that point is always between characters, and the terminal -cursor normally appears over the character following point. Therefore, -the character returned by @code{following-char} is the character the +Remember that point is always between characters, and the cursor +normally appears over the character following point. Therefore, the +character returned by @code{following-char} is the character the cursor is over. In this example, point is between the @samp{a} and the @samp{c}. @@ -526,16 +526,6 @@ The value returned is @code{nil}. In an interactive call, @var{count} is the numeric prefix argument. @end deffn -@deffn Command split-line -This command splits the current line, moving the portion of the line -after point down vertically so that it is on the next line directly -below where it was before. Whitespace is inserted as needed at the -beginning of the lower line, using the @code{indent-to} function. -@code{split-line} returns the position of point. - -Programs hardly ever use this function. -@end deffn - @defvar overwrite-mode This variable controls whether overwrite mode is in effect. The value should be @code{overwrite-mode-textual}, @code{overwrite-mode-binary}, @@ -978,8 +968,11 @@ the @var{undo} value. @comment node-name, next, previous, up @subsection Functions for Yanking - @dfn{Yanking} means reinserting an entry of previously killed text -from the kill ring. The text properties are copied too. + This section describes higher-level commands for yanking, which are +intended primarily for the user but useful also in Lisp programs. +Both @code{yank} and @code{yank-pop} honor the +@code{yank-excluded-properties} variable and @code{yank-handler} text +property (@pxref{Yanking}). @deffn Command yank &optional arg @cindex inserting killed text @@ -1213,7 +1206,7 @@ value for @code{kill-ring-max} is 60. to the buffer's text so that they can be undone. (The buffers that don't have one are usually special-purpose buffers for which Emacs assumes that undoing is not useful. In particular, any buffer whose -name begins with a space has its undo recording off by default, +name begins with a space has its undo recording off by default; see @ref{Buffer Names}.) All the primitives that modify the text in the buffer automatically add elements to the front of the undo list, which is in the variable @code{buffer-undo-list}. @@ -1318,8 +1311,7 @@ they're being called for the sake of undoing. @defun primitive-undo count list This is the basic function for undoing elements of an undo list. It undoes the first @var{count} elements of @var{list}, returning -the rest of @var{list}. You could write this function in Lisp, -but it is convenient to have it in C. +the rest of @var{list}. @code{primitive-undo} adds elements to the buffer's undo list when it changes the buffer. Undo commands avoid confusion by saving the undo @@ -1372,7 +1364,9 @@ them back to size limits you can set. (For this purpose, the ``size'' of an undo list measures the cons cells that make up the list, plus the strings of deleted text.) Three variables control the range of acceptable sizes: @code{undo-limit}, @code{undo-strong-limit} and -@code{undo-outer-limit}. +@code{undo-outer-limit}. In these variables, size is counted as the +number of bytes occupied, which includes both saved text and other +data. @defopt undo-limit This is the soft limit for the acceptable size of an undo list. The @@ -1392,6 +1386,17 @@ exceeds this limit, Emacs discards the info and displays a warning. This is a last ditch limit to prevent memory overflow. @end defopt +@defopt undo-ask-before-discard +If this variable is non-@code{nil}, when the undo info exceeds +@code{undo-outer-limit}, Emacs asks in the echo area whether to +discard the info. The default value is @code{nil}, which means to +discard it automatically. + +This option is mainly intended for debugging. Garbage collection is +inhibited while the question is asked, which means that Emacs might +leak memory if the user waits too long before answering the question. +@end defopt + @node Filling @comment node-name, next, previous, up @section Filling @@ -1481,8 +1486,6 @@ it. If the region was made up of many paragraphs, the blank lines between paragraphs are removed. This function justifies as well as filling when @var{justify} is non-@code{nil}. -In an interactive call, any prefix argument requests justification. - If @var{nosqueeze} is non-@code{nil}, that means to leave whitespace other than line breaks untouched. If @var{squeeze-after} is non-@code{nil}, it specifies a position in the region, and means don't @@ -1522,6 +1525,11 @@ values are @code{left}, @code{right}, @code{full}, @code{center}, or @defun current-justification This function returns the proper justification style to use for filling the text around point. + +This returns the value of the @code{justification} text property at +point, or the variable @var{default-justification} if there is no such +text property. However, it returns @code{nil} rather than @code{none} +to mean ``don't justify''. @end defun @defopt sentence-end-double-space @@ -1569,14 +1577,14 @@ newlines'' act as paragraph separators. @section Margins for Filling @defopt fill-prefix -This buffer-local variable specifies a string of text that appears at -the beginning -of normal text lines and should be disregarded when filling them. Any -line that fails to start with the fill prefix is considered the start of -a paragraph; so is any line that starts with the fill prefix followed by -additional whitespace. Lines that start with the fill prefix but no -additional whitespace are ordinary text lines that can be filled -together. The resulting filled lines also start with the fill prefix. +This buffer-local variable, if non-@code{nil}, specifies a string of +text that appears at the beginning of normal text lines and should be +disregarded when filling them. Any line that fails to start with the +fill prefix is considered the start of a paragraph; so is any line +that starts with the fill prefix followed by additional whitespace. +Lines that start with the fill prefix but no additional whitespace are +ordinary text lines that can be filled together. The resulting filled +lines also start with the fill prefix. The fill prefix follows the left margin whitespace, if any. @end defopt @@ -1661,12 +1669,11 @@ becomes buffer-local when set in any fashion. @defvar fill-nobreak-predicate This variable gives major modes a way to specify not to break a line -at certain places. Its value should be a list of functions, but a -single function is also supported for compatibility. Whenever filling -considers breaking the line at a certain place in the buffer, it calls -each of these functions with no arguments and with point located at -that place. If any of the functions returns non-@code{nil}, then the -line won't be broken there. +at certain places. Its value should be a list of functions. Whenever +filling considers breaking the line at a certain place in the buffer, +it calls each of these functions with no arguments and with point +located at that place. If any of the functions returns +non-@code{nil}, then the line won't be broken there. @end defvar @node Adaptive Fill @@ -1733,7 +1740,7 @@ Adaptive Fill mode matches this regular expression against the text starting after the left margin whitespace (if any) on a line; the characters it matches are that line's candidate for the fill prefix. -@w{@code{"[ \t]*\\([-|#;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}} is the +@w{@code{"[ \t]*\\([-!|#%;>*·•‣âƒâ—¦]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}} is the default value. This matches a number enclosed in parentheses or followed by a period, or certain punctuation characters, or any sequence of these intermingled with whitespace. In particular, it @@ -1898,7 +1905,8 @@ the sort order." (save-restriction (narrow-to-region beg end) (goto-char (point-min)) - (sort-subr reverse 'forward-line 'end-of-line)))) + (let ((inhibit-field-text-motion t)) + (sort-subr reverse 'forward-line 'end-of-line))))) @end group @end example @@ -2054,9 +2062,12 @@ One unusual thing about this command is that the entire line containing position @var{beg}, and the entire line containing position @var{end}, are included in the region sorted. -Note that @code{sort-columns} uses the @code{sort} utility program, -and so cannot work properly on text containing tab characters. Use -@kbd{M-x untabify} to convert tabs to spaces before sorting. +Note that @code{sort-columns} rejects text that contains tabs, because +tabs could be split across the specified columns. Use @kbd{M-x +untabify} to convert tabs to spaces before sorting. + +When possible, this command actually works by calling the @code{sort} +utility program. @end deffn @node Columns @@ -2391,6 +2402,7 @@ spaces and tab characters to reach the next tab stop column; it does not affect the display of tab characters in the buffer (@pxref{Usual Display}). Note that the @key{TAB} character as input uses this tab stop feature only in a few major modes, such as Text mode. +@xref{Tab Stops,,, emacs, The GNU Emacs Manual}. @deffn Command tab-to-tab-stop This command inserts spaces or tabs before point, up to the next tab @@ -3079,22 +3091,23 @@ This feature is used in the mode line and for other active text. @cindex keymap of character @kindex keymap @r{(text property)} The @code{keymap} property specifies an additional keymap for -commands. The property's value for the character before point applies -if it is non-@code{nil} and rear-sticky, and the property's value for -the character after point applies if it is non-@code{nil} and -front-sticky. (For mouse clicks, the position of the click is used -instead of the position of point.) If the property value is a symbol, -the symbol's function definition is used as the keymap. +commands. When this keymap applies, it is used for key lookup before +the minor mode keymaps and before the buffer's local map. +@xref{Active Keymaps}. If the property value is a symbol, the +symbol's function definition is used as the keymap. -When this keymap applies, it is used for key lookup before the minor -mode keymaps and before the buffer's local map. @xref{Active -Keymaps}. +The property's value for the character before point applies if it is +non-@code{nil} and rear-sticky, and the property's value for the +character after point applies if it is non-@code{nil} and +front-sticky. (For mouse clicks, the position of the click is used +instead of the position of point.) @item local-map @kindex local-map @r{(text property)} This property works like @code{keymap} except that it specifies a keymap to use @emph{instead of} the buffer's local map. For most -purposes (perhaps all purposes), the @code{keymap} is superior. +purposes (perhaps all purposes), it is better to use the @code{keymap} +property. @item syntax-table The @code{syntax-table} property overrides what the syntax table says @@ -3479,9 +3492,16 @@ being called over and over for the same text. @subsection Defining Clickable Text @cindex clickable text - There are two parts of setting up @dfn{clickable text} in a buffer: -(1) to indicate clickability when the mouse moves over the text, and (2) -to make a mouse button do something when you click on that text. + @dfn{Clickable text} is text that can be clicked, with either the +the mouse or via keyboard commands, to produce some result. Many +major modes use clickable text to implement features such as +hyper-links. The @code{button} package provides an easy way to insert +and manipulate clickable text. @xref{Buttons}. + + In this section, we will explain how to manually set up clickable +text in a buffer using text properties. This involves two things: (1) +indicating clickability when the mouse moves over the text, and (2) +making @kbd{RET} or a mouse click on that text do something. Indicating clickability usually involves highlighting the text, and often involves displaying helpful information about the action, such From ed112b0c83fc5fae2002d99fe6db222d8c0de391 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 13 Aug 2006 03:13:23 +0000 Subject: [PATCH 114/153] text.texi checked. --- admin/FOR-RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 27404cbd20c..115037f372b 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -100,7 +100,7 @@ lispref/streams.texi "Luc Teirlinck" Chong Yidong lispref/strings.texi "Luc Teirlinck" Chong Yidong lispref/symbols.texi "Luc Teirlinck" Chong Yidong lispref/syntax.texi "Luc Teirlinck" Chong Yidong -lispref/text.texi Chong Yidong +lispref/text.texi Chong Yidong (double-checked) lispref/tips.texi "Luc Teirlinck" Chong Yidong lispref/variables.texi "Luc Teirlinck" Chong Yidong lispref/windows.texi "Luc Teirlinck" Chong Yidong From 35dbb6cf1d6909ce26ffe150fe8b593ab9718af7 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Sun, 13 Aug 2006 16:01:44 +0000 Subject: [PATCH 115/153] (erc-log-matches-make-buffer): Add missing space. --- lisp/erc/ChangeLog | 4 ++++ lisp/erc/erc-match.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 522e4623d63..75c87b0b269 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,7 @@ +2006-08-13 Romain Francoise + + * erc-match.el (erc-log-matches-make-buffer): Add missing space. + 2006-08-07 Michael Olson * erc-backend.el (erc-process-sentinel-1): Use erc-display-message diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index ffbc7482aae..b5dc913a8c4 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -566,7 +566,7 @@ deactivate/activate match logging in the latter. See (unless buffer-already (insert " == Type \"q\" to dismiss messages ==\n") (erc-view-mode-enter nil (lambda (buffer) - (when (y-or-n-p "Discard messages?") + (when (y-or-n-p "Discard messages? ") (kill-buffer buffer))))) buffer))) From 5dab7628da331ba10d43a4f22017b8ea89218237 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Sun, 13 Aug 2006 17:04:33 +0000 Subject: [PATCH 116/153] (mm-extern-mail-server): End `y-or-n-p' prompt with a space. --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/mm-extern.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 750956b9f8b..3da68ecb902 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2006-08-13 Romain Francoise + + * mm-extern.el (mm-extern-mail-server): End `y-or-n-p' prompt with a + space. + 2006-07-28 Katsumi Yamaoka * nnheader.el (nnheader-insert-head): Make it work with Mac as well. diff --git a/lisp/gnus/mm-extern.el b/lisp/gnus/mm-extern.el index c574bd6156e..f4c728541e9 100644 --- a/lisp/gnus/mm-extern.el +++ b/lisp/gnus/mm-extern.el @@ -97,7 +97,7 @@ (subject (or (cdr (assq 'subject params)) "none")) (buf (current-buffer)) info) - (if (y-or-n-p (format "Send a request message to %s?" server)) + (if (y-or-n-p (format "Send a request message to %s? " server)) (save-window-excursion (message-mail server subject) (message-goto-body) From 43db7b94c9f8fbb48c444149c47cc9e9fd1fe8d2 Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Sun, 13 Aug 2006 17:04:56 +0000 Subject: [PATCH 117/153] Fix last entry. --- lisp/erc/ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 75c87b0b269..72754aa1cd3 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,6 +1,7 @@ 2006-08-13 Romain Francoise - * erc-match.el (erc-log-matches-make-buffer): Add missing space. + * erc-match.el (erc-log-matches-make-buffer): End `y-or-n-p' + prompt with a space. 2006-08-07 Michael Olson From e1a2960c0722989a844750468f748fca71bc65da Mon Sep 17 00:00:00 2001 From: Romain Francoise Date: Sun, 13 Aug 2006 17:05:12 +0000 Subject: [PATCH 118/153] * cus-theme.el (customize-create-theme) (custom-theme-visit-theme): End `y-or-n-p' prompt with a space. * filesets.el (filesets-add-buffer): Ditto. * pcvs.el (cvs-change-cvsroot): Ditto. --- lisp/ChangeLog | 9 +++++++++ lisp/cus-theme.el | 6 +++--- lisp/filesets.el | 2 +- lisp/pcvs.el | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8c9cfaff72a..4e44ebd5fbc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2006-08-13 Romain Francoise + + * cus-theme.el (customize-create-theme) + (custom-theme-visit-theme): End `y-or-n-p' prompt with a space. + + * filesets.el (filesets-add-buffer): Ditto. + + * pcvs.el (cvs-change-cvsroot): Ditto. + 2006-08-13 Nick Roberts * progmodes/gdb-ui.el (gdb-frame-separate-io-buffer) diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index 53f530505ae..b4fe1e4b0bf 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el @@ -99,7 +99,7 @@ the directory " custom-theme-directory "\n\n") (widget-insert " ") (widget-create 'push-button :notify (lambda (&rest ignore) - (when (y-or-n-p "Discard current changes?") + (when (y-or-n-p "Discard current changes? ") (kill-buffer (current-buffer)) (customize-create-theme))) "Reset Buffer") @@ -137,7 +137,7 @@ the directory " custom-theme-directory "\n\n") (widget-insert "\n") (widget-create 'push-button :notify (lambda (&rest ignore) - (when (y-or-n-p "Discard current changes?") + (when (y-or-n-p "Discard current changes? ") (kill-buffer (current-buffer)) (customize-create-theme))) "Reset Buffer") @@ -290,7 +290,7 @@ Optional EVENT is the location for the menu." (defun custom-theme-visit-theme () (interactive) (when (or (null custom-theme-variables) - (if (y-or-n-p "Discard current changes?") + (if (y-or-n-p "Discard current changes? ") (progn (customize-create-theme) t))) (let ((theme (call-interactively 'custom-theme-merge-theme))) (unless (eq theme 'user) diff --git a/lisp/filesets.el b/lisp/filesets.el index 4ca5a9d1420..eb8cdb02617 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -1798,7 +1798,7 @@ User will be queried, if no fileset name is provided." filesets-data nil))) (entry (or (assoc name filesets-data) (when (y-or-n-p - (format "Fileset %s does not exist. Create it?" + (format "Fileset %s does not exist. Create it? " name)) (progn (add-to-list 'filesets-data (list name '(:files))) diff --git a/lisp/pcvs.el b/lisp/pcvs.el index 89aeef53b80..a9105227bfd 100644 --- a/lisp/pcvs.el +++ b/lisp/pcvs.el @@ -2287,7 +2287,7 @@ this file, or a list of arguments to send to the program." (interactive "DNew repository: ") (if (or (file-directory-p (expand-file-name "CVSROOT" newroot)) (y-or-n-p (concat "Warning: no CVSROOT found inside repository." - " Change cvs-cvsroot anyhow?"))) + " Change cvs-cvsroot anyhow? "))) (setq cvs-cvsroot newroot))) ;;;; From e71cb549802ddb2ab5a04c2b7fdb2d892f846536 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 13 Aug 2006 19:02:57 +0000 Subject: [PATCH 119/153] * FOR-RELEASE: Elisp manual checking completed. --- admin/ChangeLog | 4 ++++ admin/FOR-RELEASE | 59 ----------------------------------------------- 2 files changed, 4 insertions(+), 59 deletions(-) diff --git a/admin/ChangeLog b/admin/ChangeLog index 51c8fa9100b..97602d53653 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,7 @@ +2006-08-13 Chong Yidong + + * FOR-RELEASE: Elisp manual checking completed. + 2006-07-17 Reiner Steib * FOR-RELEASE: Update refcard section. diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 115037f372b..8468742739c 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -46,65 +46,6 @@ and KDE projects, to use the new Emacs icons in etc/images/icons. * DOCUMENTATION -** Check the Emacs Lisp manual. - -Each manual section should be checked for factual correctness -regarding recent changes by at least two people. After each file -name, on the same line or the following line, come the names of the -people who have checked it. - -SECTION READERS ----------------------------------- -lispref/abbrevs.texi "Luc Teirlinck" Chong Yidong -lispref/advice.texi Joakim Verona Chong Yidong -lispref/anti.texi Chong Yidong Kim F. Storm -lispref/backups.texi "Luc Teirlinck" Chong Yidong -lispref/buffers.texi "Luc Teirlinck" Chong Yidong -lispref/calendar.texi Joakim Verona Chong Yidong -lispref/commands.texi "Luc Teirlinck" Chong Yidong -lispref/compile.texi "Luc Teirlinck" Chong Yidong -lispref/control.texi "Luc Teirlinck" Chong Yidong -lispref/customize.texi Chong Yidong "Luc Teirlinck" -lispref/debugging.texi Joakim Verona Lute Kamstra -lispref/display.texi Chong Yidong Jason Rumney -lispref/edebug.texi Chong Yidong "Luc Teirlinck" -lispref/elisp.texi "Luc Teirlinck" Lute Kamstra -lispref/errors.texi "Luc Teirlinck" Chong Yidong -lispref/eval.texi "Luc Teirlinck" Chong Yidong -lispref/files.texi "Luc Teirlinck" Chong Yidong -lispref/frames.texi "Luc Teirlinck" Chong Yidong -lispref/functions.texi "Luc Teirlinck" Chong Yidong -lispref/hash.texi "Luc Teirlinck" Chong Yidong -lispref/help.texi "Luc Teirlinck" Chong Yidong -lispref/hooks.texi Lute Kamstra Chong Yidong -lispref/internals.texi "Luc Teirlinck" Chong Yidong -lispref/intro.texi "Luc Teirlinck" Josh Varner -lispref/keymaps.texi "Luc Teirlinck" Chong Yidong -lispref/lists.texi "Luc Teirlinck" Chong Yidong -lispref/loading.texi "Luc Teirlinck" Chong Yidong -lispref/locals.texi Chong Yidong Nick Roberts -lispref/macros.texi "Luc Teirlinck" Chong Yidong -lispref/maps.texi Chong Yidong Kim F. Storm -lispref/markers.texi "Luc Teirlinck" Chong Yidong -lispref/minibuf.texi "Luc Teirlinck" Chong Yidong -lispref/modes.texi Chong Yidong (double-checked) -lispref/nonascii.texi "Luc Teirlinck" Chong Yidong -lispref/numbers.texi "Luc Teirlinck" Chong Yidong -lispref/objects.texi "Luc Teirlinck" Chong Yidong -lispref/os.texi "Luc Teirlinck" Chong Yidong -lispref/positions.texi "Luc Teirlinck" Chong Yidong -lispref/processes.texi Chong Yidong ttn -lispref/searching.texi "Luc Teirlinck" Chong Yidong -lispref/sequences.texi "Luc Teirlinck" Chong Yidong -lispref/streams.texi "Luc Teirlinck" Chong Yidong -lispref/strings.texi "Luc Teirlinck" Chong Yidong -lispref/symbols.texi "Luc Teirlinck" Chong Yidong -lispref/syntax.texi "Luc Teirlinck" Chong Yidong -lispref/text.texi Chong Yidong (double-checked) -lispref/tips.texi "Luc Teirlinck" Chong Yidong -lispref/variables.texi "Luc Teirlinck" Chong Yidong -lispref/windows.texi "Luc Teirlinck" Chong Yidong - ** Check the Emacs Tutorial. The first line of every tutorial must begin with text ending in a period From 369422051239c7ac9fc48ee42f898e41a77c7561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 14 Aug 2006 09:00:36 +0000 Subject: [PATCH 120/153] * term/x-win.el (menu-bar-edit-menu): Disable paste if buffer is read only. --- lisp/ChangeLog | 5 +++++ lisp/term/x-win.el | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4e44ebd5fbc..07c2f08e138 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-14 Jan Dj,Ad(Brv + + * term/x-win.el (menu-bar-edit-menu): Disable paste if buffer is + read only. + 2006-08-13 Romain Francoise * cus-theme.el (customize-create-theme) diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index af45c7c4270..38add1538aa 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -2513,8 +2513,9 @@ order until succeed.") (yank))) (define-key menu-bar-edit-menu [paste] - (cons "Paste" (cons "Paste text from clipboard or kill ring" - 'x-clipboard-yank))) + '(menu-item "Paste" x-clipboard-yank + :enable (not buffer-read-only) + :help "Paste (yank) text most recently cut/copied")) ;; Initiate drag and drop (add-hook 'after-make-frame-functions 'x-dnd-init-frame) From 9bdc2a5d70f1373b914d94cc8afb9fa82f320890 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 14 Aug 2006 09:58:03 +0000 Subject: [PATCH 121/153] *** empty log message *** --- src/ChangeLog | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7f0932a4206..7bfc9a88967 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-14 Kim F. Storm + + * .gdbinit (pitx): Print iterator position. + Limit stack dump in case iterator is not initialized. + 2006-08-12 Eli Zaretskii * frame.c (Fmouse_position, Fmouse_pixel_position) @@ -7,7 +12,7 @@ * xselect.c (Fx_register_dnd_atom): New function. (syms_of_xselect): Defsubr it. - (x_handle_dnd_message): Check that message_type is in + (x_handle_dnd_message): Check that message_type is in dpyinfo->x_dnd_atoms before generating lisp event. * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track From 82d59cb0cabac3a51a23fe06b59a22bc14fa2000 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 14 Aug 2006 09:58:12 +0000 Subject: [PATCH 122/153] (pitx): Print iterator position. Limit stack dump in case iterator is not initialized. --- src/.gdbinit | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/.gdbinit b/src/.gdbinit index 564b3762bd7..a99b17e16fb 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -164,6 +164,10 @@ define pitx if ($it->current.pos.charpos != $it->current.pos.bytepos) printf "[%d]", $it->current.pos.bytepos end + printf " pos=%d", $it->position.charpos + if ($it->position.charpos != $it->position.bytepos) + printf "[%d]", $it->position.bytepos + end printf " start=%d", $it->start.pos.charpos if ($it->start.pos.charpos != $it->start.pos.bytepos) printf "[%d]", $it->start.pos.bytepos @@ -218,7 +222,7 @@ define pitx printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent printf "\n" set $i = 0 - while ($i < $it->sp) + while ($i < $it->sp && $i < 4) set $e = $it->stack[$i] printf "stack[%d]: ", $i output $e->method From 70282fce62e13117947dfb4151e93eeb60251d65 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 14 Aug 2006 18:32:23 +0000 Subject: [PATCH 123/153] * keyboard.c (read_char): Don't reset idle timers if a time limit is supplied. --- src/ChangeLog | 5 +++++ src/keyboard.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7bfc9a88967..e97b91cf42e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-14 Chong Yidong + + * keyboard.c (read_char): Don't reset idle timers if a time limit + is supplied. + 2006-08-14 Kim F. Storm * .gdbinit (pitx): Print iterator position. diff --git a/src/keyboard.c b/src/keyboard.c index c715eadeb80..bea35a05731 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2679,7 +2679,14 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) goto non_reread; } - timer_start_idle (); + /* Start idle timers. If a time limit is supplied, we don't reset + idle timers. This avoids an infinite recursion in case an idle + timer calls `sit-for'. */ + + if (end_time) + timer_resume_idle (); + else + timer_start_idle (); /* If in middle of key sequence and minibuffer not active, start echoing if enough time elapses. */ @@ -2879,7 +2886,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* Actually read a character, waiting if necessary. */ save_getcjmp (save_jump); restore_getcjmp (local_getcjmp); - timer_start_idle (); + if (end_time) + timer_resume_idle (); + else + timer_start_idle (); c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); restore_getcjmp (save_jump); From 9143202cb6465e7e4c9ea5fde254485fccd0e6e0 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Tue, 15 Aug 2006 00:01:16 +0000 Subject: [PATCH 124/153] (gdb-info-stack-custom): Indicate selected frame with fringe arrow. Suggested by Simon Marshall . (gdb-stack-position): New variable. (gdb-starting, gdb-exited): Reset gdb-stack-position to nil. (gdb-frames-mode): Set gdb-stack-position to nil. Add to overlay-arrow-variable-list (gdb-reset): Delete gdb-stack-position from above list. --- lisp/progmodes/gdb-ui.el | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index e1378f0e07e..b5334ba5bc5 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -115,6 +115,7 @@ address for root variables.") (defvar gdb-main-file nil "Source file from which program execution begins.") (defvar gud-old-arrow nil) (defvar gdb-overlay-arrow-position nil) +(defvar gdb-stack-position nil) (defvar gdb-server-prefix nil) (defvar gdb-flush-pending-output nil) (defvar gdb-location-alist nil @@ -1296,6 +1297,7 @@ not GDB." (setq gud-old-arrow gud-overlay-arrow-position) (setq gud-overlay-arrow-position nil) (setq gdb-overlay-arrow-position nil) + (setq gdb-stack-position nil) (if gdb-use-separate-io-buffer (setq gdb-output-sink 'inferior)))) (t @@ -1330,6 +1332,7 @@ directives." (setq gdb-active-process nil) (setq gud-overlay-arrow-position nil) (setq gdb-overlay-arrow-position nil) + (setq gdb-stack-position nil) (setq gud-old-arrow nil) (setq gdb-inferior-status "exited") (gdb-force-mode-line-update @@ -2037,8 +2040,14 @@ static char *magick[] = { (goto-char bl) (when (looking-at "^#\\([0-9]+\\)") (when (string-equal (match-string 1) gdb-frame-number) - (put-text-property bl (+ bl 4) - 'face '(:inverse-video t))) + (if (> (car (window-fringes)) 0) + (progn + (or gdb-stack-position + (setq gdb-stack-position (make-marker))) + (set-marker gdb-stack-position (point))) + (set-marker gdb-stack-position nil) + (put-text-property bl (+ bl 4) + 'face '(:inverse-video t)))) (when (re-search-forward (concat (if (string-equal (match-string 1) "0") "" " in ") @@ -2109,6 +2118,8 @@ static char *magick[] = { (kill-all-local-variables) (setq major-mode 'gdb-frames-mode) (setq mode-name "Frames") + (setq gdb-stack-position nil) + (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position) (setq buffer-read-only t) (use-local-map gdb-frames-mode-map) (run-mode-hooks 'gdb-frames-mode-hook) @@ -2912,12 +2923,13 @@ Kills the gdb buffers, and resets variables and the source buffers." (setq gud-minor-mode nil) (kill-local-variable 'tool-bar-map) (kill-local-variable 'gdb-define-alist)))))) - (when (markerp gdb-overlay-arrow-position) - (move-marker gdb-overlay-arrow-position nil) - (setq gdb-overlay-arrow-position nil)) + (setq gdb-overlay-arrow-position nil) (setq overlay-arrow-variable-list (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) + (setq gdb-stack-position nil) + (setq overlay-arrow-variable-list + (delq 'gdb-stack-position overlay-arrow-variable-list)) (if (boundp 'speedbar-frame) (speedbar-timer-fn)) (setq gud-running nil) (setq gdb-active-process nil) @@ -3139,8 +3151,7 @@ BUFFER nil or omitted means use the current buffer." '((overlay-arrow . hollow-right-triangle)))) (or gdb-overlay-arrow-position (setq gdb-overlay-arrow-position (make-marker))) - (set-marker gdb-overlay-arrow-position - (point) (current-buffer)))))) + (set-marker gdb-overlay-arrow-position (point)))))) ;; remove all breakpoint-icons in assembler buffer before updating. (gdb-remove-breakpoint-icons (point-min) (point-max)))) (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) From 8b12cd99d2b2a49d3608a9419b9a82a53d2cd002 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Tue, 15 Aug 2006 00:30:07 +0000 Subject: [PATCH 125/153] *** empty log message *** --- lisp/ChangeLog | 11 +++++++++++ man/ChangeLog | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07c2f08e138..c32902da47a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2006-08-15 Nick Roberts + + * progmodes/gdb-ui.el (gdb-info-stack-custom): Indicate selected + frame with fringe arrow. Suggested by Simon Marshall + . + (gdb-stack-position): New variable. + (gdb-starting, gdb-exited): Reset gdb-stack-position to nil. + (gdb-frames-mode): Set gdb-stack-position to nil. Add to + overlay-arrow-variable-list + (gdb-reset): Delete gdb-stack-position from above list. + 2006-08-14 Jan Dj,Ad(Brv * term/x-win.el (menu-bar-edit-menu): Disable paste if buffer is diff --git a/man/ChangeLog b/man/ChangeLog index d706cf8007b..10e43a9dbd4 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2006-08-15 Nick Roberts + + * building.texi (Stack Buffer): Explain fringe arrow. + 2006-08-13 Alex Schroeder * rcirc.texi (Configuration): Use correct variable in rcirc-authinfo @@ -50,7 +54,7 @@ * building.texi (GDB Graphical Interface): Shorten node names. (GDB-UI Layout): Use GDB-related. - (Stack Buffer): Simplify English. + (Other GDB-UI Buffers): Simplify English. 2006-07-31 Richard Stallman From a7acd30f0cb170d96069065f0a60617cc0d75fa8 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Tue, 15 Aug 2006 00:33:09 +0000 Subject: [PATCH 126/153] (Stack Buffer): Explain fringe arrow. --- man/building.texi | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/man/building.texi b/man/building.texi index 8b479960e71..68aeb023b76 100644 --- a/man/building.texi +++ b/man/building.texi @@ -1001,12 +1001,13 @@ of the nested subroutine calls (@dfn{stack frames}) now active in the program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}. @findex gdb-frames-select - The selected frame number is displayed in reverse contrast. To -select a frame in GDB, move point in the stack buffer to that stack -frame and type @key{RET} (@code{gdb-frames-select}), or click +An arrow in the fringe points to the selected frame or, if the fringe is +not present, the number of the selected frame is displayed in reverse +contrast. To select a frame in GDB, move point in the stack buffer to +that stack frame and type @key{RET} (@code{gdb-frames-select}), or click @kbd{Mouse-2} on a stack frame. If the locals buffer is visible, -selecting a stack frame updates it to display the local variables of -the new frame. +selecting a stack frame updates it to display the local variables of the +new frame. @node Other GDB-UI Buffers @subsubsection Other Buffers @@ -1018,7 +1019,7 @@ If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil}, the program being debugged takes its input and displays its output here. Otherwise it uses the GUD buffer for that. To toggle whether GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}. -That takes effect when you next restart the program you are debugging. +This takes effect when you next restart the program you are debugging. The history and replay commands from Shell mode are available here, as are the commands to send signals to the debugged program. From 8db1f9fa0c11f5c2e1f4e5eb94911b573f61fd6f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 15 Aug 2006 02:42:21 +0000 Subject: [PATCH 127/153] (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC is exhausted, return with RET. (detect_coding_emacs_mule, detect_coding_iso2022) (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8) (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above change. --- src/ChangeLog | 9 ++++++++ src/coding.c | 61 +++++++++++++++++++++------------------------------ 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e97b91cf42e..5026f4f10f8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2006-08-15 Kenichi Handa + + * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC + is exhausted, return with RET. + (detect_coding_emacs_mule, detect_coding_iso2022) + (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8) + (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above + change. + 2006-08-14 Chong Yidong * keyboard.c (read_char): Don't reset idle timers if a time limit diff --git a/src/coding.c b/src/coding.c index ae9f6749792..28e7a3fafc1 100644 --- a/src/coding.c +++ b/src/coding.c @@ -219,14 +219,15 @@ encode_coding_XXX (coding, source, destination, src_bytes, dst_bytes) /* Like ONE_MORE_BYTE, but 8-bit bytes of data at SRC are in multibyte - form if MULTIBYTEP is nonzero. */ + form if MULTIBYTEP is nonzero. In addition, if SRC is not less + than SRC_END, return with RET. */ -#define ONE_MORE_BYTE_CHECK_MULTIBYTE(c1, multibytep) \ +#define ONE_MORE_BYTE_CHECK_MULTIBYTE(c1, multibytep, ret) \ do { \ if (src >= src_end) \ { \ coding->result = CODING_FINISH_INSUFFICIENT_SRC; \ - goto label_end_of_loop; \ + return ret; \ } \ c1 = *src++; \ if (multibytep && c1 == LEADING_CODE_8_BIT_CONTROL) \ @@ -632,15 +633,15 @@ detect_coding_emacs_mule (src, src_end, multibytep) while (1) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); - + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, + CODING_CATEGORY_MASK_EMACS_MULE); if (composing) { if (c < 0xA0) composing = 0; else if (c == 0xA0) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); c &= 0x7F; } else @@ -669,8 +670,6 @@ detect_coding_emacs_mule (src, src_end, multibytep) } } } - label_end_of_loop: - return CODING_CATEGORY_MASK_EMACS_MULE; } @@ -1425,9 +1424,9 @@ detect_coding_iso2022 (src, src_end, multibytep) Lisp_Object safe_chars; reg[0] = CHARSET_ASCII, reg[1] = reg[2] = reg[3] = -1; - while (mask && src < src_end) + while (mask) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found); retry: switch (c) { @@ -1435,11 +1434,11 @@ detect_coding_iso2022 (src, src_end, multibytep) if (inhibit_iso_escape_detection) break; single_shifting = 0; - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found); if (c >= '(' && c <= '/') { /* Designation sequence for a charset of dimension 1. */ - ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, mask & mask_found); if (c1 < ' ' || c1 >= 0x80 || (charset = iso_charset_table[0][c >= ','][c1]) < 0) /* Invalid designation sequence. Just ignore. */ @@ -1449,13 +1448,14 @@ detect_coding_iso2022 (src, src_end, multibytep) else if (c == '$') { /* Designation sequence for a charset of dimension 2. */ - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found); if (c >= '@' && c <= 'B') /* Designation for JISX0208.1978, GB2312, or JISX0208. */ reg[0] = charset = iso_charset_table[1][0][c]; else if (c >= '(' && c <= '/') { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, + mask & mask_found); if (c1 < ' ' || c1 >= 0x80 || (charset = iso_charset_table[1][c >= ','][c1]) < 0) /* Invalid designation sequence. Just ignore. */ @@ -1630,7 +1630,8 @@ detect_coding_iso2022 (src, src_end, multibytep) c = -1; while (src < src_end) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, + mask & mask_found); if (c < 0xA0) break; i++; @@ -1648,7 +1649,6 @@ detect_coding_iso2022 (src, src_end, multibytep) break; } } - label_end_of_loop: return (mask & mask_found); } @@ -2919,20 +2919,18 @@ detect_coding_sjis (src, src_end, multibytep) while (1) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_SJIS); if (c < 0x80) continue; if (c == 0x80 || c == 0xA0 || c > 0xEF) return 0; if (c <= 0x9F || c >= 0xE0) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); if (c < 0x40 || c == 0x7F || c > 0xFC) return 0; } } - label_end_of_loop: - return CODING_CATEGORY_MASK_SJIS; } /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". @@ -2951,17 +2949,15 @@ detect_coding_big5 (src, src_end, multibytep) while (1) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_BIG5); if (c < 0x80) continue; if (c < 0xA1 || c > 0xFE) return 0; - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); if (c < 0x40 || (c > 0x7F && c < 0xA1) || c > 0xFE) return 0; } - label_end_of_loop: - return CODING_CATEGORY_MASK_BIG5; } /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". @@ -2989,7 +2985,7 @@ detect_coding_utf_8 (src, src_end, multibytep) while (1) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_UTF_8); if (UTF_8_1_OCTET_P (c)) continue; else if (UTF_8_2_OCTET_LEADING_P (c)) @@ -3007,16 +3003,13 @@ detect_coding_utf_8 (src, src_end, multibytep) do { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); if (!UTF_8_EXTRA_OCTET_P (c)) return 0; seq_maybe_bytes--; } while (seq_maybe_bytes > 0); } - - label_end_of_loop: - return CODING_CATEGORY_MASK_UTF_8; } /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". @@ -3045,15 +3038,13 @@ detect_coding_utf_16 (src, src_end, multibytep) struct coding_system dummy_coding; struct coding_system *coding = &dummy_coding; - ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep); - ONE_MORE_BYTE_CHECK_MULTIBYTE (c2, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, 0); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c2, multibytep, 0); if ((c1 == 0xFF) && (c2 == 0xFE)) return CODING_CATEGORY_MASK_UTF_16_LE; else if ((c1 == 0xFE) && (c2 == 0xFF)) return CODING_CATEGORY_MASK_UTF_16_BE; - - label_end_of_loop: return 0; } @@ -3322,12 +3313,10 @@ detect_coding_ccl (src, src_end, multibytep) valid = coding_system_table[CODING_CATEGORY_IDX_CCL]->spec.ccl.valid_codes; while (1) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_CCL); if (! valid[c]) return 0; } - label_end_of_loop: - return CODING_CATEGORY_MASK_CCL; } From fa1f0963c428ad98d38848a07a3f767f581bb1bf Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 15 Aug 2006 02:50:30 +0000 Subject: [PATCH 128/153] *** empty log message *** --- admin/FOR-RELEASE | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 8468742739c..35070c082b1 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -44,6 +44,9 @@ and KDE projects, to use the new Emacs icons in etc/images/icons. ** Implement buffer-chars-modified-tick. +** henman@it.to-be.co.jp 09 Aug 2006: ispell.el problem. + + * DOCUMENTATION ** Check the Emacs Tutorial. From 5137195a6228c57f41de7d40c1439dc2ba9d56a2 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 15 Aug 2006 11:55:38 +0000 Subject: [PATCH 129/153] (org-clock-special-range, org-clock-update-time-maybe): New functions. (org-stamp-time-of-day-regexp): Allow weekday to be of word chars, not only a-z. (org-agenda-get-blocks): Allow multiple blocks per headline. (org-timestamp-change): Call `org-clock-update-time-maybe'. (org-export-html-title-format) (org-export-html-toplevel-hlevel): New options. (org-export-language-setup): Added support for Czech. (org-mode, org-insert-todo-heading, org-find-visible) (org-find-invisible, org-invisible-p, org-invisible-p2) (org-back-to-heading, org-on-heading-p, org-up-heading-all) (org-show-subtree, org-show-entry, org-make-options-regexp): Removed compatibility support for old outline-mode. (org-check-occur-regexp): Funtion removed. (org-on-heading-p, org-back-to-heading): Made defalias. (org-set-local): New defsubst. (org-set-regexps-and-options, org-mode) (org-set-font-lock-defaults, org-edit-agenda-file-list) (org-timeline, org-agenda-list, org-todo-list, org-tags-view) (org-remember-apply-template, org-table-edit-field) (org-table-edit-formulas, orgtbl-mode, org-export-as-ascii) (org-set-autofill-regexps): Use `org-set-local'. (org-table-eval-formula): Fixed bug with parsing of display flags. --- lisp/textmodes/org.el | 575 ++++++++++++++++++++++-------------------- 1 file changed, 305 insertions(+), 270 deletions(-) diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el index 4cda0d6b3a0..1fcac6855d9 100644 --- a/lisp/textmodes/org.el +++ b/lisp/textmodes/org.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ -;; Version: 4.43 +;; Version: 4.44 ;; ;; This file is part of GNU Emacs. ;; @@ -90,10 +90,12 @@ ;; ;; Recent changes ;; -------------- -;; Version 4.43 -;; - Big fixes +;; Version 4.44 +;; - Clock table can be done for a limited time interval. +;; - Obsolete support for the old outline mode has been removed. +;; - Bug fixes and code cleaning. ;; -;; Version 4.42 +;; Version 4.43 ;; - Bug fixes ;; - `s' key in the agenda saves all org-mode buffers. ;; @@ -212,16 +214,13 @@ ;;; Customization variables -(defvar org-version "4.43" +(defvar org-version "4.44" "The version number of the file org.el.") (defun org-version () (interactive) (message "Org-mode version %s" org-version)) -;; The following constant is for compatibility with different versions -;; of outline.el. -(defconst org-noutline-p (featurep 'noutline) - "Are we using the new outline mode?") +;; Compatibility constants (defconst org-xemacs-p (featurep 'xemacs)) ; not used by org.el itself (defconst org-format-transports-properties-p (let ((x "a")) @@ -1132,7 +1131,7 @@ files and the cdr the corresponding command. Possible values for the file identifier are \"ext\" A string identifying an extension `directory' Matches a directory - `remote' Matches a remove file, accessible through tramp or efs. + `remote' Matches a remote file, accessible through tramp or efs. Remote files most likely should be visited through emacs because external applications cannot handle such paths. t Default for all remaining files @@ -1831,6 +1830,7 @@ Org-mode files lives." (defcustom org-export-language-setup '(("en" "Author" "Date" "Table of Contents") + ("cs" "Autor" "Datum" "Obsah") ("da" "Ophavsmand" "Dato" "Indhold") ("de" "Autor" "Datum" "Inhaltsverzeichnis") ("es" "Autor" "Fecha" "\xccndice") @@ -2150,6 +2150,16 @@ you can \"misuse\" it to add arbitrary text to the header." :group 'org-export-html :type 'string) +(defcustom org-export-html-title-format "

%s

\n" + "Format for typesetting the document title in HTML export." + :group 'org-export-html + :type 'string) + +(defcustom org-export-html-toplevel-hlevel 2 + "The level for level 1 headings in HTML export." + :group 'org-export-html + :type 'string) + (defcustom org-export-html-link-org-files-as-html t "Non-nil means, make file links to `file.org' point to `file.html'. When org-mode is exporting an org-mode file to HTML, links to @@ -2694,6 +2704,10 @@ Also put tags into group 4 if tags are present.") (remove-text-properties 0 (length s) org-rm-props s) s) +(defsubst org-set-local (var value) + "Make VAR local in current buffer and set it to VALUE." + (set (make-variable-buffer-local var) value)) + (defsubst org-mode-p () "Check if the current buffer is in Org-mode." (eq major-mode 'org-mode)) @@ -2703,7 +2717,7 @@ Also put tags into group 4 if tags are present.") (when (org-mode-p) (let ((re (org-make-options-regexp '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO" - "STARTUP" "ARCHIVE" "TAGS"))) + "STARTUP" "ARCHIVE" "TAGS" "CALC"))) (splitre "[ \t]+") kwds int key value cat arch tags) (save-excursion @@ -2755,10 +2769,10 @@ Also put tags into group 4 if tags are present.") (remove-text-properties 0 (length arch) '(face t fontified t) arch))) ))) - (and cat (set (make-local-variable 'org-category) cat)) - (and kwds (set (make-local-variable 'org-todo-keywords) kwds)) - (and arch (set (make-local-variable 'org-archive-location) arch)) - (and int (set (make-local-variable 'org-todo-interpretation) int)) + (and cat (org-set-local 'org-category cat)) + (and kwds (org-set-local 'org-todo-keywords kwds)) + (and arch (org-set-local 'org-archive-location arch)) + (and int (org-set-local 'org-todo-interpretation int)) (when tags (let (e tgs) (while (setq e (pop tags)) @@ -2770,7 +2784,7 @@ Also put tags into group 4 if tags are present.") (string-to-char (match-string 2 e))) tgs)) (t (push (list e) tgs)))) - (set (make-local-variable 'org-tag-alist) nil) + (org-set-local 'org-tag-alist nil) (while (setq e (pop tgs)) (or (and (stringp (car e)) (assoc (car e) org-tag-alist)) @@ -2928,15 +2942,11 @@ The following commands are available: ;; Need to do this here because define-derived-mode sets up ;; the keymap so late. (if (featurep 'xemacs) - (if org-noutline-p - (progn - (easy-menu-remove outline-mode-menu-heading) - (easy-menu-remove outline-mode-menu-show) - (easy-menu-remove outline-mode-menu-hide)) - (delete-menu-item '("Headings")) - (delete-menu-item '("Show")) - (delete-menu-item '("Hide")) - (set-menubar-dirty-flag)) + (progn + ;; Assume this is Greg's port, it used easymenu + (easy-menu-remove outline-mode-menu-heading) + (easy-menu-remove outline-mode-menu-show) + (easy-menu-remove outline-mode-menu-hide)) (define-key org-mode-map [menu-bar headings] 'undefined) (define-key org-mode-map [menu-bar hide] 'undefined) (define-key org-mode-map [menu-bar show] 'undefined)) @@ -2947,7 +2957,7 @@ The following commands are available: (if org-descriptive-links (org-add-to-invisibility-spec '(org-link))) (org-add-to-invisibility-spec '(org-cwidth)) (when (featurep 'xemacs) - (set (make-local-variable 'line-move-ignore-invisible) t)) + (org-set-local 'line-move-ignore-invisible t)) (setq outline-regexp "\\*+") ;;(setq outline-regexp "\\(?:\\*+\\|[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\) \\)") (setq outline-level 'org-outline-level) @@ -2958,12 +2968,14 @@ The following commands are available: 4 (string-to-vector org-ellipsis)) (setq buffer-display-table org-display-table)) (org-set-regexps-and-options) + ;; Calc embedded + (org-set-local 'calc-embedded-open-mode "# ") (modify-syntax-entry ?# "<") (if org-startup-truncated (setq truncate-lines t)) - (set (make-local-variable 'font-lock-unfontify-region-function) - 'org-unfontify-region) + (org-set-local 'font-lock-unfontify-region-function + 'org-unfontify-region) ;; Activate before-change-function - (set (make-local-variable 'org-table-may-need-update) t) + (org-set-local 'org-table-may-need-update t) (org-add-hook 'before-change-functions 'org-before-change-function nil 'local) ;; Check for running clock before killing a buffer @@ -3107,7 +3119,7 @@ that will be added to PLIST. Returns the string that was modified." org-ts-regexp "\\)?") "Regular expression matching a time stamp or time stamp range.") -(defvar org-§emph-face nil) +(defvar org-§emph-face nil) (defun org-do-emphasis-faces (limit) "Run through the buffer and add overlays to links." @@ -3340,10 +3352,9 @@ between words." ))) (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords)) ;; Now set the full font-lock-keywords - (set (make-local-variable 'org-font-lock-keywords) - org-font-lock-extra-keywords) - (set (make-local-variable 'font-lock-defaults) - '(org-font-lock-keywords t nil nil backward-paragraph)) + (org-set-local 'org-font-lock-keywords org-font-lock-extra-keywords) + (org-set-local 'font-lock-defaults + '(org-font-lock-keywords t nil nil backward-paragraph)) (kill-local-variable 'font-lock-keywords) nil)) (defvar org-m nil) @@ -3812,9 +3823,7 @@ state (TODO by default). Also with prefix arg, force first state." (org-insert-heading) (save-excursion (org-back-to-heading) - (if org-noutline-p - (outline-previous-heading) - (outline-previous-visible-heading t)) + (outline-previous-heading) (looking-at org-todo-line-regexp)) (if (or arg (not (match-beginning 2)) @@ -4703,7 +4712,7 @@ the children that do not contain any open TODO items." (pc '(:org-comment t)) (pall '(:org-archived t :org-comment t)) (rea (concat ":" org-archive-tag ":")) - bmp file re) + bmp file re) (save-excursion (while (setq file (pop files)) (org-check-agenda-file file) @@ -4775,7 +4784,7 @@ If not found, stay at current position and return nil." pos)) (defconst org-dblock-start-re - "^#\\+BEGIN:[ \t]+\\(\\S-+\\)[ \t]+\\(.*\\)" + "^#\\+BEGIN:[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?" "Matches the startline of a dynamic block, with parameters.") (defconst org-dblock-end-re "^#\\+END\\([: \t\r\n]\\|$\\)" @@ -4803,7 +4812,7 @@ the property list including an extra property :name with the block name." (let* ((begdel (1+ (match-end 0))) (name (match-string 1)) (params (append (list :name name) - (read (concat "(" (match-string 2) ")"))))) + (read (concat "(" (match-string 3) ")"))))) (unless (re-search-forward org-dblock-end-re nil t) (error "Dynamic block not terminated")) (delete-region begdel (match-beginning 0)) @@ -5200,7 +5209,6 @@ If CALLBACK is non-nil, it is a function which is called to confirm that the match should indeed be shown." (interactive "sRegexp: ") (org-remove-occur-highlights nil nil t) - (setq regexp (org-check-occur-regexp regexp)) (let ((cnt 0)) (save-excursion (goto-char (point-min)) @@ -5625,56 +5633,58 @@ next column. For time difference computation, a year is assumed to be exactly 365 days in order to avoid rounding problems." (interactive "P") - (save-excursion - (unless (org-at-date-range-p) - (goto-char (point-at-bol)) - (re-search-forward org-tr-regexp (point-at-eol) t)) - (if (not (org-at-date-range-p)) - (error "Not at a time-stamp range, and none found in current line"))) - (let* ((ts1 (match-string 1)) - (ts2 (match-string 2)) - (havetime (or (> (length ts1) 15) (> (length ts2) 15))) - (match-end (match-end 0)) - (time1 (org-time-string-to-time ts1)) - (time2 (org-time-string-to-time ts2)) - (t1 (time-to-seconds time1)) - (t2 (time-to-seconds time2)) - (diff (abs (- t2 t1))) - (negative (< (- t2 t1) 0)) - ;; (ys (floor (* 365 24 60 60))) - (ds (* 24 60 60)) - (hs (* 60 60)) - (fy "%dy %dd %02d:%02d") - (fy1 "%dy %dd") - (fd "%dd %02d:%02d") - (fd1 "%dd") - (fh "%02d:%02d") - y d h m align) - (if havetime - (setq ; y (floor (/ diff ys)) diff (mod diff ys) - y 0 - d (floor (/ diff ds)) diff (mod diff ds) - h (floor (/ diff hs)) diff (mod diff hs) - m (floor (/ diff 60))) - (setq ; y (floor (/ diff ys)) diff (mod diff ys) - y 0 - d (floor (+ (/ diff ds) 0.5)) - h 0 m 0)) - (if (not to-buffer) - (message (org-make-tdiff-string y d h m)) - (when (org-at-table-p) - (goto-char match-end) - (setq align t) - (and (looking-at " *|") (goto-char (match-end 0)))) - (if (looking-at - "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]") - (replace-match "")) - (if negative (insert " -")) - (if (> y 0) (insert " " (format (if havetime fy fy1) y d h m)) - (if (> d 0) (insert " " (format (if havetime fd fd1) d h m)) - (insert " " (format fh h m)))) - (if align (org-table-align)) - (message "Time difference inserted")))) + (or + (org-clock-update-time-maybe) + (save-excursion + (unless (org-at-date-range-p) + (goto-char (point-at-bol)) + (re-search-forward org-tr-regexp (point-at-eol) t)) + (if (not (org-at-date-range-p)) + (error "Not at a time-stamp range, and none found in current line"))) + (let* ((ts1 (match-string 1)) + (ts2 (match-string 2)) + (havetime (or (> (length ts1) 15) (> (length ts2) 15))) + (match-end (match-end 0)) + (time1 (org-time-string-to-time ts1)) + (time2 (org-time-string-to-time ts2)) + (t1 (time-to-seconds time1)) + (t2 (time-to-seconds time2)) + (diff (abs (- t2 t1))) + (negative (< (- t2 t1) 0)) + ;; (ys (floor (* 365 24 60 60))) + (ds (* 24 60 60)) + (hs (* 60 60)) + (fy "%dy %dd %02d:%02d") + (fy1 "%dy %dd") + (fd "%dd %02d:%02d") + (fd1 "%dd") + (fh "%02d:%02d") + y d h m align) + (if havetime + (setq ; y (floor (/ diff ys)) diff (mod diff ys) + y 0 + d (floor (/ diff ds)) diff (mod diff ds) + h (floor (/ diff hs)) diff (mod diff hs) + m (floor (/ diff 60))) + (setq ; y (floor (/ diff ys)) diff (mod diff ys) + y 0 + d (floor (+ (/ diff ds) 0.5)) + h 0 m 0)) + (if (not to-buffer) + (message (org-make-tdiff-string y d h m)) + (when (org-at-table-p) + (goto-char match-end) + (setq align t) + (and (looking-at " *|") (goto-char (match-end 0)))) + (if (looking-at + "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]") + (replace-match "")) + (if negative (insert " -")) + (if (> y 0) (insert " " (format (if havetime fy fy1) y d h m)) + (if (> d 0) (insert " " (format (if havetime fd fd1) d h m)) + (insert " " (format fh h m)))) + (if align (org-table-align)) + (message "Time difference inserted"))))) (defun org-make-tdiff-string (y d h m) (let ((fmt "") @@ -5817,6 +5827,7 @@ in the timestamp determines what will be changed." (setcar (nthcdr 2 time0) (or (nth 1 time0) 0)) (setq time (apply 'encode-time time0)))) (insert (setq org-last-changed-timestamp (format-time-string fmt time))) + (org-clock-update-time-maybe) (goto-char pos) ;; Try to recenter the calendar window, if any (if (and org-calendar-follow-timestamp-change @@ -5937,18 +5948,19 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set." "Holds the file total time in minutes, after a call to `org-clock-sum'.") (make-variable-buffer-local 'org-clock-file-total-minutes) -(defun org-clock-sum () +(defun org-clock-sum (&optional tstart tend) "Sum the times for each subtree. Puts the resulting times in minutes as a text property on each headline." (interactive) (let* ((bmp (buffer-modified-p)) (re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" org-clock-string - ".*=>[ \t]*\\([0-9]+\\):\\([0-9]+\\)[ \t]*$")) + "[ \t]*\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)")) (lmax 30) (ltimes (make-vector lmax 0)) (t1 0) (level 0) + ts te dt time) (remove-text-properties (point-min) (point-max) '(:org-clock-minutes t)) (save-excursion @@ -5956,8 +5968,16 @@ Puts the resulting times in minutes as a text property on each headline." (while (re-search-backward re nil t) (if (match-end 2) ;; A time - (setq t1 (+ t1 (* 60 (string-to-number (match-string 2))) - (string-to-number (match-string 3)))) + (setq ts (match-string 2) + te (match-string 3) + ts (time-to-seconds + (apply 'encode-time (org-parse-time-string ts))) + te (time-to-seconds + (apply 'encode-time (org-parse-time-string te))) + ts (if tstart (max ts tstart) ts) + te (if tend (min te tend) te) + dt (- te ts) + t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1)) ;; A headline (setq level (- (match-end 1) (match-beginning 1))) (when (or (> t1 0) (> (aref ltimes level) 0)) @@ -6069,26 +6089,112 @@ The BEGIN line can contain parameters. Allowed are: (interactive) (org-remove-clock-overlays) (unless (org-find-dblock "clocktable") - (org-create-dblock (list :name "clocktable" - :maxlevel 2 :emphasize nil))) + (org-create-dblock (list :name "clocktable" + :maxlevel 2 :emphasize nil))) (org-update-dblock)) +(defun org-clock-update-time-maybe () + "If this is a CLOCK line, update it and return t. +Otherwise, return nil." + (interactive) + (save-excursion + (beginning-of-line 1) + (skip-chars-forward " \t") + (when (looking-at org-clock-string) + (let ((re (concat "[ \t]*" org-clock-string + " *[[<]\\([^]>]+\\)[]>]-+[[<]\\([^]>]+\\)[]>]" + "\\([ \t]*=>.*\\)?")) + ts te h m s) + (if (not (looking-at re)) + nil + (and (match-end 3) (delete-region (match-beginning 3) (match-end 3))) + (end-of-line 1) + (setq ts (match-string 1) + te (match-string 2)) + (setq s (- (time-to-seconds + (apply 'encode-time (org-parse-time-string te))) + (time-to-seconds + (apply 'encode-time (org-parse-time-string ts)))) + h (floor (/ s 3600)) + s (- s (* 3600 h)) + m (floor (/ s 60)) + s (- s (* 60 s))) + (insert " => " (format "%2d:%02d" h m)) + t))))) + +(defun org-clock-special-range (key &optional time as-strings) + "Return two times bordering a special time range. +Key is a symbol specifying the range and can be one of `today', `yesterday', +`thisweek', `lastweek', `thismonth', `lastmonth', `thisyear', `lastyear'. +A week starts Monday 0:00 and ends Sunday 24:00. +The range is determined relative to TIME. TIME defaults to the current time. +The return value is a cons cell with two internal times like the ones +returned by `current time' or `encode-time'. if AS-STRINGS is non-nil, +the returned times will be formatted strings." + (let* ((tm (decode-time (or time (current-time)))) + (s 0) (m (nth 1 tm)) (h (nth 2 tm)) + (d (nth 3 tm)) (month (nth 4 tm)) (y (nth 5 tm)) + (dow (nth 6 tm)) + s1 m1 h1 d1 month1 y1 diff ts te fm) + (cond + ((eq key 'today) + (setq h 0 m 0 h1 24 m1 0)) + ((eq key 'yesterday) + (setq d (1- d) h 0 m 0 h1 24 m1 0)) + ((eq key 'thisweek) + (setq diff (if (= dow 0) 6 (1- dow)) + m 0 h 0 d (- d diff) d1 (+ 7 d))) + ((eq key 'lastweek) + (setq diff (+ 7 (if (= dow 0) 6 (1- dow))) + m 0 h 0 d (- d diff) d1 (+ 7 d))) + ((eq key 'thismonth) + (setq d 1 h 0 m 0 d1 1 month1 (1+ month) h1 0 m1 0)) + ((eq key 'lastmonth) + (setq d 1 h 0 m 0 d1 1 month (1- month) month1 (1+ month) h1 0 m1 0)) + ((eq key 'thisyear) + (setq m 0 h 0 d 1 month 1 y1 (1+ y))) + ((eq key 'lastyear) + (setq m 0 h 0 d 1 month 1 y (1- y) y1 (1+ y))) + (t (error "No such time block %s" key))) + (setq ts (encode-time s m h d month y) + te (encode-time (or s1 s) (or m1 m) (or h1 h) + (or d1 d) (or month1 month) (or y1 y))) + (setq fm (cdr org-time-stamp-formats)) + (if as-strings + (cons (format-time-string fm ts) (format-time-string fm te)) + (cons ts te)))) + (defun org-dblock-write:clocktable (params) "Write the standard clocktable." (let ((hlchars '((1 . "*") (2 . ?/))) (emph nil) (ins (make-marker)) - ipos time h m p level hlc hdl maxlevel) + ipos time h m p level hlc hdl maxlevel + ts te cc block) (setq maxlevel (or (plist-get params :maxlevel) 3) - emph (plist-get params :emphasize)) + emph (plist-get params :emphasize) + ts (plist-get params :tstart) + te (plist-get params :tend) + block (plist-get params :block)) + (when block + (setq cc (org-clock-special-range block nil t) + ts (car cc) te (cdr cc))) + (if ts (setq ts (time-to-seconds + (apply 'encode-time (org-parse-time-string ts))))) + (if te (setq te (time-to-seconds + (apply 'encode-time (org-parse-time-string te))))) (move-marker ins (point)) (setq ipos (point)) (insert-before-markers "Clock summary at [" (substring (format-time-string (cdr org-time-stamp-formats)) 1 -1) - "]\n|L|Headline|Time|\n") - (org-clock-sum) + "]." + (if block + (format " Considered range is /%s/." block) + "") + "\n\n|L|Headline|Time|\n") + (org-clock-sum ts te) (setq h (/ org-clock-file-total-minutes 60) m (- org-clock-file-total-minutes (* 60 h))) (insert-before-markers "|-\n|0|" "*Total file time*| " @@ -6475,7 +6581,7 @@ the buffer and restores the previous window configuration." (if (stringp org-agenda-files) (let ((cw (current-window-configuration))) (find-file org-agenda-files) - (set (make-local-variable 'org-window-configuration) cw) + (org-set-local 'org-window-configuration cw) (org-add-hook 'after-save-hook (lambda () (set-window-configuration @@ -6603,7 +6709,7 @@ dates." (setq buffer-read-only nil) (erase-buffer) (org-agenda-mode) (setq buffer-read-only nil) - (set (make-local-variable 'org-agenda-type) 'timeline) + (org-set-local 'org-agenda-type 'timeline) (if doclosed (push :closed args)) (push :timestamp args) (if dotodo (push :todo args)) @@ -6701,9 +6807,9 @@ NDAYS defaults to `org-agenda-ndays'." (setq buffer-read-only nil) (erase-buffer) (org-agenda-mode) (setq buffer-read-only nil) - (set (make-local-variable 'org-agenda-type) 'agenda) - (set (make-local-variable 'starting-day) (car day-numbers)) - (set (make-local-variable 'include-all-loc) include-all) + (org-set-local 'org-agenda-type 'agenda) + (org-set-local 'starting-day (car day-numbers)) + (org-set-local 'include-all-loc include-all) (when (and (or include-all org-agenda-include-all-todo) (member today day-numbers)) (setq files thefiles @@ -6812,11 +6918,11 @@ for a keyword. A numeric prefix directly selects the Nth keyword in (setq buffer-read-only nil) (erase-buffer) (org-agenda-mode) (setq buffer-read-only nil) - (set (make-local-variable 'org-agenda-type) 'todo) - (set (make-local-variable 'last-arg) arg) - (set (make-local-variable 'org-todo-keywords) kwds) - (set (make-local-variable 'org-agenda-redo-command) - '(org-todo-list (or current-prefix-arg last-arg) t)) + (org-set-local 'org-agenda-type 'todo) + (org-set-local 'last-arg arg) + (org-set-local 'org-todo-keywords kwds) + (org-set-local 'org-agenda-redo-command + '(org-todo-list (or current-prefix-arg last-arg) t)) (setq files (org-agenda-files) rtnall nil) (org-prepare-agenda-buffers files) @@ -7704,11 +7810,12 @@ the documentation of `org-diary'." (abbreviate-file-name buffer-file-name)))) (regexp org-tr-regexp) (d0 (calendar-absolute-from-gregorian date)) - marker hdmarker ee txt d1 d2 s1 s2 timestr category tags) + marker hdmarker ee txt d1 d2 s1 s2 timestr category tags pos) (goto-char (point-min)) (while (re-search-forward regexp nil t) (catch :skip (org-agenda-skip) + (setq pos (point)) (setq timestr (match-string 0) s1 (match-string 1) s2 (match-string 2) @@ -7736,7 +7843,8 @@ the documentation of `org-diary'." 'org-marker marker 'org-hd-marker hdmarker 'priority (org-get-priority txt) 'category category) (push txt ee))) - (outline-next-heading))) + (goto-char pos))) +; (outline-next-heading))) ;FIXME: correct to be removed?????? ;; Sort the entries by expiration date. (nreverse ee))) @@ -7757,7 +7865,7 @@ groups carry important information: (defconst org-stamp-time-of-day-regexp (concat - "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +[a-zA-Z]+ +\\)" + "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +\\sw+ +\\)" "\\([012][0-9]:[0-5][0-9]\\)>" "\\(--?" "<\\1\\([012][0-9]:[0-5][0-9]\\)>\\)?") @@ -8620,10 +8728,10 @@ The prefix arg TODO-ONLY limits the search to TODO entries." (setq buffer-read-only nil) (erase-buffer) (org-agenda-mode) (setq buffer-read-only nil) - (set (make-local-variable 'org-agenda-type) 'tags) - (set (make-local-variable 'org-agenda-redo-command) - (list 'org-tags-view (list 'quote todo-only) - (list 'if 'current-prefix-arg nil match) t)) + (org-set-local 'org-agenda-type 'tags) + (org-set-local 'org-agenda-redo-command + (list 'org-tags-view (list 'quote todo-only) + (list 'if 'current-prefix-arg nil match) t)) (setq files (org-agenda-files) rtnall nil) (org-prepare-agenda-buffers files) @@ -10234,13 +10342,13 @@ to be run from that hook to fucntion properly." (org-startup-with-deadline-check nil)) (org-mode)) (if (and file (string-match "\\S-" file) (not (file-directory-p file))) - (set (make-local-variable 'org-default-notes-file) file)) + (org-set-local 'org-default-notes-file file)) (goto-char (point-min)) (if (re-search-forward "%\\?" nil t) (replace-match ""))) (let ((org-startup-folded nil) (org-startup-with-deadline-check nil)) (org-mode))) - (set (make-local-variable 'org-finish-function) 'remember-buffer)) + (org-set-local 'org-finish-function 'remember-buffer)) ;;;###autoload (defun org-remember-handler () @@ -11492,10 +11600,10 @@ it can be edited in place." '(invisible t org-cwidth t display t intangible t)) (goto-char p) - (set (make-local-variable 'org-finish-function) - 'org-table-finish-edit-field) - (set (make-local-variable 'org-window-configuration) cw) - (set (make-local-variable 'org-field-marker) pos) + (org-set-local 'org-finish-function + 'org-table-finish-edit-field) + (org-set-local 'org-window-configuration cw) + (org-set-local 'org-field-marker pos) (message "Edit and finish with C-c C-c")))) (defun org-table-finish-edit-field () @@ -12098,10 +12206,11 @@ not overwrite the stored one." (setq formula (car tmp) fmt (concat (cdr (assoc "%" org-table-local-parameters)) (nth 1 tmp))) - (while (string-match "[pnfse]\\(-?[0-9]+\\)" fmt) + (while (string-match "\\([pnfse]\\)\\(-?[0-9]+\\)" fmt) (setq c (string-to-char (match-string 1 fmt)) - n (string-to-number (or (match-string 1 fmt) ""))) - (if (= c ?p) (setq modes (org-set-calc-mode 'calc-internal-prec n)) + n (string-to-number (match-string 2 fmt))) + (if (= c ?p) + (setq modes (org-set-calc-mode 'calc-internal-prec n)) (setq modes (org-set-calc-mode 'calc-float-format (list (cdr (assoc c '((?n . float) (?f . fix) @@ -12314,8 +12423,8 @@ Parameters get priority." (switch-to-buffer-other-window "*Edit Formulas*") (erase-buffer) (fundamental-mode) - (set (make-local-variable 'org-pos) pos) - (set (make-local-variable 'org-window-configuration) wc) + (org-set-local 'org-pos pos) + (org-set-local 'org-window-configuration wc) (use-local-map org-edit-formulas-map) (setq s "# Edit formulas and finish with `C-c C-c'. # Use `C-u C-c C-c' to also appy them immediately to the entire table. @@ -12481,15 +12590,15 @@ table editor in arbitrary modes.") (let ((c (assq 'orgtbl-mode minor-mode-map-alist))) (and c (setq minor-mode-map-alist (cons c (delq c minor-mode-map-alist))))) - (set (make-local-variable (quote org-table-may-need-update)) t) + (org-set-local (quote org-table-may-need-update) t) (org-add-hook 'before-change-functions 'org-before-change-function nil 'local) - (set (make-local-variable 'org-old-auto-fill-inhibit-regexp) - auto-fill-inhibit-regexp) - (set (make-local-variable 'auto-fill-inhibit-regexp) - (if auto-fill-inhibit-regexp - (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp) - "[ \t]*|")) + (org-set-local 'org-old-auto-fill-inhibit-regexp + auto-fill-inhibit-regexp) + (org-set-local 'auto-fill-inhibit-regexp + (if auto-fill-inhibit-regexp + (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp) + "[ \t]*|")) (org-add-to-invisibility-spec '(org-cwidth)) (easy-menu-add orgtbl-mode-menu) (run-hooks 'orgtbl-mode-hook)) @@ -13388,7 +13497,7 @@ underlined headlines. The default is 3." (set (make-local-variable (cdr x)) (plist-get opt-plist (car x)))) org-export-plist-vars) - (set (make-local-variable 'org-odd-levels-only) odd) + (org-set-local 'org-odd-levels-only odd) (setq umax (if arg (prefix-numeric-value arg) org-export-headline-levels)) @@ -13594,22 +13703,15 @@ command." (goto-char (point-min))))) (defun org-find-visible () - (if (featurep 'noutline) - (let ((s (point))) - (while (and (not (= (point-max) (setq s (next-overlay-change s)))) - (get-char-property s 'invisible))) - s) - (skip-chars-forward "^\n") - (point))) + (let ((s (point))) + (while (and (not (= (point-max) (setq s (next-overlay-change s)))) + (get-char-property s 'invisible))) + s)) (defun org-find-invisible () - (if (featurep 'noutline) - (let ((s (point))) - (while (and (not (= (point-max) (setq s (next-overlay-change s)))) - (not (get-char-property s 'invisible)))) - s) - (skip-chars-forward "^\r") - (point))) - + (let ((s (point))) + (while (and (not (= (point-max) (setq s (next-overlay-change s)))) + (not (get-char-property s 'invisible)))) + s)) ;; HTML @@ -13859,14 +13961,16 @@ lang=\"%s\" xml:lang=\"%s\"> (insert (or (plist-get opt-plist :preamble) "")) (when (plist-get opt-plist :auto-preamble) - (if title (insert (concat "

" - (org-html-expand title) "

\n"))) - + (if title (insert (format org-export-html-title-format + (org-html-expand title)))) (if text (insert "

\n" (org-html-expand text) "

"))) (if org-export-with-toc (progn - (insert (format "

%s

\n" (nth 3 lang-words))) + (insert (format "%s\n" + org-export-html-toplevel-hlevel + (nth 3 lang-words) + org-export-html-toplevel-hlevel)) (insert "
    \n
  • ") (setq lines (mapcar '(lambda (line) @@ -14553,7 +14657,7 @@ When TITLE is nil, just close all open levels." (insert "
      \n
    • " title "
      \n"))) (if org-export-with-section-numbers (setq title (concat (org-section-number level) " " title))) - (setq level (+ level 1)) + (setq level (+ level org-export-html-toplevel-hlevel -1)) (if with-toc (insert (format "\n%s\n" level head-count title level)) @@ -15763,6 +15867,10 @@ See the individual commands for more information." "--" ("TODO Lists" ["TODO/DONE/-" org-todo t] + ("Select keyword" + ["Next keyword" org-shiftright (org-on-heading-p)] + ["Previous keyword" org-shiftleft (org-on-heading-p)] + ["Complete Keyword" org-complete (assq :todo-keyword (org-context))]) ["Show TODO Tree" org-show-todo-tree t] ["Global TODO list" org-todo-list t] "--" @@ -16042,31 +16150,32 @@ return nil." ;; In the paragraph separator we include headlines, because filling ;; text in a line directly attached to a headline would otherwise ;; fill the headline as well. - (set (make-local-variable 'comment-start-skip) "^#+[ \t]*") - (set (make-local-variable 'paragraph-separate) "\f\\|\\*\\|[ ]*$\\|[ \t]*[:|]") + (org-set-local 'comment-start-skip "^#+[ \t]*") + (org-set-local 'paragraph-separate "\f\\|\\*\\|[ ]*$\\|[ \t]*[:|]") ;; The paragraph starter includes hand-formatted lists. - (set (make-local-variable 'paragraph-start) - "\f\\|[ ]*$\\|\\([*\f]+\\)\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]") + (org-set-local 'paragraph-start + "\f\\|[ ]*$\\|\\([*\f]+\\)\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]") ;; Inhibit auto-fill for headers, tables and fixed-width lines. ;; But only if the user has not turned off tables or fixed-width regions - (set (make-local-variable 'auto-fill-inhibit-regexp) - (concat "\\*\\|#" - "\\|[ \t]*" org-keyword-time-regexp - (if (or org-enable-table-editor org-enable-fixed-width-editor) - (concat - "\\|[ \t]*[" - (if org-enable-table-editor "|" "") - (if org-enable-fixed-width-editor ":" "") - "]")))) + (org-set-local + 'auto-fill-inhibit-regexp + (concat "\\*\\|#" + "\\|[ \t]*" org-keyword-time-regexp + (if (or org-enable-table-editor org-enable-fixed-width-editor) + (concat + "\\|[ \t]*[" + (if org-enable-table-editor "|" "") + (if org-enable-fixed-width-editor ":" "") + "]")))) ;; We use our own fill-paragraph function, to make sure that tables ;; and fixed-width regions are not wrapped. That function will pass ;; through to `fill-paragraph' when appropriate. - (set (make-local-variable 'fill-paragraph-function) 'org-fill-paragraph) - ;; Adaptive filling: To get full control, first make sure that + (org-set-local 'fill-paragraph-function 'org-fill-paragraph) + ; Adaptive filling: To get full control, first make sure that ;; `adaptive-fill-regexp' never matches. Then install our own matcher. - (set (make-local-variable 'adaptive-fill-regexp) "\000") - (set (make-local-variable 'adaptive-fill-function) - 'org-adaptive-fill-function)) + (org-set-local 'adaptive-fill-regexp "\000") + (org-set-local 'adaptive-fill-function + 'org-adaptive-fill-function)) (defun org-fill-paragraph (&optional justify) "Re-align a table, pass through to fill-paragraph if no table." @@ -16145,18 +16254,7 @@ that can be added." t) "\\'")))) -;; Functions needed for compatibility with old outline.el. - -;; Programming for the old outline.el (that uses selective display -;; instead of `invisible' text properties) is a nightmare, mostly -;; because regular expressions can no longer be anchored at -;; beginning/end of line. Therefore a number of function need special -;; treatment when the old outline.el is being used. - -;; The following functions capture almost the entire compatibility code -;; between the different versions of outline-mode. The only other -;; places where this is important are the font-lock-keywords, and in -;; `org-export-visible'. Search for `org-noutline-p' to find them. +;; Functions extending outline functionality ;; C-a should go to the beginning of a *visible* line, also in the ;; new outline.el. I guess this should be patched into Emacs? @@ -16174,60 +16272,26 @@ to a visible line beginning. This makes the function of C-a more intuitive." (beginning-of-line 1)) (forward-char 1)))) -(when org-noutline-p - (define-key org-mode-map "\C-a" 'org-beginning-of-line)) +(define-key org-mode-map "\C-a" 'org-beginning-of-line) (defun org-invisible-p () "Check if point is at a character currently not visible." - (if org-noutline-p - ;; Early versions of noutline don't have `outline-invisible-p'. - (if (fboundp 'outline-invisible-p) - (outline-invisible-p) - (get-char-property (point) 'invisible)) - (save-excursion - (skip-chars-backward "^\r\n") - (equal (char-before) ?\r)))) + ;; Early versions of noutline don't have `outline-invisible-p'. + (if (fboundp 'outline-invisible-p) + (outline-invisible-p) + (get-char-property (point) 'invisible))) (defun org-invisible-p2 () "Check if point is at a character currently not visible." (save-excursion - (if org-noutline-p - (progn - (if (and (eolp) (not (bobp))) (backward-char 1)) - ;; Early versions of noutline don't have `outline-invisible-p'. - (if (fboundp 'outline-invisible-p) - (outline-invisible-p) - (get-char-property (point) 'invisible))) - (skip-chars-backward "^\r\n") - (equal (char-before) ?\r)))) + (if (and (eolp) (not (bobp))) (backward-char 1)) + ;; Early versions of noutline don't have `outline-invisible-p'. + (if (fboundp 'outline-invisible-p) + (outline-invisible-p) + (get-char-property (point) 'invisible)))) -(defun org-back-to-heading (&optional invisible-ok) - "Move to previous heading line, or beg of this line if it's a heading. -Only visible heading lines are considered, unless INVISIBLE-OK is non-nil." - (if org-noutline-p - (outline-back-to-heading invisible-ok) - (if (and (or (bobp) (memq (char-before) '(?\n ?\r))) - (looking-at outline-regexp)) - t - (if (re-search-backward (concat (if invisible-ok "\\([\r\n]\\|^\\)" "^") - outline-regexp) - nil t) - (if invisible-ok - (progn (goto-char (or (match-end 1) (match-beginning 0))) - (looking-at outline-regexp))) - (error "Before first heading"))))) - -(defun org-on-heading-p (&optional invisible-ok) - "Return t if point is on a (visible) heading line. -If INVISIBLE-OK is non-nil, an invisible heading line is ok too." - (if org-noutline-p - (outline-on-heading-p 'invisible-ok) - (save-excursion - (skip-chars-backward "^\n\r") - (and (looking-at outline-regexp) - (or invisible-ok - (bobp) - (equal (char-before) ?\n)))))) +(defalias 'org-back-to-heading 'outline-back-to-heading) +(defalias 'org-on-heading-p 'outline-on-heading-p) (defun org-on-target-p () (let ((pos (point))) @@ -16243,47 +16307,20 @@ If INVISIBLE-OK is non-nil, an invisible heading line is ok too." "Move to the heading line of which the present line is a subheading. This function considers both visible and invisible heading lines. With argument, move up ARG levels." - (if org-noutline-p - (if (fboundp 'outline-up-heading-all) - (outline-up-heading-all arg) ; emacs 21 version of outline.el - (outline-up-heading arg t)) ; emacs 22 version of outline.el - (org-back-to-heading t) - (looking-at outline-regexp) - (if (<= (- (match-end 0) (match-beginning 0)) arg) - (error "Cannot move up %d levels" arg) - (re-search-backward - (concat "[\n\r]" (regexp-quote - (make-string (- (match-end 0) (match-beginning 0) arg) - ?*)) - "[^*]")) - (forward-char 1)))) + (if (fboundp 'outline-up-heading-all) + (outline-up-heading-all arg) ; emacs 21 version of outline.el + (outline-up-heading arg t))) ; emacs 22 version of outline.el (defun org-show-hidden-entry () "Show an entry where even the heading is hidden." (save-excursion - (if (not org-noutline-p) - (progn - (org-back-to-heading t) - (org-flag-heading nil))) (org-show-entry))) -(defun org-check-occur-regexp (regexp) - "If REGEXP starts with \"^\", modify it to check for \\r as well. -Of course, only for the old outline mode." - (if org-noutline-p - regexp - (if (string-match "^\\^" regexp) - (concat "[\n\r]" (substring regexp 1)) - regexp))) - (defun org-flag-heading (flag &optional entry) "Flag the current heading. FLAG non-nil means make invisible. When ENTRY is non-nil, show the entire entry." (save-excursion (org-back-to-heading t) - (if (not org-noutline-p) - ;; Make the current headline visible - (outline-flag-region (max 1 (1- (point))) (point) (if flag ?\r ?\n))) ;; Check if we should show the entire entry (if entry (progn @@ -16293,9 +16330,7 @@ When ENTRY is non-nil, show the entire entry." (org-flag-heading nil)))) (outline-flag-region (max 1 (1- (point))) (save-excursion (outline-end-of-heading) (point)) - (if org-noutline-p - flag - (if flag ?\r ?\n)))))) + flag)))) (defun org-end-of-subtree (&optional invisible-OK) ;; This is an exact copy of the original function, but it uses @@ -16324,7 +16359,7 @@ When ENTRY is non-nil, show the entire entry." (point) (save-excursion (outline-end-of-subtree) (outline-next-heading) (point)) - (if org-noutline-p nil ?\n))) + nil)) (defun org-show-entry () "Show the body directly following this heading. @@ -16337,16 +16372,16 @@ Show the heading too, if it is currently invisible." (save-excursion (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move) (or (match-beginning 1) (point-max))) - (if org-noutline-p nil ?\n)))) + nil))) (defun org-make-options-regexp (kwds) "Make a regular expression for keyword lines." (concat - (if org-noutline-p "^" "[\n\r]") + "^" "#?[ \t]*\\+\\(" (mapconcat 'regexp-quote kwds "\\|") "\\):[ \t]*" - (if org-noutline-p "\\(.+\\)" "\\([^\n\r]+\\)"))) + "\\(.+\\)")) ;; Make `bookmark-jump' show the jump location if it was hidden. (eval-after-load "bookmark" From 22a616f7afff613bd378eac51d56bca748fecdbf Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 15 Aug 2006 11:58:05 +0000 Subject: [PATCH 130/153] (Installation, Activation): Split from Installation and Activation. (Clocking work time): Documented new features. --- man/org.texi | 154 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 114 insertions(+), 40 deletions(-) diff --git a/man/org.texi b/man/org.texi index 3e327279726..7897ba32867 100644 --- a/man/org.texi +++ b/man/org.texi @@ -3,8 +3,8 @@ @setfilename ../info/org @settitle Org Mode Manual -@set VERSION 4.43 -@set DATE July 2006 +@set VERSION 4.44 +@set DATE August 2006 @dircategory Emacs @direntry @@ -98,7 +98,8 @@ Software Foundation raise funds for GNU development.'' Introduction * Summary:: Brief summary of what Org-mode does -* Installation:: How to install Org-mode +* Installation:: How to install a downloaded version of Org-mode +* Activation:: How to activate Org-mode for certain buffers. * Feedback:: Bug reports, ideas, patches etc. Document Structure @@ -270,7 +271,8 @@ Extensions, Hooks and Hacking @menu * Summary:: Brief summary of what Org-mode does -* Installation:: How to install Org-mode +* Installation:: How to install a downloaded version of Org-mode +* Activation:: How to activate Org-mode for certain buffers. * Feedback:: Bug reports, ideas, patches etc. @end menu @@ -323,18 +325,68 @@ questions (FAQ), links to tutorials etc. This page is located at @page -@node Installation, Feedback, Summary, Introduction -@section Installation and Activation +@node Installation, Activation, Summary, Introduction +@section Installation @cindex installation +@cindex XEmacs + +@b{Important:} If Org-mode is part of the Emacs distribution or an +XEmacs package, please skip this section and go directly to +@ref{Activation}. + +If you have downloaded Org-mode from the Web, you must take the +following steps to install it: Go into the Org-mode distribution +directory and edit the top section of the file @file{Makefile}. You +must set the name of the Emacs binary (likely either @file{emacs} or +@file{xemacs}), and the paths to the directories where local Lisp and +Info files are kept. If you don't have access to the system-wide +directories, create your own two directories for these files, enter them +into the Makefile, and make sure Emacs finds the Lisp files by adding +the following line to @file{.emacs}: + +@example +(setq load-path (cons "~/path/to/lispdir" load-path)) +@end example + +@b{XEmacs users now need to install the file @file{noutline.el} from +the @file{xemacs} subdirectory of the Org-mode distribution. Use the +command:} + +@example +@b{make install-noutline} +@end example + +@noindent Now byte-compile and install the Lisp files with the shell +commands: + +@example +make +make install +@end example + +@noindent If you want to install the info documentation, use this command: + +@example +make install-info +@end example + +@noindent Then add to @file{.emacs}: + +@lisp +;; This line only if org-mode is not part of the X/Emacs distribution. +(require 'org-install) +@end lisp + +@node Activation, Feedback, Installation, Introduction +@section Activation +@cindex activation @cindex autoload @cindex global keybindings @cindex keybindings, global -If Org-mode is part of the Emacs distribution or an XEmacs package, -you only need to copy the following lines to your @file{.emacs} file. -The last two lines define @emph{global} keys for the commands -@command{org-store-link} and @command{org-agenda} - please -choose suitable keys yourself. +Add the following lines to your @file{.emacs} file. The last two lines +define @emph{global} keys for the commands @command{org-store-link} and +@command{org-agenda} - please choose suitable keys yourself. @lisp ;; The following lines are always needed. Choose your own keys. @@ -345,30 +397,17 @@ choose suitable keys yourself. Furthermore, you must activate @code{font-lock-mode} in org-mode buffers, because significant functionality depends on font-locking being -active. You can do this with either one of the following two lines: +active. You can do this with either one of the following two lines +(XEmacs user must use the second option): @lisp (global-font-lock-mode 1) ; for all buffers (add-hook 'org-mode-hook 'turn-on-font-lock) ; org-mode buffers only @end lisp -If you have downloaded Org-mode from the Web, you must take additional -action: Byte-compile @file{org.el} and @file{org-publish.el} and put -them together with @file{org-install.el} on your load path. Then add to -@file{.emacs}: - -@lisp -;; This line only if org-mode is not part of the X/Emacs distribution. -(require 'org-install) -@end lisp - -If you use Org-mode with XEmacs, you also need to install the file -@file{noutline.el} from the @file{xemacs} subdirectory of the Org-mode -distribution. - @cindex org-mode, turning on -With this setup, all files with extension @samp{.org} will be put into -Org-mode. As an alternative, make the first line of a file look like -this: +With this setup, all files with extension @samp{.org} will be put +into Org-mode. As an alternative, make the first line of a file look +like this: @example MY PROJECTS -*- mode: org; -*- @@ -378,7 +417,7 @@ MY PROJECTS -*- mode: org; -*- the file's name is. See also the variable @code{org-insert-mode-line-in-empty-file}. -@node Feedback, , Installation, Introduction +@node Feedback, , Activation, Introduction @section Feedback @cindex feedback @cindex bug reports @@ -826,8 +865,14 @@ But in the end, not individual scenes matter but the film as a whole. @end group @end example -Org-mode supports these lists by tuning filling and wrapping commands -to deal with them correctly. +Org-mode supports these lists by tuning filling and wrapping commands to +deal with them correctly@footnote{Org-mode only changes the filling +settings for Emacs. For XEmacs, you should use Kyle E. Jones' +@file{filladapt.el}. To turn is on, put into @file{.emacs}: +@example +(require 'filladapt) +@end example +}. The following commands act on items when the cursor is in the first line of an item (the line with the bullet or number). @@ -2160,7 +2205,7 @@ If you define many keywords, you can use in-buffer completion (see The second possibility is to use TODO keywords to indicate different types of action items. For example, you might want to indicate that -items are for ``work'' or ``home.'' If you are into David Allen's +items are for ``work'' or ``home''. If you are into David Allen's @emph{Getting Things DONE}, you might want to use todo types @samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}. Or, when you work with several people on a single project, you might want to assign @@ -2547,7 +2592,12 @@ keyword together with a timestamp. Stop the clock (clock-out). The inserts another timestamp at the same location where the clock was last started. It also directly computes the resulting time in inserts it after the time range as @samp{=> -HH:MM}. +HH:MM}. +@kindex C-c C-y +@item C-c C-y +Recompute the time interval after changing one of the time stamps. This +is only necessary if you edit the time stamps directly. If you change +them with @kbd{S-@key{cursor}} keys, the update is automatic. @kindex C-c C-t @item C-c C-t Changing the TODO state of an item to DONE automatically stops the clock @@ -2565,8 +2615,8 @@ can use visibility cycling to study the tree, but the overlays disappear automatically when the buffer is changed. @kindex C-c C-x C-r @item C-c C-x C-r -Insert a dynamic block containing a clock report as an org-mode table -into the current file. +Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock +report as an org-mode table into the current file. @example #+BEGIN: clocktable :maxlevel 2 :emphasize nil @@ -2578,7 +2628,32 @@ table. The @samp{BEGIN} line can specify options: @example :maxlevels @r{Maximum level depth to which times are listed in the table.} :emphasize @r{When @code{t}, emphasize level one and level two items} +:block @r{The time block to consider. This block is specified relative} + @r{to the current time and may be any of these keywords:} + @r{@code{today}, @code{yesterday}, @code{thisweek}, @code{lastweek},} + @r{@code{thismonth}, @code{lastmonth}, @code{thisyear}, or @code{lastyear}}. +:tstart @r{A time string specifying when to start considering times} +:tend @r{A time string specifying when to stop considering times} @end example +So to get a clock summary for the current day, you could write +@example +#+BEGIN: clocktable :maxlevel 2 :block today + +#+END: clocktable +@end example +and to use a specific time range you could write@footnote{Note that all +parameters must be specified in a single line - the line is broken here +only to fit it onto the manual.} +@example +#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>" + :tend "<2006-08-10 Thu 12:00>" + +#+END: clocktable +@end example +@kindex C-u C-c C-x C-u +@item C-u C-c C-x C-u +Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if +you have several clocktable blocks in a buffer. @end table The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in @@ -4653,8 +4728,7 @@ setup. See the installation instructions in the file @item @file{cdlatex.el} by Carsten Dominik @cindex @file{cdlatex.el} Org-mode can make use of the cdlatex package to efficiently enter -La@TeX{} fragments into Org-mode files. -@file{cdlatex.el} is not part of Emacs, find it on the web. +La@TeX{} fragments into Org-mode files. See @ref{CDLaTeX mode}. @item @file{remember.el} by John Wiegley @cindex @file{remember.el} Org mode cooperates with remember, see @ref{Remember}. @@ -4784,7 +4858,7 @@ caused by the preparations for the 22.1 release. In the mean time, @url{http://dto.freeshell.org/e/org-publish.el}. @cindex @file{org-blog.el} @item @file{org-blog.el} by David O'Toole -A blogging plug-in for @file{org-publish.el}. +A blogging plug-in for @file{org-publish.el}.@* @url{http://dto.freeshell.org/notebook/OrgMode.html}. @cindex @file{org-blogging.el} @item @file{org-blogging.el} by Bastien Guerry @@ -4805,7 +4879,7 @@ to the block and can also specify parameters for the function producing the content of the block. @example -#+BEGIN: myblock :parameter1 value1 :parameter2 value2 ..... +#+BEGIN: myblock :parameter1 value1 :parameter2 value2 ... #+END: @end example From 4c3ec0fc9645276fc9f9084b6a9872860ac10de0 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 15 Aug 2006 11:58:49 +0000 Subject: [PATCH 131/153] *** empty log message *** --- etc/ChangeLog | 4 ++++ lisp/ChangeLog | 27 +++++++++++++++++++++++++++ man/ChangeLog | 6 ++++++ 3 files changed, 37 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index 08eda1c1fc6..32d7525e153 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2006-08-15 Carsten Dominik + + * orgcard.tex: Version number change. + 2006-08-12 Werner Lemberg * TUTORIAL.de: Synchronize with TUTORIAL. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c32902da47a..31201341796 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,30 @@ +2006-08-15 Carsten Dominik + + * textmodes/org.el (org-clock-special-range, + org-clock-update-time-maybe): New functions. + (org-stamp-time-of-day-regexp): Allow weekday to be of word chars, + not only a-z. + (org-agenda-get-blocks): Allow multiple blocks per headline. + (org-timestamp-change): Call `org-clock-update-time-maybe'. + (org-export-html-title-format) + (org-export-html-toplevel-hlevel): New options. + (org-export-language-setup): Added support for Czech. + (org-mode, org-insert-todo-heading, org-find-visible) + (org-find-invisible, org-invisible-p, org-invisible-p2) + (org-back-to-heading, org-on-heading-p, org-up-heading-all) + (org-show-subtree, org-show-entry, org-make-options-regexp): + Removed compatibility support for old outline-mode. + (org-check-occur-regexp): Funtion removed. + (org-on-heading-p, org-back-to-heading): Made defalias. + (org-set-local): New defsubst. + (org-set-regexps-and-options, org-mode) + (org-set-font-lock-defaults, org-edit-agenda-file-list) + (org-timeline, org-agenda-list, org-todo-list, org-tags-view) + (org-remember-apply-template, org-table-edit-field) + (org-table-edit-formulas, orgtbl-mode, org-export-as-ascii) + (org-set-autofill-regexps): Use `org-set-local'. + (org-table-eval-formula): Fixed bug with parsing of display flags. + 2006-08-15 Nick Roberts * progmodes/gdb-ui.el (gdb-info-stack-custom): Indicate selected diff --git a/man/ChangeLog b/man/ChangeLog index 10e43a9dbd4..cdf811da570 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,9 @@ +2006-08-15 Carsten Dominik + + * org.texi (Installation, Activation): Split from Installation and + Activation. + (Clocking work time): Documented new features. + 2006-08-15 Nick Roberts * building.texi (Stack Buffer): Explain fringe arrow. From 29cf022180b04a33c0dfa9ce571be7637ab1e5ae Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 15 Aug 2006 11:59:09 +0000 Subject: [PATCH 132/153] Version number change. --- etc/orgcard.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/orgcard.tex b/etc/orgcard.tex index 951d0167c2e..ef2e847b5f1 100644 --- a/etc/orgcard.tex +++ b/etc/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{4.43} +\def\orgversionnumber{4.44} \def\year{2006} % %**start of header From 3236e6b849ab228d0e0d466343f10b1202e1cf9d Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 15 Aug 2006 17:39:21 +0000 Subject: [PATCH 133/153] * keyboard.c (read_char): Don't change idle timer state at all if end_time is supplied. --- src/ChangeLog | 5 +++++ src/keyboard.c | 25 ++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5026f4f10f8..936f8a2546c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-15 Chong Yidong + + * keyboard.c (read_char): Don't change idle timer state at all if + end_time is supplied. + 2006-08-15 Kenichi Handa * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC diff --git a/src/keyboard.c b/src/keyboard.c index bea35a05731..fed6fbc79dd 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2679,13 +2679,11 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) goto non_reread; } - /* Start idle timers. If a time limit is supplied, we don't reset - idle timers. This avoids an infinite recursion in case an idle - timer calls `sit-for'. */ + /* Start idle timers if no time limit is supplied. We don't do it + if a time limit is supplied to avoid an infinite recursion in the + situation where an idle timer calls `sit-for'. */ - if (end_time) - timer_resume_idle (); - else + if (!end_time) timer_start_idle (); /* If in middle of key sequence and minibuffer not active, @@ -2756,7 +2754,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); /* Now that we have read an event, Emacs is not idle. */ - timer_stop_idle (); + if (!end_time) + timer_stop_idle (); goto exit; } @@ -2886,9 +2885,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* Actually read a character, waiting if necessary. */ save_getcjmp (save_jump); restore_getcjmp (local_getcjmp); - if (end_time) - timer_resume_idle (); - else + if (!end_time) timer_start_idle (); c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); restore_getcjmp (save_jump); @@ -2941,7 +2938,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) non_reread: - timer_stop_idle (); + if (!end_time) + timer_stop_idle (); RESUME_POLLING; if (NILP (c)) @@ -2975,7 +2973,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) last_input_char = c; Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt); - if (CONSP (c) && EQ (XCAR (c), Qselect_window)) + if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) /* We stopped being idle for this event; undo that. This prevents automatic window selection (under mouse_autoselect_window from acting as a real input event, for @@ -3181,7 +3179,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) show_help_echo (help, window, object, position, 0); /* We stopped being idle for this event; undo that. */ - timer_resume_idle (); + if (!end_time) + timer_resume_idle (); goto retry; } From 7e18844978b0a9827e9cd41b20740b74b1decef2 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 15 Aug 2006 19:59:08 +0000 Subject: [PATCH 134/153] * commands.texi (Reading One Event): Explain idleness in `read-event'. --- lispref/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 6303c1c4563..579918f36a2 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +2006-08-15 Chong Yidong + + * commands.texi (Reading One Event): Explain idleness in + `read-event'. + 2006-08-12 Chong Yidong * text.texi (Near Point): Say "cursor" not "terminal cursor". From 9411b080963173da11f2086118b33c0172216685 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 15 Aug 2006 22:28:02 +0000 Subject: [PATCH 135/153] * commands.texi (Reading One Event): Explain idleness in `read-event'. --- lispref/commands.texi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lispref/commands.texi b/lispref/commands.texi index 8e34fe360bf..2a091524bed 100644 --- a/lispref/commands.texi +++ b/lispref/commands.texi @@ -2229,6 +2229,15 @@ number of seconds; on these systems, @var{seconds} is rounded down. If @var{seconds} is @code{nil}, @code{read-event} waits as long as necessary for input to arrive. +If @var{seconds} is @code{nil}, Emacs is considered idle while waiting +for user input to arrive. Idle timers---those created with +@code{run-with-idle-timer} (@pxref{Timers})---can run during this +period. However, if @var{seconds} is non-@code{nil}, the state of +idleness remains unchanged. If Emacs is non-idle when +@code{read-event} is called, it remains non-idle throughout the +operation of @code{read-event}; if Emacs is idle (which can happen if +the call happens inside an idle timer), it remains idle. + 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 From 29cbc4829462914df43038b05711b71aad6e570a Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 16 Aug 2006 00:20:53 +0000 Subject: [PATCH 136/153] (choose_write_coding_system): Use LF for end-of-line in auto-saving. --- src/ChangeLog | 5 +++++ src/fileio.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 936f8a2546c..58929cc40d2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-16 Kenichi Handa + + * fileio.c (choose_write_coding_system): Use LF for end-of-line + in auto-saving. + 2006-08-15 Chong Yidong * keyboard.c (read_char): Don't change idle timer state at all if diff --git a/src/fileio.c b/src/fileio.c index d26b2808726..4a39e7ffa19 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4845,6 +4845,8 @@ choose_write_coding_system (start, end, filename, /* ... but with the special flag to indicate not to strip off leading code of eight-bit-control chars. */ coding->flags = 1; + /* We force LF for end-of-line because that is faster. */ + coding->eol_type = CODING_EOL_LF; goto done_setup_coding; } else if (!NILP (Vcoding_system_for_write)) From 7b245e6346d1759266bf22528d02fd6dc1b0be70 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 04:57:08 +0000 Subject: [PATCH 137/153] Clean up wording. --- INSTALL.CVS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/INSTALL.CVS b/INSTALL.CVS index 3716930eccc..e67ea4db0f2 100644 --- a/INSTALL.CVS +++ b/INSTALL.CVS @@ -12,8 +12,9 @@ The bootstrap process makes sure all necessary files are rebuilt before it builds the final Emacs binary. Normally, it is not necessary to use "make bootstrap" after every CVS -update. Unless there are problems, we suggest to use the following -alternative procedure, after you did "make bootstrap" at least once: +update. Unless there are problems, we suggest using the following +alternative procedure after you have done "make bootstrap" at least +once: $ ./configure $ make From 27f9dfbf21276dab85c3a2ff229d3188af8bf0e3 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:04:16 +0000 Subject: [PATCH 138/153] (compare-windows): Factor compare-ignore-whitespace into ignore-whitespace. Check each buffer for its skip-function. Handle compare-windows-skip-whitespace special-case test by returning t from default skip function. --- lisp/compare-w.el | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/lisp/compare-w.el b/lisp/compare-w.el index e61f24a0c7c..3aa01424fb5 100644 --- a/lisp/compare-w.el +++ b/lisp/compare-w.el @@ -167,16 +167,14 @@ on first call it advances points to the next difference, on second call it synchronizes points by skipping the difference, on third call it again advances points to the next difference and so on." (interactive "P") + (if compare-ignore-whitespace + (setq ignore-whitespace (not ignore-whitespace))) (let* (p1 p2 maxp1 maxp2 b1 b2 w2 (progress 1) (opoint1 (point)) opoint2 - (skip-func (if (if ignore-whitespace ; XOR - (not compare-ignore-whitespace) - compare-ignore-whitespace) - (if (stringp compare-windows-whitespace) - 'compare-windows-skip-whitespace - compare-windows-whitespace))) + skip-func-1 + skip-func-2 (sync-func (if (stringp compare-windows-sync) 'compare-windows-sync-regexp compare-windows-sync))) @@ -190,8 +188,19 @@ on third call it again advances points to the next difference and so on." b2 (window-buffer w2)) (setq opoint2 p2) (setq maxp1 (point-max)) - (save-excursion - (set-buffer b2) + + (setq skip-func-1 (if ignore-whitespace + (if (stringp compare-windows-whitespace) + (lambda () (compare-windows-skip-whitespace) + t) + compare-windows-whitespace))) + + (with-current-buffer b2 + (setq skip-func-2 (if ignore-whitespace + (if (stringp compare-windows-whitespace) + (lambda () (compare-windows-skip-whitespace) + t) + compare-windows-whitespace))) (push-mark p2 t) (setq maxp2 (point-max))) (push-mark) @@ -199,17 +208,16 @@ on third call it again advances points to the next difference and so on." (while (> progress 0) ;; If both windows have whitespace next to point, ;; optionally skip over it. - (and skip-func + (and skip-func-1 (save-excursion (let (p1a p2a w1 w2 result1 result2) - (setq result1 (funcall skip-func opoint1)) + (setq result1 (funcall skip-func-1 opoint1)) (setq p1a (point)) (set-buffer b2) (goto-char p2) - (setq result2 (funcall skip-func opoint2)) + (setq result2 (funcall skip-func-2 opoint2)) (setq p2a (point)) - (if (or (stringp compare-windows-whitespace) - (and result1 result2 (eq result1 result2))) + (if (and result1 result2 (eq result1 result2)) (setq p1 p1a p2 p2a))))) From 19f0515adac3bc3b0ffa371fb92350bdb0b5fd15 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:05:08 +0000 Subject: [PATCH 139/153] (custom-newline): New function. (custom-mode-map): Bind newline to custom-newline. --- lisp/cus-edit.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 0493dd0894c..609b5572a08 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4436,6 +4436,7 @@ The format is suitable for use with `easy-menu-define'." (let ((map (make-keymap))) (set-keymap-parent map widget-keymap) (define-key map [remap self-insert-command] 'custom-no-edit) + (define-key map "\^m" 'custom-newline) (define-key map " " 'scroll-up) (define-key map "\177" 'scroll-down) (define-key map "\C-c\C-c" 'Custom-set) @@ -4452,6 +4453,14 @@ The format is suitable for use with `easy-menu-define'." (interactive "@d") (error "You can't edit this part of the Custom buffer")) +(defun custom-newline (pos &optional event) + "Invoke button at POS, or refuse to allow editing of Custom buffer." + (interactive "@d") + (let ((button (get-char-property pos 'button))) + (if button + (widget-apply-action button event) + (error "You can't edit this part of the Custom buffer")))) + (easy-menu-define Custom-mode-menu custom-mode-map "Menu used in customization buffers." From b605a60ad353518cc072bc0f4cad78dfed6364a2 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:05:56 +0000 Subject: [PATCH 140/153] (comment-indent): Fully update INDENT before checking to see if it will change the text. --- lisp/newcomment.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 5dfa1eb8959..358c834de73 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -599,11 +599,16 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any." (if (and other (<= other max) (> other min)) ;; There is a comment and it's in the range: bingo. (setq indent other)))))))) + ;; Update INDENT to leave at least one space + ;; after other nonwhite text on the line. + (save-excursion + (skip-chars-backward " \t") + (unless (bolp) + (setq indent (max indent (1+ (current-column)))))) + ;; If that's different from comment's current position, change it. (unless (= (current-column) indent) - ;; If that's different from current, change it. (delete-region (point) (progn (skip-chars-backward " \t") (point))) - (indent-to (if (bolp) indent - (max indent (1+ (current-column))))))) + (indent-to indent))) (goto-char cpos) (set-marker cpos nil)))) From ad47c4a0a50bfb43ff1d29e80fa3edf9b0955249 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:07:22 +0000 Subject: [PATCH 141/153] (move-beginning-of-line): Test whether fields would prevent motion back to line's first visible character. If so, stop where the fields would stop the motion. --- lisp/simple.el | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 9288ab6bd79..f1b80968ff1 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3770,7 +3770,8 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." (interactive "p") (or arg (setq arg 1)) - (let ((orig (point))) + (let ((orig (point)) + start first-vis first-vis-field-value) ;; Move by lines, if ARG is not 1 (the default). (if (/= arg 1) @@ -3781,10 +3782,24 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) (goto-char (previous-char-property-change (point))) (skip-chars-backward "^\n")) + (setq start (point)) - ;; Take care of fields. - (goto-char (constrain-to-field (point) orig - (/= arg 1) t nil)))) + ;; Now find first visible char in the line + (while (and (not (eobp)) (line-move-invisible-p (point))) + (goto-char (next-char-property-change (point)))) + (setq first-vis (point)) + + ;; See if fields would stop us from reaching FIRST-VIS. + (setq first-vis-field-value + (constrain-to-field first-vis orig (/= arg 1) t nil)) + + (goto-char (if (/= first-vis-field-value first-vis) + ;; If yes, obey them. + first-vis-field-value + ;; Otherwise, move to START with attention to fields. + ;; (It is possible that fields never matter in this case.) + (constrain-to-field (point) orig + (/= arg 1) t nil))))) ;;; Many people have said they rarely use this feature, and often type From c0acb3ee4ce9a7255b060f2ec311ae6b3fda3ce9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:09:18 +0000 Subject: [PATCH 142/153] (x-clipboard-yank): Specify * in interactive spec. (special-event-map): Process drag-n-drop events this way. --- lisp/term/x-win.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 38add1538aa..0fc76382130 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -2505,7 +2505,7 @@ order until succeed.") ;; Override Paste so it looks at CLIPBOARD first. (defun x-clipboard-yank () "Insert the clipboard contents, or the last stretch of killed text." - (interactive) + (interactive "*") (let ((clipboard-text (x-selection-value 'CLIPBOARD)) (x-select-enable-clipboard t)) (if (and clipboard-text (> (length clipboard-text) 0)) @@ -2519,7 +2519,7 @@ order until succeed.") ;; Initiate drag and drop (add-hook 'after-make-frame-functions 'x-dnd-init-frame) -(global-set-key [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) +(define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) ;; Let F10 do menu bar navigation. (and (fboundp 'menu-bar-open) From 81b4d9abbf1448128159f3f25fa3fc4cd51a09b7 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:10:55 +0000 Subject: [PATCH 143/153] (Variable Definitions): Explain when the standard value expression is evaluated. --- lispref/customize.texi | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/lispref/customize.texi b/lispref/customize.texi index e3e78c46bb4..9e10e547b56 100644 --- a/lispref/customize.texi +++ b/lispref/customize.texi @@ -251,19 +251,30 @@ turn this feature back on, if someone would like to do the work. Use @code{defcustom} to declare user-editable variables. -@defmac defcustom option default doc [keyword value]@dots{} -Declare @var{option} as a customizable user option variable. Do not -quote @var{option}. The argument @var{doc} specifies the documentation -string for the variable. There is no need to start it with a @samp{*} -because @code{defcustom} automatically marks @var{option} as a -@dfn{user option} (@pxref{Defining Variables}). +@defmac defcustom option standard doc [keyword value]@dots{} +This construct declares @var{option} as a customizable user option +variable. You should not quote @var{option}. The argument @var{doc} +specifies the documentation string for the variable. There is no need +to start it with a @samp{*}, because @code{defcustom} automatically +marks @var{option} as a @dfn{user option} (@pxref{Defining +Variables}). -If @var{option} is void, @code{defcustom} initializes it to -@var{default}. @var{default} should be an expression to compute the -value; be careful in writing it, because it can be evaluated on more -than one occasion. You should normally avoid using backquotes in -@var{default} because they are not expanded when editing the value, -causing list values to appear to have the wrong structure. +The argument @var{standard} is an expression that specifies the +standard value for @var{option}. Evaluating the @code{defcustom} form +evaluates @var{standard}, but does not necessarily install the +standard value. If @var{option} already has a default value, +@code{defcustom} does not change it. If the user has saved a +customization for @var{option}, @code{defcustom} installs the user's +customized value as @var{option}'s default value. If neither of those +cases applies, @code{defcustom} installs the result of evaluating +@var{standard} as the default value. + +The expression @var{standard} can be evaluated at various other times, +too---whenever the customization facility needs to know @var{option}'s +standard value. So be sure to use an expression which is harmless to +evaluate at any time. We recommend avoiding backquotes in +@var{standard}, because they are not expanded when editing the value, +so list values will appear to have the wrong structure. If you specify the @code{:set} option, to make the variable take other special actions when set through the customization buffer, the @@ -406,7 +417,7 @@ type of @var{symbol}. @end defun Internally, @code{defcustom} uses the symbol property -@code{standard-value} to record the expression for the default value, +@code{standard-value} to record the expression for the standard value, and @code{saved-value} to record the value saved by the user with the customization buffer. Both properties are actually lists whose car is an expression which evaluates to the value. From 0007b8a660d4fde62c3f342acc15bd11123b066a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:11:54 +0000 Subject: [PATCH 144/153] (Extended Menu Items): Show format of cached bindings in extended menu items. --- lispref/keymaps.texi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi index 44b92ddfcb8..13f4550a082 100644 --- a/lispref/keymaps.texi +++ b/lispref/keymaps.texi @@ -2016,7 +2016,7 @@ binding, like this: @c This line is not too long--rms. @example -(@var{item-string} @r{[}@var{help-string}@r{]} (@var{key-binding-data}) . @var{real-binding}) +(@var{item-string} @r{[}@var{help}@r{]} (@var{key-binding-data}) . @var{real-binding}) @end example @noindent @@ -2140,6 +2140,13 @@ operates on menu data structures, so you should write it so it can safely be called at any time. @end table + When an equivalent key binding is cached, the binding looks like this. + +@example +(menu-item @var{item-name} @var{real-binding} (@var{key-binding-data}) + . @var{item-property-list}) +@end example + @node Menu Separators @subsubsection Menu Separators @cindex menu separators From 4e7ab35cb786337cb9eb413fd2ca500075c3c930 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:12:46 +0000 Subject: [PATCH 145/153] (Help Mode): Move node up in file. --- man/help.texi | 114 +++++++++++++++++++++++++------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/man/help.texi b/man/help.texi index 6696b3440dd..08f528f5151 100644 --- a/man/help.texi +++ b/man/help.texi @@ -74,9 +74,9 @@ This displays the available Emacs packages based on keywords. * Key Help:: Asking what a key does in Emacs. * Name Help:: Asking about a command, variable or function name. * Apropos:: Asking what pertains to a given topic. +* Help Mode:: Special features of Help mode and Help buffers. * Library Keywords:: Finding Lisp libraries by keywords (topics). * Language Help:: Help relating to international language support. -* Help Mode:: Special features of Help mode and Help buffers. * Misc Help:: Other help commands. * Help Files:: Commands to display pre-written help files. * Help Echo:: Help on active text and tooltips (`balloon help') @@ -390,6 +390,62 @@ display the most relevant ones first. the variable @code{apropos-documentation-sort-by-scores} is @code{nil}, apropos lists the symbols found in alphabetical order. +@node Help Mode +@section Help Mode Commands + + Help buffers provide the same commands as View mode (@pxref{Misc File +Ops}), plus a few special commands of their own. + +@table @kbd +@item @key{SPC} +Scroll forward. +@item @key{DEL} +Scroll backward. +@item @key{RET} +Follow a cross reference at point. +@item @key{TAB} +Move point forward to the next cross reference. +@item S-@key{TAB} +Move point back to the previous cross reference. +@item Mouse-1 +@itemx Mouse-2 +Follow a cross reference that you click on. +@item C-c C-c +Show all documentation about the symbol at point. +@end table + + When a function name (@pxref{M-x,, Running Commands by Name}), +variable name (@pxref{Variables}), or face name (@pxref{Faces}) +appears in the documentation, it normally appears inside paired +single-quotes. To view the documentation of that command, variable or +face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2}, +or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace +your steps. + +@cindex URL, viewing in help +@cindex help, viewing web pages +@cindex viewing web pages in help +@cindex web pages, viewing in help +@findex browse-url + You can follow cross references to URLs (web pages) also. This uses +the @code{browse-url} command to view the page in the browser you +choose. @xref{Browse-URL}. + +@kindex @key{TAB} @r{(Help mode)} +@findex help-next-ref +@kindex S-@key{TAB} @r{(Help mode)} +@findex help-previous-ref + There are convenient commands to move point to cross references in +the help text. @key{TAB} (@code{help-next-ref}) moves point down to +the next cross reference. @kbd{S-@key{TAB}} moves up to the previous +cross reference (@code{help-previous-ref}). + + To view all documentation about any symbol name that appears in the +text, move point to the symbol name and type @kbd{C-c C-c} +(@code{help-follow-symbol}). This shows all available documentation +about the symbol as a variable, function and/or face. As above, use +@kbd{C-c C-b} to retrace your steps. + @node Library Keywords @section Keyword Search for Lisp Libraries @@ -460,62 +516,6 @@ input method currently in use. @xref{Input Methods}. coding systems---either a specified coding system, or the ones currently in use. @xref{Coding Systems}. -@node Help Mode -@section Help Mode Commands - - Help buffers provide the same commands as View mode (@pxref{Misc File -Ops}), plus a few special commands of their own. - -@table @kbd -@item @key{SPC} -Scroll forward. -@item @key{DEL} -Scroll backward. -@item @key{RET} -Follow a cross reference at point. -@item @key{TAB} -Move point forward to the next cross reference. -@item S-@key{TAB} -Move point back to the previous cross reference. -@item Mouse-1 -@itemx Mouse-2 -Follow a cross reference that you click on. -@item C-c C-c -Show all documentation about the symbol at point. -@end table - - When a function name (@pxref{M-x,, Running Commands by Name}), -variable name (@pxref{Variables}), or face name (@pxref{Faces}) -appears in the documentation, it normally appears inside paired -single-quotes. To view the documentation of that command, variable or -face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2}, -or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace -your steps. - -@cindex URL, viewing in help -@cindex help, viewing web pages -@cindex viewing web pages in help -@cindex web pages, viewing in help -@findex browse-url - You can follow cross references to URLs (web pages) also. This uses -the @code{browse-url} command to view the page in the browser you -choose. @xref{Browse-URL}. - -@kindex @key{TAB} @r{(Help mode)} -@findex help-next-ref -@kindex S-@key{TAB} @r{(Help mode)} -@findex help-previous-ref - There are convenient commands to move point to cross references in -the help text. @key{TAB} (@code{help-next-ref}) moves point down to -the next cross reference. @kbd{S-@key{TAB}} moves up to the previous -cross reference (@code{help-previous-ref}). - - To view all documentation about any symbol name that appears in the -text, move point to the symbol name and type @kbd{C-c C-c} -(@code{help-follow-symbol}). This shows all available documentation -about the symbol as a variable, function and/or face. As above, use -@kbd{C-c C-b} to retrace your steps. - @node Misc Help @section Other Help Commands From ef043ba0d6beddd7c6239ef34a79d6012a05e249 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:13:18 +0000 Subject: [PATCH 146/153] (Top): Update subnode menu. --- man/emacs.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/emacs.texi b/man/emacs.texi index 5277a5cebbc..780b5c97b6e 100644 --- a/man/emacs.texi +++ b/man/emacs.texi @@ -272,9 +272,9 @@ Help * Key Help:: Asking what a key does in Emacs. * Name Help:: Asking about a command, variable or function name. * Apropos:: Asking what pertains to a given topic. +* Help Mode:: Special features of Help mode and Help buffers. * Library Keywords:: Finding Lisp libraries by keywords (topics). * Language Help:: Help relating to international language support. -* Help Mode:: Special features of Help mode and Help buffers. * Misc Help:: Other help commands. * Help Files:: Commands to display pre-written help files. * Help Echo:: Help on active text and tooltips (`balloon help') From ba057869d6b25756a7785e7673466a5de25c39ab Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:13:48 +0000 Subject: [PATCH 147/153] (Marking Objects): Mention term "select all". --- man/mark.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/mark.texi b/man/mark.texi index 7429b67db2b..2736dccd297 100644 --- a/man/mark.texi +++ b/man/mark.texi @@ -369,7 +369,7 @@ negative) instead of the current page. Finally, @kbd{C-x h} (@code{mark-whole-buffer}) sets up the entire buffer as the region, by putting point at the beginning and the mark at -the end. +the end. (In some programs this is called ``select all.'') In Transient Mark mode, all of these commands activate the mark. From 1096b4a013322558b66d89ad9f71eb327696509a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:14:31 +0000 Subject: [PATCH 148/153] (Saving Emacs Sessions): Clean up wording. --- man/misc.texi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/man/misc.texi b/man/misc.texi index 33c85a9fc8b..f6fb5edfbdb 100644 --- a/man/misc.texi +++ b/man/misc.texi @@ -1998,11 +1998,11 @@ subsequent Emacs sessions reload the saved desktop. @findex desktop-save @vindex desktop-save-mode You can save the desktop manually with the command @kbd{M-x -desktop-save}. You can also enable automatic desktop saving when -you exit Emacs and its restoring when Emacs starts: use the -Customization buffer (@pxref{Easy Customization}) to set -@code{desktop-save-mode} to @code{t} for future sessions, or add this -line in your @file{~/.emacs} file: +desktop-save}. You can also enable automatic saving of the desktop +when you exit Emacs, and automatic restoration of the last saved +desktop when Emacs starts: use the Customization buffer (@pxref{Easy +Customization}) to set @code{desktop-save-mode} to @code{t} for future +sessions, or add this line in your @file{~/.emacs} file: @example (desktop-save-mode 1) From c33f8948974b2c8614bec80860c6ec01a2a11d5f Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:15:25 +0000 Subject: [PATCH 149/153] (debug_output_compilation_hack): New function. --- src/print.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/print.c b/src/print.c index c36b9476f82..ac8736d2aa4 100644 --- a/src/print.c +++ b/src/print.c @@ -924,6 +924,15 @@ to make it write to the debugging output. */) return character; } +/* This function is never called. Its purpose is to prevent + print_output_debug_flag from being optimized away. */ + +int +debug_output_compilation_hack (x) + int x; +{ + print_output_debug_flag = x; +} #if defined(GNU_LINUX) From 3cb74cd1277590da7137297c1f2e6db95d9403a0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 16 Aug 2006 05:17:30 +0000 Subject: [PATCH 150/153] *** empty log message *** --- ChangeLog | 4 ++++ lisp/ChangeLog | 21 +++++++++++++++++++++ lispref/ChangeLog | 8 ++++++++ man/ChangeLog | 10 ++++++++++ src/ChangeLog | 4 ++++ 5 files changed, 47 insertions(+) diff --git a/ChangeLog b/ChangeLog index b34b4d6d09c..0651090b995 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-08-16 Richard Stallman + + * INSTALL.CVS: Clean up wording. + 2006-07-14 Eli Zaretskii * configure.in (PKG_CHECK_MODULES): Redirect the output of diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 31201341796..44e3f73538e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,24 @@ +2006-08-16 Richard Stallman + + * term/x-win.el (x-clipboard-yank): Specify * in interactive spec. + (special-event-map): Process drag-n-drop events this way. + + * simple.el (move-beginning-of-line): Test whether fields + would prevent motion back to line's first visible character. + If so, stop where the fields would stop the motion. + + * newcomment.el (comment-indent): Fully update INDENT + before checking to see if it will change the text. + + * cus-edit.el (custom-newline): New function. + (custom-mode-map): Bind newline to custom-newline. + + * compare-w.el (compare-windows): Factor compare-ignore-whitespace + into ignore-whitespace. + Check each buffer for its skip-function. + Handle compare-windows-skip-whitespace special-case test + by returning t from default skip function. + 2006-08-15 Carsten Dominik * textmodes/org.el (org-clock-special-range, diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 579918f36a2..d09689ce637 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,11 @@ +2006-08-16 Richard Stallman + + * keymaps.texi (Extended Menu Items): Show format of cached + bindings in extended menu items. + + * customize.texi (Variable Definitions): Explain when the + standard value expression is evaluated. + 2006-08-15 Chong Yidong * commands.texi (Reading One Event): Explain idleness in diff --git a/man/ChangeLog b/man/ChangeLog index cdf811da570..4063ca3e2b0 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,13 @@ +2006-08-16 Richard Stallman + + * misc.texi (Saving Emacs Sessions): Clean up wording. + + * mark.texi (Marking Objects): Mention term "select all". + + * emacs.texi (Top): Update subnode menu. + + * help.texi (Help Mode): Move node up in file. + 2006-08-15 Carsten Dominik * org.texi (Installation, Activation): Split from Installation and diff --git a/src/ChangeLog b/src/ChangeLog index 58929cc40d2..b3242619d7f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-16 Richard Stallman + + * print.c (debug_output_compilation_hack): New function. + 2006-08-16 Kenichi Handa * fileio.c (choose_write_coding_system): Use LF for end-of-line From e9f67acfc1ab9c2038d7c82ddbed91ea824a599e Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 16 Aug 2006 09:04:47 +0000 Subject: [PATCH 151/153] (PKG_CHECK_MODULES): Use AS_MESSAGE_LOG_FD instead of hardcoding it. --- ChangeLog | 5 +++++ configure.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0651090b995..892a4a18ba3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-08-16 Andreas Schwab + + * configure.in (PKG_CHECK_MODULES): Use AS_MESSAGE_LOG_FD instead + of hardcoding it. + 2006-08-16 Richard Stallman * INSTALL.CVS: Clean up wording. diff --git a/configure.in b/configure.in index f6fe08f8f54..0b7a62907d2 100644 --- a/configure.in +++ b/configure.in @@ -1500,7 +1500,7 @@ AC_DEFUN([PKG_CHECK_MODULES], [ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then AC_MSG_CHECKING(for $2) - if $PKG_CONFIG --exists "$2" 2>&5; then + if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD; then AC_MSG_RESULT(yes) succeeded=yes From dae581bf8d1eb6b08fac90505e38244db2a3f3da Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 16 Aug 2006 12:33:12 +0000 Subject: [PATCH 152/153] (debug_output_compilation_hack): Fix return type. --- src/ChangeLog | 4 ++++ src/print.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index b3242619d7f..f37715a4b71 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-16 Andreas Schwab + + * print.c (debug_output_compilation_hack): Fix return type. + 2006-08-16 Richard Stallman * print.c (debug_output_compilation_hack): New function. diff --git a/src/print.c b/src/print.c index ac8736d2aa4..e56c231d30a 100644 --- a/src/print.c +++ b/src/print.c @@ -927,7 +927,7 @@ to make it write to the debugging output. */) /* This function is never called. Its purpose is to prevent print_output_debug_flag from being optimized away. */ -int +void debug_output_compilation_hack (x) int x; { From 5ebdc2990a95cc38b21f772eea4de3ceee149e54 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 16 Aug 2006 14:04:41 +0000 Subject: [PATCH 153/153] Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 123-125) - Update from CVS 2006-08-09 Katsumi Yamaoka * lisp/gnus/compface.el (uncompface): Use binary rather than raw-text-unix. 2006-08-09 Katsumi Yamaoka * lisp/gnus/compface.el (uncompface): Make sure the eol conversion doesn't take place when communicating with the external programs. Reported by ARISAWA Akihiro . 2006-07-31 Katsumi Yamaoka * lisp/gnus/nnheader.el (nnheader-insert-head): Fix typo in comment. 2006-07-31 Andreas Seltenreich * lisp/gnus/nnweb.el (nnweb-google-parse-1): Update regexp for author and date. Make it more robust by parsing author and date independently. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-398 --- lisp/gnus/ChangeLog | 19 +++++++++++++++++++ lisp/gnus/compface.el | 40 ++++++++++++++++++++++------------------ lisp/gnus/nnheader.el | 2 +- lisp/gnus/nnweb.el | 11 ++++++----- 4 files changed, 48 insertions(+), 24 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 3da68ecb902..6ddd513610a 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -3,6 +3,25 @@ * mm-extern.el (mm-extern-mail-server): End `y-or-n-p' prompt with a space. +2006-08-09 Katsumi Yamaoka + + * compface.el (uncompface): Use binary rather than raw-text-unix. + +2006-08-09 Katsumi Yamaoka + + * compface.el (uncompface): Make sure the eol conversion doesn't take + place when communicating with the external programs. Reported by + ARISAWA Akihiro . + +2006-07-31 Katsumi Yamaoka + + * nnheader.el (nnheader-insert-head): Fix typo in comment. + +2006-07-31 Andreas Seltenreich + + * nnweb.el (nnweb-google-parse-1): Update regexp for author and date. + Make it more robust by parsing author and date independently. + 2006-07-28 Katsumi Yamaoka * nnheader.el (nnheader-insert-head): Make it work with Mac as well. diff --git a/lisp/gnus/compface.el b/lisp/gnus/compface.el index f6bd9bfd720..33e05046e84 100644 --- a/lisp/gnus/compface.el +++ b/lisp/gnus/compface.el @@ -34,24 +34,28 @@ GNU/Linux system these might be in packages with names like `compface' or `faces-xface' and `netpbm' or `libgr-progs', for instance." (with-temp-buffer (insert face) - (and (eq 0 (apply 'call-process-region (point-min) (point-max) - "uncompface" - 'delete '(t nil) nil)) - (progn - (goto-char (point-min)) - (insert "/* Width=48, Height=48 */\n") - ;; I just can't get "icontopbm" to work correctly on its - ;; own in XEmacs. And Emacs doesn't understand un-raw pbm - ;; files. - (if (not (featurep 'xemacs)) - (eq 0 (call-process-region (point-min) (point-max) - "icontopbm" - 'delete '(t nil))) - (shell-command-on-region (point-min) (point-max) - "icontopbm | pnmnoraw" - (current-buffer) t) - t)) - (buffer-string)))) + (let ((coding-system-for-read 'raw-text) + ;; At least "icontopbm" doesn't work with Windows because + ;; the line-break code is converted into CRLF by default. + (coding-system-for-write 'binary)) + (and (eq 0 (apply 'call-process-region (point-min) (point-max) + "uncompface" + 'delete '(t nil) nil)) + (progn + (goto-char (point-min)) + (insert "/* Width=48, Height=48 */\n") + ;; I just can't get "icontopbm" to work correctly on its + ;; own in XEmacs. And Emacs doesn't understand un-raw pbm + ;; files. + (if (not (featurep 'xemacs)) + (eq 0 (call-process-region (point-min) (point-max) + "icontopbm" + 'delete '(t nil))) + (shell-command-on-region (point-min) (point-max) + "icontopbm | pnmnoraw" + (current-buffer) t) + t)) + (buffer-string))))) (provide 'compface) diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index 79732cd3d88..82e1d3ab554 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -598,7 +598,7 @@ the line could be found." (nth 1 (mm-insert-file-contents file nil beg (incf beg nnheader-head-chop-length)))) - ;; CRLF of CR might be used for the line-break code. + ;; CRLF or CR might be used for the line-break code. (prog1 (not (re-search-forward "\n\r?\n\\|\r\r" nil t)) (goto-char (point-max))) (or (null nnheader-max-head-length) diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index 7c0c8e0e444..d020d533aea 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el @@ -366,14 +366,15 @@ Valid types include `google', `dejanews', and `gmane'.") (mm-url-decode-entities) (search-backward " - ") (when (looking-at - " - \\([a-zA-Z]+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?[^\n]+by ?\n?\\([^<\n]+\\)\n") - (setq From (match-string 4) - Date (format "%s %s 00:00:00 %s" + "\\W+\\(\\w+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?") + (setq Date (format "%s %s 00:00:00 %s" (match-string 1) (match-string 2) (or (match-string 3) - (substring (current-time-string) -4))))) - + (substring (current-time-string) -4)))) + (goto-char (match-end 0))) + (when (looking-at "[^b]+by\\W+\\([^<\n]+\\)") + (setq From (match-string 1))) (widen) (forward-line 1) (incf i)