Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 101516. ------------------------------------------------------------ revno: 101516 committer: Dan Nicolaescu branch nick: trunk timestamp: Tue 2010-09-21 09:42:12 +0300 message: Check in missing ChangeLog entry. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-20 11:38:50 +0000 +++ src/ChangeLog 2010-09-21 06:42:12 +0000 @@ -1,5 +1,9 @@ 2010-09-20 Dan Nicolaescu + * Makefile.in (temacs): Link using $(CC) not $(LD). + (LD_FIRSTFLAG): Define using autoconf. + (LD): Remove. + Remove HAVE_TERMIOS definitions. * s/usg5-4-common.h (HAVE_TERMIOS): * s/template.h (HAVE_TERMIOS): ------------------------------------------------------------ revno: 101515 committer: Dan Nicolaescu branch nick: trunk timestamp: Tue 2010-09-21 09:36:01 +0300 message: Check in missing ChangeLog entry. diff: === modified file 'ChangeLog' --- ChangeLog 2010-09-18 13:57:06 +0000 +++ ChangeLog 2010-09-21 06:36:01 +0000 @@ -1,3 +1,7 @@ +2010-09-20 Dan Nicolaescu + + * configure.in (LINKER): Rename to LD_FIRSTFLAG, do not include $(CC). + 2010-09-18 Eli Zaretskii * config.bat: Detect that libxml2 is installed and if so, build ------------------------------------------------------------ revno: 101514 committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2010-09-20 23:44:05 +0000 message: rfc2047.el (rfc2047-encode-parameter): Doc fix. emacs-mime.texi (rfc2047): Update description for rfc2047-encode-parameter. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-09-13 15:32:45 +0000 +++ doc/misc/ChangeLog 2010-09-20 23:44:05 +0000 @@ -1,3 +1,8 @@ +2010-09-20 Katsumi Yamaoka + + * emacs-mime.texi (rfc2047): Update description for + rfc2047-encode-parameter. + 2010-09-13 Michael Albinus * tramp.texi (Inline methods): Remove "ssh1_old", "ssh2_old" and === modified file 'doc/misc/emacs-mime.texi' --- doc/misc/emacs-mime.texi 2010-09-02 00:55:51 +0000 +++ doc/misc/emacs-mime.texi 2010-09-20 23:44:05 +0000 @@ -1469,21 +1469,9 @@ @item rfc2047-encode-parameter @findex rfc2047-encode-parameter -Encode a parameter in the RFC2047-like style. This is a replacement for -the @code{rfc2231-encode-string} function. @xref{rfc2231}. - -When attaching files as @acronym{MIME} parts, we should use the RFC2231 -encoding to specify the file names containing non-@acronym{ASCII} -characters. However, many mail softwares don't support it in practice -and recipients won't be able to extract files with correct names. -Instead, the RFC2047-like encoding is acceptable generally. This -function provides the very RFC2047-like encoding, resigning to such a -regrettable trend. To use it, put the following line in your -@file{~/.gnus.el} file: - -@lisp -(defalias 'mail-header-encode-parameter 'rfc2047-encode-parameter) -@end lisp +Encode a parameter in the RFC2047-like style. This is a substitution +for the @code{rfc2231-encode-string} function, that is the standard but +many mailers don't support it. @xref{rfc2231}. @end table === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-20 23:08:33 +0000 +++ lisp/gnus/ChangeLog 2010-09-20 23:44:05 +0000 @@ -1,3 +1,7 @@ +2010-09-20 Katsumi Yamaoka + + * rfc2047.el (rfc2047-encode-parameter): Doc fix. + 2010-09-20 Lars Magne Ingebrigtsen * nnimap.el (nnimap-request-group): Don't select the imap buffer before === modified file 'lisp/gnus/rfc2047.el' --- lisp/gnus/rfc2047.el 2010-09-02 00:55:51 +0000 +++ lisp/gnus/rfc2047.el 2010-09-20 23:44:05 +0000 @@ -851,18 +851,8 @@ (defun rfc2047-encode-parameter (param value) "Return and PARAM=VALUE string encoded in the RFC2047-like style. -This is a replacement for the `rfc2231-encode-string' function. - -When attaching files as MIME parts, we should use the RFC2231 encoding -to specify the file names containing non-ASCII characters. However, -many mail softwares don't support it in practice and recipients won't -be able to extract files with correct names. Instead, the RFC2047-like -encoding is acceptable generally. This function provides the very -RFC2047-like encoding, resigning to such a regrettable trend. To use -it, put the following line in your ~/.gnus.el file: - -\(defalias 'mail-header-encode-parameter 'rfc2047-encode-parameter) -" +This is a substitution for the `rfc2231-encode-string' function, that +is the standard but many mailers don't support it." (let ((rfc2047-encoding-type 'mime) (rfc2047-encode-max-chars nil)) (rfc2045-encode-string param (rfc2047-encode-string value)))) ------------------------------------------------------------ revno: 101513 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2010-09-20 23:08:33 +0000 message: Merge changes made in Gnus trunk. mail-parse.el (mail-header-encode-parameter): Use -encode-parameter instead of -encode-string. nnimap.el (nnimap-fetch-inbox): Use "[]" as the parameter instead of "". gnus-news.texi: Say what Emacs versions we support. nnimap.el: Implement group deletion. nnimap.el (nnimap-transform-headers): Return the size of the entire message in the Bytes header, not just the size of the first part. gnus-news.texi: The nnimap makeover. gnus-news.texi (Supported Emacs versions): Fix typo. nnimap.el (nnimap-request-move-article): Fix article moving from nnimap to other servers. nnimap.el (nnimap-request-set-mark): Don't wait for a response when we haven't requested anything. nnimap.el (nnimap-command): Make sure that the error message doesn't error out. diff: === modified file 'doc/misc/gnus-news.texi' --- doc/misc/gnus-news.texi 2010-09-02 00:55:51 +0000 +++ doc/misc/gnus-news.texi 2010-09-20 23:08:33 +0000 @@ -18,6 +18,17 @@ @itemize @bullet +@item Supported Emacs versions +The following Emacs versions are supported by No Gnus: +@itemize @bullet + +@item Emacs 22 and up +@item XEmacs 21.4 +@item XEmacs 21.5 +@item SXEmacs + +@end itemize + @item Installation changes @itemize @bullet @@ -55,6 +66,11 @@ @itemize @bullet +@item New version of @code{nnimap} + +@code{nnimap} has been reimplemented in a mostly-compatible way. +@c Mention any incompatibilities. + @item Gnus includes the Emacs Lisp @acronym{SASL} library. This provides a clean @acronym{API} to @acronym{SASL} mechanisms from === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-20 01:57:46 +0000 +++ lisp/gnus/ChangeLog 2010-09-20 23:08:33 +0000 @@ -1,3 +1,28 @@ +2010-09-20 Lars Magne Ingebrigtsen + + * nnimap.el (nnimap-request-group): Don't select the imap buffer before + opening the server. + (nnimap-request-delete-group): Implement group deletion. + (nnimap-transform-headers): Return the size of the entire message in + the Bytes header, not just the size of the first part. + (nnimap-request-move-article): When moving an article from nnimap, + request the article first so the accepting form has an article to + accept. Reported by Dan Christensen. + (nnimap-command): Make sure that the error message doesn't error out. + +2010-09-20 David Edmondson (tiny change) + + * nnimap.el (nnimap-request-set-mark): Don't wait for a response when + we haven't requested anything. + +2010-09-20 Lars Magne Ingebrigtsen + + * nnimap.el (nnimap-fetch-inbox): Use "[]" as the parameter instead of + "". Fix found by Andrew Cohen. + + * mail-parse.el (mail-header-encode-parameter): Use -encode-parameter + instead of -encode-string. + 2010-09-20 Katsumi Yamaoka * gnus-html.el (gnus-html-image-fetched): Pass arg to kill-buffer. === modified file 'lisp/gnus/mail-parse.el' --- lisp/gnus/mail-parse.el 2010-09-20 00:36:54 +0000 +++ lisp/gnus/mail-parse.el 2010-09-20 23:08:33 +0000 @@ -45,7 +45,7 @@ (defalias 'mail-header-parse-content-type 'rfc2231-parse-qp-string) (defalias 'mail-header-parse-content-disposition 'rfc2231-parse-qp-string) (defalias 'mail-content-type-get 'rfc2231-get-value) -(defalias 'mail-header-encode-parameter 'rfc2045-encode-string) +(defalias 'mail-header-encode-parameter 'rfc2047-encode-parameter) (defalias 'mail-header-remove-comments 'ietf-drums-remove-comments) (defalias 'mail-header-remove-whitespace 'ietf-drums-remove-whitespace) === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-09-20 00:36:54 +0000 +++ lisp/gnus/nnimap.el 2010-09-20 23:08:33 +0000 @@ -137,7 +137,7 @@ (defun nnimap-transform-headers () (goto-char (point-min)) - (let (article bytes lines) + (let (article bytes lines size) (block nil (while (not (eobp)) (while (not (looking-at "^\\* [0-9]+ FETCH.*UID \\([0-9]+\\)")) @@ -148,6 +148,12 @@ bytes (nnimap-get-length) lines nil) (beginning-of-line) + (setq size + (and (re-search-forward "RFC822.SIZE \\([0-9]+\\)" + (line-end-position) + t) + (match-string 1))) + (beginning-of-line) (when (search-forward "BODYSTRUCTURE" (line-end-position) t) (let ((structure (ignore-errors (read (current-buffer))))) (while (and (consp structure) @@ -157,7 +163,8 @@ (delete-region (line-beginning-position) (line-end-position)) (insert (format "211 %s Article retrieved." article)) (forward-line 1) - (insert (format "Chars: %d\n" bytes)) + (when size + (insert (format "Chars: %s\n" size))) (when lines (insert (format "Lines: %s\n" lines))) (re-search-forward "^\r$") @@ -384,9 +391,9 @@ (nreverse parts))) (deffoo nnimap-request-group (group &optional server dont-check info) - (with-current-buffer nntp-server-buffer - (let ((result (nnimap-possibly-change-group group server)) - articles active marks high low) + (let ((result (nnimap-possibly-change-group group server)) + articles active marks high low) + (with-current-buffer nntp-server-buffer (when result (if (and dont-check (setq active (nth 2 (assoc group nnimap-current-infos)))) @@ -424,6 +431,11 @@ low high group)))) t))) +(deffoo nnimap-request-delete-group (group &optional force server) + (when (nnimap-possibly-change-group nil server) + (with-current-buffer (nnimap-buffer) + (car (nnimap-command "DELETE %S" (utf7-encode group)))))) + (defun nnimap-get-flags (spec) (let ((articles nil) elems) @@ -460,10 +472,11 @@ (nnimap-find-article-by-message-id internal-move-group message-id)))) (with-temp-buffer - (let ((result (eval accept-form))) - (when result - (nnimap-delete-article article) - result))))))) + (when (nnimap-request-article article group server (current-buffer)) + (let ((result (eval accept-form))) + (when result + (nnimap-delete-article article) + result)))))))) (deffoo nnimap-request-expire-articles (articles group &optional server force) (cond @@ -530,7 +543,8 @@ (mapconcat #'identity flags " "))))))) ;; Wait for the last command to complete to avoid later ;; syncronisation problems with the stream. - (nnimap-wait-for-response sequence))))) + (when sequence + (nnimap-wait-for-response sequence)))))) (deffoo nnimap-request-accept-article (group &optional server last) (when (nnimap-possibly-change-group nil server) @@ -863,7 +877,9 @@ (if (equal (caar response) "OK") (cons t response) (nnheader-report 'nnimap "%s" - (mapconcat #'identity (car response) " ")) + (mapconcat (lambda (a) + (format "%s" a)) + (car response) " ")) nil))) (defun nnimap-get-response (sequence) @@ -972,7 +988,7 @@ "BODY.PEEK[HEADER] BODY.PEEK" "RFC822.PEEK")) (if nnimap-split-download-body-default - "" + "[]" "[1]"))) t)) ------------------------------------------------------------ revno: 101512 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2010-09-21 00:42:47 +0200 message: * lisp/textmodes/reftex-parse.el (reftex-what-macro) (reftex-context-substring): Let-bind forward-sexp-function to nil since we don't need/want to treat \begin...\end as a block. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-20 21:45:09 +0000 +++ lisp/ChangeLog 2010-09-20 22:42:47 +0000 @@ -1,5 +1,9 @@ 2010-09-20 Stefan Monnier + * textmodes/reftex-parse.el (reftex-what-macro) + (reftex-context-substring): Let-bind forward-sexp-function to nil + since we don't need/want to treat \begin...\end as a block (bug#7053). + * emacs-lisp/lisp.el (up-list): Don't do nothing silently. * simple.el (blink-matching-open): Use syntax-class. === modified file 'lisp/textmodes/reftex-parse.el' --- lisp/textmodes/reftex-parse.el 2010-09-20 13:27:59 +0000 +++ lisp/textmodes/reftex-parse.el 2010-09-20 22:42:47 +0000 @@ -385,7 +385,7 @@ (defun reftex-section-info (file) ;; Return a section entry for the current match. - ;; Carefull: This function expects the match-data to be still in place! + ;; Careful: This function expects the match-data to be still in place! (let* ((marker (set-marker (make-marker) (1- (match-beginning 3)))) (macro (reftex-match-string 3)) (prefix (save-match-data @@ -778,13 +778,15 @@ (narrow-to-region (max (point-min) bound) (point-max)) ;; move back out of the current parenthesis (while (condition-case nil - (progn (up-list -1) t) + (let ((forward-sexp-function nil)) + (up-list -1) t) (error nil)) (setq cnt 1 cnt-opt 0) ;; move back over any touching sexps (while (and (reftex-move-to-previous-arg bound) (condition-case nil - (progn (backward-sexp) t) + (let ((forward-sexp-function nil)) + (backward-sexp) t) (error nil))) (if (eq (following-char) ?\[) (incf cnt-opt)) (incf cnt)) @@ -965,15 +967,14 @@ (if (re-search-forward "\\\\end{" nil t) (match-beginning 0) (point-max)))))) - ((or (= (preceding-char) ?\{) - (= (preceding-char) ?\[)) + ((memq (preceding-char) '(?\{ ?\[)) ;; Inside a list - get only the list. (buffer-substring-no-properties (point) (min (+ (point) 150) (point-max) (condition-case nil - (progn + (let ((forward-sexp-function nil)) ;Unneeded fanciness. (up-list 1) (1- (point))) (error (point-max)))))) ------------------------------------------------------------ revno: 101511 committer: Dan Nicolaescu branch nick: trunk timestamp: Tue 2010-09-21 01:35:37 +0300 message: Link temacs using $(CC) not $(LD). * configure.in (LINKER): Rename to LD_FIRSTFLAG, do not include $(CC). * src/Makefile.in (temacs): Link using $(CC) not $(LD). (LD_FIRSTFLAG): Define using autoconf. (LD): Remove. diff: === modified file 'configure' --- configure 2010-09-14 00:04:48 +0000 +++ configure 2010-09-20 22:35:37 +0000 @@ -599,7 +599,7 @@ TOOLTIP_SUPPORT MOUSE_SUPPORT LIB_GCC -LINKER +LD_FIRSTFLAG LD_SWITCH_SYSTEM_TEMACS POST_ALLOC_OBJ PRE_ALLOC_OBJ @@ -14703,7 +14703,7 @@ -LINKER= +LD_FIRSTFLAG= ORDINARY_LINK= case "$opsys" in ## gnu: GNU needs its own crt0. @@ -14713,14 +14713,14 @@ ## library search parth, i.e. it won't search /usr/lib for libc and ## friends. Using -nostartfiles instead avoids this problem, and ## will also work on earlier NetBSD releases. - netbsd|openbsd) LINKER="\$(CC) -nostartfiles" ;; + netbsd|openbsd) LD_FIRSTFLAG="-nostartfiles" ;; ## macpcc: NAKAJI Hiroyuki says ## MkLinux/LinuxPPC needs this. ## ibms390x only supports opsys = gnu-linux so it can be added here. gnu-*) case "$machine" in - macppc|ibms390x) LINKER="\$(CC) -nostdlib" ;; + macppc|ibms390x) LD_FIRSTFLAG="-nostdlib" ;; esac ;; esac @@ -14728,14 +14728,14 @@ if test "x$ORDINARY_LINK" = "xyes"; then - LINKER="\$(CC)" + LD_FIRSTFLAG="" $as_echo "#define ORDINARY_LINK 1" >>confdefs.h -## The system files defining neither ORDINARY_LINK nor LINKER are: +## The system files defining neither ORDINARY_LINK nor LD_FIRSTFLAG are: ## freebsd, gnu-* not on macppc|ibms390x. -elif test "x$GCC" = "xyes" && test "x$LINKER" = "x"; then +elif test "x$GCC" = "xyes" && test "x$LD_FIRSTFLAG" = "x"; then ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure ## places that are difficult to figure out at make time. Fortunately, @@ -14745,18 +14745,17 @@ ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from ## searching for libraries in its internal directories, so we have to ## ask GCC explicitly where to find libgcc.a (LIB_GCC below). - LINKER="\$(CC) -nostdlib" + LD_FIRSTFLAG="-nostdlib" fi -test "x$LINKER" = "x" && LINKER=ld ## FIXME? What setting of EDIT_LDFLAGS should this have? -test "$NS_IMPL_GNUSTEP" = "yes" && LINKER="\$(CC) -rdynamic" +test "$NS_IMPL_GNUSTEP" = "yes" && LD_FIRSTFLAG="-rdynamic" ## FIXME? The logic here is not precisely the same as that above. -## There is no check here for a pre-defined LINKER. +## There is no check here for a pre-defined LD_FIRSTFLAG. ## Should we only be setting LIB_GCC if LD ~ -nostdlib? LIB_GCC= if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then === modified file 'configure.in' --- configure.in 2010-09-13 19:50:30 +0000 +++ configure.in 2010-09-20 22:35:37 +0000 @@ -3373,7 +3373,7 @@ AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) -LINKER= +LD_FIRSTFLAG= ORDINARY_LINK= case "$opsys" in ## gnu: GNU needs its own crt0. @@ -3383,14 +3383,14 @@ ## library search parth, i.e. it won't search /usr/lib for libc and ## friends. Using -nostartfiles instead avoids this problem, and ## will also work on earlier NetBSD releases. - netbsd|openbsd) LINKER="\$(CC) -nostartfiles" ;; + netbsd|openbsd) LD_FIRSTFLAG="-nostartfiles" ;; ## macpcc: NAKAJI Hiroyuki says ## MkLinux/LinuxPPC needs this. ## ibms390x only supports opsys = gnu-linux so it can be added here. gnu-*) case "$machine" in - macppc|ibms390x) LINKER="\$(CC) -nostdlib" ;; + macppc|ibms390x) LD_FIRSTFLAG="-nostdlib" ;; esac ;; esac @@ -3398,12 +3398,12 @@ if test "x$ORDINARY_LINK" = "xyes"; then - LINKER="\$(CC)" + LD_FIRSTFLAG="" AC_DEFINE(ORDINARY_LINK, 1, [Define if the C compiler is the linker.]) -## The system files defining neither ORDINARY_LINK nor LINKER are: +## The system files defining neither ORDINARY_LINK nor LD_FIRSTFLAG are: ## freebsd, gnu-* not on macppc|ibms390x. -elif test "x$GCC" = "xyes" && test "x$LINKER" = "x"; then +elif test "x$GCC" = "xyes" && test "x$LD_FIRSTFLAG" = "x"; then ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure ## places that are difficult to figure out at make time. Fortunately, @@ -3413,18 +3413,17 @@ ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from ## searching for libraries in its internal directories, so we have to ## ask GCC explicitly where to find libgcc.a (LIB_GCC below). - LINKER="\$(CC) -nostdlib" + LD_FIRSTFLAG="-nostdlib" fi -test "x$LINKER" = "x" && LINKER=ld ## FIXME? What setting of EDIT_LDFLAGS should this have? -test "$NS_IMPL_GNUSTEP" = "yes" && LINKER="\$(CC) -rdynamic" +test "$NS_IMPL_GNUSTEP" = "yes" && LD_FIRSTFLAG="-rdynamic" -AC_SUBST(LINKER) +AC_SUBST(LD_FIRSTFLAG) ## FIXME? The logic here is not precisely the same as that above. -## There is no check here for a pre-defined LINKER. +## There is no check here for a pre-defined LD_FIRSTFLAG. ## Should we only be setting LIB_GCC if LD ~ -nostdlib? LIB_GCC= if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then === modified file 'src/Makefile.in' --- src/Makefile.in 2010-09-10 16:44:35 +0000 +++ src/Makefile.in 2010-09-20 22:35:37 +0000 @@ -35,6 +35,7 @@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ +LD_FIRSTFLAG=@LD_FIRSTFLAG@ EXEEXT = @EXEEXT@ version = @version@ # Substitute an assignment for the MAKE variable, because @@ -124,8 +125,6 @@ ## Where to find libgcc.a, if using gcc and necessary. LIB_GCC=@LIB_GCC@ -LD=@LINKER@ - ## May use $CRT_DIR. LIB_STANDARD=@LIB_STANDARD@ @@ -646,7 +645,7 @@ temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} - $(LD) ${TEMACS_LDFLAGS} ${TEMACS_LDFLAGS2} \ + $(CC) $(LD_FIRSTFLAG) ${TEMACS_LDFLAGS} ${TEMACS_LDFLAGS2} \ -o temacs ${START_FILES} ${obj} ${otherobj} ${LIBES} ## The following oldxmenu-related rules are only (possibly) used if ------------------------------------------------------------ revno: 101510 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-09-20 23:45:09 +0200 message: * lisp/simple.el (blink-matching-open): Use syntax-class. * lisp/emacs-lisp/lisp.el (up-list): Don't do nothing silently. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-20 14:57:01 +0000 +++ lisp/ChangeLog 2010-09-20 21:45:09 +0000 @@ -1,5 +1,9 @@ 2010-09-20 Stefan Monnier + * emacs-lisp/lisp.el (up-list): Don't do nothing silently. + + * simple.el (blink-matching-open): Use syntax-class. + * progmodes/pascal.el (pascal-mode): Use define-derived-mode. Set invisibility spec for pascal's outline mode. (pascal-outline-change): Clean up calling convention. === modified file 'lisp/emacs-lisp/lisp.el' --- lisp/emacs-lisp/lisp.el 2010-08-29 16:17:13 +0000 +++ lisp/emacs-lisp/lisp.el 2010-09-20 21:45:09 +0000 @@ -141,15 +141,19 @@ This command assumes point is not in a string or comment." (interactive "^p") (or arg (setq arg 1)) - (let ((inc (if (> arg 0) 1 -1))) + (let ((inc (if (> arg 0) 1 -1)) + pos) (while (/= arg 0) - (if forward-sexp-function + (if (null forward-sexp-function) + (goto-char (or (scan-lists (point) inc 1) (buffer-end arg))) (condition-case err - (while (let ((pos (point))) + (while (progn (setq pos (point)) (forward-sexp inc) (/= (point) pos))) (scan-error (goto-char (nth 2 err)))) - (goto-char (or (scan-lists (point) inc 1) (buffer-end arg)))) + (if (= (point) pos) + (signal 'scan-error + (list "Unbalanced parentheses" (point) (point))))) (setq arg (- arg inc))))) (defun kill-sexp (&optional arg) === modified file 'lisp/simple.el' --- lisp/simple.el 2010-09-14 14:41:53 +0000 +++ lisp/simple.el 2010-09-20 21:45:09 +0000 @@ -5525,9 +5525,10 @@ ;; backward-sexp skips backward over prefix chars, ;; so move back to the matching paren. (while (and (< (point) (1- oldpos)) - (let ((code (car (syntax-after (point))))) - (or (eq (logand 65536 code) 6) - (eq (logand 1048576 code) 1048576)))) + (let ((code (syntax-after (point)))) + (or (eq (syntax-class code) 6) + (eq (logand 1048576 (car code)) + 1048576)))) (forward-char 1)) (point)) (error nil)))))) ------------------------------------------------------------ revno: 101509 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-09-20 16:57:01 +0200 message: * lisp/progmodes/pascal.el (pascal-mode): Use define-derived-mode. Set invisibility spec for pascal's outline mode. (pascal-outline-change): Clean up calling convention. (pascal-show-all, pascal-hide-other-defuns): Update callers. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-20 14:22:16 +0000 +++ lisp/ChangeLog 2010-09-20 14:57:01 +0000 @@ -1,5 +1,10 @@ 2010-09-20 Stefan Monnier + * progmodes/pascal.el (pascal-mode): Use define-derived-mode. + Set invisibility spec for pascal's outline mode. + (pascal-outline-change): Clean up calling convention. + (pascal-show-all, pascal-hide-other-defuns): Update callers. + * progmodes/prolog.el (prolog-smie-forward-token) (prolog-smie-backward-token): New functions. (prolog-mode-variables): Use them to parse "!," correctly. === modified file 'lisp/progmodes/pascal.el' --- lisp/progmodes/pascal.el 2010-01-13 08:35:10 +0000 +++ lisp/progmodes/pascal.el 2010-09-20 14:57:01 +0000 @@ -223,7 +223,7 @@ "*List of contexts where auto lineup of :'s or ='s should be done. Elements can be of type: 'paramlist', 'declaration' or 'case', which will do auto lineup in parameterlist, declarations or case-statements -respectively. The word 'all' will do all lineups. '(case paramlist) for +respectively. The word 'all' will do all lineups. '(case paramlist) for instance will do lineup in case-statements and parameterlist, while '(all) will do all lineups." :type '(set :extra-offset 8 @@ -311,7 +311,7 @@ ;;;###autoload -(defun pascal-mode () +(define-derived-mode pascal-mode prog-mode "Pascal" "Major mode for editing Pascal code. \\ TAB indents for Pascal code. Delete converts tabs to spaces as it moves back. @@ -334,60 +334,47 @@ Variables controlling indentation/edit style: - pascal-indent-level (default 3) + `pascal-indent-level' (default 3) Indentation of Pascal statements with respect to containing block. - pascal-case-indent (default 2) + `pascal-case-indent' (default 2) Indentation for case statements. - pascal-auto-newline (default nil) + `pascal-auto-newline' (default nil) Non-nil means automatically newline after semicolons and the punctuation mark after an end. - pascal-indent-nested-functions (default t) + `pascal-indent-nested-functions' (default t) Non-nil means nested functions are indented. - pascal-tab-always-indent (default t) + `pascal-tab-always-indent' (default t) Non-nil means TAB in Pascal mode should always reindent the current line, regardless of where in the line point is when the TAB command is used. - pascal-auto-endcomments (default t) + `pascal-auto-endcomments' (default t) Non-nil means a comment { ... } is set after the ends which ends cases and functions. The name of the function or case will be set between the braces. - pascal-auto-lineup (default t) + `pascal-auto-lineup' (default t) List of contexts where auto lineup of :'s or ='s should be done. -See also the user variables pascal-type-keywords, pascal-start-keywords and -pascal-separator-keywords. +See also the user variables `pascal-type-keywords', `pascal-start-keywords' and +`pascal-separator-keywords'. Turning on Pascal mode calls the value of the variable pascal-mode-hook with no args, if that value is non-nil." - (interactive) - (kill-all-local-variables) - (use-local-map pascal-mode-map) - (setq major-mode 'pascal-mode) - (setq mode-name "Pascal") - (setq local-abbrev-table pascal-mode-abbrev-table) - (set-syntax-table pascal-mode-syntax-table) - (make-local-variable 'indent-line-function) - (setq indent-line-function 'pascal-indent-line) - (make-local-variable 'comment-indent-function) - (setq comment-indent-function 'pascal-indent-comment) - (make-local-variable 'parse-sexp-ignore-comments) - (setq parse-sexp-ignore-comments nil) - (make-local-variable 'blink-matching-paren-dont-ignore-comments) - (setq blink-matching-paren-dont-ignore-comments t) - (make-local-variable 'case-fold-search) - (setq case-fold-search t) - (make-local-variable 'comment-start) - (setq comment-start "{") - (make-local-variable 'comment-start-skip) - (setq comment-start-skip "(\\*+ *\\|{ *") - (make-local-variable 'comment-end) - (setq comment-end "}") + (set (make-local-variable 'local-abbrev-table) pascal-mode-abbrev-table) + (set (make-local-variable 'indent-line-function) 'pascal-indent-line) + (set (make-local-variable 'comment-indent-function) 'pascal-indent-comment) + (set (make-local-variable 'parse-sexp-ignore-comments) nil) + (set (make-local-variable 'blink-matching-paren-dont-ignore-comments) t) + (set (make-local-variable 'case-fold-search) t) + (set (make-local-variable 'comment-start) "{") + (set (make-local-variable 'comment-start-skip) "(\\*+ *\\|{ *") + (set (make-local-variable 'comment-end) "}") ;; Font lock support - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '(pascal-font-lock-keywords nil t)) + (set (make-local-variable 'font-lock-defaults) + '(pascal-font-lock-keywords nil t)) ;; Imenu support - (make-local-variable 'imenu-generic-expression) - (setq imenu-generic-expression pascal-imenu-generic-expression) - (setq imenu-case-fold-search t) - (run-mode-hooks 'pascal-mode-hook)) + (set (make-local-variable 'imenu-generic-expression) + pascal-imenu-generic-expression) + (set (make-local-variable 'imenu-case-fold-search) t) + ;; Pascal-mode's own hide/show support. + (add-to-invisibility-spec '(pascal . t))) @@ -1478,18 +1465,12 @@ (unless pascal-outline-mode (pascal-show-all))) -(defun pascal-outline-change (b e pascal-flag) - (save-excursion - ;; This used to use selective display so the boundaries used by the - ;; callers didn't have to be precise, since it just looked for \n or \^M - ;; and switched them. - (goto-char b) (setq b (line-end-position)) - (goto-char e) (setq e (line-end-position))) +(defun pascal-outline-change (b e hide) (when (> e b) ;; We could try and optimize this in the case where the region is ;; already hidden. But I'm not sure it's worth the trouble. (remove-overlays b e 'invisible 'pascal) - (when (eq pascal-flag ?\^M) + (when hide (let ((ol (make-overlay b e nil t nil))) (overlay-put ol 'invisible 'pascal) (overlay-put ol 'evaporate t))))) @@ -1497,7 +1478,7 @@ (defun pascal-show-all () "Show all of the text in the buffer." (interactive) - (pascal-outline-change (point-min) (point-max) ?\n)) + (pascal-outline-change (point-min) (point-max) nil)) (defun pascal-hide-other-defuns () "Show only the current defun." @@ -1505,42 +1486,45 @@ (save-excursion (let ((beg (progn (if (not (looking-at "\\(function\\|procedure\\)\\>")) (pascal-beg-of-defun)) - (point))) + (line-beginning-position))) (end (progn (pascal-end-of-defun) (backward-sexp 1) - (search-forward "\n\\|\^M" nil t) - (point))) + (line-beginning-position 2))) (opoint (point-min))) + ;; BEG at BOL. + ;; OPOINT at EOL. + ;; END at BOL. (goto-char (point-min)) ;; Hide all functions before current function - (while (re-search-forward "^\\(function\\|procedure\\)\\>" beg 'move) - (pascal-outline-change opoint (1- (match-beginning 0)) ?\^M) - (setq opoint (point)) + (while (re-search-forward "^[ \t]*\\(function\\|procedure\\)\\>" + beg 'move) + (pascal-outline-change opoint (line-end-position 0) t) + (setq opoint (line-end-position)) ;; Functions may be nested (if (> (progn (pascal-end-of-defun) (point)) beg) (goto-char opoint))) (if (> beg opoint) - (pascal-outline-change opoint (1- beg) ?\^M)) + (pascal-outline-change opoint (1- beg) t)) ;; Show current function - (pascal-outline-change beg end ?\n) + (pascal-outline-change (1- beg) end nil) ;; Hide nested functions (forward-char 1) (while (re-search-forward "^\\(function\\|procedure\\)\\>" end 'move) - (setq opoint (point)) + (setq opoint (line-end-position)) (pascal-end-of-defun) - (pascal-outline-change opoint (point) ?\^M)) + (pascal-outline-change opoint (line-end-position) t)) (goto-char end) (setq opoint end) ;; Hide all function after current function (while (re-search-forward "^\\(function\\|procedure\\)\\>" nil 'move) - (pascal-outline-change opoint (1- (match-beginning 0)) ?\^M) - (setq opoint (point)) + (pascal-outline-change opoint (line-end-position 0) t) + (setq opoint (line-end-position)) (pascal-end-of-defun)) - (pascal-outline-change opoint (point-max) ?\^M) + (pascal-outline-change opoint (point-max) t) ;; Hide main program (if (< (progn (forward-line -1) (point)) end) @@ -1548,7 +1532,7 @@ (goto-char beg) (pascal-end-of-defun) (backward-sexp 1) - (pascal-outline-change (point) (point-max) ?\^M)))))) + (pascal-outline-change (line-end-position) (point-max) t)))))) (defun pascal-outline-next-defun () "Move to next function/procedure, hiding all others." === modified file 'test/ChangeLog' --- test/ChangeLog 2010-09-18 16:21:16 +0000 +++ test/ChangeLog 2010-09-20 14:57:01 +0000 @@ -1,3 +1,7 @@ +2010-09-20 Stefan Monnier + + * indent/prolog.prolog: Use normal spacing around !. + 2010-09-18 Stefan Monnier * indent/octave.m: Remove one more `fixindent'. Use `end'. @@ -22,7 +26,8 @@ (icalendar-testsuite--do-test-export): Code formatting. (icalendar-testsuite--test-parse-vtimezone): Doc fix. (icalendar-testsuite--do-test-import) - (icalendar-testsuite--do-test-cycle): Use icalendar-testsuite--compare-strings + (icalendar-testsuite--do-test-cycle): + Use icalendar-testsuite--compare-strings (icalendar-testsuite--run-import-tests): Comment added. (icalendar-testsuite--run-import-tests) (icalendar-testsuite--run-real-world-tests): Fix expected results. ------------------------------------------------------------ revno: 101508 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-09-20 16:22:16 +0200 message: * lisp/progmodes/prolog.el (prolog-smie-forward-token) (prolog-smie-backward-token): New functions. (prolog-mode-variables): Use them to parse "!," correctly. Set up smie-blink-matching for ".". * test/indent/prolog.prolog: Use normal spacing around !. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-20 14:15:27 +0000 +++ lisp/ChangeLog 2010-09-20 14:22:16 +0000 @@ -1,5 +1,10 @@ 2010-09-20 Stefan Monnier + * progmodes/prolog.el (prolog-smie-forward-token) + (prolog-smie-backward-token): New functions. + (prolog-mode-variables): Use them to parse "!," correctly. + Set up smie-blink-matching for ".". + * textmodes/ispell.el (ispell-start, ispell-end): Rename from `start' and `end'. (ispell-region, ispell-process-line): Update users. === modified file 'lisp/progmodes/prolog.el' --- lisp/progmodes/prolog.el 2010-08-18 11:01:15 +0000 +++ lisp/progmodes/prolog.el 2010-09-20 14:22:16 +0000 @@ -99,12 +99,36 @@ (defvar prolog-mode-abbrev-table nil) (define-abbrev-table 'prolog-mode-abbrev-table ()) +(defun prolog-smie-forward-token () + (forward-comment (point-max)) + (buffer-substring-no-properties + (point) + (progn (cond + ((looking-at "[!;]") (forward-char 1)) + ((not (zerop (skip-chars-forward "#&*+-./:<=>?@\\^`~")))) + ((not (zerop (skip-syntax-forward "w_'")))) + ;; In case of non-ASCII punctuation. + ((not (zerop (skip-syntax-forward "."))))) + (point)))) + +(defun prolog-smie-backward-token () + (forward-comment (- (point-max))) + (buffer-substring-no-properties + (point) + (progn (cond + ((memq (char-before) '(?! ?\;)) (forward-char -1)) + ((not (zerop (skip-chars-backward "#&*+-./:<=>?@\\^`~")))) + ((not (zerop (skip-syntax-backward "w_'")))) + ;; In case of non-ASCII punctuation. + ((not (zerop (skip-syntax-backward "."))))) + (point)))) + (defconst prolog-smie-op-levels ;; Rather than construct the operator levels table from the BNF, ;; we directly provide the operator precedences from GNU Prolog's - ;; manual. The only problem is that GNU Prolog's manual uses - ;; precedence levels in the opposite sense (higher numbers bind less - ;; tightly) than SMIE, so we use negative numbers. + ;; manual (7.14.10 op/3). The only problem is that GNU Prolog's + ;; manual uses precedence levels in the opposite sense (higher + ;; numbers bind less tightly) than SMIE, so we use negative numbers. '(("." -10000 -10000) (":-" -1200 -1200) ("-->" -1200 -1200) @@ -162,9 +186,18 @@ (make-local-variable 'imenu-generic-expression) (setq imenu-generic-expression '((nil "^\\sw+" 0))) (smie-setup prolog-smie-op-levels prolog-smie-indent-rules) + (set (make-local-variable 'smie-forward-token-function) + #'prolog-smie-forward-token) + (set (make-local-variable 'smie-backward-token-function) + #'prolog-smie-backward-token) (set (make-local-variable 'forward-sexp-function) 'smie-forward-sexp-command) (set (make-local-variable 'smie-indent-basic) prolog-indent-width) + (set (make-local-variable 'smie-blink-matching-triggers) '(?.)) + (set (make-local-variable 'smie-closer-alist) '((t . "."))) + (add-hook 'post-self-insert-hook #'smie-blink-matching-open 'append 'local) + ;; There's no real closer in Prolog anyway. + (set (make-local-variable 'smie-blink-matching-inners) t) (make-local-variable 'comment-start) (setq comment-start "%") (make-local-variable 'comment-start-skip) === modified file 'test/indent/prolog.prolog' --- test/indent/prolog.prolog 2010-06-02 20:13:11 +0000 +++ test/indent/prolog.prolog 2010-09-20 14:22:16 +0000 @@ -150,7 +150,7 @@ %% instantiate(+X, +T, -E) %% Utilise la variable X de type T. Le résultat E est X auquel on ajoute %% tous les arguments implicites (de valeur inconnue). -instantiate(X, T, X) :- var(T), ! . +instantiate(X, T, X) :- var(T), !. instantiate(X, forall(_, _, T), app(E, _)) :- !, instantiate(X, T, E). instantiate(X, _, X). ------------------------------------------------------------ revno: 101507 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-09-20 16:15:27 +0200 message: * lisp/textmodes/ispell.el (ispell-start, ispell-end): Rename from `start' and `end'. (ispell-region, ispell-process-line): Update users. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-20 13:27:59 +0000 +++ lisp/ChangeLog 2010-09-20 14:15:27 +0000 @@ -1,5 +1,9 @@ 2010-09-20 Stefan Monnier + * textmodes/ispell.el (ispell-start, ispell-end): Rename from `start' + and `end'. + (ispell-region, ispell-process-line): Update users. + * textmodes/reftex-parse.el (reftex-what-macro): Don't hardcode point-min==1. === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2010-09-20 11:53:42 +0000 +++ lisp/textmodes/ispell.el 2010-09-20 14:15:27 +0000 @@ -2816,7 +2816,11 @@ (setq ispell-current-dictionary dict ispell-current-personal-dictionary pdict)))) -;;; Spelling of comments are checked when ispell-check-comments is non-nil. +;; Avoid error messages when compiling for these dynamic variables. +(defvar ispell-start) +(defvar ispell-end) + +;; Spelling of comments are checked when ispell-check-comments is non-nil. ;;;###autoload (defun ispell-region (reg-start reg-end &optional recheckp shift) @@ -2893,18 +2897,20 @@ (if (marker-position skip-region-start) (min skip-region-start ispell-region-end) (marker-position ispell-region-end)))) - (let* ((start (point)) - (end (save-excursion (end-of-line) (min (point) reg-end))) - (string (ispell-get-line start end in-comment))) + (let* ((ispell-start (point)) + (ispell-end (save-excursion + (end-of-line) (min (point) reg-end))) + (string (ispell-get-line + ispell-start ispell-end in-comment))) (if in-comment ; account for comment chars added - (setq start (- start (length in-comment)) + (setq ispell-start (- ispell-start (length in-comment)) in-comment nil)) - (setq end (point)) ; "end" tracks region retrieved. + (setq ispell-end (point)) ; "end" tracks region retrieved. (if string ; there is something to spell check! ;; (special start end) (setq shift (ispell-process-line string (and recheckp shift)))) - (goto-char end))))) + (goto-char ispell-end))))) (if ispell-quit nil (or shift 0))) @@ -3136,17 +3142,13 @@ (point) (+ (point) len)) coding))))) -;; Avoid error messages when compiling for these dynamic variables. -;; FIXME: dynamically scoped vars should have an "ispell-" prefix. -(defvar start) -(defvar end) - (defun ispell-process-line (string shift) "Send STRING, a line of text, to ispell and processes the result. This will modify the buffer for spelling errors. -Requires variables START and END to be defined in its lexical scope. +Requires variables ISPELL-START and ISPELL-END to be defined in its +dynamic scope. Returns the sum SHIFT due to changes in word replacements." - ;;(declare special start end) + ;;(declare special ispell-start ispell-end) (let (poss accept-list) (if (not (numberp shift)) (setq shift 0)) @@ -3169,10 +3171,10 @@ ;; Markers can move with highlighting! This destroys ;; end of region markers line-end and ispell-region-end (let ((word-start - (copy-marker (+ start ispell-offset (car (cdr poss))))) + (copy-marker (+ ispell-start ispell-offset (car (cdr poss))))) (word-len (length (car poss))) - (line-end (copy-marker end)) - (line-start (copy-marker start)) + (line-end (copy-marker ispell-end)) + (line-start (copy-marker ispell-start)) recheck-region replace) (goto-char word-start) ;; Adjust the horizontal scroll & point @@ -3279,11 +3281,12 @@ (file-name-nondirectory ispell-program-name) (or ispell-current-dictionary "default")))) (sit-for 0) - (setq start (marker-position line-start) - end (marker-position line-end)) + (setq ispell-start (marker-position line-start) + ispell-end (marker-position line-end)) ;; Adjust markers when end of region lost from highlighting. - (if (and (not recheck-region) (< end (+ word-start word-len))) - (setq end (+ word-start word-len))) + (if (and (not recheck-region) + (< ispell-end (+ word-start word-len))) + (setq ispell-end (+ word-start word-len))) (if (= word-start ispell-region-end) (set-marker ispell-region-end (+ word-start word-len))) ;; going out of scope - unneeded ------------------------------------------------------------ revno: 101506 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-09-20 15:27:59 +0200 message: * lisp/textmodes/reftex-parse.el (reftex-what-macro): Don't hardcode point-min==1. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-20 11:53:42 +0000 +++ lisp/ChangeLog 2010-09-20 13:27:59 +0000 @@ -1,5 +1,8 @@ 2010-09-20 Stefan Monnier + * textmodes/reftex-parse.el (reftex-what-macro): Don't hardcode + point-min==1. + * textmodes/ispell.el: Fix commenting convention. (ispell-parse-output): Simplify, use push. (ispell-region): Use match-string-no-properties. === modified file 'lisp/textmodes/reftex-parse.el' --- lisp/textmodes/reftex-parse.el 2010-08-29 16:17:13 +0000 +++ lisp/textmodes/reftex-parse.el 2010-09-20 13:27:59 +0000 @@ -775,7 +775,7 @@ pos cmd-list cmd cnt cnt-opt entry) (save-restriction (save-excursion - (narrow-to-region (max 1 bound) (point-max)) + (narrow-to-region (max (point-min) bound) (point-max)) ;; move back out of the current parenthesis (while (condition-case nil (progn (up-list -1) t) ------------------------------------------------------------ revno: 101505 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-09-20 13:53:42 +0200 message: * lisp/textmodes/ispell.el: Fix commenting convention. (ispell-parse-output): Simplify, use push. (ispell-region): Use match-string-no-properties. (ispell-begin-skip-region-regexp): Use mapconcat to simplify. (ispell-minor-mode): Use define-minor-mode. (ispell-message): Remove unused var `skip-regexp'. (ispell-add-per-file-word-list): Use dynamic let-binding. Try and use the proper comment marker. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-20 11:20:38 +0000 +++ lisp/ChangeLog 2010-09-20 11:53:42 +0000 @@ -1,5 +1,14 @@ 2010-09-20 Stefan Monnier + * textmodes/ispell.el: Fix commenting convention. + (ispell-parse-output): Simplify, use push. + (ispell-region): Use match-string-no-properties. + (ispell-begin-skip-region-regexp): Use mapconcat to simplify. + (ispell-minor-mode): Use define-minor-mode. + (ispell-message): Remove unused var `skip-regexp'. + (ispell-add-per-file-word-list): Use dynamic let-binding. + Try and use the proper comment marker. + * mail/sendmail.el: Fix commenting convention. (sendmail-send-it): Use line-beginning-position. === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2010-09-10 11:20:51 +0000 +++ lisp/textmodes/ispell.el 2010-09-20 11:53:42 +0000 @@ -770,8 +770,8 @@ -;;; The version must be 3.1 or greater for this version of ispell.el -;;; There is an incompatibility between version 3.1.12 and lower versions. +;; The version must be 3.1 or greater for this version of ispell.el +;; There is an incompatibility between version 3.1.12 and lower versions. (defconst ispell-required-version '(3 1 12) "Ispell versions with which this version of ispell.el is known to work.") (defvar ispell-offset -1 @@ -1106,7 +1106,7 @@ (defun ispell-valid-dictionary-list () - "Returns a list of valid dictionaries. + "Return a list of valid dictionaries. The variable `ispell-library-directory' defines the library location." ;; Initialize variables and dictionaries alists for desired spellchecker. ;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs @@ -1269,9 +1269,6 @@ ;;; ********************************************************************** - -;;; This variable contains the current dictionary being used if the ispell -;;; process is running. (defvar ispell-current-dictionary nil "The name of the current dictionary, or nil for the default. This is passed to the ispell process using the `-d' switch and is @@ -1296,6 +1293,7 @@ ;; Return a string decoded from Nth element of the current dictionary. (defun ispell-get-decoded-string (n) + "Get the decoded string in slot N of the descriptor of the current dict." (let* ((slot (or (assoc ispell-current-dictionary ispell-local-dictionary-alist) (assoc ispell-current-dictionary ispell-dictionary-alist) @@ -2151,7 +2149,7 @@ (if (and ispell-use-framepop-p (fboundp 'framepop-display-buffer)) (progn (framepop-display-buffer (get-buffer ispell-choices-buffer)) -;;; (get-buffer-window ispell-choices-buffer t) + ;; (get-buffer-window ispell-choices-buffer t) (select-window (previous-window))) ; *Choices* window ;; standard selection by splitting a small buffer out of this window. (let ((choices-window (get-buffer-window ispell-choices-buffer))) @@ -2546,18 +2544,18 @@ (setq count (string-to-number output) ; get number of misses. output (substring output (1+ (string-match " " output 1))))) (setq offset (string-to-number output)) - (if (eq type ?#) ; No miss or guess list. - (setq output nil) - (setq output (substring output (1+ (string-match " " output 1))))) + (setq output (if (eq type ?#) ; No miss or guess list. + nil + (substring output (1+ (string-match " " output 1))))) (while output (let ((end (string-match ", \\|\\($\\)" output))) ; end of miss/guess. (setq cur-count (1+ cur-count)) (if (> cur-count count) - (setq guess-list (cons (substring output 0 end) guess-list)) - (setq miss-list (cons (substring output 0 end) miss-list))) - (if (match-end 1) ; True only when at end of line. - (setq output nil) ; no more misses or guesses - (setq output (substring output (+ end 2)))))) + (push (substring output 0 end) guess-list) + (push (substring output 0 end) miss-list)) + (setq output (if (match-end 1) ; True only when at end of line. + nil ; No more misses or guesses. + (substring output (+ end 2)))))) ;; return results. Accept word if it was already accepted. ;; adjust offset. (if (member original-word accept-list) @@ -2849,8 +2847,7 @@ (message "searching for regions to skip")) (if (re-search-forward (ispell-begin-skip-region-regexp) reg-end t) (progn - (setq key (buffer-substring-no-properties - (match-beginning 0) (match-end 0))) + (setq key (match-string-no-properties 0)) (set-marker skip-region-start (- (point) (length key))) (goto-char reg-start))) (let (message-log-max) @@ -2944,42 +2941,30 @@ "Return a regexp of the search keys for region skipping. Includes `ispell-skip-region-alist' plus tex, tib, html, and comment keys. Must call after `ispell-buffer-local-parsing' due to dependence on mode." - ;; start with regions generic to all buffers - (let ((skip-regexp (ispell-begin-skip-region ispell-skip-region-alist))) - ;; Comments - (if (and (null ispell-check-comments) comment-start) - (setq skip-regexp (concat (regexp-quote comment-start) "\\|" - skip-regexp))) - (if (and (eq 'exclusive ispell-check-comments) comment-start) - ;; search from end of current comment to start of next comment. - (setq skip-regexp (concat (if (string= "" comment-end) "^" - (regexp-quote comment-end)) - "\\|" skip-regexp))) - ;; tib - (if ispell-skip-tib - (setq skip-regexp (concat ispell-tib-ref-beginning "\\|" skip-regexp))) - ;; html stuff - (if ispell-skip-html - (setq skip-regexp (concat - (ispell-begin-skip-region ispell-html-skip-alists) - "\\|" - skip-regexp))) - ;; tex - (if (eq ispell-parser 'tex) - (setq skip-regexp (concat (ispell-begin-tex-skip-regexp) "\\|" - skip-regexp))) - ;; messages - (if (and ispell-checking-message - (not (eq t ispell-checking-message))) - (setq skip-regexp (concat - (mapconcat (lambda (lst) (car lst)) - ispell-checking-message - "\\|") - "\\|" - skip-regexp))) - - ;; return new regexp - skip-regexp)) + (mapconcat + 'identity + (delq nil + (list + ;; messages + (if (and ispell-checking-message + (not (eq t ispell-checking-message))) + (mapconcat #'car ispell-checking-message "\\|")) + ;; tex + (if (eq ispell-parser 'tex) + (ispell-begin-tex-skip-regexp)) + ;; html stuff + (if ispell-skip-html + (ispell-begin-skip-region ispell-html-skip-alists)) + ;; tib + (if ispell-skip-tib ispell-tib-ref-beginning) + ;; Comments + (if (and (eq 'exclusive ispell-check-comments) comment-start) + ;; search from end of current comment to start of next comment. + (if (string= "" comment-end) "^" (regexp-quote comment-end))) + (if (and (null ispell-check-comments) comment-start) + (regexp-quote comment-start)) + (ispell-begin-skip-region ispell-skip-region-alist))) + "\\|")) (defun ispell-begin-skip-region (skip-alist) @@ -3456,15 +3441,6 @@ ;;; Ispell Minor Mode ;;; ********************************************************************** -(defvar ispell-minor-mode nil - "Non-nil if Ispell minor mode is enabled.") -;; Variable indicating that ispell minor mode is active. -(make-variable-buffer-local 'ispell-minor-mode) - -(or (assq 'ispell-minor-mode minor-mode-alist) - (setq minor-mode-alist - (cons '(ispell-minor-mode " Spell") minor-mode-alist))) - (defvar ispell-minor-keymap (let ((map (make-sparse-keymap))) (define-key map " " 'ispell-minor-check) @@ -3472,14 +3448,8 @@ map) "Keymap used for Ispell minor mode.") -(or (not (boundp 'minor-mode-map-alist)) - (assoc 'ispell-minor-mode minor-mode-map-alist) - (setq minor-mode-map-alist - (cons (cons 'ispell-minor-mode ispell-minor-keymap) - minor-mode-map-alist))) - ;;;###autoload -(defun ispell-minor-mode (&optional arg) +(define-minor-mode ispell-minor-mode "Toggle Ispell minor mode. With prefix argument ARG, turn Ispell minor mode on if ARG is positive, otherwise turn it off. @@ -3489,11 +3459,7 @@ All the buffer-local variables and dictionaries are ignored -- to read them into the running ispell process, type \\[ispell-word] SPC." - (interactive "P") - (setq ispell-minor-mode - (not (or (and (null arg) ispell-minor-mode) - (<= (prefix-numeric-value arg) 0)))) - (force-mode-line-update)) + nil " Spell" ispell-minor-keymap) (defun ispell-minor-check () "Check previous word then continue with the normal binding of this key. @@ -3759,15 +3725,14 @@ (goto-char (point-min)) ;; Select type or skip checking if this is a non-multipart message ;; Point moved to end of buffer if region is encoded. - (if (and mimep (not boundary)) - (let (skip-regexp) ; protect from `ispell-mime-skip-part' + (when (and mimep (not boundary)) (goto-char (point-min)) (re-search-forward "Content-[^ \t]*:" end-of-headers t) (forward-line -1) ; following fn starts one line above (ispell-mime-skip-part nil) ;; if message-text-end region, limit may be less than point. (if (> (point) limit) - (set-marker limit (point))))) + (set-marker limit (point)))) (goto-char (max end-of-headers (point))) (forward-line 1) (setq case-fold-search old-case-fold-search) @@ -3850,7 +3815,7 @@ (sit-for 2)))))))) -;;; Can kill the current ispell process +;; Can kill the current ispell process (defun ispell-buffer-local-dict (&optional no-reload) "Initializes local dictionary and local personal dictionary. @@ -3923,16 +3888,14 @@ (setq ispell-buffer-local-name (buffer-name))) (save-excursion (goto-char (point-min)) - (let ((old-case-fold-search case-fold-search) - line-okay search done found) + (let (line-okay search done found) (while (not done) - (setq case-fold-search nil - search (search-forward ispell-words-keyword nil 'move) + (let ((case-fold-search nil)) + (setq search (search-forward ispell-words-keyword nil 'move) found (or found search) line-okay (< (+ (length word) 1 ; 1 for space after word.. (progn (end-of-line) (current-column))) - 80) - case-fold-search old-case-fold-search) + fill-column))) (if (or (and search line-okay) (null search)) (progn @@ -3941,7 +3904,13 @@ (progn (open-line 1) (unless found (newline)) - (insert (concat comment-start " " ispell-words-keyword)) + (insert (if (fboundp 'comment-padright) + ;; Try and use the proper comment marker, + ;; e.g. ";;" rather than ";". + (comment-padright comment-start + (comment-add nil)) + comment-start) + " " ispell-words-keyword) (if (> (length comment-end) 0) (save-excursion (newline) ------------------------------------------------------------ revno: 101504 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-09-20 14:44:39 +0300 message: Use const for constant arguments. * lwlib/lwlib.h (lw_register_widget, lw_create_widget): * lwlib/lwlib.c (allocate_widget_info, lw_register_widget) (lw_create_widget, separator_table): Use const. diff: === modified file 'lwlib/ChangeLog' --- lwlib/ChangeLog 2010-07-29 04:16:23 +0000 +++ lwlib/ChangeLog 2010-09-20 11:44:39 +0000 @@ -1,3 +1,9 @@ +2010-09-20 Dan Nicolaescu + + * lwlib.h (lw_register_widget, lw_create_widget): + * lwlib.c (allocate_widget_info, lw_register_widget) + (lw_create_widget, separator_table): Use const. + 2010-07-29 Dan Nicolaescu * xlwmenu.c (abort_gracefully): Mark as NO_RETURN. === modified file 'lwlib/lwlib.c' --- lwlib/lwlib.c 2010-07-08 10:29:51 +0000 +++ lwlib/lwlib.c 2010-09-20 11:44:39 +0000 @@ -66,9 +66,9 @@ all_widget_info = NULL; #ifdef USE_MOTIF -char *lwlib_toolkit_type = "motif"; +const char *lwlib_toolkit_type = "motif"; #else -char *lwlib_toolkit_type = "lucid"; +const char *lwlib_toolkit_type = "lucid"; #endif static widget_value *merge_widget_value (widget_value *, @@ -80,7 +80,7 @@ static void free_widget_value_tree (widget_value *); static widget_value *copy_widget_value_tree (widget_value *, change_type); -static widget_info *allocate_widget_info (char *, char *, LWLIB_ID, +static widget_info *allocate_widget_info (const char *, const char *, LWLIB_ID, widget_value *, lw_callback, lw_callback, lw_callback, lw_callback); @@ -249,8 +249,8 @@ } static widget_info * -allocate_widget_info (char* type, - char* name, +allocate_widget_info (const char* type, + const char* name, LWLIB_ID id, widget_value* val, lw_callback pre_activate_cb, @@ -823,8 +823,8 @@ } void -lw_register_widget (char* type, - char* name, +lw_register_widget (const char* type, + const char* name, LWLIB_ID id, widget_value* val, lw_callback pre_activate_cb, @@ -867,7 +867,7 @@ } Widget -lw_create_widget (char* type, char* name, LWLIB_ID id, widget_value* val, +lw_create_widget (const char* type, const char* name, LWLIB_ID id, widget_value* val, Widget parent, Boolean pop_up_p, lw_callback pre_activate_cb, lw_callback selection_cb, lw_callback post_activate_cb, lw_callback highlight_cb) @@ -1326,7 +1326,7 @@ { static struct separator_table { - char *name; + const char *name; enum menu_separator type; } separator_names[] = @@ -1371,7 +1371,7 @@ /* Alternative, more Emacs-style names. */ static struct separator_table { - char *name; + const char *name; enum menu_separator type; } separator_names[] = === modified file 'lwlib/lwlib.h' --- lwlib/lwlib.h 2010-07-07 22:18:28 +0000 +++ lwlib/lwlib.h 2010-09-20 11:44:39 +0000 @@ -132,14 +132,14 @@ typedef void (*lw_callback) (Widget w, LWLIB_ID id, void* data); -void lw_register_widget (char* type, char* name, LWLIB_ID id, +void lw_register_widget (const char* type, const char* name, LWLIB_ID id, widget_value* val, lw_callback pre_activate_cb, lw_callback selection_cb, lw_callback post_activate_cb, lw_callback highlight_cb); Widget lw_get_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p); Widget lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p); -Widget lw_create_widget (char* type, char* name, LWLIB_ID id, +Widget lw_create_widget (const char* type, const char* name, LWLIB_ID id, widget_value* val, Widget parent, Boolean pop_up_p, lw_callback pre_activate_cb, lw_callback selection_cb, ------------------------------------------------------------ revno: 101503 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-09-20 14:38:50 +0300 message: Remove HAVE_TERMIOS definitions. * src/s/usg5-4-common.h (HAVE_TERMIOS): * src/s/template.h (HAVE_TERMIOS): * src/s/gnu-linux.h (HAVE_TERMIOS): * src/s/darwin.h (HAVE_TERMIOS): * src/s/cygwin.h (HAVE_TERMIOS): * src/s/bsd-common.h (HAVE_TERMIOS): * src/s/aix4-2.h (HAVE_TERMIOS): * src/s/hpux10-20.h (HAVE_TERMIOS): Do not define, it is assumed defined on all non-MS platforms. (HAVE_PSTAT_GETDYNAMIC): Do not define, autoconf does it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-20 11:32:26 +0000 +++ src/ChangeLog 2010-09-20 11:38:50 +0000 @@ -1,5 +1,17 @@ 2010-09-20 Dan Nicolaescu + Remove HAVE_TERMIOS definitions. + * s/usg5-4-common.h (HAVE_TERMIOS): + * s/template.h (HAVE_TERMIOS): + * s/gnu-linux.h (HAVE_TERMIOS): + * s/darwin.h (HAVE_TERMIOS): + * s/cygwin.h (HAVE_TERMIOS): + * s/bsd-common.h (HAVE_TERMIOS): + * s/aix4-2.h (HAVE_TERMIOS): + * s/hpux10-20.h (HAVE_TERMIOS): Do not define, it is assumed + defined on all non-MS platforms. + (HAVE_PSTAT_GETDYNAMIC): Do not define, autoconf does it. + * xterm.c (xt_action_hook): Use const. 2010-09-20 Juanma Barranquero === modified file 'src/s/aix4-2.h' --- src/s/aix4-2.h 2010-08-20 22:36:07 +0000 +++ src/s/aix4-2.h 2010-09-20 11:38:50 +0000 @@ -37,10 +37,6 @@ #define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc"); #define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd)); -/* Define HAVE_TERMIO if the system provides sysV-style ioctls - for terminal control. */ -#define HAVE_TERMIOS - /* Define HAVE_PTYS if the system supports pty devices. */ #define HAVE_PTYS === modified file 'src/s/bsd-common.h' --- src/s/bsd-common.h 2010-07-29 20:01:08 +0000 +++ src/s/bsd-common.h 2010-09-20 11:38:50 +0000 @@ -42,7 +42,6 @@ #undef KERNEL_FILE #undef LDAV_SYMBOL -#define HAVE_TERMIOS #define NO_TERMIO /* If the system's imake configuration file defines `NeedWidePrototypes' === modified file 'src/s/cygwin.h' --- src/s/cygwin.h 2010-07-29 20:01:08 +0000 +++ src/s/cygwin.h 2010-09-20 11:38:50 +0000 @@ -45,16 +45,6 @@ through a pipe. */ #undef INTERRUPT_INPUT -/* Define HAVE_TERMIOS if the system provides POSIX-style - functions and macros for terminal control. - - Define HAVE_TERMIO if the system provides sysV-style ioctls - for terminal control. - - Do not define both. HAVE_TERMIOS is preferred, if it is - supported on your system. */ -#define HAVE_TERMIOS - /* Define HAVE_PTYS if the system supports pty devices. */ #define HAVE_PTYS #define PTY_ITERATION for (i = 0; i < 1; i++) /* ick */ === modified file 'src/s/darwin.h' --- src/s/darwin.h 2010-07-08 03:03:52 +0000 +++ src/s/darwin.h 2010-09-20 11:38:50 +0000 @@ -63,15 +63,6 @@ if system supports pty's. 'a' means it is /dev/ptya0 */ #define FIRST_PTY_LETTER 'p' -/* Define HAVE_TERMIOS if the system provides POSIX-style - functions and macros for terminal control. - - Define HAVE_TERMIO if the system provides sysV-style ioctls - for terminal control. - - Do not define both. HAVE_TERMIOS is preferred, if it is supported - on your system. */ -#define HAVE_TERMIOS #define NO_TERMIO /* Define HAVE_PTYS if the system supports pty devices. === modified file 'src/s/gnu-linux.h' --- src/s/gnu-linux.h 2010-07-29 20:01:08 +0000 +++ src/s/gnu-linux.h 2010-09-20 11:38:50 +0000 @@ -80,10 +80,6 @@ #endif /* not HAVE_GRANTPT */ -/* Define HAVE_TERMIOS if the system provides POSIX-style - functions and macros for terminal control. */ -#define HAVE_TERMIOS - /* Define HAVE_PTYS if the system supports pty devices. */ #define HAVE_PTYS === modified file 'src/s/hpux10-20.h' --- src/s/hpux10-20.h 2010-08-22 20:02:16 +0000 +++ src/s/hpux10-20.h 2010-09-20 11:38:50 +0000 @@ -35,11 +35,8 @@ if system supports pty's. 'p' means it is /dev/ptym/ptyp0 */ #define FIRST_PTY_LETTER 'p' -#define HAVE_TERMIOS #define NO_TERMIO -#define ORDINARY_LINK - /* Define HAVE_PTYS if the system supports pty devices. */ #define HAVE_PTYS @@ -78,9 +75,6 @@ HP-UX 10.20, and that it works for HP-UX 0 as well. */ #define NO_EDITRES -/* Tested in getloadavg.c. */ -#define HAVE_PSTAT_GETDYNAMIC - /* Eric Backus says, HP-UX 9.x on HP 700 machines has a broken `rint' in some library versions including math library version number A.09.05. === modified file 'src/s/template.h' --- src/s/template.h 2010-07-29 03:25:08 +0000 +++ src/s/template.h 2010-09-20 11:38:50 +0000 @@ -63,18 +63,6 @@ if system supports pty's. 'a' means it is /dev/ptya0. */ #define FIRST_PTY_LETTER 'a' -/* Define HAVE_TERMIOS if the system provides POSIX-style - functions and macros for terminal control. - - Define HAVE_TERMIO if the system provides sysV-style ioctls - for terminal control. - - Do not define both. HAVE_TERMIOS is preferred, if it is - supported on your system. */ - -#define HAVE_TERMIOS -/* #define HAVE_TERMIO */ - /* Define HAVE_PTYS if the system supports pty devices. */ #define HAVE_PTYS === modified file 'src/s/usg5-4-common.h' --- src/s/usg5-4-common.h 2010-07-29 20:01:08 +0000 +++ src/s/usg5-4-common.h 2010-09-20 11:38:50 +0000 @@ -31,10 +31,6 @@ It sets the Lisp variable system-type. */ #define SYSTEM_TYPE "usg-unix-v" -/* Define HAVE_TERMIO if the system provides sysV-style ioctls - for terminal control. */ -#define HAVE_TERMIO - /* The file containing the kernel's symbol table is called /unix. */ #define KERNEL_FILE "/unix" @@ -78,7 +74,6 @@ /* Define HAVE_PTYS if the system supports pty devices. */ #define HAVE_PTYS -#define HAVE_TERMIOS /* It is possible to receive SIGCHLD when there are no children waiting, because a previous waitsys(2) cleaned up the carcass of child ------------------------------------------------------------ revno: 101502 committer: Dan Nicolaescu branch nick: trunk timestamp: Mon 2010-09-20 14:32:26 +0300 message: * src/xterm.c (xt_action_hook): Use const. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-20 01:20:32 +0000 +++ src/ChangeLog 2010-09-20 11:32:26 +0000 @@ -1,3 +1,7 @@ +2010-09-20 Dan Nicolaescu + + * xterm.c (xt_action_hook): Use const. + 2010-09-20 Juanma Barranquero Don't make W32 code conditional on HAVE_SOCKETS, it's always defined. === modified file 'src/xterm.c' --- src/xterm.c 2010-09-14 14:41:53 +0000 +++ src/xterm.c 2010-09-20 11:32:26 +0000 @@ -4004,7 +4004,7 @@ XEvent *event, String *params, Cardinal *num_params) { int scroll_bar_p; - char *end_action; + const char *end_action; #ifdef USE_MOTIF scroll_bar_p = XmIsScrollBar (widget); ------------------------------------------------------------ revno: 101501 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-09-20 13:20:38 +0200 message: * lisp/mail/sendmail.el: Fix commenting convention. (sendmail-send-it): Use line-beginning-position. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-20 11:13:52 +0000 +++ lisp/ChangeLog 2010-09-20 11:20:38 +0000 @@ -1,5 +1,8 @@ 2010-09-20 Stefan Monnier + * mail/sendmail.el: Fix commenting convention. + (sendmail-send-it): Use line-beginning-position. + * help-fns.el (describe-variable): Add original value, if applicable. 2010-09-20 Juanma Barranquero === modified file 'lisp/mail/sendmail.el' --- lisp/mail/sendmail.el 2010-09-17 00:08:06 +0000 +++ lisp/mail/sendmail.el 2010-09-20 11:20:38 +0000 @@ -1096,23 +1096,23 @@ ;; Delete Resent-BCC ourselves (if (save-excursion (beginning-of-line) (looking-at "resent-bcc")) - (delete-region (save-excursion (beginning-of-line) (point)) - (save-excursion (end-of-line) (1+ (point)))))) -;;; Apparently this causes a duplicate Sender. -;;; ;; If the From is different than current user, insert Sender. -;;; (goto-char (point-min)) -;;; (and (re-search-forward "^From:" delimline t) -;;; (progn -;;; (require 'mail-utils) -;;; (not (string-equal -;;; (mail-strip-quoted-names -;;; (save-restriction -;;; (narrow-to-region (point-min) delimline) -;;; (mail-fetch-field "From"))) -;;; (user-login-name)))) -;;; (progn -;;; (forward-line 1) -;;; (insert "Sender: " (user-login-name) "\n"))) + (delete-region (line-beginning-position) + (line-beginning-position 2)))) + ;; Apparently this causes a duplicate Sender. + ;; ;; If the From is different than current user, insert Sender. + ;; (goto-char (point-min)) + ;; (and (re-search-forward "^From:" delimline t) + ;; (progn + ;; (require 'mail-utils) + ;; (not (string-equal + ;; (mail-strip-quoted-names + ;; (save-restriction + ;; (narrow-to-region (point-min) delimline) + ;; (mail-fetch-field "From"))) + ;; (user-login-name)))) + ;; (progn + ;; (forward-line 1) + ;; (insert "Sender: " (user-login-name) "\n"))) ;; Don't send out a blank subject line (goto-char (point-min)) (if (re-search-forward "^Subject:\\([ \t]*\n\\)+\\b" delimline t) @@ -1179,9 +1179,9 @@ nil errbuf nil "-oi") (and envelope-from (list "-f" envelope-from)) -;;; ;; Don't say "from root" if running under su. -;;; (and (equal (user-real-login-name) "root") -;;; (list "-f" (user-login-name))) + ;; ;; Don't say "from root" if running under su. + ;; (and (equal (user-real-login-name) "root") + ;; (list "-f" (user-login-name))) (and mail-alias-file (list (concat "-oA" mail-alias-file))) (if mail-interactive @@ -1714,48 +1714,48 @@ when the message is sent, we apply FUNCTION to ARGS. This is how Rmail arranges to mark messages `answered'." (interactive "P") -;;; This is commented out because I found it was confusing in practice. -;;; It is easy enough to rename *mail* by hand with rename-buffer -;;; if you want to have multiple mail buffers. -;;; And then you can control which messages to save. --rms. -;;; (let ((index 1) -;;; buffer) -;;; ;; If requested, look for a mail buffer that is modified and go to it. -;;; (if noerase -;;; (progn -;;; (while (and (setq buffer -;;; (get-buffer (if (= 1 index) "*mail*" -;;; (format "*mail*<%d>" index)))) -;;; (not (buffer-modified-p buffer))) -;;; (setq index (1+ index))) -;;; (if buffer (switch-to-buffer buffer) -;;; ;; If none exists, start a new message. -;;; ;; This will never re-use an existing unmodified mail buffer -;;; ;; (since index is not 1 anymore). Perhaps it should. -;;; (setq noerase nil)))) -;;; ;; Unless we found a modified message and are happy, start a new message. -;;; (if (not noerase) -;;; (progn -;;; ;; Look for existing unmodified mail buffer. -;;; (while (and (setq buffer -;;; (get-buffer (if (= 1 index) "*mail*" -;;; (format "*mail*<%d>" index)))) -;;; (buffer-modified-p buffer)) -;;; (setq index (1+ index))) -;;; ;; If none, make a new one. -;;; (or buffer -;;; (setq buffer (generate-new-buffer "*mail*"))) -;;; ;; Go there and initialize it. -;;; (switch-to-buffer buffer) -;;; (erase-buffer) -;;; (setq default-directory (expand-file-name "~/")) -;;; (auto-save-mode auto-save-default) -;;; (mail-mode) -;;; (mail-setup to subject in-reply-to cc replybuffer actions) -;;; (if (and buffer-auto-save-file-name -;;; (file-exists-p buffer-auto-save-file-name)) -;;; (message "Auto save file for draft message exists; consider M-x mail-recover")) -;;; t)) + ;; This is commented out because I found it was confusing in practice. + ;; It is easy enough to rename *mail* by hand with rename-buffer + ;; if you want to have multiple mail buffers. + ;; And then you can control which messages to save. --rms. + ;; (let ((index 1) + ;; buffer) + ;; ;; If requested, look for a mail buffer that is modified and go to it. + ;; (if noerase + ;; (progn + ;; (while (and (setq buffer + ;; (get-buffer (if (= 1 index) "*mail*" + ;; (format "*mail*<%d>" index)))) + ;; (not (buffer-modified-p buffer))) + ;; (setq index (1+ index))) + ;; (if buffer (switch-to-buffer buffer) + ;; ;; If none exists, start a new message. + ;; ;; This will never re-use an existing unmodified mail buffer + ;; ;; (since index is not 1 anymore). Perhaps it should. + ;; (setq noerase nil)))) + ;; ;; Unless we found a modified message and are happy, start a new message. + ;; (if (not noerase) + ;; (progn + ;; ;; Look for existing unmodified mail buffer. + ;; (while (and (setq buffer + ;; (get-buffer (if (= 1 index) "*mail*" + ;; (format "*mail*<%d>" index)))) + ;; (buffer-modified-p buffer)) + ;; (setq index (1+ index))) + ;; ;; If none, make a new one. + ;; (or buffer + ;; (setq buffer (generate-new-buffer "*mail*"))) + ;; ;; Go there and initialize it. + ;; (switch-to-buffer buffer) + ;; (erase-buffer) + ;; (setq default-directory (expand-file-name "~/")) + ;; (auto-save-mode auto-save-default) + ;; (mail-mode) + ;; (mail-setup to subject in-reply-to cc replybuffer actions) + ;; (if (and buffer-auto-save-file-name + ;; (file-exists-p buffer-auto-save-file-name)) + ;; (message "Auto save file for draft message exists; consider M-x mail-recover")) + ;; t)) (if (eq noerase 'new) (pop-to-buffer (generate-new-buffer "*mail*")) @@ -1776,7 +1776,7 @@ (mail-mode) ;; Disconnect the buffer from its visited file ;; (in case the user has actually visited a file *mail*). -;;; (set-visited-file-name nil) + ;; (set-visited-file-name nil) (let (initialized) (and (not (and noerase (not (eq noerase 'new)))) ------------------------------------------------------------ revno: 101500 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2010-09-20 13:13:52 +0200 message: * lisp/help-fns.el (describe-variable): Add original value, if applicable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-20 01:20:32 +0000 +++ lisp/ChangeLog 2010-09-20 11:13:52 +0000 @@ -1,3 +1,7 @@ +2010-09-20 Stefan Monnier + + * help-fns.el (describe-variable): Add original value, if applicable. + 2010-09-20 Juanma Barranquero * subr.el (y-or-n-p): Remove leftover code from revno 101459. === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2010-08-29 16:17:13 +0000 +++ lisp/help-fns.el 2010-09-20 11:13:52 +0000 @@ -645,7 +645,20 @@ ;; inappropriate e.g C-h v features ;; (help-xref-on-pp from (point)) (if (< (point) (+ from 20)) - (delete-region (1- from) from))))) + (delete-region (1- from) from)) + (let* ((sv (get variable 'standard-value)) + (origval (and (consp sv) + (condition-case nil + (eval (car sv)) + (error :help-eval-error))))) + (when (and (consp sv) + (not (equal origval val)) + (not (equal origval :help-eval-error))) + (princ "\nOriginal value was \n") + (setq from (point)) + (pp origval) + (if (< (point) (+ from 20)) + (delete-region (1- from) from))))))) (terpri) (when locus ------------------------------------------------------------ revno: 101499 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2010-09-20 10:16:02 +0000 message: gnus.texi (Article Washing): Add `gnus-article-html' in `mm-text-html-renderer' doc. diff: === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2010-09-20 00:36:54 +0000 +++ doc/misc/gnus.texi 2010-09-20 10:16:02 +0000 @@ -9838,6 +9838,9 @@ can use include: @table @code +@item gnus-article-html +Use Gnus rendered based on w3m. + @item w3 Use Emacs/W3. ------------------------------------------------------------ revno: 101498 committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2010-09-20 01:57:46 +0000 message: Make Gnus work for Emacs 22 and XEmacs. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-20 01:20:32 +0000 +++ lisp/gnus/ChangeLog 2010-09-20 01:57:46 +0000 @@ -1,3 +1,10 @@ +2010-09-20 Katsumi Yamaoka + + * gnus-html.el (gnus-html-image-fetched): Pass arg to kill-buffer. + + * gnus-sum.el (gnus-summary-update-mark): Replace subst-char-in-string + by mm-subst-char-in-string. + 2010-09-19 Lars Magne Ingebrigtsen * nnimap.el (nnimap-wait-for-connection): Avoid a race condition while === modified file 'lisp/gnus/gnus-html.el' --- lisp/gnus/gnus-html.el 2010-09-20 00:36:54 +0000 +++ lisp/gnus/gnus-html.el 2010-09-20 01:57:46 +0000 @@ -339,7 +339,7 @@ (when (search-forward "\n\n" nil t) ;; Write region (image data) silently (write-region (point) (point-max) file nil 1) - (kill-buffer) + (kill-buffer (current-buffer)) (when (and (buffer-live-p buffer) ;; If the `image' has no marker, do not replace anything (cadr image) === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-09-20 00:36:54 +0000 +++ lisp/gnus/gnus-sum.el 2010-09-20 01:57:46 +0000 @@ -10769,8 +10769,9 @@ (goto-char (+ forward (point))) ;; Replace the old mark with the new mark. (let ((to-insert - (subst-char-in-string (char-after) mark - (buffer-substring (point) (1+ (point)))))) + (mm-subst-char-in-string + (char-after) mark + (buffer-substring (point) (1+ (point)))))) (delete-region (point) (1+ (point))) (insert to-insert)) ;; Optionally update the marks by some user rule.