Now on revision 105899. Conflicting tags: mh-e-doc-8.3 mh-e-8.3 ------------------------------------------------------------ revno: 105899 committer: Michael Albinus branch nick: trunk timestamp: Sat 2011-09-24 13:45:13 +0200 message: * net/dbus.el (dbus-unregister-object): Remove match rule of signals. Release services only if they are defined. (Bug#9581) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 23:55:52 +0000 +++ lisp/ChangeLog 2011-09-24 11:45:13 +0000 @@ -1,3 +1,8 @@ +2011-09-24 Michael Albinus + + * net/dbus.el (dbus-unregister-object): Remove match rule of signals. + Release services only if they are defined. (Bug#9581) + 2011-09-23 Richard Stallman * textmodes/paragraphs.el (forward-sentence): For backwards case, === modified file 'lisp/net/dbus.el' --- lisp/net/dbus.el 2011-05-23 17:57:17 +0000 +++ lisp/net/dbus.el 2011-09-24 11:45:13 +0000 @@ -143,7 +143,7 @@ (value (cdr object)) (entry (gethash key dbus-registered-objects-table)) ret) - ;; entry has the structure ((UNAME SERVICE PATH MEMBER) ...). + ;; entry has the structure ((UNAME SERVICE PATH MEMBER [RULE]) ...). ;; value has the structure ((SERVICE PATH [HANDLER]) ...). ;; MEMBER is either a string (the handler), or a cons cell (a ;; property value). UNAME and property values are not taken into @@ -154,11 +154,17 @@ (when (equal (car value) (butlast (cdr elt) (- (length (cdr elt)) (length (car value))))) + (setq ret t) ;; Compute new hash value. If it is empty, remove it from the ;; hash table. (unless (puthash key (delete elt entry) dbus-registered-objects-table) (remhash key dbus-registered-objects-table)) - (setq ret t))) + ;; Remove match rule of signals. + (let ((rule (nth 4 elt))) + (when (stringp rule) + (dbus-call-method + (car key) dbus-service-dbus dbus-path-dbus dbus-interface-dbus + "RemoveMatch" rule))))) ;; Check, whether there is still a registered function or property ;; for the given service. If not, unregister the service from the ;; bus. @@ -166,17 +172,18 @@ (let ((service (cadr elt)) (bus (car key)) found) - (maphash - (lambda (k v) - (dolist (e v) - (ignore-errors - (when (and (equal bus (car k)) (string-equal service (cadr e))) - (setq found t))))) - dbus-registered-objects-table) - (unless found - (dbus-call-method - bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus - "ReleaseName" service)))) + (when service + (maphash + (lambda (k v) + (dolist (e v) + (ignore-errors + (when (and (equal bus (car k)) (string-equal service (cadr e))) + (setq found t))))) + dbus-registered-objects-table) + (unless found + (dbus-call-method + bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus + "ReleaseName" service))))) ;; Return. ret)) ------------------------------------------------------------ revno: 105898 committer: Michael Albinus branch nick: trunk timestamp: Sat 2011-09-24 13:36:53 +0200 message: * dbusbind.c (Fdbus_register_signal): Add match rule to Vdbus_registered_objects_table. (Bug#9581) (Fdbus_register_method, Vdbus_registered_objects_table): Fix docstring. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-09-24 09:22:06 +0000 +++ src/ChangeLog 2011-09-24 11:36:53 +0000 @@ -1,3 +1,10 @@ +2011-09-24 Michael Albinus + + * dbusbind.c (Fdbus_register_signal): Add match rule to + Vdbus_registered_objects_table. (Bug#9581) + (Fdbus_register_method, Vdbus_registered_objects_table): Fix + docstring. + 2011-09-24 Jim Meyering do not ignore write error for any output size === modified file 'src/dbusbind.c' --- src/dbusbind.c 2011-09-09 01:06:52 +0000 +++ src/dbusbind.c 2011-09-24 11:36:53 +0000 @@ -2145,7 +2145,7 @@ /* Create a hash table entry. */ key = list3 (bus, interface, signal); - key1 = list4 (uname, service, path, handler); + key1 = list5 (uname, service, path, handler, build_string (rule)); value = Fgethash (key, Vdbus_registered_objects_table, Qnil); if (NILP (Fmember (key1, value))) @@ -2177,7 +2177,7 @@ registered. This means that other D-Bus clients have no way of noticing the newly registered method. When interfaces are constructed incrementally by adding single methods or properties at a time, -DONT-REGISTER-SERVICE can be use to prevent other clients from +DONT-REGISTER-SERVICE can be used to prevent other clients from discovering the still incomplete interface.*/) (Lisp_Object bus, Lisp_Object service, Lisp_Object path, Lisp_Object interface, Lisp_Object method, Lisp_Object handler, @@ -2319,6 +2319,9 @@ arrives (methods and signals), or a cons cell containing the value of the property. +For signals, there is also a fifth element RULE, which keeps the match +string the signal is registered with. + In the second case, the key in the hash table is the list (BUS SERIAL). BUS is either a Lisp symbol, `:system' or `:session', or a string denoting the bus address. SERIAL is the serial number of the ------------------------------------------------------------ revno: 105897 committer: Richard Stallman branch nick: trunk timestamp: Sat 2011-09-24 06:31:37 -0400 message: bidi.c: Whitespace changes and a few added parentheses, to follow usual Emacs and GNU style. diff: === modified file 'src/bidi.c' --- src/bidi.c 2011-09-17 15:18:56 +0000 +++ src/bidi.c 2011-09-24 10:31:37 +0000 @@ -222,7 +222,7 @@ static inline void bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after) { - int higher_level = level_before > level_after ? level_before : level_after; + int higher_level = (level_before > level_after ? level_before : level_after); /* The prev_was_pdf gork is required for when we have several PDFs in a row. In that case, we want to compute the sor type for the @@ -233,18 +233,18 @@ level to which we descend after processing all the PDFs. */ if (!bidi_it->prev_was_pdf || level_before < level_after) /* FIXME: should the default sor direction be user selectable? */ - bidi_it->sor = (higher_level & 1) != 0 ? R2L : L2R; + bidi_it->sor = ((higher_level & 1) != 0 ? R2L : L2R); if (level_before > level_after) bidi_it->prev_was_pdf = 1; bidi_it->prev.type = UNKNOWN_BT; - bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 = - bidi_it->last_strong.orig_type = UNKNOWN_BT; - bidi_it->prev_for_neutral.type = bidi_it->sor == R2L ? STRONG_R : STRONG_L; + bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 + = bidi_it->last_strong.orig_type = UNKNOWN_BT; + bidi_it->prev_for_neutral.type = (bidi_it->sor == R2L ? STRONG_R : STRONG_L); bidi_it->prev_for_neutral.charpos = bidi_it->charpos; bidi_it->prev_for_neutral.bytepos = bidi_it->bytepos; - bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_w1 = - bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; + bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_w1 + = bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; bidi_it->ignore_bn_limit = -1; /* meaning it's unknown */ } @@ -325,10 +325,10 @@ /* Size of header used by bidi_shelve_cache. */ enum { - bidi_shelve_header_size = - (sizeof (bidi_cache_idx) + sizeof (bidi_cache_start_stack) - + sizeof (bidi_cache_sp) + sizeof (bidi_cache_start) - + sizeof (bidi_cache_last_idx)) + bidi_shelve_header_size + = (sizeof (bidi_cache_idx) + sizeof (bidi_cache_start_stack) + + sizeof (bidi_cache_sp) + sizeof (bidi_cache_start) + + sizeof (bidi_cache_last_idx)) }; /* Reset the cache state to the empty state. We only reset the part @@ -353,8 +353,8 @@ { if (bidi_cache_size > BIDI_CACHE_CHUNK) { - bidi_cache = - (struct bidi_it *) xrealloc (bidi_cache, BIDI_CACHE_CHUNK * elsz); + bidi_cache + = (struct bidi_it *) xrealloc (bidi_cache, BIDI_CACHE_CHUNK * elsz); bidi_cache_size = BIDI_CACHE_CHUNK; } bidi_cache_reset (); @@ -490,17 +490,17 @@ { /* The bidi cache cannot be larger than the largest Lisp string or buffer. */ - ptrdiff_t string_or_buffer_bound = - max (BUF_BYTES_MAX, STRING_BYTES_BOUND); + ptrdiff_t string_or_buffer_bound + = max (BUF_BYTES_MAX, STRING_BYTES_BOUND); /* Also, it cannot be larger than what C can represent. */ - ptrdiff_t c_bound = - (min (PTRDIFF_MAX, SIZE_MAX) - bidi_shelve_header_size) / elsz; + ptrdiff_t c_bound + = (min (PTRDIFF_MAX, SIZE_MAX) - bidi_shelve_header_size) / elsz; - bidi_cache = - xpalloc (bidi_cache, &bidi_cache_size, - max (BIDI_CACHE_CHUNK, idx - bidi_cache_size + 1), - min (string_or_buffer_bound, c_bound), elsz); + bidi_cache + = xpalloc (bidi_cache, &bidi_cache_size, + max (BIDI_CACHE_CHUNK, idx - bidi_cache_size + 1), + min (string_or_buffer_bound, c_bound), elsz); } } @@ -708,8 +708,8 @@ ptrdiff_t idx; memcpy (&idx, p, sizeof (bidi_cache_idx)); - bidi_cache_total_alloc -= - bidi_shelve_header_size + idx * sizeof (struct bidi_it); + bidi_cache_total_alloc + -= bidi_shelve_header_size + idx * sizeof (struct bidi_it); } else { @@ -737,8 +737,9 @@ + sizeof (bidi_cache_start_stack) + sizeof (bidi_cache_sp) + sizeof (bidi_cache_start), sizeof (bidi_cache_last_idx)); - bidi_cache_total_alloc -= - bidi_shelve_header_size + bidi_cache_idx * sizeof (struct bidi_it); + bidi_cache_total_alloc + -= (bidi_shelve_header_size + + bidi_cache_idx * sizeof (struct bidi_it)); } xfree (p); @@ -813,18 +814,18 @@ bidi_it->type_after_w1 = NEUTRAL_B; bidi_it->orig_type = NEUTRAL_B; bidi_it->prev_was_pdf = 0; - bidi_it->prev.type = bidi_it->prev.type_after_w1 = - bidi_it->prev.orig_type = UNKNOWN_BT; - bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 = - bidi_it->last_strong.orig_type = UNKNOWN_BT; + bidi_it->prev.type = bidi_it->prev.type_after_w1 + = bidi_it->prev.orig_type = UNKNOWN_BT; + bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 + = bidi_it->last_strong.orig_type = UNKNOWN_BT; bidi_it->next_for_neutral.charpos = -1; - bidi_it->next_for_neutral.type = - bidi_it->next_for_neutral.type_after_w1 = - bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; + bidi_it->next_for_neutral.type + = bidi_it->next_for_neutral.type_after_w1 + = bidi_it->next_for_neutral.orig_type = UNKNOWN_BT; bidi_it->prev_for_neutral.charpos = -1; - bidi_it->prev_for_neutral.type = - bidi_it->prev_for_neutral.type_after_w1 = - bidi_it->prev_for_neutral.orig_type = UNKNOWN_BT; + bidi_it->prev_for_neutral.type + = bidi_it->prev_for_neutral.type_after_w1 + = bidi_it->prev_for_neutral.orig_type = UNKNOWN_BT; bidi_it->sor = L2R; /* FIXME: should it be user-selectable? */ bidi_it->disp_pos = -1; /* invalid/unknown */ bidi_it->disp_prop = 0; @@ -848,7 +849,7 @@ bidi_it->next_en_pos = -1; bidi_it->next_for_ws.type = UNKNOWN_BT; bidi_set_sor_type (bidi_it, - bidi_it->paragraph_dir == R2L ? 1 : 0, + (bidi_it->paragraph_dir == R2L ? 1 : 0), bidi_it->level_stack[0].level); /* X10 */ bidi_cache_reset (); @@ -925,8 +926,8 @@ int frame_window_p, EMACS_INT *ch_len, EMACS_INT *nchars) { int ch; - EMACS_INT endpos = - (string->s || STRINGP (string->lstring)) ? string->schars : ZV; + EMACS_INT endpos + = (string->s || STRINGP (string->lstring)) ? string->schars : ZV; struct text_pos pos; /* If we got past the last known position of display string, compute @@ -1173,8 +1174,9 @@ we are potentially in a new paragraph that doesn't yet exist. */ pos = bidi_it->charpos; - s = STRINGP (bidi_it->string.lstring) ? - SDATA (bidi_it->string.lstring) : bidi_it->string.s; + s = (STRINGP (bidi_it->string.lstring) + ? SDATA (bidi_it->string.lstring) + : bidi_it->string.s); if (bytepos > begbyte && bidi_char_at_pos (bytepos, s, bidi_it->string.unibyte) == '\n') { @@ -1324,9 +1326,10 @@ bidi_it->first_elt = 0; if (string_p) { - const unsigned char *p = - STRINGP (bidi_it->string.lstring) - ? SDATA (bidi_it->string.lstring) : bidi_it->string.s; + const unsigned char *p + = (STRINGP (bidi_it->string.lstring) + ? SDATA (bidi_it->string.lstring) + : bidi_it->string.s); if (bidi_it->charpos < 0) bidi_it->charpos = 0; @@ -1509,8 +1512,10 @@ int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level; int new_level = bidi_resolve_explicit_1 (bidi_it); EMACS_INT eob = bidi_it->string.s ? bidi_it->string.schars : ZV; - const unsigned char *s = STRINGP (bidi_it->string.lstring) - ? SDATA (bidi_it->string.lstring) : bidi_it->string.s; + const unsigned char *s + = (STRINGP (bidi_it->string.lstring) + ? SDATA (bidi_it->string.lstring) + : bidi_it->string.s); if (prev_level < new_level && bidi_it->type == WEAK_BN @@ -1594,9 +1599,9 @@ int next_char; bidi_type_t type_of_next; struct bidi_it saved_it; - EMACS_INT eob = - (STRINGP (bidi_it->string.lstring) || bidi_it->string.s) - ? bidi_it->string.schars : ZV; + EMACS_INT eob + = ((STRINGP (bidi_it->string.lstring) || bidi_it->string.s) + ? bidi_it->string.schars : ZV); type = bidi_it->type; override = bidi_it->level_stack[bidi_it->stack_idx].override; @@ -1663,15 +1668,15 @@ && bidi_it->prev.orig_type == WEAK_EN) || bidi_it->prev.type_after_w1 == WEAK_AN))) { - const unsigned char *s = - STRINGP (bidi_it->string.lstring) - ? SDATA (bidi_it->string.lstring) : bidi_it->string.s; + const unsigned char *s + = (STRINGP (bidi_it->string.lstring) + ? SDATA (bidi_it->string.lstring) + : bidi_it->string.s); - next_char = - bidi_it->charpos + bidi_it->nchars >= eob - ? BIDI_EOB - : bidi_char_at_pos (bidi_it->bytepos + bidi_it->ch_len, s, - bidi_it->string.unibyte); + next_char = (bidi_it->charpos + bidi_it->nchars >= eob + ? BIDI_EOB + : bidi_char_at_pos (bidi_it->bytepos + bidi_it->ch_len, + s, bidi_it->string.unibyte)); type_of_next = bidi_get_type (next_char, override); if (type_of_next == WEAK_BN @@ -1720,17 +1725,17 @@ else /* W5: ET/BN with EN after it. */ { EMACS_INT en_pos = bidi_it->charpos + bidi_it->nchars; - const unsigned char *s = - STRINGP (bidi_it->string.lstring) - ? SDATA (bidi_it->string.lstring) : bidi_it->string.s; + const unsigned char *s = (STRINGP (bidi_it->string.lstring) + ? SDATA (bidi_it->string.lstring) + : bidi_it->string.s); if (bidi_it->nchars <= 0) abort (); - next_char = - bidi_it->charpos + bidi_it->nchars >= eob - ? BIDI_EOB - : bidi_char_at_pos (bidi_it->bytepos + bidi_it->ch_len, s, - bidi_it->string.unibyte); + next_char + = (bidi_it->charpos + bidi_it->nchars >= eob + ? BIDI_EOB + : bidi_char_at_pos (bidi_it->bytepos + bidi_it->ch_len, s, + bidi_it->string.unibyte)); type_of_next = bidi_get_type (next_char, override); if (type_of_next == WEAK_ET @@ -1875,8 +1880,8 @@ && bidi_get_category (type) != NEUTRAL) /* This is all per level run, so stop when we reach the end of this level run. */ - || bidi_it->level_stack[bidi_it->stack_idx].level != - current_level)); + || (bidi_it->level_stack[bidi_it->stack_idx].level + != current_level))); bidi_remember_char (&saved_it.next_for_neutral, bidi_it); @@ -1971,9 +1976,9 @@ if (bidi_it->scan_dir == 1) { - EMACS_INT eob = - (bidi_it->string.s || STRINGP (bidi_it->string.lstring)) - ? bidi_it->string.schars : ZV; + EMACS_INT eob + = ((bidi_it->string.s || STRINGP (bidi_it->string.lstring)) + ? bidi_it->string.schars : ZV); /* There's no sense in trying to advance if we hit end of text. */ if (bidi_it->charpos >= eob) @@ -2018,9 +2023,8 @@ UNKNOWN_BT. */ if (bidi_cache_idx > bidi_cache_start && !bidi_it->first_elt) { - int bob = - (bidi_it->string.s || STRINGP (bidi_it->string.lstring)) ? 0 : 1; - + int bob = ((bidi_it->string.s || STRINGP (bidi_it->string.lstring)) + ? 0 : 1); if (bidi_it->scan_dir > 0) { if (bidi_it->nchars <= 0) @@ -2345,9 +2349,9 @@ bidi_it->separator_limit = bidi_it->string.schars; else if (bidi_it->bytepos < ZV_BYTE) { - EMACS_INT sep_len = - bidi_at_paragraph_end (bidi_it->charpos + bidi_it->nchars, - bidi_it->bytepos + bidi_it->ch_len); + EMACS_INT sep_len + = bidi_at_paragraph_end (bidi_it->charpos + bidi_it->nchars, + bidi_it->bytepos + bidi_it->ch_len); if (bidi_it->nchars <= 0) abort (); if (sep_len >= 0) @@ -2355,8 +2359,8 @@ bidi_it->new_paragraph = 1; /* Record the buffer position of the last character of the paragraph separator. */ - bidi_it->separator_limit = - bidi_it->charpos + bidi_it->nchars + sep_len; + bidi_it->separator_limit + = bidi_it->charpos + bidi_it->nchars + sep_len; } } } ------------------------------------------------------------ revno: 105896 committer: Jim Meyering branch nick: trunk timestamp: Sat 2011-09-24 11:22:06 +0200 message: do not ignore write error for any output size The previous change was incomplete. While it makes emacs --batch detect the vast majority of stdout write failures, errors were still ignored whenever the output size is k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096, $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \ && echo FAIL: ignored write error FAIL: ignored write error $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \ && echo FAIL: ignored write error FAIL: ignored write error * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-09-23 09:56:55 +0000 +++ src/ChangeLog 2011-09-24 09:22:06 +0000 @@ -1,3 +1,18 @@ +2011-09-24 Jim Meyering + + do not ignore write error for any output size + The previous change was incomplete. + While it makes emacs --batch detect the vast majority of stdout + write failures, errors were still ignored whenever the output size is + k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096, + $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \ + && echo FAIL: ignored write error + FAIL: ignored write error + $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \ + && echo FAIL: ignored write error + FAIL: ignored write error + * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574) + 2011-09-23 Andreas Schwab * emacs.c (Fkill_emacs): In noninteractive mode exit === modified file 'src/emacs.c' --- src/emacs.c 2011-09-23 09:56:55 +0000 +++ src/emacs.c 2011-09-24 09:22:06 +0000 @@ -2019,7 +2019,7 @@ unlink (SSDATA (Vauto_save_list_file_name)); exit_code = EXIT_SUCCESS; - if (noninteractive && fflush (stdout)) + if (noninteractive && (fflush (stdout) || ferror (stdout))) exit_code = EXIT_FAILURE; exit (INTEGERP (arg) ? XINT (arg) : exit_code); } ------------------------------------------------------------ revno: 105895 committer: Richard Stallman branch nick: trunk timestamp: Fri 2011-09-23 19:55:52 -0400 message: For moving backward sentences, distinguish start of paragraph from start of its text. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 23:47:27 +0000 +++ lisp/ChangeLog 2011-09-23 23:55:52 +0000 @@ -1,5 +1,8 @@ 2011-09-23 Richard Stallman + * textmodes/paragraphs.el (forward-sentence): For backwards case, + distinguish start of paragraph from start of its text. + * mail/emacsbug.el (report-emacs-bug-query-existing-bugs): Autoload. * mail/rmail.el (rmail-view-buffer-kill-buffer-hook): New function. === modified file 'lisp/textmodes/paragraphs.el' --- lisp/textmodes/paragraphs.el 2011-09-22 13:34:02 +0000 +++ lisp/textmodes/paragraphs.el 2011-09-23 23:55:52 +0000 @@ -456,19 +456,23 @@ (sentence-end (sentence-end))) (while (< arg 0) (let ((pos (point)) - (par-beg - (save-excursion - (start-of-paragraph-text) - ;; Move PAR-BEG back over indentation - ;; to allow s1entence-end to match if it is anchored at - ;; BOL and the paragraph starts indented. - (beginning-of-line) - (point)))) + par-beg par-text-beg) + (save-excursion + (start-of-paragraph-text) + ;; Start of real text in the paragraph. + ;; We move back to here if we don't see a sentence-end. + (setq par-text-beg (point)) + ;; Start of the first line of the paragraph. + ;; We use this as the search limit + ;; to allow s1entence-end to match if it is anchored at + ;; BOL and the paragraph starts indented. + (beginning-of-line) + (setq par-beg (point))) (if (and (re-search-backward sentence-end par-beg t) (or (< (match-end 0) pos) (re-search-backward sentence-end par-beg t))) (goto-char (match-end 0)) - (goto-char par-beg))) + (goto-char par-text-beg))) (setq arg (1+ arg))) (while (> arg 0) (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) ------------------------------------------------------------ revno: 105894 committer: Richard Stallman branch nick: trunk timestamp: Fri 2011-09-23 19:47:27 -0400 message: Autoload report-emacs-bug-query-existing-bugs. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 23:44:32 +0000 +++ lisp/ChangeLog 2011-09-23 23:47:27 +0000 @@ -1,5 +1,7 @@ 2011-09-23 Richard Stallman + * mail/emacsbug.el (report-emacs-bug-query-existing-bugs): Autoload. + * mail/rmail.el (rmail-view-buffer-kill-buffer-hook): New function. (rmail-generate-viewer-buffer): Put that hook on view buffer. (rmail-mode-kill-buffer-hook): Override that hook, to kill view buffer. === modified file 'lisp/mail/emacsbug.el' --- lisp/mail/emacsbug.el 2011-06-28 18:10:11 +0000 +++ lisp/mail/emacsbug.el 2011-09-23 23:47:27 +0000 @@ -479,6 +479,7 @@ buglist)))) (report-emacs-bug-create-existing-bugs-buffer (nreverse buglist) keywords))) +;;;###autoload (defun report-emacs-bug-query-existing-bugs (keywords) "Query for KEYWORDS at `report-emacs-bug-tracker-url', and return the result. The result is an alist with items of the form (URL SUBJECT NO)." ------------------------------------------------------------ revno: 105893 committer: Richard Stallman branch nick: trunk timestamp: Fri 2011-09-23 19:44:32 -0400 message: Don't allow killing Rmail view buffer by itself. It gets killed only when its Rmail buffer gets killed. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 16:26:48 +0000 +++ lisp/ChangeLog 2011-09-23 23:44:32 +0000 @@ -1,3 +1,9 @@ +2011-09-23 Richard Stallman + + * mail/rmail.el (rmail-view-buffer-kill-buffer-hook): New function. + (rmail-generate-viewer-buffer): Put that hook on view buffer. + (rmail-mode-kill-buffer-hook): Override that hook, to kill view buffer. + 2011-09-23 Andreas Schwab * international/mule-diag.el (mule-diag): Insert a newline after === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2011-09-09 08:59:51 +0000 +++ lisp/mail/rmail.el 2011-09-23 23:44:32 +0000 @@ -1310,9 +1310,14 @@ (if (and (local-variable-p 'rmail-view-buffer) (buffer-live-p rmail-view-buffer)) rmail-view-buffer - (generate-new-buffer - (format " *message-viewer %s*" - (file-name-nondirectory (or buffer-file-name (buffer-name))))))) + (let ((newbuf + (generate-new-buffer + (format " *message-viewer %s*" + (file-name-nondirectory + (or buffer-file-name (buffer-name))))))) + (with-current-buffer newbuf + (add-hook 'kill-buffer-hook 'rmail-view-buffer-kill-buffer-hook nil t)) + newbuf))) (defun rmail-swap-buffers () "Swap text between current buffer and `rmail-view-buffer'. @@ -1372,7 +1377,14 @@ (message "Marking buffer unmodified to avoid rewriting Babyl file as mbox file"))) (defun rmail-mode-kill-buffer-hook () - (if (buffer-live-p rmail-view-buffer) (kill-buffer rmail-view-buffer))) + ;; Turn off the hook on the view buffer, so we can kill it, then kill it. + (if (buffer-live-p rmail-view-buffer) + (with-current-buffer rmail-view-buffer + (setq kill-buffer-hook nil) + (kill-buffer rmail-view-buffer)))) + +(defun rmail-view-buffer-kill-buffer-hook () + (error "Can't kill message view buffer by itself")) ;; Set up the permanent locals associated with an Rmail file. (defun rmail-perm-variables () ------------------------------------------------------------ revno: 105892 author: Antoine Levitt committer: Chong Yidong branch nick: trunk timestamp: Fri 2011-09-23 17:22:31 -0400 message: * erc-button.el (erc-button-next-function): Scoping fix (Bug#9487). diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2011-07-04 13:23:04 +0000 +++ lisp/erc/ChangeLog 2011-09-23 21:22:31 +0000 @@ -1,3 +1,8 @@ +2011-09-23 Antoine Levitt + + * erc-button.el (erc-button-next-function): Scoping fix + (Bug#9487). + 2011-07-04 Vivek Dasmohapatra * erc.el (erc-generate-new-buffer-name): Reuse old buffer names === modified file 'lisp/erc/erc-button.el' --- lisp/erc/erc-button.el 2011-04-26 13:50:09 +0000 +++ lisp/erc/erc-button.el 2011-09-23 21:22:31 +0000 @@ -430,19 +430,19 @@ (defun erc-button-next-function () "Pseudo completion function that actually jumps to the next button. For use on `completion-at-point-functions'." - (let ((here (point))) - (when (< here (erc-beg-of-input-line)) - (lambda () - (while (and (get-text-property here 'erc-callback) - (not (= here (point-max)))) - (setq here (1+ here))) - (while (and (not (get-text-property here 'erc-callback)) - (not (= here (point-max)))) - (setq here (1+ here))) - (if (< here (point-max)) - (goto-char here) - (error "No next button")) - t)))) + (when (< (point) (erc-beg-of-input-line)) + `(lambda () + (let ((here ,(point))) + (while (and (get-text-property here 'erc-callback) + (not (= here (point-max)))) + (setq here (1+ here))) + (while (and (not (get-text-property here 'erc-callback)) + (not (= here (point-max)))) + (setq here (1+ here))) + (if (< here (point-max)) + (goto-char here) + (error "No next button")) + t)))) (defun erc-button-next () "Go to the next button in this buffer." ------------------------------------------------------------ revno: 105891 committer: Andreas Schwab branch nick: emacs timestamp: Fri 2011-09-23 18:26:48 +0200 message: * lisp/international/mule-diag.el (mule-diag): Insert a newline after each fontset description. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 15:06:14 +0000 +++ lisp/ChangeLog 2011-09-23 16:26:48 +0000 @@ -1,3 +1,8 @@ +2011-09-23 Andreas Schwab + + * international/mule-diag.el (mule-diag): Insert a newline after + each fontset description. + 2011-09-23 Stefan Monnier * simple.el (delete-trailing-whitespace): === modified file 'lisp/international/mule-diag.el' --- lisp/international/mule-diag.el 2011-02-19 03:38:45 +0000 +++ lisp/international/mule-diag.el 2011-09-23 16:26:48 +0000 @@ -1139,7 +1139,8 @@ (insert "Fontset-Name\t\t\t\t\t\t WDxHT Style\n") (insert "------------\t\t\t\t\t\t ----- -----\n") (dolist (fontset (fontset-list)) - (print-fontset fontset t))) + (print-fontset fontset t) + (insert "\n"))) (help-print-return-message)))) ;;;###autoload ------------------------------------------------------------ revno: 105890 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-09-23 11:06:14 -0400 message: * lisp/simple.el (delete-trailing-whitespace): Document last change; simplify. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 14:56:00 +0000 +++ lisp/ChangeLog 2011-09-23 15:06:14 +0000 @@ -1,3 +1,8 @@ +2011-09-23 Stefan Monnier + + * simple.el (delete-trailing-whitespace): + Document last change; simplify. + 2011-09-23 Peter J. Weisberg * simple.el (delete-trailing-whitespace): Also delete === modified file 'lisp/simple.el' --- lisp/simple.el 2011-09-23 14:56:00 +0000 +++ lisp/simple.el 2011-09-23 15:06:14 +0000 @@ -568,6 +568,7 @@ All whitespace after the last non-whitespace character in a line is deleted. This respects narrowing, created by \\[narrow-to-region] and friends. A formfeed is not considered whitespace by this function. +If END is nil, also delete all trailing lines at the end of the buffer. If the region is active, only delete whitespace within the region." (interactive (progn (barf-if-buffer-read-only) @@ -580,18 +581,18 @@ (start (or start (point-min)))) (goto-char start) (while (re-search-forward "\\s-$" end-marker t) - (skip-syntax-backward "-" (save-excursion (forward-line 0) (point))) + (skip-syntax-backward "-" (line-beginning-position)) ;; Don't delete formfeeds, even if they are considered whitespace. - (save-match-data - (if (looking-at ".*\f") - (goto-char (match-end 0)))) + (if (looking-at-p ".*\f") + (goto-char (match-end 0))) (delete-region (point) (match-end 0))) - (save-restriction - (goto-char end-marker) - (widen) - (if (and (eobp) - (looking-back "\n\n+" nil t)) - (replace-match "\n"))) + ;; Delete trailing empty lines. + (goto-char end-marker) + (when (and (not end) + (<= (skip-chars-backward "\n") -2) + ;; Really the end of buffer. + (save-restriction (widen) (eobp))) + (delete-region (1+ (point)) end-marker)) (set-marker end-marker nil)))) ;; Return nil for the benefit of `write-file-functions'. nil) ------------------------------------------------------------ revno: 105889 committer: martin rudalics branch nick: trunk timestamp: Fri 2011-09-23 17:01:49 +0200 message: Document some window code changes in NEWS. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-09-23 09:12:53 +0000 +++ doc/lispref/ChangeLog 2011-09-23 15:01:49 +0000 @@ -25,6 +25,7 @@ window-list-1. (Buffers and Windows): Rewrite. Explain a window's previous and next buffers and the corresponding functions. + (Window Tree): Merge into Windows and Frames section. * elisp.texi (Top): Update node listings for frames and windows sections. === modified file 'etc/ChangeLog' --- etc/ChangeLog 2011-09-20 04:51:59 +0000 +++ etc/ChangeLog 2011-09-23 15:01:49 +0000 @@ -1,3 +1,7 @@ +2011-09-23 Martin Rudalics + + * NEWS: Document some window code changes. + 2011-09-20 Bill Wohler Release MH-E version 8.3. === modified file 'etc/NEWS' --- etc/NEWS 2011-09-20 04:51:59 +0000 +++ etc/NEWS 2011-09-23 15:01:49 +0000 @@ -961,6 +961,97 @@ ** Window changes ++++ +*** Window tree functions are accessible in Elisp. +Functions are provided to return the parent, siblings or child windows +of any window including internal windows (windows not associated with a +buffer) in the window tree. + ++++ +*** Window manipulation can deal with internal windows. +Many window handling functions like `split-window', `delete-window', or +`delete-other-windows' as well as the window resizing functions can now +act on any window including internal ones. + ++++ +*** window-total-height/-width vs window-body-height/-width. +The function `window-height' has been renamed to `window-total-height' +and `window-width' has been renamed to `window-body-width'. The old +names are provided as aliases. Two new functions `window-total-width' +and `window-body-height' are provided. + ++++ +*** Window parameters specific to window handling functions. +For each window you can specify a parameter to override the default +behavior of a number of functions like `split-window', `delete-window' +and `delete-other-windows'. + ++++ +*** New semantics of third argument of `split-window'. + +The third argument of `split-window' has been renamed to SIDE and can be +set to any of the values 'below, 'right, 'above, or 'left to make the +new window appear on the corresponding side of the window that shall be +split. Any other value of SIDE will cause `split-window' to split the +window into two side-by-side windows as before. + ++++ +*** New option `window-nest'. +The new option `window-nest' allows to return the space obtained for +resizing or creating a window more reliably to the window from which +such space was obtained. + ++++ +*** New option `window-splits'. +The new option `window-splits' allows to split a window that otherwise +cannot be split because it's too small by stealing space from other +windows in the same combination. + ++++ +*** `split-window-above-each-other' and `split-window-side-by-side'. +The commands `split-window-vertically' and `split-window-horizontally' +have been renamed to `split-window-above-each-other' and +`split-window-side-by-side' respectively. The old names are provided as +aliases. + ++++ +*** Window resizing functions. +A new standard function for resizing windows called `resize-window' has +been introduced. This and all other functions for resizing windows no +longer delete any windows when they become too small. + ++++ +*** Frame/window resizing. +Resizing an Emacs frame now preserves the proportional sizes of +subwindows modulo restrictions imposed by window minimum sizes and +fixed-size windows. + ++++ +*** `adjust-window-trailing-edge' adjustments. +`adjust-window-trailing-edge' can now deal with fixed-size windows and +is able to resize other windows if a window adjacent to the trailing +edge cannot be shrunk any more. This makes its behavior more similar to +that of Emacs 21 without compromising, however, its inability to delete +windows which was introduced in Emacs 22. + ++++ +*** Commands for maximizing and minimizing windows. +New functions to maximize and minimize a window within its frame are +provided, namely `maximize-window' and `minimize-window'. + ++++ +*** Window-local buffer lists. +Windows now have local buffer lists. This means that removing a buffer +from display in a window will preferably show the buffer previously +shown in that window with its previous window-start and window-point +positions. This also means that the same buffer may be automatically +shown twice even if it already appears in another window. + ++++ +*** New commands `switch-to-prev-buffer' and `switch-to-next-buffer'. +These functions allow to navigate through the live buffers that have +been shown in a specific window. + *** `switch-to-buffer' has a new optional argument FORCE-SAME-WINDOW, which if non-nil requires the buffer to be displayed in the currently selected window, signaling an error otherwise. If nil, another window ------------------------------------------------------------ revno: 105888 author: Peter J. Weisberg committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-09-23 10:56:00 -0400 message: * lisp/simple.el (delete-trailing-whitespace): Also delete extra newlines at the end of the buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 14:47:01 +0000 +++ lisp/ChangeLog 2011-09-23 14:56:00 +0000 @@ -1,5 +1,8 @@ 2011-09-23 Peter J. Weisberg + * simple.el (delete-trailing-whitespace): Also delete + extra newlines at the end of the buffer. + * textmodes/picture.el: Make motion commands obey shift-select-mode. (picture-newline): Use forward-line so as to ignore fields. === modified file 'lisp/simple.el' --- lisp/simple.el 2011-09-23 10:52:23 +0000 +++ lisp/simple.el 2011-09-23 14:56:00 +0000 @@ -586,6 +586,12 @@ (if (looking-at ".*\f") (goto-char (match-end 0)))) (delete-region (point) (match-end 0))) + (save-restriction + (goto-char end-marker) + (widen) + (if (and (eobp) + (looking-back "\n\n+" nil t)) + (replace-match "\n"))) (set-marker end-marker nil)))) ;; Return nil for the benefit of `write-file-functions'. nil) ------------------------------------------------------------ revno: 105887 author: Peter J. Weisberg committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-09-23 10:47:01 -0400 message: * lisp/textmodes/picture.el: Make motion commands obey shift-select-mode. (picture-newline): Use forward-line so as to ignore fields. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 14:32:36 +0000 +++ lisp/ChangeLog 2011-09-23 14:47:01 +0000 @@ -1,3 +1,8 @@ +2011-09-23 Peter J. Weisberg + + * textmodes/picture.el: Make motion commands obey shift-select-mode. + (picture-newline): Use forward-line so as to ignore fields. + 2011-09-23 Stefan Monnier * subr.el (with-wrapper-hook): Fix edebug spec. @@ -9,8 +14,8 @@ 2011-09-23 Michael Albinus - * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): Fix - nasty bug using wrong cached values. + * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): + Fix nasty bug using wrong cached values. 2011-09-23 Alan Mackenzie @@ -75,8 +80,8 @@ 2011-09-21 Martin Rudalics - * window.el (set-window-buffer-start-and-point): Call - set-window-start with NOFORCE argument t. Suggested by Thierry + * window.el (set-window-buffer-start-and-point): + Call set-window-start with NOFORCE argument t. Suggested by Thierry Volpiatto . (quit-window): Reword doc-string. Handle new format of quit-restore parameter. Don't delete window if it has a === modified file 'lisp/textmodes/picture.el' --- lisp/textmodes/picture.el 2011-01-25 04:08:28 +0000 +++ lisp/textmodes/picture.el 2011-09-23 14:47:01 +0000 @@ -83,7 +83,7 @@ "Position point at the beginning of the line. With ARG not nil, move forward ARG - 1 lines first. If scan reaches end of buffer, stop there without error." - (interactive "P") + (interactive "^P") (if arg (forward-line (1- (prefix-numeric-value arg)))) (beginning-of-line) (setq picture-desired-column 0)) @@ -92,7 +92,7 @@ "Position point after last non-blank character on current line. With ARG not nil, move forward ARG - 1 lines first. If scan reaches end of buffer, stop there without error." - (interactive "P") + (interactive "^P") (if arg (forward-line (1- (prefix-numeric-value arg)))) (beginning-of-line) (skip-chars-backward " \t" (prog1 (point) (end-of-line))) @@ -101,7 +101,7 @@ (defun picture-forward-column (arg &optional interactive) "Move cursor right, making whitespace if necessary. With argument, move that many columns." - (interactive "p\nd") + (interactive "^p\nd") (let (deactivate-mark) (picture-update-desired-column interactive) (setq picture-desired-column (max 0 (+ picture-desired-column arg))) @@ -115,14 +115,14 @@ (defun picture-backward-column (arg &optional interactive) "Move cursor left, making whitespace if necessary. With argument, move that many columns." - (interactive "p\nd") + (interactive "^p\nd") (picture-update-desired-column interactive) (picture-forward-column (- arg))) (defun picture-move-down (arg) "Move vertically down, making whitespace if necessary. With argument, move that many lines." - (interactive "p") + (interactive "^p") (let (deactivate-mark) (picture-update-desired-column nil) (picture-newline arg) @@ -139,7 +139,7 @@ (defun picture-move-up (arg) "Move vertically up, making whitespace if necessary. With argument, move that many lines." - (interactive "p") + (interactive "^p") (picture-update-desired-column nil) (picture-move-down (- arg))) @@ -212,7 +212,7 @@ With ARG do it that many times. Useful for delineating rectangles in conjunction with diagonal picture motion. Do \\[command-apropos] picture-movement to see commands which control motion." - (interactive "p") + (interactive "^p") (picture-move-down (* arg picture-vertical-step)) (picture-forward-column (* arg picture-horizontal-step))) @@ -221,7 +221,7 @@ With ARG do it that many times. Useful for delineating rectangles in conjunction with diagonal picture motion. Do \\[command-apropos] picture-movement to see commands which control motion." - (interactive "p") + (interactive "^p") (picture-motion (- arg))) (defun picture-mouse-set-point (event) @@ -323,13 +323,14 @@ "Move to the beginning of the following line. With argument, moves that many lines (up, if negative argument); always moves to the beginning of a line." - (interactive "p") - (if (< arg 0) - (forward-line arg) - (while (> arg 0) - (end-of-line) - (if (eobp) (newline) (forward-char 1)) - (setq arg (1- arg))))) + (interactive "^p") + (let ((start (point)) + (lines-left (forward-line arg))) + (if (and (eobp) + (> (point) start)) + (newline)) + (if (> lines-left 0) + (newline lines-left)))) (defun picture-open-line (arg) "Insert an empty line after the current line. @@ -438,7 +439,7 @@ line. The character must be preceded by whitespace. \"interesting characters\" are defined by variable `picture-tab-chars'. If no such character is found, move to beginning of line." - (interactive "P") + (interactive "^P") (let ((target (current-column))) (save-excursion (if (and (not arg) @@ -464,7 +465,7 @@ With prefix arg, overwrite the traversed text with spaces. The tab stop list can be changed by \\[picture-set-tab-stops] and \\[edit-tab-stops]. See also documentation for variable `picture-tab-chars'." - (interactive "P") + (interactive "^P") (let* ((opoint (point))) (move-to-tab-stop) (if arg ------------------------------------------------------------ revno: 105886 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2011-09-23 10:32:36 -0400 message: * lisp/subr.el (with-wrapper-hook): Fix edebug spec. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 10:52:23 +0000 +++ lisp/ChangeLog 2011-09-23 14:32:36 +0000 @@ -1,3 +1,7 @@ +2011-09-23 Stefan Monnier + + * subr.el (with-wrapper-hook): Fix edebug spec. + 2011-09-23 Lars Magne Ingebrigtsen * simple.el (kill-line): Note effect of `show-trailing-whitespace' === modified file 'lisp/subr.el' --- lisp/subr.el 2011-09-11 03:35:02 +0000 +++ lisp/subr.el 2011-09-23 14:32:36 +0000 @@ -1377,7 +1377,7 @@ ARGS is a list of variables which will be passed as additional arguments to each function, after the initial argument, and which the first argument expects to receive when called." - (declare (indent 2) (debug t)) + (declare (indent 2) (debug (form sexp body))) ;; We need those two gensyms because CL's lexical scoping is not available ;; for function arguments :-( (let ((funs (make-symbol "funs")) ------------------------------------------------------------ revno: 105885 fixes bug(s): http://debbugs.gnu.org/4538 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Fri 2011-09-23 12:52:23 +0200 message: * simple.el (kill-line): Note effect of `show-trailing-whitespace'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 09:38:41 +0000 +++ lisp/ChangeLog 2011-09-23 10:52:23 +0000 @@ -1,3 +1,8 @@ +2011-09-23 Lars Magne Ingebrigtsen + + * simple.el (kill-line): Note effect of `show-trailing-whitespace' + (bug#4538). + 2011-09-23 Michael Albinus * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): Fix === modified file 'lisp/simple.el' --- lisp/simple.el 2011-09-22 16:49:57 +0000 +++ lisp/simple.el 2011-09-23 10:52:23 +0000 @@ -3430,6 +3430,10 @@ To kill a whole line, when point is not at the beginning, type \ \\[move-beginning-of-line] \\[kill-line] \\[kill-line]. +If `show-trailing-whitespace' is non-nil, this command will just +kill the rest of the current line, even if there are only +nonblanks there. + If `kill-whole-line' is non-nil, then this command kills the whole line including its terminating newline, when used at the beginning of a line with no argument. As a consequence, you can always kill a whole line