Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 102429. ------------------------------------------------------------ revno: 102429 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2010-11-18 06:34:02 +0000 message: shr.el: Allow customizing the vertical table lines. shr.el (shr-table-horizontal-line): Renamed from shr-table-line. (shr-table-vertical-line): New variable. (shr-insert-table): Use it. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-18 02:00:00 +0000 +++ lisp/gnus/ChangeLog 2010-11-18 06:34:02 +0000 @@ -1,3 +1,9 @@ +2010-11-18 Lars Magne Ingebrigtsen + + * shr.el (shr-table-horizontal-line): Renamed from shr-table-line. + (shr-table-vertical-line): New variable. + (shr-insert-table): Use it. + 2010-11-18 Katsumi Yamaoka * gnus-html.el (gnus-html-wash-images): Don't display images if === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2010-11-17 22:15:24 +0000 +++ lisp/gnus/shr.el 2010-11-18 06:34:02 +0000 @@ -55,18 +55,23 @@ :group 'shr :type 'regexp) -(defcustom shr-table-line ?- - "Character used to draw table line." +(defcustom shr-table-horizontal-line ?- + "Character used to draw horizontal table lines." + :group 'shr + :type 'character) + +(defcustom shr-table-vertical-line ?| + "Character used to draw vertical table lines." :group 'shr :type 'character) (defcustom shr-table-corner ?+ - "Character used to draw table corner." + "Character used to draw table corners." :group 'shr :type 'character) (defcustom shr-hr-line ?- - "Character used to draw hr line." + "Character used to draw hr lines." :group 'shr :type 'character) @@ -778,7 +783,7 @@ max))) (dotimes (i height) (shr-indent) - (insert "|\n")) + (insert shr-table-vertical-line "\n")) (dolist (column row) (goto-char start) (let ((lines (nth 2 column)) @@ -787,7 +792,7 @@ (dolist (line lines) (setq overlay-line (pop overlay-lines)) (end-of-line) - (insert line "|") + (insert line shr-table-vertical-line) (dolist (overlay overlay-line) (let ((o (make-overlay (- (point) (nth 0 overlay) 1) (- (point) (nth 1 overlay) 1))) @@ -799,7 +804,8 @@ ;; possibly. (dotimes (i (- height (length lines))) (end-of-line) - (insert (make-string (string-width (car lines)) ? ) "|") + (insert (make-string (string-width (car lines)) ? ) + shr-table-vertical-line) (forward-line 1))))) (shr-insert-table-ruler widths))) @@ -809,7 +815,8 @@ (shr-indent)) (insert shr-table-corner) (dotimes (i (length widths)) - (insert (make-string (aref widths i) shr-table-line) shr-table-corner)) + (insert (make-string (aref widths i) shr-table-horizontal-line) + shr-table-corner)) (insert "\n")) (defun shr-table-widths (table suggested-widths) ------------------------------------------------------------ revno: 102428 [merge] committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-11-17 22:54:14 -0500 message: Merge from emacs-23 diff: === modified file '.dir-locals.el' --- .dir-locals.el 2010-11-09 20:07:10 +0000 +++ .dir-locals.el 2010-11-18 03:54:14 +0000 @@ -2,6 +2,8 @@ (sentence-end-double-space . t) (fill-column . 70))) (c-mode . ((c-file-style . "GNU"))) + ;; You must set bugtracker_debbugs_url in your bazaar.conf for this to work. + ;; See admin/notes/bugtracker. (log-edit-mode . ((log-edit-rewrite-fixes " (bug#\\([0-9]+\\))" . "debbugs:\\1"))) (change-log-mode . ((add-log-time-zone-rule . t) === modified file 'admin/notes/bugtracker' --- admin/notes/bugtracker 2010-10-31 00:38:13 +0000 +++ admin/notes/bugtracker 2010-11-18 03:54:14 +0000 @@ -474,16 +474,41 @@ ** Bazaar stuff -*** You can use `bzr commit --fixes emacs:123' to mark that a commit fixes -Emacs bug 123. You will first need to add a line to your bazaar.conf: - -bugtracker_emacs_url = http://debbugs.gnu.org/{id} +*** You can use `bzr commit --fixes debbugs:123' to mark that a commit fixes +Emacs bug 123. You will first need to add a line to your ~/bazaar.conf +or ~/locations.conf: + +bugtracker_debbugs_url = http://debbugs.gnu.org/{id} + +Here "{id}" is a literal string, a placeholder that will be replaced +by the bug number you specify after `--fixes debbugs:' in the bzr +command line (123 in the example above). + +In the bazaar.conf file, this setting should go into the [DEFAULTS] +section. + +In the locations.conf file, it should go into the branch-specific +configuration section for the branch where you want this to be in +effect. For example, if you want this to be in effect for the branch +located at `/home/projects/emacs/trunk', you need to have this in your +~/locations.conf file: + +[/home/projects/emacs/trunk] +bugtracker_debbugs_url = http://debbugs.gnu.org/{id} + +If you want to use this in all Emacs branches whose common parent is +`/home/projects/emacs', put the setting in the [/home/projects/emacs] +section. See "bzr help configuration" for more information about +the *.conf files, their location and formats. See "bzr help bugs" for +more information about the bugtracker_debbugs_url setting. + +See also log-edit-rewrite-fixes in .dir-locals.el. Note that all this does is add some metadata to the commit, it doesn't -actually mark the bug as closed in the tracker. There seems to be no -way to see this "metadata" with `bzr log', which is rather poor, but -it will show up as a link in a recent loggerhead installation, or with -some of the graphical frontends to bzr log. +actually mark the bug as closed in the tracker. You can see this +information with `bzr log', and it will show up as a link in a recent +loggerhead installation, or with some of the graphical frontends to +`bzr log'. ** Gnus-specific voodoo === modified file 'configure' --- configure 2010-11-15 06:39:02 +0000 +++ configure 2010-11-18 03:54:14 +0000 @@ -9364,6 +9364,17 @@ $as_echo "#define HAVE_GCONF 1" >>confdefs.h + for ac_func in g_type_init +do : + ac_fn_c_check_func "$LINENO" "g_type_init" "ac_cv_func_g_type_init" +if test "x$ac_cv_func_g_type_init" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_G_TYPE_INIT 1 +_ACEOF + +fi +done + fi fi === modified file 'configure.in' --- configure.in 2010-11-15 06:39:02 +0000 +++ configure.in 2010-11-18 03:54:14 +0000 @@ -1982,6 +1982,8 @@ PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.13, HAVE_GCONF=yes, HAVE_GCONF=no) if test "$HAVE_GCONF" = yes; then AC_DEFINE(HAVE_GCONF, 1, [Define to 1 if using GConf.]) + dnl Newer GConf doesn't link with g_objects, so this is not defined. + AC_CHECK_FUNCS([g_type_init]) fi fi === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2010-11-13 13:29:31 +0000 +++ doc/lispref/ChangeLog 2010-11-18 03:54:14 +0000 @@ -1,3 +1,14 @@ +2010-11-17 Eli Zaretskii + + * customize.texi (Composite Types): Lower-case index entry. + + * loading.texi (How Programs Do Loading): Document + load-file-name. (Bug#7346) + +2010-11-17 Glenn Morris + + * text.texi (Kill Functions, Low-Level Kill Ring): Small fixes. + 2010-11-13 Eli Zaretskii * display.texi (Usual Display): Characters with no fonts are not === modified file 'doc/lispref/customize.texi' --- doc/lispref/customize.texi 2010-01-13 08:35:10 +0000 +++ doc/lispref/customize.texi 2010-11-12 17:03:57 +0000 @@ -733,7 +733,7 @@ @node Composite Types @subsection Composite Types -@cindex Composite Types (customization) +@cindex composite types (customization) When none of the simple types is appropriate, you can use composite types, which build new types from other types or from specified data. === modified file 'doc/lispref/loading.texi' --- doc/lispref/loading.texi 2010-08-22 21:15:20 +0000 +++ doc/lispref/loading.texi 2010-11-18 03:54:14 +0000 @@ -107,6 +107,10 @@ @code{load-path}, then all three suffixes in the second directory, and so on. @xref{Library Search}. +Whatever the name under which the file is eventually found, and the +directory where Emacs found it, Emacs sets the value of the variable +@code{load-file-name} to that file's name. + If you get a warning that @file{foo.elc} is older than @file{foo.el}, it means you should consider recompiling @file{foo.el}. @xref{Byte Compilation}. @@ -157,6 +161,12 @@ file, and it is @code{nil} otherwise. @end defvar +@defvar load-file-name +When Emacs is in the process of loading a file, this variable's value +is the name of that file, as Emacs found it during the search +described earlier in this section. +@end defvar + @defvar load-read-function @anchor{Definition of load-read-function} @c do not allow page break at anchor; work around Texinfo deficiency. === modified file 'doc/lispref/text.texi' --- doc/lispref/text.texi 2010-09-18 15:50:06 +0000 +++ doc/lispref/text.texi 2010-11-18 03:54:14 +0000 @@ -901,10 +901,10 @@ The command does not set @code{this-command} to @code{kill-region}, so a subsequent kill command does not append to the same kill ring entry. -Don't call @code{copy-region-as-kill} in Lisp programs unless you aim to -support Emacs 18. For newer Emacs versions, it is better to use -@code{kill-new} or @code{kill-append} instead. @xref{Low-Level Kill -Ring}. +@c FIXME Why is it better? Why isn't copy-region-as-kill obsolete then? +@c Why is it used in many places in Emacs? +In Lisp programs, it is better to use @code{kill-new} or +@code{kill-append} instead of this command. @xref{Low-Level Kill Ring}. @end deffn @node Yanking @@ -1042,8 +1042,8 @@ @subsection Low-Level Kill Ring These functions and variables provide access to the kill ring at a -lower level, but still convenient for use in Lisp programs, because they -take care of interaction with window system selections +lower level, but are still convenient for use in Lisp programs, +because they take care of interaction with window system selections (@pxref{Window System Selections}). @defun current-kill n &optional do-not-move @@ -4324,6 +4324,4 @@ @code{inhibit-modification-hooks} to @code{nil}. @end defvar -@ignore - arch-tag: 3721e738-a1cb-4085-bc1a-6cb8d8e1d32b -@end ignore + === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-11-18 02:38:03 +0000 +++ doc/misc/ChangeLog 2010-11-18 03:54:14 +0000 @@ -2,6 +2,14 @@ * gnus.texi (Misc Article): Document gnus-inhibit-images. +2010-11-17 Glenn Morris + + * edt.texi: Remove information about Emacs 19. + +2010-11-17 Michael Albinus + + * trampver.texi: Update release number. + 2010-11-12 Katsumi Yamaoka * gnus.texi (Article Washing): Fix typo. === modified file 'doc/misc/edt.texi' --- doc/misc/edt.texi 2010-06-24 07:10:51 +0000 +++ doc/misc/edt.texi 2010-11-10 08:48:15 +0000 @@ -63,8 +63,8 @@ @node Overview @chapter Overview of the EDT Package -This manual describes version 4.0 of the EDT Emulation for Emacs 19 and -above. It comes with special functions which replicate nearly all of +This manual describes version 4.0 of the EDT Emulation for Emacs. +It comes with special functions which replicate nearly all of EDT's keypad mode behavior. It sets up default keypad and function key bindings which closely match those found in EDT. Support is provided so that users may reconfigure most keypad and function key bindings to @@ -152,9 +152,8 @@ EDT Emulation is active to change the settings for that session. @strong{Please note:} Another way to set the scroll margins is to use -the Emacs customization feature (not available in Emacs 19) to set the -following two variables directly: @code{edt-top-scroll-margin} and -@code{edt-bottom-scroll-margin}. +the Emacs customization feature to set the following two variables +directly: @code{edt-top-scroll-margin} and @code{edt-bottom-scroll-margin}. Enter the Emacs @code{customize} command. First select the @samp{Editing} group and then select the @samp{Emulations} group. @@ -239,8 +238,7 @@ just as they existed before the EDT emulation was first invoked. @item -Support GNU Emacs 19 and higher. (GNU Emacs 18 and below is no longer -supported.) XEmacs 19, and above, is also supported. +Support GNU Emacs 19 and higher. XEmacs 19, and above, is also supported. @item Supports highlighting of marked text within the EDT emulation on all @@ -933,9 +931,8 @@ EDT Emulation is active to change the settings for that session. @strong{Please note:} Another way to set the scroll margins is to use -the Emacs customization feature (not available in Emacs 19) to set the -following two variables directly: @code{edt-top-scroll-margin} and -@code{edt-bottom-scroll-margin}. +the Emacs customization feature to set the following two variables +directly: @code{edt-top-scroll-margin} and @code{edt-bottom-scroll-margin}. Enter the Emacs @code{customize} command. First select the @samp{Editing} group and then select the @samp{Emulations} group. @@ -946,7 +943,3 @@ @include doclicense.texi @bye - -@ignore - arch-tag: 1b7ebe01-754b-4834-a12b-f152ef7db9e0 -@end ignore === modified file 'etc/NEWS.23' --- etc/NEWS.23 2010-11-09 20:07:10 +0000 +++ etc/NEWS.23 2010-11-18 03:54:14 +0000 @@ -48,6 +48,10 @@ * Incompatible Lisp Changes in Emacs 23.3 +** posn-col-row now excludes the header line from the row count +If the frame has a header line, posn-col-row will count row numbers +starting from the first line of text below the header line. + * Lisp changes in Emacs 23.3 @@ -55,6 +59,7 @@ The old names are obsolete. ** The use of unintern without an obarray arg is declared obsolete. ** The function `princ-list' is declared obsolete. +** The yank-handler argument to kill-region and friends is declared obsolete. ** New function byte-to-string, like char-to-string but for bytes. === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-11-15 06:42:21 +0000 +++ lib-src/ChangeLog 2010-11-18 03:54:14 +0000 @@ -1,3 +1,8 @@ +2010-11-18 YAMAMOTO Mitsuharu + + * emacsclient.c (set_local_socket) [DARWIN_OS]: Add fall-back + definition of _CS_DARWIN_USER_TEMP_DIR for Mac OS X 10.4 and older. + 2010-11-15 Dan Nicolaescu * test-distrib.c: Remove include guards for config.h and fcntl.h. === modified file 'lib-src/emacsclient.c' --- lib-src/emacsclient.c 2010-10-08 10:14:47 +0000 +++ lib-src/emacsclient.c 2010-11-18 03:54:14 +0000 @@ -1225,6 +1225,9 @@ if (!tmpdir) { #ifdef DARWIN_OS +#ifndef _CS_DARWIN_USER_TEMP_DIR +#define _CS_DARWIN_USER_TEMP_DIR 65537 +#endif size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t) 0); if (n > 0) { === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-18 03:02:15 +0000 +++ lisp/ChangeLog 2010-11-18 03:54:14 +0000 @@ -1,5 +1,86 @@ 2010-11-18 Stefan Monnier + * simple.el (kill-new, kill-append, kill-region): + * comint.el (comint-kill-region): Make the yank-handler argument obsolete. + +2010-11-18 Stefan Monnier + + * emacs-lisp/smie.el (smie-bnf-classify): Signal errors for tokens + that are both openers (resp. closers) and something else. + (smie-grammar): Loosen definition of valid values. + (smie-next-sexp, smie-down-list, smie-blink-matching-open) + (smie-indent--parent, smie-rule-parent, smie-indent-keyword) + (smie-indent-after-keyword): Adjust users. + (smie-indent-keyword): Don't indent empty lines. + + * vc-hg.el (vc-hg-program): New var. + Suggested by Norman Gray . + (vc-hg-state, vc-hg-working-revision, vc-hg-command): Use it. + +2010-11-18 Glenn Morris + + * emacs-lisp/autoload.el (autoload-find-destination): The function + coding-system-eol-type may return non-numeric values. (Bug#7414) + +2010-11-18 Ulrich Mueller + + * server.el (server-force-stop): Ensure the server is stopped (Bug#7409). + +2010-11-18 Eli Zaretskii + + * subr.el (posn-col-row): Pay attention to header line. (Bug#7390) + +2010-11-18 Chong Yidong + + * textmodes/picture.el (picture-mouse-set-point): Don't use + posn-col-row; explicitly compute the motion based on the posn at + the window-start (Bug#7390). + +2010-11-18 Glenn Morris + + * novice.el (disabled-command-function): + Fix 2009-11-15 change. (Bug#7384) + +2010-11-18 Glenn Morris + + * calendar/calendar.el (diary-iso-date-forms): Make elements + mutually exclusive. (Bug#7377) + +2010-11-18 Stefan Monnier + + * emacs-lisp/smie.el (smie-prec2->grammar): Obey equality constraints + when filling the remaining "unconstrained" values. + +2010-11-18 Stefan Monnier + + * emacs-lisp/bytecomp.el (byte-compile-warnings): Simplify the + safety predicate. + + * files.el (safe-local-variable-p): Gracefully handle errors. + + * emacs-lisp/smie.el (smie-rule-parent, smie-indent--rule): + Use smie-indent-virtual when indenting relative to an opener. + (smie-rule-separator): Use smie-rule-parent. + (smie-indent-keyword): Consult rules, even for openers at bol. + (smie-indent-comment-close): Try to align closer's content. + +2010-11-18 Glenn Morris + + * ls-lisp.el (ls-lisp-dired-ignore-case): Make it an obsolete alias. + +2010-11-18 Glenn Morris + + * printing.el (pr-menu-bind): Doc fix. + + * speedbar.el (speedbar-toggle-images): Doc fix. + + * progmodes/python.el (python-shell): Doc fix. + + * wid-edit.el (widget-field-use-before-change) + (widget-use-overlay-change): Doc fixes. + +2010-11-18 Stefan Monnier + Minor cleanup to improve style. * textmodes/rst.el (rst-update-section): Use point-marker. (rst-get-decoration): Eliminate unneeded assignment. === modified file 'lisp/calendar/calendar.el' --- lisp/calendar/calendar.el 2010-07-10 23:34:57 +0000 +++ lisp/calendar/calendar.el 2010-11-12 03:16:20 +0000 @@ -736,14 +736,16 @@ (defcustom diary-iso-date-forms '((month "[-/]" day "[^-/0-9]") (year "[-/]" month "[-/]" day "[^0-9]") - (monthname "-" day "[^-0-9]") - (year "-" monthname "-" day "[^0-9]") + ;; Cannot allow [-/] as separators here, since it would also match + ;; the first element (bug#7377). + (monthname " *" day "[^-0-9]") + (year " *" monthname " *" day "[^0-9]") (dayname "\\W")) "List of pseudo-patterns describing the ISO style of dates. -The defaults are: MONTH[-/]DAY; YEAR[-/]MONTH[-/]DAY; MONTHNAME-DAY; -YEAR-MONTHNAME-DAY; DAYNAME. Normally you should not customize this, +The defaults are: MONTH[-/]DAY; YEAR[-/]MONTH[-/]DAY; MONTHNAME DAY; +YEAR MONTHNAME DAY; DAYNAME. Normally you should not customize this, but `diary-date-forms' (which see)." - :version "23.1" + :version "23.3" ; bug#7377 :type '(repeat (choice (cons :tag "Backup" :value (backup . nil) (const backup) @@ -2570,5 +2572,4 @@ ;; byte-compile-dynamic: t ;; End: -;; arch-tag: 19c61596-c8fb-4c69-bcf1-7dd739919cd8 ;;; calendar.el ends here === modified file 'lisp/comint.el' --- lisp/comint.el 2010-10-24 21:36:09 +0000 +++ lisp/comint.el 2010-11-18 03:54:14 +0000 @@ -2648,6 +2648,7 @@ (let ((inhibit-read-only t)) (kill-region beg end yank-handler) (comint-update-fence)))))) +(set-advertised-calling-convention 'comint-kill-region '(beg end) "23.3") ;; Support for source-file processing commands. === modified file 'lisp/emacs-lisp/autoload.el' --- lisp/emacs-lisp/autoload.el 2010-10-22 03:32:46 +0000 +++ lisp/emacs-lisp/autoload.el 2010-11-18 03:54:14 +0000 @@ -575,8 +575,8 @@ (autoload-ensure-default-file (autoload-generated-file))) ;; This is to make generated-autoload-file have Unix EOLs, so ;; that it is portable to all platforms. - (unless (zerop (coding-system-eol-type buffer-file-coding-system)) - (set-buffer-file-coding-system 'unix)) + (or (eq 0 (coding-system-eol-type buffer-file-coding-system)) + (set-buffer-file-coding-system 'unix)) (or (> (buffer-size) 0) (error "Autoloads file %s lacks boilerplate" buffer-file-name)) (or (file-writable-p buffer-file-name) === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2010-11-12 03:21:38 +0000 +++ lisp/emacs-lisp/bytecomp.el 2010-11-18 03:54:14 +0000 @@ -301,21 +301,12 @@ (set :menu-tag "Some" ,@(mapcar (lambda (x) `(const ,x)) byte-compile-warning-types)))) -;;;###autoload(put 'byte-compile-warnings 'safe-local-variable 'byte-compile-warnings-safe-p) ;;;###autoload -(defun byte-compile-warnings-safe-p (x) - "Return non-nil if X is valid as a value of `byte-compile-warnings'." - (or (booleanp x) - (and (listp x) - (if (eq (car x) 'not) (setq x (cdr x)) - t) - (equal (mapcar - (lambda (e) - (when (memq e byte-compile-warning-types) - e)) - x) - x)))) +(put 'byte-compile-warnings 'safe-local-variable + (lambda (v) + (or (symbolp v) + (null (delq nil (mapcar (lambda (x) (not (symbolp x))) v)))))) (defun byte-compile-warning-enabled-p (warning) "Return non-nil if WARNING is enabled, according to `byte-compile-warnings'." === modified file 'lisp/emacs-lisp/smie.el' --- lisp/emacs-lisp/smie.el 2010-11-09 20:07:10 +0000 +++ lisp/emacs-lisp/smie.el 2010-11-18 03:54:14 +0000 @@ -63,11 +63,32 @@ ;; Since then, some of that code has been beaten into submission, but the ;; smie-indent-keyword is still pretty obscure. +;; Conflict resolution: +;; +;; - One source of conflicts is when you have: +;; (exp ("IF" exp "ELSE" exp "END") ("CASE" cases "END")) +;; (cases (cases "ELSE" insts) ...) +;; The IF-rule implies ELSE=END and the CASE-rule implies ELSE>END. +;; FIXME: we could try to resolve such conflicts automatically by changing +;; the way BNF rules such as the IF-rule is handled. I.e. rather than +;; IF=ELSE and ELSE=END, we could turn them into IFEND +;; and IF=END, + +;; TODO & BUGS: +;; +;; - FIXME: I think the behavior on empty lines is wrong. It shouldn't +;; look at the next token on subsequent lines. +;; - Using the structural information SMIE gives us, it should be possible to +;; implement a `smie-align' command that would automatically figure out what +;; there is to align and how to do it (something like: align the token of +;; lowest precedence that appears the same number of times on all lines, +;; and then do the same on each side of that token). +;; - Maybe accept two juxtaposed non-terminals in the BNF under the condition +;; that the first always ends with a terminal, or that the second always +;; starts with a terminal. + ;;; Code: -;; FIXME: I think the behavior on empty lines is wrong. It shouldn't -;; look at the next token on subsequent lines. - (eval-when-compile (require 'cl)) (defgroup smie nil @@ -155,6 +176,11 @@ (put 'smie-bnf->prec2 'pure t) (defun smie-bnf->prec2 (bnf &rest precs) + ;; FIXME: Add repetition operator like (repeat ). + ;; Maybe also add (or ...) for things like + ;; (exp (exp (or "+" "*" "=" ..) exp)). + ;; Basically, make it EBNF (except for the specification of a separator in + ;; the repetition). (let ((nts (mapcar 'car bnf)) ;Non-terminals (first-ops-table ()) (last-ops-table ()) @@ -327,6 +353,7 @@ "Return a table classifying terminals. Each terminal can either be an `opener', a `closer', or neither." (let ((table (make-hash-table :test #'equal)) + (nts (mapcar #'car bnf)) (alist '())) (dolist (category bnf) (puthash (car category) 'neither table) ;Remove non-terminals. @@ -336,14 +363,22 @@ (let ((first (pop rhs))) (puthash first (if (memq (gethash first table) '(nil opener)) - 'opener 'neither) + 'opener + (unless (member first nts) + (error "SMIE: token %s is both opener and non-opener" + first)) + 'neither) table)) (while (cdr rhs) (puthash (pop rhs) 'neither table)) ;Remove internals. (let ((last (pop rhs))) (puthash last (if (memq (gethash last table) '(nil closer)) - 'closer 'neither) + 'closer + (unless (member last nts) + (error "SMIE: token %s is both closer and non-closer" + last)) + 'neither) table))))) (maphash (lambda (tok v) (when (memq v '(closer opener)) @@ -385,6 +420,18 @@ (append names (list (car names))) " < "))) +;; (defun smie-check-grammar (grammar prec2 &optional dummy) +;; (maphash (lambda (k v) +;; (when (consp k) +;; (let ((left (nth 2 (assoc (car k) grammar))) +;; (right (nth 1 (assoc (cdr k) grammar)))) +;; (when (and left right) +;; (cond +;; ((< left right) (assert (eq v '<))) +;; ((> left right) (assert (eq v '>))) +;; (t (assert (eq v '=)))))))) +;; prec2)) + (put 'smie-prec2->grammar 'pure t) (defun smie-prec2->grammar (prec2) "Take a 2D precedence table and turn it into an alist of precedence levels. @@ -453,6 +500,7 @@ ;; left = right). (unless (caar cst) (setcar (car cst) i) + ;; (smie-check-grammar table prec2 'step1) (incf i)) (setq csts (delq cst csts)))) (unless progress @@ -462,8 +510,19 @@ (incf i 10)) ;; Propagate equalities back to their source. (dolist (eq (nreverse eqs)) - (assert (or (null (caar eq)) (eq (car eq) (cdr eq)))) - (setcar (car eq) (cadr eq))) + (when (null (cadr eq)) + ;; There's an equality constraint, but we still haven't given + ;; it a value: that means it binds tighter than anything else, + ;; and it can't be an opener/closer (those don't have equality + ;; constraints). + ;; So set it here rather than below since doing it below + ;; makes it more difficult to obey the equality constraints. + (setcar (cdr eq) i) + (incf i)) + (assert (or (null (caar eq)) (eq (caar eq) (cadr eq)))) + (setcar (car eq) (cadr eq)) + ;; (smie-check-grammar table prec2 'step2) + ) ;; Finally, fill in the remaining vars (which only appeared on the ;; right side of the < constraints). (let ((classification-table (gethash :smie-open/close-alist prec2))) @@ -484,6 +543,7 @@ (incf i))))) ;See other (incf i) above. (let ((ca (gethash :smie-closer-alist prec2))) (when ca (push (cons :smie-closer-alist ca) table))) + ;; (smie-check-grammar table prec2 'step3) table)) ;;; Parsing using a precedence level table. @@ -493,9 +553,9 @@ This list is normally built by `smie-prec2->grammar'. Each element is of the form (TOKEN LEFT-LEVEL RIGHT-LEVEL). Parsing is done using an operator precedence parser. -LEFT-LEVEL and RIGHT-LEVEL can be either numbers or nil, where nil +LEFT-LEVEL and RIGHT-LEVEL can be either numbers or a list, where a list means that this operator does not bind on the corresponding side, -i.e. a LEFT-LEVEL of nil means this is a token that behaves somewhat like +e.g. a LEFT-LEVEL of nil means this is a token that behaves somewhat like an open-paren, whereas a RIGHT-LEVEL of nil would correspond to something like a close-paren.") @@ -579,9 +639,10 @@ (if (eq pos (point)) ;; We did not move, so let's abort the loop. (throw 'return (list t (point)))))) - ((null (funcall op-back toklevels)) + ((not (numberp (funcall op-back toklevels))) ;; A token like a paren-close. - (assert (funcall op-forw toklevels)) ;Otherwise, why mention it? + (assert (numberp ; Otherwise, why mention it in smie-grammar. + (funcall op-forw toklevels))) (push toklevels levels)) (t (while (and levels (< (funcall op-back toklevels) @@ -589,7 +650,7 @@ (setq levels (cdr levels))) (cond ((null levels) - (if (and halfsexp (funcall op-forw toklevels)) + (if (and halfsexp (numberp (funcall op-forw toklevels))) (push toklevels levels) (throw 'return (prog1 (list (or (car toklevels) t) (point) token) @@ -605,15 +666,15 @@ ;; Keep looking as long as we haven't matched the ;; topmost operator. (levels - (if (funcall op-forw toklevels) + (if (numberp (funcall op-forw toklevels)) (push toklevels levels))) ;; We matched the topmost operator. If the new operator ;; is the last in the corresponding BNF rule, we're done. - ((null (funcall op-forw toklevels)) + ((not (numberp (funcall op-forw toklevels))) ;; It is the last element, let's stop here. (throw 'return (list nil (point) token))) ;; If the new operator is not the last in the BNF rule, - ;; ans is not associative, it's one of the inner operators + ;; and is not associative, it's one of the inner operators ;; (like the "in" in "let .. in .. end"), so keep looking. ((not (smie--associative-p toklevels)) (push toklevels levels)) @@ -714,7 +775,7 @@ ;; intervention, e.g. for Octave's use of `until' ;; as a pseudo-closer of `do'. (closer) - ((or (equal levels '(nil)) (nth 1 (car levels))) + ((or (equal levels '(nil)) (numberp (nth 1 (car levels)))) (error "Doesn't look like a block")) (t ;; Now that smie-setup automatically sets smie-closer-alist @@ -725,7 +786,7 @@ (when (and (eq (nth 2 level) (nth 1 other)) (not (memq other seen))) (push other seen) - (if (nth 2 other) + (if (numberp (nth 2 other)) (push other levels) (push (car other) found)))))) (cond @@ -766,8 +827,8 @@ (progn (goto-char start) (down-list inc) nil) (forward-sexp inc) (/= (point) pos))) - ((and levels (null (nth (+ 1 offset) levels))) nil) - ((and levels (null (nth (- 2 offset) levels))) + ((and levels (not (numberp (nth (+ 1 offset) levels)))) nil) + ((and levels (not (numberp (nth (- 2 offset) levels)))) (let ((end (point))) (goto-char start) (signal 'scan-error @@ -852,7 +913,7 @@ (not (memq (char-before) smie-blink-matching-triggers))) (or smie-blink-matching-inners - (null (nth 2 (assoc token smie-grammar))))) + (not (numberp (nth 2 (assoc token smie-grammar)))))) ;; The major mode might set blink-matching-check-function ;; buffer-locally so that interactive calls to ;; blink-matching-open work right, but let's not presume @@ -928,7 +989,7 @@ (save-excursion (let* ((pos (point)) (tok (funcall smie-forward-token-function))) - (unless (cadr (assoc tok smie-grammar)) + (unless (numberp (cadr (assoc tok smie-grammar))) (goto-char pos)) (setq smie--parent (smie-backward-sexp 'halfsexp)))))) @@ -969,8 +1030,14 @@ (goto-char (cadr (smie-indent--parent))) (cons 'column (+ (or offset 0) - (if (smie-indent--hanging-p) - (smie-indent-virtual) (current-column)))))) + ;; Use smie-indent-virtual when indenting relative to an opener: + ;; this will also by default use current-column unless + ;; that opener is hanging, but will additionally consult + ;; rules-function, so it gives it a chance to tweak + ;; indentation (e.g. by forcing indentation relative to + ;; its own parent, as in fn a => fn b => fn c =>). + (if (or (listp (car smie--parent)) (smie-indent--hanging-p)) + (smie-indent-virtual) (current-column)))))) (defvar smie-rule-separator-outdent 2) @@ -1030,11 +1097,7 @@ ;; FIXME: Rather than consult the number of spaces, we could *set* the ;; number of spaces so as to align the separator with the close-paren ;; while aligning the content with the rest. - (let ((parent-col - (save-excursion - (goto-char (cadr smie--parent)) - (if (smie-indent--hanging-p) - (smie-indent-virtual) (current-column)))) + (let ((parent-col (cdr (smie-rule-parent))) (parent-pos-col ;FIXME: we knew this when computing smie--parent. (save-excursion (goto-char (cadr smie--parent)) @@ -1083,7 +1146,16 @@ (+ offset (if (null base-pos) 0 (goto-char base-pos) - (if (smie-indent--hanging-p) + ;; Use smie-indent-virtual when indenting relative to an opener: + ;; this will also by default use current-column unless + ;; that opener is hanging, but will additionally consult + ;; rules-function, so it gives it a chance to tweak indentation + ;; (e.g. by forcing indentation relative to its own parent, as in + ;; fn a => fn b => fn c =>). + ;; When parent==nil it doesn't matter because the only case + ;; where it's really used is when the base-pos is hanging anyway. + (if (or (and parent (null (car parent))) + (smie-indent--hanging-p)) (smie-indent-virtual) (current-column))))) (t (error "Unknown indentation offset %s" offset)))))) @@ -1160,27 +1232,30 @@ (let* ((pos (point)) (toklevels (smie-indent-forward-token)) (token (pop toklevels))) - (if (null (car toklevels)) - (save-excursion - (goto-char pos) - ;; Different cases: - ;; - smie-indent--bolp: "indent according to others". - ;; - common hanging: "indent according to others". - ;; - SML-let hanging: "indent like parent". - ;; - if-after-else: "indent-like parent". - ;; - middle-of-line: "trust current position". - (cond - ((null (cdr toklevels)) nil) ;Not a keyword. - ((smie-indent--bolp) - ;; For an open-paren-like thingy at BOL, always indent only - ;; based on other rules (typically smie-indent-after-keyword). - nil) - ;; We're only ever here for virtual-indent. - ((smie-indent--rule :before token)) - (t - ;; By default use point unless we're hanging. - (unless (smie-indent--hanging-p) (current-column))))) - + (cond + ((< pos (line-beginning-position)) + ;; The token we just read is actually not on the line where we started. + nil) + ((not (numberp (car toklevels))) + (save-excursion + (goto-char pos) + ;; Different cases: + ;; - smie-indent--bolp: "indent according to others". + ;; - common hanging: "indent according to others". + ;; - SML-let hanging: "indent like parent". + ;; - if-after-else: "indent-like parent". + ;; - middle-of-line: "trust current position". + (cond + ((null (cdr toklevels)) nil) ;Not a keyword. + ((smie-indent--rule :before token)) + ((smie-indent--bolp) ;I.e. non-virtual indent. + ;; For an open-paren-like thingy at BOL, always indent only + ;; based on other rules (typically smie-indent-after-keyword). + nil) + (t + ;; By default use point unless we're hanging. + (unless (smie-indent--hanging-p) (current-column)))))) + (t ;; FIXME: This still looks too much like black magic!! (let* ((parent (smie-backward-sexp 'halfsexp))) ;; Different behaviors: @@ -1260,7 +1335,7 @@ ;; So we use a heuristic here, which is that we only use virtual ;; if the parent is tightly linked to the child token (they're ;; part of the same BNF rule). - (if (car parent) (current-column) (smie-indent-virtual)))))))))) + (if (car parent) (current-column) (smie-indent-virtual))))))))))) (defun smie-indent-comment () "Compute indentation of a comment." @@ -1298,10 +1373,19 @@ comment-end-skip (not (looking-at " \t*$")) ;Not just a \n comment-closer. (looking-at comment-end-skip) - (nth 4 (syntax-ppss)) - (save-excursion - (goto-char (nth 8 (syntax-ppss))) - (current-column)))) + (let ((end (match-string 0))) + (and (nth 4 (syntax-ppss)) + (save-excursion + (goto-char (nth 8 (syntax-ppss))) + (and (looking-at comment-start-skip) + (let ((start (match-string 0))) + ;; Align the common substring between starter + ;; and ender, if possible. + (if (string-match "\\(.+\\).*\n\\(.*?\\)\\1" + (concat start "\n" end)) + (+ (current-column) (match-beginning 0) + (- (match-beginning 2) (match-end 2))) + (current-column))))))))) (defun smie-indent-comment-inside () (and (nth 4 (syntax-ppss)) @@ -1319,11 +1403,11 @@ ;; The default indentation after a keyword/operator is ;; 0 for infix, t for prefix, and use another rule ;; for postfix. - ((null (nth 2 toklevel)) nil) ;A closer. - ((or (null (nth 1 toklevel)) ;An opener. - (rassoc tok smie-closer-alist)) ;An inner. + ((not (numberp (nth 2 toklevel))) nil) ;A closer. + ((or (not (numberp (nth 1 toklevel))) ;An opener. + (rassoc tok smie-closer-alist)) ;An inner. (+ (smie-indent-virtual) (smie-indent--offset 'basic))) ; - (t (smie-indent-virtual)))))) ;An infix. + (t (smie-indent-virtual)))))) ;An infix. (defun smie-indent-exps () ;; Indentation of sequences of simple expressions without === modified file 'lisp/files.el' --- lisp/files.el 2010-11-09 20:07:10 +0000 +++ lisp/files.el 2010-11-18 03:54:14 +0000 @@ -3224,7 +3224,10 @@ evaluates to a non-nil value with VAL as an argument." (or (member (cons sym val) safe-local-variable-values) (let ((safep (get sym 'safe-local-variable))) - (and (functionp safep) (funcall safep val))))) + (and (functionp safep) + ;; If the function signals an error, that means it + ;; can't assure us that the value is safe. + (with-demoted-errors (funcall safep val)))))) (defun risky-local-variable-p (sym &optional ignored) "Non-nil if SYM could be dangerous as a file-local variable. === modified file 'lisp/ls-lisp.el' --- lisp/ls-lisp.el 2010-11-11 08:28:35 +0000 +++ lisp/ls-lisp.el 2010-11-18 03:54:14 +0000 @@ -103,10 +103,16 @@ (ls-lisp-set-options))) :group 'ls-lisp) +;; Only made an obsolete alias in 23.3. Before that, the initial +;; value was set according to: +;; (or (memq ls-lisp-emulation '(MS-Windows MacOS)) +;; (and (boundp 'ls-lisp-dired-ignore-case) ls-lisp-dired-ignore-case)) +;; Which isn't the right thing to do. +(define-obsolete-variable-alias 'ls-lisp-dired-ignore-case + 'ls-lisp-ignore-case "21.1") + (defcustom ls-lisp-ignore-case - ;; Name change for consistency with other option names. - (or (memq ls-lisp-emulation '(MS-Windows MacOS)) - (and (boundp 'ls-lisp-dired-ignore-case) ls-lisp-dired-ignore-case)) + (memq ls-lisp-emulation '(MS-Windows MacOS)) "Non-nil causes ls-lisp alphabetic sorting to ignore case." :set-after '(ls-lisp-emulation) :type 'boolean === modified file 'lisp/mouse-sel.el' --- lisp/mouse-sel.el 2010-11-01 06:13:43 +0000 +++ lisp/mouse-sel.el 2010-11-18 03:54:14 +0000 @@ -1,4 +1,4 @@ -;;; mouse-sel.el --- multi-click selection support for Emacs 19 +;;; mouse-sel.el --- multi-click selection support ;; Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006, ;; 2007, 2008, 2009, 2010 Free Software Foundation, Inc. === modified file 'lisp/novice.el' --- lisp/novice.el 2010-01-13 08:35:10 +0000 +++ lisp/novice.el 2010-11-13 09:16:18 +0000 @@ -1,7 +1,7 @@ ;;; novice.el --- handling of disabled commands ("novice mode") for Emacs -;; Copyright (C) 1985, 1986, 1987, 1994, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1987, 1994, 2001, 2002, 2003, 2004, 2005, +;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: internal, help @@ -110,9 +110,9 @@ (not (string= "" user-init-file)) (y-or-n-p "Enable command for future editing sessions also? ")) (enable-command cmd) - (put cmd 'disabled nil))) - (?n nil) - (t (call-interactively cmd))))) + (put cmd 'disabled nil)))) + (or (char-equal char ?n) + (call-interactively cmd)))) (defun en/disable-command (command disable) (unless (commandp command) @@ -169,5 +169,4 @@ (provide 'novice) -;; arch-tag: f83c0f96-497e-4db6-a430-8703716c6dd9 ;;; novice.el ends here === modified file 'lisp/printing.el' --- lisp/printing.el 2010-10-03 02:17:47 +0000 +++ lisp/printing.el 2010-11-18 03:54:14 +0000 @@ -3438,12 +3438,7 @@ (defun pr-menu-bind () "Install `printing' menu in the menubar. - -On Emacs 20, it replaces the Tools/Print menu by Tools/Printing menu. - -On Emacs 21 and 22, it replaces the File/Print* menu entries by File/Print -menu. - +This replaces the File/Print* menu entries with a File/Print sub-menu. Calls `pr-update-menus' to adjust menus." (interactive) (pr-global-menubar pr-menu-spec) @@ -6670,5 +6665,4 @@ (provide 'printing) -;; arch-tag: 9ce9ac3f-0f60-4370-900b-1943215d9d18 ;;; printing.el ends here === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2010-11-17 15:00:16 +0000 +++ lisp/progmodes/python.el 2010-11-18 03:54:14 +0000 @@ -2807,7 +2807,7 @@ process is started. If you use this, you will probably want to ensure that the current arguments are retained (they will be included in the prompt). This argument is ignored when this function is called -programmatically, or when running in Emacs 19.34 or older. +programmatically. Note: You can toggle between using the CPython interpreter and the JPython interpreter by hitting \\[python-toggle-shells]. This toggles === modified file 'lisp/server.el' --- lisp/server.el 2010-11-09 20:07:10 +0000 +++ lisp/server.el 2010-11-18 03:54:14 +0000 @@ -609,7 +609,7 @@ (defun server-force-stop () "Kill all connections to the current server. This function is meant to be called from `kill-emacs-hook'." - (server-start nil t)) + (server-start t t)) ;;;###autoload (defun server-force-delete (&optional name) === modified file 'lisp/simple.el' --- lisp/simple.el 2010-11-13 03:46:00 +0000 +++ lisp/simple.el 2010-11-18 03:54:14 +0000 @@ -2990,11 +2990,6 @@ Optional second argument REPLACE non-nil means that STRING will replace the front of the kill ring, rather than being added to the list. -Optional third arguments YANK-HANDLER controls how the STRING is later -inserted into a buffer; see `insert-for-yank' for details. -When a yank handler is specified, STRING must be non-empty (the yank -handler, if non-nil, is stored as a `yank-handler' text property on STRING). - When `save-interprogram-paste-before-kill' and `interprogram-paste-function' are non-nil, saves the interprogram paste string(s) into `kill-ring' before STRING. @@ -3034,22 +3029,19 @@ (setq kill-ring-yank-pointer kill-ring) (if interprogram-cut-function (funcall interprogram-cut-function string))) +(set-advertised-calling-convention + 'kill-new '(string &optional replace) "23.3") (defun kill-append (string before-p &optional yank-handler) "Append STRING to the end of the latest kill in the kill ring. If BEFORE-P is non-nil, prepend STRING to the kill. -Optional third argument YANK-HANDLER, if non-nil, specifies the -yank-handler text property to be set on the combined kill ring -string. If the specified yank-handler arg differs from the -yank-handler property of the latest kill string, this function -adds the combined string to the kill ring as a new element, -instead of replacing the last kill with it. If `interprogram-cut-function' is set, pass the resulting kill to it." (let* ((cur (car kill-ring))) (kill-new (if before-p (concat string cur) (concat cur string)) (or (= (length cur) 0) (equal yank-handler (get-text-property 0 'yank-handler cur))) yank-handler))) +(set-advertised-calling-convention 'kill-append '(string before-p) "23.3") (defcustom yank-pop-change-selection nil "If non-nil, rotating the kill ring changes the window system selection." @@ -3130,11 +3122,7 @@ Any command that calls this function is a \"kill command\". If the previous command was also a kill command, the text killed this time appends to the text killed last time -to make one entry in the kill ring. - -In Lisp code, optional third arg YANK-HANDLER, if non-nil, -specifies the yank-handler text property to be set on the killed -text. See `insert-for-yank'." +to make one entry in the kill ring." ;; Pass point first, then mark, because the order matters ;; when calling kill-append. (interactive (list (point) (mark))) @@ -3166,6 +3154,7 @@ (barf-if-buffer-read-only) ;; If the buffer isn't read-only, the text is. (signal 'text-read-only (list (current-buffer))))))) +(set-advertised-calling-convention 'kill-region '(beg end) "23.3") ;; copy-region-as-kill no longer sets this-command, because it's confusing ;; to get two copies of the text when the user accidentally types M-w and === modified file 'lisp/speedbar.el' --- lisp/speedbar.el 2010-11-09 05:33:07 +0000 +++ lisp/speedbar.el 2010-11-18 03:54:14 +0000 @@ -1692,8 +1692,7 @@ (speedbar-enable-update))) (defun speedbar-toggle-images () - "Toggle use of images in the speedbar frame. -Images are not available in Emacs 20 or earlier." + "Toggle use of images in the speedbar frame." (interactive) (setq speedbar-use-images (not speedbar-use-images)) (speedbar-refresh)) === modified file 'lisp/subr.el' --- lisp/subr.el 2010-11-02 01:50:22 +0000 +++ lisp/subr.el 2010-11-18 03:54:14 +0000 @@ -954,7 +954,8 @@ ((null spacing) (setq spacing 0))) (cons (/ (car pair) (frame-char-width frame)) - (/ (cdr pair) (+ (frame-char-height frame) spacing)))))))) + (- (/ (cdr pair) (+ (frame-char-height frame) spacing)) + (if (null header-line-format) 0 1)))))))) (defun posn-actual-col-row (position) "Return the actual column and row in POSITION, measured in characters. === modified file 'lisp/textmodes/picture.el' --- lisp/textmodes/picture.el 2010-11-06 20:23:42 +0000 +++ lisp/textmodes/picture.el 2010-11-18 03:54:14 +0000 @@ -226,16 +226,30 @@ (picture-motion (- arg))) (defun picture-mouse-set-point (event) - "Move point to the position clicked on, making whitespace if necessary." + "Move point to the position of EVENT, making whitespace if necessary." (interactive "e") - (let* ((pos (posn-col-row (event-start event))) - (x (car pos)) - (y (cdr pos)) - (current-row (count-lines (window-start) (line-beginning-position)))) - (unless (equal x (current-column)) - (picture-forward-column (- x (current-column)))) - (unless (equal y current-row) - (picture-move-down (- y current-row))))) + (let ((position (event-start event))) + (unless (posn-area position) ; Ignore EVENT unless in text area + (let* ((window (posn-window position)) + (frame (if (framep window) window (window-frame window))) + (pair (posn-x-y position)) + (start-pos (window-start window)) + (start-pair (posn-x-y (posn-at-point start-pos))) + (dx (- (car pair) (car start-pair))) + (dy (- (cdr pair) (cdr start-pair))) + (char-ht (frame-char-height frame)) + (spacing (when (display-graphic-p frame) + (or (with-current-buffer (window-buffer window) + line-spacing) + (frame-parameter frame 'line-spacing)))) + rows cols) + (cond ((floatp spacing) + (setq spacing (truncate (* spacing char-ht)))) + ((null spacing) + (setq spacing 0))) + (goto-char start-pos) + (picture-move-down (/ dy (+ char-ht spacing))) + (picture-forward-column (/ dx (frame-char-width frame))))))) ;; Picture insertion and deletion. === modified file 'lisp/vc/vc-hg.el' --- lisp/vc/vc-hg.el 2010-11-09 20:07:10 +0000 +++ lisp/vc/vc-hg.el 2010-11-18 03:54:14 +0000 @@ -134,6 +134,10 @@ :version "23.1" :group 'vc) +(defcustom vc-hg-program "hg" + "Name of the Mercurial executable (excluding any arguments)." + :type 'string + :group 'vc) ;;; Properties of the backend @@ -174,7 +178,7 @@ (append (list "TERM=dumb" "LANGUAGE=C") process-environment))) (process-file - "hg" nil t nil + vc-hg-program nil t nil "--config" "alias.status=status" "--config" "defaults.status=" "status" "-A" (file-relative-name file))) @@ -212,7 +216,7 @@ (let ((process-environment avoid-local-env)) ;; Ignore all errors. (process-file - "hg" nil t nil + vc-hg-program nil t nil "--config" "alias.parents=parents" "--config" "defaults.parents=" "parents" "--template" "{rev}" (file-relative-name file))) @@ -227,7 +231,7 @@ (condition-case nil (let ((process-environment avoid-local-env)) (process-file - "hg" nil nil nil + vc-hg-program nil nil nil ;; We use "log" here, if there's a faster command ;; that returns true for an 'added file and false ;; for an 'unregistered one, we could use that. @@ -620,7 +624,7 @@ "A wrapper around `vc-do-command' for use in vc-hg.el. The difference to vc-do-command is that this function always invokes `hg', and that it passes `vc-hg-global-switches' to it before FLAGS." - (apply 'vc-do-command (or buffer "*vc*") okstatus "hg" file-or-list + (apply 'vc-do-command (or buffer "*vc*") okstatus vc-hg-program file-or-list (if (stringp vc-hg-global-switches) (cons vc-hg-global-switches flags) (append vc-hg-global-switches === modified file 'lisp/wid-edit.el' --- lisp/wid-edit.el 2010-10-24 23:40:55 +0000 +++ lisp/wid-edit.el 2010-11-18 03:54:14 +0000 @@ -316,9 +316,8 @@ (defvar widget-field-use-before-change t "Non-nil means use `before-change-functions' to track editable fields. -This enables the use of undo, but doesn't work on Emacs 19.34 and earlier. -Using before hooks also means that the :notify function can't know the -new value.") +This enables the use of undo. Using before hooks also means that +the :notify function can't know the new value.") (defun widget-specify-field (widget from to) "Specify editable button for WIDGET between FROM and TO." @@ -1053,7 +1052,7 @@ (defvar widget-use-overlay-change t "If non-nil, use overlay change functions to tab around in the buffer. -This is much faster, but doesn't work reliably on Emacs 19.34.") +This is much faster.") (defun widget-move (arg) "Move point to the ARG next field or button. @@ -3782,5 +3781,4 @@ (provide 'wid-edit) -;; arch-tag: a076e75e-18a1-4b46-8be5-3f317bcbc707 ;;; wid-edit.el ends here === modified file 'nt/INSTALL' --- nt/INSTALL 2010-10-13 14:50:06 +0000 +++ nt/INSTALL 2010-11-18 03:54:14 +0000 @@ -105,9 +105,9 @@ since v1.3.3, include the MinGW headers and libraries as an integral part). - Note that building Emacs with Visual Studio 2005 (VC++ 8.0) is not - supported at this time, due to changes introduced by Microsoft into - the libraries shipped with the compiler. + Note that building Emacs with Visual Studio 2005 (VC++ 8.0) and + later is not supported at this time, due to changes introduced by + Microsoft into the libraries shipped with the compiler. The rest of this file assumes you have a working development environment. If you just installed such an environment, try === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-17 19:15:24 +0000 +++ src/ChangeLog 2010-11-18 03:54:14 +0000 @@ -1,3 +1,24 @@ +2010-11-18 Jan Djärv + + * xsettings.c (init_gconf): Check HAVE_G_TYPE_INIT. + + * config.in (HAVE_G_TYPE_INIT): New symbol. + +2010-11-18 Eli Zaretskii + + * lread.c (Fload): Mention `load-in-progress' and + `load-file-name'. (Bug#7346) + + * keyboard.c (kbd_buffer_nr_stored): Define only ifdef subprocesses. + (kbd_buffer_store_event_hold, kbd_buffer_get_event) + (tty_read_avail_input): Call kbd_buffer_nr_stored only ifdef + subprocesses. Use buffer_free only ifdef subprocesses. + + * process.c (init_process) [subprocesses]: Init kbd_is_on_hold in + the subprocesses version, not in the non-subprocesses one. + + * Makefile.in: Don't use ## comment, it breaks the MSDOS build. + 2010-11-17 Eli Zaretskii * xdisp.c (set_cursor_from_row): Fix cursor positioning in empty === modified file 'src/config.in' --- src/config.in 2010-11-15 06:39:02 +0000 +++ src/config.in 2010-11-18 03:54:14 +0000 @@ -294,6 +294,9 @@ /* Define to 1 if you have the `gtk_widget_set_has_window' function. */ #undef HAVE_GTK_WIDGET_SET_HAS_WINDOW +/* Define to 1 if you have the `g_type_init' function. */ +#undef HAVE_G_TYPE_INIT + /* Define to 1 if netdb.h declares h_errno. */ #undef HAVE_H_ERRNO === modified file 'src/keyboard.c' --- src/keyboard.c 2010-11-17 02:37:45 +0000 +++ src/keyboard.c 2010-11-18 03:54:14 +0000 @@ -3601,6 +3601,7 @@ return FRAME_KBOARD (XFRAME (frame)); } +#ifdef subprocesses /* Return the number of slots occupied in kbd_buffer. */ static int @@ -3613,6 +3614,7 @@ : ((kbd_buffer + KBD_BUFFER_SIZE) - kbd_fetch_ptr + (kbd_store_ptr - kbd_buffer))); } +#endif /* subprocesses */ Lisp_Object Vthrow_on_input; @@ -3734,6 +3736,7 @@ { *kbd_store_ptr = *event; ++kbd_store_ptr; +#ifdef subprocesses if (kbd_buffer_nr_stored () > KBD_BUFFER_SIZE/2 && ! kbd_on_hold_p ()) { /* Don't read keyboard input until we have processed kbd_buffer. @@ -3745,6 +3748,7 @@ #endif stop_polling (); } +#endif /* subprocesses */ } /* If we're inside while-no-input, and this event qualifies @@ -3905,6 +3909,7 @@ register int c; Lisp_Object obj; +#ifdef subprocesses if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4) { /* Start reading input again, we have processed enough so we can @@ -3916,6 +3921,7 @@ #endif /* SIGIO */ start_polling (); } +#endif /* subprocesses */ if (noninteractive /* In case we are running as a daemon, only do this before @@ -7058,10 +7064,12 @@ int n_to_read, i; struct tty_display_info *tty = terminal->display_info.tty; int nread = 0; +#ifdef subprocesses int buffer_free = KBD_BUFFER_SIZE - kbd_buffer_nr_stored () - 1; if (kbd_on_hold_p () || buffer_free <= 0) return 0; +#endif /* subprocesses */ if (!terminal->name) /* Don't read from a dead terminal. */ return 0; @@ -7143,9 +7151,11 @@ #endif #endif +#ifdef subprocesses /* Don't read more than we can store. */ if (n_to_read > buffer_free) n_to_read = buffer_free; +#endif /* subprocesses */ /* Now read; for one reason or another, this will not block. NREAD is set to the number of chars read. */ === modified file 'src/lread.c' --- src/lread.c 2010-10-22 08:02:31 +0000 +++ src/lread.c 2010-11-18 03:54:14 +0000 @@ -966,6 +966,10 @@ `require' calls, in an element of `load-history' whose car is the file name loaded. See `load-history'. +While the file is in the process of being loaded, the variable +`load-in-progress' is non-nil and the variable `load-file-name' +is bound to the file's name. + Return t if the file exists and loads successfully. */) (Lisp_Object file, Lisp_Object noerror, Lisp_Object nomessage, Lisp_Object nosuffix, Lisp_Object must_suffix) { === modified file 'src/xsettings.c' --- src/xsettings.c 2010-11-12 09:31:44 +0000 +++ src/xsettings.c 2010-11-18 03:54:14 +0000 @@ -627,7 +627,9 @@ #if defined (HAVE_GCONF) && defined (HAVE_XFT) char *s; +#ifdef HAVE_G_TYPE_INIT g_type_init (); +#endif gconf_client = gconf_client_get_default (); s = gconf_client_get_string (gconf_client, SYSTEM_MONO_FONT, NULL); if (s) ------------------------------------------------------------ revno: 102427 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-11-17 22:02:15 -0500 message: * lisp/textmodes/rst.el: Minor cleanup to improve style. (rst-get-decoration): Eliminate unneeded assignment. (rst-update-section, rst-promote-region, rst-straighten-decorations) (rst-section-tree, rst-adjust): Use point-marker. (rst-toc-mode-mouse-goto): Avoid setq. (rst-shift-region-guts, rst-shift-region-left) (rst-iterate-leftmost-paragraphs, rst-iterate-leftmost-paragraphs-2) (rst-convert-bullets-to-enumeration): Use copy-marker. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-18 02:44:44 +0000 +++ lisp/ChangeLog 2010-11-18 03:02:15 +0000 @@ -1,5 +1,15 @@ 2010-11-18 Stefan Monnier + Minor cleanup to improve style. + * textmodes/rst.el (rst-update-section): Use point-marker. + (rst-get-decoration): Eliminate unneeded assignment. + (rst-promote-region, rst-straighten-decorations) + (rst-section-tree, rst-adjust): Use point-marker. + (rst-toc-mode-mouse-goto): Avoid setq. + (rst-shift-region-guts, rst-shift-region-left) + (rst-iterate-leftmost-paragraphs, rst-iterate-leftmost-paragraphs-2) + (rst-convert-bullets-to-enumeration): Use copy-marker. + * minibuffer.el (completion-fail-discreetly): New var. (completion--do-completion): Use it. === modified file 'lisp/textmodes/rst.el' --- lisp/textmodes/rst.el 2010-10-03 02:26:35 +0000 +++ lisp/textmodes/rst.el 2010-11-18 03:02:15 +0000 @@ -698,12 +698,10 @@ requested decoration." (interactive) - (let (marker + (end-of-line) + (let ((marker (point-marker)) len) - (end-of-line) - (setq marker (point-marker)) - ;; Fixup whitespace at the beginning and end of the line (if (or (null indent) (eq style 'simple)) (setq indent 0)) @@ -789,7 +787,7 @@ just finds all of them in a file. You can then invoke another function to remove redundancies and inconsistencies." - (let (positions + (let ((positions ()) (curline 1)) ;; Iterate over all the section titles/decorations in the file. (save-excursion @@ -870,7 +868,7 @@ A point can be specified to go to the given location before extracting the decoration." - (let (char style indent) + (let (char style) (save-excursion (if point (goto-char point)) (beginning-of-line) @@ -879,10 +877,10 @@ (forward-line -1) (rst-line-homogeneous-nodent-p))) - (under (save-excursion - (forward-line +1) - (rst-line-homogeneous-nodent-p))) - ) + (under (save-excursion + (forward-line +1) + (rst-line-homogeneous-nodent-p))) + ) ;; Check that the line above the overline is not part of a title ;; above it. @@ -910,15 +908,11 @@ ;; Both overline and underline. (t (setq char under - style 'over-and-under)) - ) - ) - ) - ;; Find indentation. - (setq indent (save-excursion (back-to-indentation) (current-column))) - ) - ;; Return values. - (list char style indent))) + style 'over-and-under))))) + ;; Return values. + (list char style + ;; Find indentation. + (save-excursion (back-to-indentation) (current-column)))))) (defun rst-get-decorations-around (&optional alldecos) @@ -1041,7 +1035,7 @@ (interactive) (let* (;; Save our original position on the current line. - (origpt (set-marker (make-marker) (point))) + (origpt (point-marker)) ;; Parse the positive and negative prefix arguments. (reverse-direction @@ -1395,32 +1389,28 @@ ;; Create a list of markers for all the decorations which are found within ;; the region. (save-excursion - (let (m line) + (let (line) (while (and cur (< (setq line (caar cur)) region-end-line)) - (setq m (make-marker)) (goto-char (point-min)) (forward-line (1- line)) - (push (list (set-marker m (point)) (cdar cur)) marker-list) + (push (list (point-marker) (cdar cur)) marker-list) (setq cur (cdr cur)) )) ;; Apply modifications. - (let (nextdeco) - (dolist (p marker-list) - ;; Go to the decoration to promote. - (goto-char (car p)) - - ;; Rotate the next decoration. - (setq nextdeco (rst-get-next-decoration - (cadr p) hier suggestion demote)) - - ;; Update the decoration. - (apply 'rst-update-section nextdeco) - - ;; Clear marker to avoid slowing down the editing after we're done. - (set-marker (car p) nil) - )) + (dolist (p marker-list) + ;; Go to the decoration to promote. + (goto-char (car p)) + + ;; Update the decoration. + (apply 'rst-update-section + ;; Rotate the next decoration. + (rst-get-next-decoration + (cadr p) hier suggestion demote)) + + ;; Clear marker to avoid slowing down the editing after we're done. + (set-marker (car p) nil)) (setq deactivate-mark nil) - ))) + ))) @@ -1463,11 +1453,10 @@ (levels-and-markers (mapcar (lambda (deco) (cons (rst-position (cdr deco) hier) - (let ((m (make-marker))) + (progn (goto-char (point-min)) (forward-line (1- (car deco))) - (set-marker m (point)) - m))) + (point-marker)))) alldecos)) ) (dolist (lm levels-and-markers) @@ -1511,7 +1500,7 @@ "Find all the positions of prefixes in region between BEG and END. This is used to find bullets and enumerated list items. PFX-RE is a regular expression for matching the lines with items." - (let (pfx) + (let ((pfx ())) (save-excursion (goto-char beg) (while (< (point) end) @@ -1635,10 +1624,9 @@ (forward-line (1- (car deco))) (list (gethash (cons (cadr deco) (caddr deco)) levels) (rst-get-stripped-line) - (let ((m (make-marker))) + (progn (beginning-of-line 1) - (set-marker m (point))) - )) + (point-marker)))) alldecos))) (let ((lcontnr (cons nil lines))) @@ -2057,11 +2045,11 @@ "In `rst-toc' mode, go to the occurrence whose line you click on. EVENT is the input event." (interactive "e") - (let (pos) + (let ((pos (with-current-buffer (window-buffer (posn-window (event-end event))) (save-excursion (goto-char (posn-point (event-end event))) - (setq pos (rst-toc-mode-find-section)))) + (rst-toc-mode-find-section))))) (pop-to-buffer (marker-buffer pos)) (goto-char pos) (recenter 5))) @@ -2306,8 +2294,8 @@ (defun rst-shift-region-guts (find-next-fun offset-fun) "(See `rst-shift-region-right' for a description)." - (let* ((mbeg (set-marker (make-marker) (region-beginning))) - (mend (set-marker (make-marker) (region-end))) + (let* ((mbeg (copy-marker (region-beginning))) + (mend (copy-marker (region-end))) (tabs (rst-compute-bullet-tabs mbeg)) (leftmostcol (rst-find-leftmost-column (region-beginning) (region-end))) ) @@ -2386,8 +2374,8 @@ indentation is removed, up to the leftmost character in the region, and automatic filling is disabled." (interactive "P") - (let ((mbeg (set-marker (make-marker) (region-beginning))) - (mend (set-marker (make-marker) (region-end))) + (let ((mbeg (copy-marker (region-beginning))) + (mend (copy-marker (region-end))) (leftmostcol (rst-find-leftmost-column (region-beginning) (region-end))) (rst-shift-fill-region @@ -2421,8 +2409,7 @@ of each paragraph only." `(save-excursion (let ((leftcol (rst-find-leftmost-column ,beg ,end)) - (endm (set-marker (make-marker) ,end)) - ) + (endm (copy-marker ,end))) (do* (;; Iterate lines (l (progn (goto-char ,beg) (back-to-indentation)) @@ -2460,8 +2447,7 @@ `(save-excursion (let ((,leftmost (rst-find-leftmost-column ,beg ,end)) - (endm (set-marker (make-marker) ,end)) - ) + (endm (copy-marker ,end))) (do* (;; Iterate lines (l (progn (goto-char ,beg) (back-to-indentation)) @@ -2538,9 +2524,7 @@ (let* (;; Find items and convert the positions to markers. (items (mapcar (lambda (x) - (cons (let ((m (make-marker))) - (set-marker m (car x)) - m) + (cons (copy-marker (car x)) (cdr x))) (rst-find-pfx-in-region beg end rst-re-items))) (count 1) ------------------------------------------------------------ revno: 102426 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-11-17 21:44:44 -0500 message: * lisp/minibuffer.el (completion-fail-discreetly): New var. (completion--do-completion): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-18 02:43:42 +0000 +++ lisp/ChangeLog 2010-11-18 02:44:44 +0000 @@ -1,5 +1,8 @@ 2010-11-18 Stefan Monnier + * minibuffer.el (completion-fail-discreetly): New var. + (completion--do-completion): Use it. + * electric.el (electric-pair-pairs): New var. (electric-pair-post-self-insert-function): Use it. (electric-layout-post-self-insert-function): Don't insert a before === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2010-11-09 20:07:10 +0000 +++ lisp/minibuffer.el 2010-11-18 02:44:44 +0000 @@ -530,6 +530,9 @@ (make-variable-buffer-local 'completion-all-sorted-completions) (defvar completion-cycling nil) +(defvar completion-fail-discreetly nil + "If non-nil, stay quiet when there is no match.") + (defun completion--do-completion (&optional try-completion-function) "Do the completion and return a summary of what happened. M = completion was performed, the text was Modified. @@ -558,7 +561,9 @@ (cond ((null comp) (minibuffer-hide-completions) - (ding) (minibuffer-message "No match") (minibuffer--bitset nil nil nil)) + (unless completion-fail-discreetly + (ding) (minibuffer-message "No match")) + (minibuffer--bitset nil nil nil)) ((eq t comp) (minibuffer-hide-completions) (goto-char (field-end)) ------------------------------------------------------------ revno: 102425 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-11-17 21:43:42 -0500 message: * lisp/electric.el (electric-pair-pairs): New var. (electric-pair-post-self-insert-function): Use it. (electric-layout-post-self-insert-function): Don't insert a before newline unless it's actually needed. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-17 15:07:48 +0000 +++ lisp/ChangeLog 2010-11-18 02:43:42 +0000 @@ -1,3 +1,10 @@ +2010-11-18 Stefan Monnier + + * electric.el (electric-pair-pairs): New var. + (electric-pair-post-self-insert-function): Use it. + (electric-layout-post-self-insert-function): Don't insert a before + newline unless it's actually needed. + 2010-11-17 Stefan Monnier * progmodes/python.el (run-python): Explain why we remove the current === modified file 'lisp/electric.el' --- lisp/electric.el 2010-11-16 21:14:46 +0000 +++ lisp/electric.el 2010-11-18 02:43:42 +0000 @@ -261,6 +261,11 @@ ;; Electric pairing. +(defcustom electric-pair-pairs + '((?\" . ?\")) + "Alist of pairs that should be used regardless of major mode." + :type '(repeat (cons character character))) + (defcustom electric-pair-skip-self t "If non-nil, skip char instead of inserting a second closing paren. When inserting a closing paren character right before the same character, @@ -271,13 +276,18 @@ (defun electric-pair-post-self-insert-function () (let* ((syntax (and (eq (char-before) last-command-event) ; Sanity check. - (char-syntax last-command-event))) + (let ((x (assq last-command-event electric-pair-pairs))) + (cond + (x (if (eq (car x) (cdr x)) ?\" ?\()) + ((rassq last-command-event electric-pair-pairs) ?\)) + (t (char-syntax last-command-event)))))) ;; FIXME: when inserting the closer, we should maybe use ;; self-insert-command, although it may prove tricky running ;; post-self-insert-hook recursively, and we wouldn't want to trigger ;; blink-matching-open. (closer (if (eq syntax ?\() - (cdr (aref (syntax-table) last-command-event)) + (cdr (or (assq last-command-event electric-pair-pairs) + (aref (syntax-table) last-command-event))) last-command-event))) (cond ;; Wrap a pair around the active region. @@ -351,10 +361,13 @@ ;; It happened to make electric-indent-mode work automatically with ;; electric-layout-mode (at the cost of re-indenting lines ;; multiple times), but I'm not sure it's what we want. - (before (goto-char (1- pos)) (insert "\n")) - (after (insert "\n")) - (around (goto-char (1- pos)) (insert "\n") - (forward-char 1) (insert "\n"))) + (before (goto-char (1- pos)) (skip-chars-backward " \t") + (unless (bolp) (insert "\n"))) + (after (insert "\n")) ; FIXME: check eolp before inserting \n? + (around (save-excursion + (goto-char (1- pos)) (skip-chars-backward " \t") + (unless (bolp) (insert "\n"))) + (insert "\n"))) ; FIXME: check eolp before inserting \n? (goto-char end))))) ;;;###autoload ------------------------------------------------------------ revno: 102424 committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2010-11-18 02:38:03 +0000 message: gnus.texi (Misc Article): Document gnus-inhibit-images. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-11-13 03:33:24 +0000 +++ doc/misc/ChangeLog 2010-11-18 02:38:03 +0000 @@ -1,3 +1,7 @@ +2010-11-18 Katsumi Yamaoka + + * gnus.texi (Misc Article): Document gnus-inhibit-images. + 2010-11-12 Katsumi Yamaoka * gnus.texi (Article Washing): Fix typo. === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2010-11-12 05:59:53 +0000 +++ doc/misc/gnus.texi 2010-11-18 02:38:03 +0000 @@ -12461,6 +12461,8 @@ will be fetched as a result of reading mail, so that nobody can use web bugs (and the like) to track whether you've read email. +Also @pxref{Misc Article} for @code{gnus-inhibit-images}. + @item gnus-html-cache-directory @vindex gnus-html-cache-directory Gnus will download and cache images according to how @@ -12941,6 +12943,15 @@ @uref{http://www.gnu.org/software/libidn/, GNU Libidn}, and this variable is only enabled if you have installed it. +@vindex gnus-inhibit-images +@item gnus-inhibit-images +If this is non-@code{nil}, inhibit displaying of images inline in the +article body. It is effective to images that are in articles as +@acronym{MIME} parts, and images in @acronym{HTML} articles rendered +when @code{mm-text-html-renderer} (@pxref{Display Customization, +,Display Customization, emacs-mime, The Emacs MIME Manual}) is +@code{shr} or @code{gnus-w3m}. + @end table ------------------------------------------------------------ revno: 102423 committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2010-11-18 02:00:00 +0000 message: gnus-html.el: Don't display images if gnus-inhibit-images is non-nil. (gnus-html-wash-images): Don't display images if gnus-inhibit-images is non-nil; register displayer for cid images. (gnus-html-display-image): Work for cid image. (gnus-html-insert-image): Allow arguments. (gnus-html-put-image): Inhibit read-only. (gnus-html-prefetch-images): Don't prefetch images if gnus-inhibit-images is non-nil. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-17 22:15:24 +0000 +++ lisp/gnus/ChangeLog 2010-11-18 02:00:00 +0000 @@ -1,3 +1,13 @@ +2010-11-18 Katsumi Yamaoka + + * gnus-html.el (gnus-html-wash-images): Don't display images if + gnus-inhibit-images is non-nil; register displayer for cid images. + (gnus-html-display-image): Work for cid image. + (gnus-html-insert-image): Allow arguments. + (gnus-html-put-image): Inhibit read-only. + (gnus-html-prefetch-images): Don't prefetch images if + gnus-inhibit-images is non-nil. + 2010-11-17 Lars Magne Ingebrigtsen * shr.el (shr-put-image): Break lines when inserting big pictures. === modified file 'lisp/gnus/gnus-html.el' --- lisp/gnus/gnus-html.el 2010-11-16 00:04:25 +0000 +++ lisp/gnus/gnus-html.el 2010-11-18 02:00:00 +0000 @@ -169,7 +169,7 @@ (defun gnus-html-wash-images () "Run through current buffer and replace img tags by images." - (let (tag parameters string start end images url) + (let (tag parameters string start end images url alt-text) (goto-char (point-min)) ;; Search for all the images first. (while (re-search-forward "]*\\)>" nil t) @@ -180,81 +180,93 @@ (delete-region (match-beginning 0) (match-end 0))) (setq end (point)) (when (string-match "src=\"\\([^\"]+\\)" parameters) - (setq url (gnus-html-encode-url (match-string 1 parameters))) (gnus-message 8 "gnus-html-wash-tags: fetching image URL %s" url) - (if (string-match "^cid:\\(.*\\)" url) + (setq url (gnus-html-encode-url (match-string 1 parameters)) + alt-text (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)" + parameters) + (xml-substitute-special (match-string 2 parameters)))) + (gnus-add-text-properties + start end + (list 'image-url url + 'image-displayer `(lambda (url start end) + (gnus-html-display-image url start end + ,alt-text)) + 'gnus-image (list url start end alt-text))) + (gnus-overlay-put (gnus-make-overlay start end) + 'local-map gnus-html-image-map) + (if (string-match "\\`cid:" url) ;; URLs with cid: have their content stashed in other ;; parts of the MIME structure, so just insert them ;; immediately. - (let* ((handle (mm-get-content-id - (setq url (match-string 1 url)))) - (image (when handle - (gnus-create-image + (let* ((handle (mm-get-content-id (substring url (match-end 0)))) + (image (when (and handle + (not gnus-inhibit-images)) + (gnus-create-image (mm-with-part handle (buffer-string)) nil t)))) - (when image - (let ((string (buffer-substring start end))) - (delete-region start end) - (gnus-put-image (gnus-rescale-image - image (gnus-html-maximum-image-size)) - (gnus-string-or string "*") 'cid) - (gnus-add-image 'cid image)))) + (if image + (progn + (gnus-put-image + (gnus-rescale-image + image (gnus-html-maximum-image-size)) + (gnus-string-or (prog1 + (buffer-substring start end) + (delete-region start end)) + "*") + 'cid) + (gnus-add-image 'cid image)) + (widget-convert-button + 'link start end + :action 'gnus-html-insert-image + :help-echo url + :keymap gnus-html-image-map + :button-keymap gnus-html-image-map))) ;; Normal, external URL. - (let ((alt-text - (when (string-match "\\(alt\\|title\\)=\"\\([^\"]+\\)" - parameters) - (xml-substitute-special (match-string 2 parameters))))) - (gnus-put-text-property start end 'image-url url) - (gnus-put-text-property - start end 'image-displayer - (lambda (url start end) - (gnus-html-display-image url start end))) - (if (gnus-html-image-url-blocked-p - url - (if (buffer-live-p gnus-summary-buffer) - (with-current-buffer gnus-summary-buffer - (gnus-blocked-images)) - (gnus-blocked-images))) - (progn - (widget-convert-button - 'link start end - :action 'gnus-html-insert-image - :help-echo url - :keymap gnus-html-image-map - :button-keymap gnus-html-image-map) - (let ((overlay (gnus-make-overlay start end)) - (spec (list url start end alt-text))) - (gnus-overlay-put overlay 'local-map gnus-html-image-map) - (gnus-overlay-put overlay 'gnus-image spec) - (gnus-put-text-property - start end - 'gnus-image spec))) - ;; Non-blocked url - (let ((width - (when (string-match "width=\"?\\([0-9]+\\)" parameters) - (string-to-number (match-string 1 parameters)))) - (height - (when (string-match "height=\"?\\([0-9]+\\)" parameters) - (string-to-number (match-string 1 parameters))))) - ;; Don't fetch images that are really small. They're - ;; probably tracking pictures. - (when (and (or (null height) - (> height 4)) - (or (null width) - (> width 4))) - (gnus-html-display-image url start end alt-text)))))))))) + (if (or gnus-inhibit-images + (gnus-html-image-url-blocked-p + url + (if (buffer-live-p gnus-summary-buffer) + (with-current-buffer gnus-summary-buffer + (gnus-blocked-images)) + (gnus-blocked-images)))) + (widget-convert-button + 'link start end + :action 'gnus-html-insert-image + :help-echo url + :keymap gnus-html-image-map + :button-keymap gnus-html-image-map) + ;; Non-blocked url + (let ((width + (when (string-match "width=\"?\\([0-9]+\\)" parameters) + (string-to-number (match-string 1 parameters)))) + (height + (when (string-match "height=\"?\\([0-9]+\\)" parameters) + (string-to-number (match-string 1 parameters))))) + ;; Don't fetch images that are really small. They're + ;; probably tracking pictures. + (when (and (or (null height) + (> height 4)) + (or (null width) + (> width 4))) + (gnus-html-display-image url start end alt-text))))))))) (defun gnus-html-display-image (url start end &optional alt-text) "Display image at URL on text from START to END. Use ALT-TEXT for the image string." - (if (gnus-html-cache-expired url gnus-html-image-cache-ttl) - ;; We don't have it, so schedule it for fetching - ;; asynchronously. - (gnus-html-schedule-image-fetching - (current-buffer) - (list url alt-text)) - ;; It's already cached, so just insert it. - (gnus-html-put-image (gnus-html-get-image-data url) url (or alt-text "*")))) + (or alt-text (setq alt-text "*")) + (if (string-match "\\`cid:" url) + (let ((handle (mm-get-content-id (substring url (match-end 0))))) + (when handle + (gnus-html-put-image (mm-with-part handle (buffer-string)) + url alt-text))) + (if (gnus-html-cache-expired url gnus-html-image-cache-ttl) + ;; We don't have it, so schedule it for fetching + ;; asynchronously. + (gnus-html-schedule-image-fetching + (current-buffer) + (list url alt-text)) + ;; It's already cached, so just insert it. + (gnus-html-put-image (gnus-html-get-image-data url) url alt-text)))) (defun gnus-html-wash-tags () (let (tag parameters string start end images url) @@ -338,7 +350,7 @@ (replace-match "" t t)) (mm-url-decode-entities))) -(defun gnus-html-insert-image () +(defun gnus-html-insert-image (&rest args) "Fetch and insert the image under point." (interactive) (apply 'gnus-html-display-image (get-text-property (point) 'gnus-image))) @@ -437,7 +449,8 @@ (save-excursion (goto-char start) (let ((alt-text (or alt-text - (buffer-substring-no-properties start end)))) + (buffer-substring-no-properties start end))) + (inhibit-read-only t)) (if (and image ;; Kludge to avoid displaying 30x30 gif images, which ;; seems to be a signal of a broken image. @@ -498,7 +511,8 @@ (while (re-search-forward "]+src=[\"']\\(http[^\"']+\\)" nil t) (let ((url (gnus-html-encode-url (mm-url-decode-entities-string (match-string 1))))) - (unless (gnus-html-image-url-blocked-p url blocked-images) + (unless (or gnus-inhibit-images + (gnus-html-image-url-blocked-p url blocked-images)) (when (gnus-html-cache-expired url gnus-html-image-cache-ttl) (gnus-html-schedule-image-fetching nil (list url)))))))))) ------------------------------------------------------------ revno: 102422 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2010-11-17 22:15:24 +0000 message: Merge changes made in Gnus trunk. nnir.el (nnir-run-imap): Order the article list separately for each group. shr.el (shr-put-image): Break lines when inserting big pictures. mml2015.el (mml2015-epg-encrypt): Fix two cons with missing sender. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-17 08:28:15 +0000 +++ lisp/gnus/ChangeLog 2010-11-17 22:15:24 +0000 @@ -1,3 +1,17 @@ +2010-11-17 Lars Magne Ingebrigtsen + + * shr.el (shr-put-image): Break lines when inserting big pictures. + +2010-11-17 Daniel Dehennin + + * mml2015.el (mml2015-epg-encrypt): Fix two cons with missing + sender, thanks Katsumi Yamaoka. + +2010-11-17 Andrew Cohen + + * nnir.el (nnir-run-imap): Reverse the article list for each group + rather than the whole list. + 2010-11-17 Katsumi Yamaoka * shr.el (shr-image-displayer): Protect function against non-existent === modified file 'lisp/gnus/mml2015.el' --- lisp/gnus/mml2015.el 2010-11-16 23:05:02 +0000 +++ lisp/gnus/mml2015.el 2010-11-17 22:15:24 +0000 @@ -1062,7 +1062,7 @@ (epa-select-keys context "\ Select keys for signing. If no one is selected, default secret key is used. " - (cons mml2015-signers) t) + (cons sender mml2015-signers) t) (if (or sender mml2015-signers) (delq nil (mapcar @@ -1077,7 +1077,7 @@ signer))) (error "No secret key for %s" signer)) signer-key) - (cons mml2015-signers)))))))) + (cons sender mml2015-signers)))))))) (epg-context-set-signers context signers)) (epg-context-set-armor context t) (epg-context-set-textmode context t) === modified file 'lisp/gnus/nnir.el' --- lisp/gnus/nnir.el 2010-11-11 04:05:15 +0000 +++ lisp/gnus/nnir.el 2010-11-17 22:15:24 +0000 @@ -677,14 +677,14 @@ (cdr (assoc nnir-imap-default-search-key nnir-imap-search-arguments)))) (gnus-inhibit-demon t) - (groups (or groups (nnir-get-active srv))) - artlist) + (groups (or groups (nnir-get-active srv)))) (message "Opening server %s" server) (apply 'vconcat (mapcar (lambda (x) - (let ((group x)) + (let ((group x) + artlist) (condition-case () (when (nnimap-possibly-change-group (gnus-group-short-name group) server) === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2010-11-17 08:28:15 +0000 +++ lisp/gnus/shr.el 2010-11-17 22:15:24 +0000 @@ -388,6 +388,11 @@ (let ((image (ignore-errors (shr-rescale-image data)))) (when image + ;; When inserting big-ish pictures, put them at the + ;; beginning of the line. + (when (and (> (current-column) 0) + (> (car (image-size image t)) 400)) + (insert "\n")) (insert-image image (or alt "*")))) (insert alt))) ------------------------------------------------------------ revno: 102421 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2010-11-17 21:15:24 +0200 message: Fix bug #7417 with cursor positioning on empty lines. xdisp.c (set_cursor_from_row): Fix cursor positioning in empty lines on text-mode terminals. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-17 15:12:02 +0000 +++ src/ChangeLog 2010-11-17 19:15:24 +0000 @@ -1,3 +1,8 @@ +2010-11-17 Eli Zaretskii + + * xdisp.c (set_cursor_from_row): Fix cursor positioning in empty + lines on text-mode terminals. (bug#7417) + 2010-11-17 Stefan Monnier * xterm.c (get_current_wm_state): Rename from get_current_vm_state. === modified file 'src/xdisp.c' --- src/xdisp.c 2010-11-17 02:37:45 +0000 +++ src/xdisp.c 2010-11-17 19:15:24 +0000 @@ -12839,6 +12839,15 @@ && BUFFERP (glyph->object) && glyph->charpos == pt_old) && bpos_covered < pt_old) { + /* An empty line has a single glyph whose OBJECT is zero and + whose CHARPOS is the position of a newline on that line. + Note that on a TTY, there are more glyphs after that, which + were produced by extend_face_to_end_of_line, but their + CHARPOS is zero or negative. */ + int empty_line_p = + (row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end) + && INTEGERP (glyph->object) && glyph->charpos > 0; + if (row->ends_in_ellipsis_p && pos_after == last_pos) { EMACS_INT ellipsis_pos; @@ -12875,6 +12884,7 @@ || (row->truncated_on_right_p && pt_old > bpos_max) /* Zero-width characters produce no glyphs. */ || (!string_seen + && !empty_line_p && (row->reversed_p ? glyph_after > glyphs_end : glyph_after < glyphs_end))) ------------------------------------------------------------ revno: 102420 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-11-17 10:12:02 -0500 message: * src/xterm.c (get_current_wm_state): Rename from get_current_vm_state. (do_ewmh_fullscreen, x_handle_net_wm_state): Update callers. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-17 15:07:48 +0000 +++ src/ChangeLog 2010-11-17 15:12:02 +0000 @@ -1,3 +1,8 @@ +2010-11-17 Stefan Monnier + + * xterm.c (get_current_wm_state): Rename from get_current_vm_state. + (do_ewmh_fullscreen, x_handle_net_wm_state): Update callers. + 2010-11-17 Kenichi Handa * coding.c (Fset_terminal_coding_system_internal): Fix previous === modified file 'src/xterm.c' --- src/xterm.c 2010-11-17 02:37:45 +0000 +++ src/xterm.c 2010-11-17 15:12:02 +0000 @@ -8403,7 +8403,7 @@ STICKY is set to 1 if the sticky state is set, 0 if not. */ static void -get_current_vm_state (struct frame *f, +get_current_wm_state (struct frame *f, Window window, int *size_state, int *sticky) @@ -8474,7 +8474,7 @@ Lisp_Object lval = get_frame_param (f, Qfullscreen); int cur, dummy; - get_current_vm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy); + get_current_wm_state (f, FRAME_OUTER_WINDOW (f), &cur, &dummy); /* Some window managers don't say they support _NET_WM_STATE, but they do say they support _NET_WM_STATE_FULLSCREEN. Try that also. */ @@ -8556,7 +8556,7 @@ Lisp_Object lval; int sticky = 0; - get_current_vm_state (f, event->window, &value, &sticky); + get_current_wm_state (f, event->window, &value, &sticky); lval = Qnil; switch (value) { ------------------------------------------------------------ revno: 102419 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-11-17 10:07:48 -0500 message: Remove "tiny change"s for Eric Hanchrow diff: === modified file 'ChangeLog' --- ChangeLog 2010-11-15 06:39:02 +0000 +++ ChangeLog 2010-11-17 15:07:48 +0000 @@ -2894,7 +2894,7 @@ * make-dist (lispref): Do include lispref/index.texi. -2004-01-06 Eric Hanchrow (tiny change) +2004-01-06 Eric Hanchrow * make-dist (tempdir): Include cursors in nt/icons. === modified file 'etc/ChangeLog' --- etc/ChangeLog 2010-11-13 13:29:31 +0000 +++ etc/ChangeLog 2010-11-17 15:07:48 +0000 @@ -3359,7 +3359,7 @@ * NEWS: Mention the thumbs.el package. -2004-08-14 Eric Hanchrow (tiny change) +2004-08-14 Eric Hanchrow * TUTORIAL.es: Replace actual whitespace with the magic string that causes help-with-tutorial to automatically insert the correct === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-17 15:00:16 +0000 +++ lisp/ChangeLog 2010-11-17 15:07:48 +0000 @@ -9631,7 +9631,7 @@ * vc-bzr.el (vc-bzr-revision-table): New function. -2010-01-25 Eric Hanchrow (tiny change) +2010-01-25 Eric Hanchrow * vc-git.el (vc-git-dir-status-goto-stage): Pass --relative to the diff-index command. This requires at least git-1.5.5. (Bug#1589). === modified file 'lisp/ChangeLog.11' --- lisp/ChangeLog.11 2010-09-20 01:20:32 +0000 +++ lisp/ChangeLog.11 2010-11-17 15:07:48 +0000 @@ -11494,7 +11494,7 @@ * net/zone-mode.el (zone-mode): Use write-file-functions, not write-file-hooks. -2003-12-29 Eric Hanchrow (tiny change) +2003-12-29 Eric Hanchrow * autorevert.el (auto-revert-interval): Doc fix. @@ -12922,7 +12922,7 @@ * emacs-lisp/tq.el (tq-create): Fix mixed up unquote style. -2003-09-12 Eric Hanchrow (tiny change) +2003-09-12 Eric Hanchrow * dired.el (dired-mode-map): Fix typo. === modified file 'lisp/ChangeLog.12' --- lisp/ChangeLog.12 2010-10-24 21:36:09 +0000 +++ lisp/ChangeLog.12 2010-11-17 15:07:48 +0000 @@ -2528,7 +2528,7 @@ * files.el (find-alternate-file): Revert query message to Emacs 21 version. -2007-01-20 Eric Hanchrow (tiny change) +2007-01-20 Eric Hanchrow * progmodes/cperl-mode.el (cperl-electric-keywords): Document in the doc string how to use personal abbrevs without electric keywords. @@ -7791,7 +7791,7 @@ * textmodes/table.el: Add move-beginning-of-line and move-end-of-line to Point Motion Only Group. -2006-07-22 Eric Hanchrow (tiny change) +2006-07-22 Eric Hanchrow * progmodes/delphi.el (delphi-fill-comment): Use save-restriction. @@ -20588,7 +20588,7 @@ * progmodes/gud.el (gud-speedbar-menu-items): Use :visible instead of :active. -2005-10-08 Eric Hanchrow (tiny change) +2005-10-08 Eric Hanchrow * textmodes/ispell.el (ispell-check-version): Ignore hyphen, and all that follows, in aspell's version text. @@ -29165,7 +29165,7 @@ * jit-lock.el (jit-lock-stealth-time): Change default value to 16. (jit-lock-stealth-nice): Change default value to 0.5. -2005-04-23 Eric Hanchrow (tiny change) +2005-04-23 Eric Hanchrow * abbrev.el (write-abbrev-file): Write table entries in alphabetical order by table name. === modified file 'lisp/ChangeLog.13' --- lisp/ChangeLog.13 2010-10-14 14:32:27 +0000 +++ lisp/ChangeLog.13 2010-11-17 15:07:48 +0000 @@ -13493,7 +13493,7 @@ * menu-bar.el (menu-bar-vc-filter): New function. (menu-bar-tools-menu): Use it as a filter. -2007-08-01 Eric Hanchrow (tiny change) +2007-08-01 Eric Hanchrow * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix. === modified file 'lisp/ChangeLog.14' --- lisp/ChangeLog.14 2010-10-14 14:32:27 +0000 +++ lisp/ChangeLog.14 2010-11-17 15:07:48 +0000 @@ -2148,7 +2148,7 @@ * emacs-lisp/find-func.el (find-library-name, find-library): Doc fixes. (Part of bug#2270) -2009-02-10 Eric Hanchrow (tiny change) +2009-02-10 Eric Hanchrow * env.el (getenv): When FRAME is non-nil, pass the frame environment to `getenv-internal', not the frame. (Bug#2259) @@ -6518,7 +6518,7 @@ (hl-line-unhighlight, global-hl-line-unhighlight): Use `when'. (hl-line-sticky-flag): Remove spurious * in docstring. -2008-10-14 Eric Hanchrow (tiny change) +2008-10-14 Eric Hanchrow * vc-git.el (vc-git-show-log-entry): Include the revision in the search string. === modified file 'lisp/erc/ChangeLog.06' --- lisp/erc/ChangeLog.06 2010-01-13 08:35:10 +0000 +++ lisp/erc/ChangeLog.06 2010-11-17 15:07:48 +0000 @@ -174,7 +174,7 @@ * erc-nicklist.el (erc-nicklist-insert-contents): Add missing parenthesis. Thanks to Stephan Stahl for the report. -2006-09-10 Eric Hanchrow (tiny change) +2006-09-10 Eric Hanchrow * erc.el (erc-cmd-IGNORE): Prompt user if this might be a regexp instead of a single user. === modified file 'src/ChangeLog' --- src/ChangeLog 2010-11-17 05:51:09 +0000 +++ src/ChangeLog 2010-11-17 15:07:48 +0000 @@ -248,8 +248,8 @@ * xfns.c (set_machine_and_pid_properties): Let X set WM_CLIENT_MACHINE. - * xdisp.c (note_mode_line_or_margin_highlight): Initialize - Cursor to No_Cursor for HAVE_WINDOW_SYSTEM also. + * xdisp.c (note_mode_line_or_margin_highlight): + Initialize Cursor to No_Cursor for HAVE_WINDOW_SYSTEM also. 2010-11-06 Eli Zaretskii ------------------------------------------------------------ revno: 102418 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-11-17 10:00:16 -0500 message: * lisp/progmodes/python.el (run-python): Explain why we remove the current directory from sys.path. Suggested by Eric Hanchrow . diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-17 14:54:15 +0000 +++ lisp/ChangeLog 2010-11-17 15:00:16 +0000 @@ -1,5 +1,8 @@ 2010-11-17 Stefan Monnier + * progmodes/python.el (run-python): Explain why we remove the current + directory from sys.path. Suggested by Eric Hanchrow . + * progmodes/grep.el (grep-regexp-alist): Tighten the regexp (bug#7378). 2010-11-16 Stefan Monnier === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2010-11-09 20:07:10 +0000 +++ lisp/progmodes/python.el 2010-11-17 15:00:16 +0000 @@ -1586,6 +1586,11 @@ (with-current-buffer (let* ((cmdlist (append (python-args-to-list cmd) + ;; It's easy for the user to cause the process to be + ;; started without realizing it (e.g. to perform + ;; completion); for this reason loading files from the + ;; current directory is a security risk. See + ;; http://article.gmane.org/gmane.emacs.devel/103569 '("-i" "-c" "import sys; sys.path.remove('')"))) (path (getenv "PYTHONPATH")) (process-environment ; to import emacs.py ------------------------------------------------------------ revno: 102417 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2010-11-17 09:54:15 -0500 message: * lisp/progmodes/grep.el (grep-regexp-alist): Tighten the regexp. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-11-16 21:19:34 +0000 +++ lisp/ChangeLog 2010-11-17 14:54:15 +0000 @@ -1,3 +1,7 @@ +2010-11-17 Stefan Monnier + + * progmodes/grep.el (grep-regexp-alist): Tighten the regexp (bug#7378). + 2010-11-16 Stefan Monnier * progmodes/octave-mod.el: Rely on elecric-*-modes. === modified file 'lisp/progmodes/grep.el' --- lisp/progmodes/grep.el 2010-05-21 20:43:04 +0000 +++ lisp/progmodes/grep.el 2010-11-17 14:54:15 +0000 @@ -348,7 +348,11 @@ ;; produces them ;; ("^\\(.+?\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2\\(?:\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\)?\\2\\)?" ;; 1 3 (4 . 5)) - ("^\\(\\(.+?\\):\\([0-9]+\\):\\).*?\ + ;; Note that we want to use as tight a regexp as we can to try and + ;; handle weird file names (with colons in them) as well as possible. + ;; E.g. we use [1-9][0-9]* rather than [0-9]+ so as to accept ":034:" in + ;; file names. + ("^\\(\\(.+?\\):\\([1-9][0-9]*\\):\\).*?\ \\(\033\\[01;31m\\(?:\033\\[K\\)?\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" 2 3 ;; Calculate column positions (beg . end) of first grep match on a line @@ -357,7 +361,7 @@ (- (match-beginning 4) (match-end 1))) . (lambda () (- (match-end 5) (match-end 1) - (- (match-end 4) (match-beginning 4))))) + (- (match-end 4) (match-beginning 4))))) nil 1) ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") ------------------------------------------------------------ revno: 102416 committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2010-11-17 08:28:15 +0000 message: shr.el (shr-image-displayer): Protect function against non-existent image source. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-17 07:22:19 +0000 +++ lisp/gnus/ChangeLog 2010-11-17 08:28:15 +0000 @@ -1,5 +1,8 @@ 2010-11-17 Katsumi Yamaoka + * shr.el (shr-image-displayer): Protect function against non-existent + image source. + * gnus-art.el (gnus-inhibit-images): New user option. (gnus-mime-display-single): Don't display image if it is non-nil. === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2010-11-17 07:22:19 +0000 +++ lisp/gnus/shr.el 2010-11-17 08:28:15 +0000 @@ -441,19 +441,20 @@ is an argument. The function to be returned takes three arguments URL, START, and END." `(lambda (url start end) - (if (string-match "\\`cid:" url) - ,(when content-function - `(let ((image (funcall ,content-function - (substring url (match-end 0))))) - (when image - (goto-char start) - (shr-put-image image - (prog1 - (buffer-substring-no-properties start end) - (delete-region start end)))))) - (url-retrieve url 'shr-image-fetched - (list (current-buffer) start end) - t)))) + (when url + (if (string-match "\\`cid:" url) + ,(when content-function + `(let ((image (funcall ,content-function + (substring url (match-end 0))))) + (when image + (goto-char start) + (shr-put-image image + (prog1 + (buffer-substring-no-properties start end) + (delete-region start end)))))) + (url-retrieve url 'shr-image-fetched + (list (current-buffer) start end) + t))))) (defun shr-heading (cont &rest types) (shr-ensure-paragraph) ------------------------------------------------------------ revno: 102415 committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2010-11-17 07:22:19 +0000 message: gnus-art.el (gnus-inhibit-images): New user option. * gnus-art.el (gnus-inhibit-images): New user option. (gnus-mime-display-single): Don't display image if it is non-nil. * mm-decode.el (mm-shr): Bind shr-inhibit-images to the value of gnus-inhibit-images. * shr.el (shr-image-displayer): New function. (shr-tag-img): Use it. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-11-16 23:05:02 +0000 +++ lisp/gnus/ChangeLog 2010-11-17 07:22:19 +0000 @@ -1,3 +1,14 @@ +2010-11-17 Katsumi Yamaoka + + * gnus-art.el (gnus-inhibit-images): New user option. + (gnus-mime-display-single): Don't display image if it is non-nil. + + * mm-decode.el (mm-shr): Bind shr-inhibit-images to the value of + gnus-inhibit-images. + + * shr.el (shr-image-displayer): New function. + (shr-tag-img): Use it. + 2010-11-16 Daniel Dehennin * mml2015.el (mml2015-epg-sign): Use From header. === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-11-15 23:45:55 +0000 +++ lisp/gnus/gnus-art.el 2010-11-17 07:22:19 +0000 @@ -1636,6 +1636,12 @@ :group 'gnus-article :type 'boolean) +(defcustom gnus-inhibit-images nil + "Non-nil means inhibit displaying of images inline in the article body." + :version "24.1" + :group 'gnus-article + :type 'boolean) + (defcustom gnus-blocked-images 'gnus-block-private-groups "Images that have URLs matching this regexp will be blocked. This can also be a function to be evaluated. If so, it will be @@ -5845,7 +5851,9 @@ (while ignored (when (string-match (pop ignored) type) (throw 'ignored nil))) - (if (and (setq not-attachment + (if (and (not (and gnus-inhibit-images + (string-match "\\`image/" type))) + (setq not-attachment (and (not (mm-inline-override-p handle)) (or (not (mm-handle-disposition handle)) (equal (car (mm-handle-disposition handle)) === modified file 'lisp/gnus/mm-decode.el' --- lisp/gnus/mm-decode.el 2010-11-11 23:51:05 +0000 +++ lisp/gnus/mm-decode.el 2010-11-17 07:22:19 +0000 @@ -1687,6 +1687,7 @@ (start end &optional base-url)) (declare-function shr-insert-document "shr" (dom)) (defvar shr-blocked-images) +(defvar gnus-inhibit-images) (autoload 'gnus-blocked-images "gnus-art") (defun mm-shr (handle) @@ -1703,6 +1704,7 @@ (when handle (mm-with-part handle (buffer-string)))))) + (shr-inhibit-images gnus-inhibit-images) charset) (unless handle (setq handle (mm-dissect-buffer t))) === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2010-11-15 23:45:55 +0000 +++ lisp/gnus/shr.el 2010-11-17 07:22:19 +0000 @@ -435,6 +435,26 @@ (search-forward "\r\n\r\n" nil t)) (buffer-substring (point) (point-max)))))) +(defun shr-image-displayer (content-function) + "Return a function to display an image. +CONTENT-FUNCTION is a function to retrieve an image for a cid url that +is an argument. The function to be returned takes three arguments URL, +START, and END." + `(lambda (url start end) + (if (string-match "\\`cid:" url) + ,(when content-function + `(let ((image (funcall ,content-function + (substring url (match-end 0))))) + (when image + (goto-char start) + (shr-put-image image + (prog1 + (buffer-substring-no-properties start end) + (delete-region start end)))))) + (url-retrieve url 'shr-image-fetched + (list (current-buffer) start end) + t)))) + (defun shr-heading (cont &rest types) (shr-ensure-paragraph) (apply #'shr-fontize-cont cont types) @@ -574,10 +594,7 @@ (put-text-property start (point) 'shr-alt alt) (put-text-property start (point) 'image-url url) (put-text-property start (point) 'image-displayer - (lambda (url start end) - (url-retrieve url 'shr-image-fetched - (list (current-buffer) start end) - t))) + (shr-image-displayer shr-content-function)) (put-text-property start (point) 'help-echo alt) (setq shr-state 'image))))) ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.