# HG changeset patch # User Katsumi Yamaoka # Date 1284504384 0 # Node ID ccf206bc1b3a0418723e13e60e13489dac24dda7 # Parent b7aba7c5d378956208b7e9eb21a3bb6ea2a40bd3# Parent 4d54e23aa31ed8504d9fde190f6d2bd0433febaa Merge from mainline. diff -r b7aba7c5d378 -r ccf206bc1b3a admin/unidata/unidata-gen.el --- a/admin/unidata/unidata-gen.el Tue Sep 14 06:13:41 2010 +0000 +++ b/admin/unidata/unidata-gen.el Tue Sep 14 22:46:24 2010 +0000 @@ -95,7 +95,7 @@ (with-temp-buffer ;; Insert a file of this format: ;; (CHAR NAME CATEGORY ...) - ;; where CHAR is a charater code, the following elements are strings + ;; where CHAR is a character code, the following elements are strings ;; representing character properties. (insert-file-contents unidata-text-file) (goto-char (point-min)) diff -r b7aba7c5d378 -r ccf206bc1b3a doc/emacs/ChangeLog --- a/doc/emacs/ChangeLog Tue Sep 14 06:13:41 2010 +0000 +++ b/doc/emacs/ChangeLog Tue Sep 14 22:46:24 2010 +0000 @@ -1,3 +1,19 @@ +2010-09-14 Glenn Morris + + * cal-xtra.texi (Fancy Diary Display): Emphasize that sort should be + the last hook item. + + * calendar.texi (Appointments): Also updated when a diary include file + is saved. + +2010-09-14 Glenn Morris + + * trouble.texi (Bugs): Update the section intro. + (Known Problems): New section. + (Checklist): Misc updates. Prefer M-x report-emacs-bug. + (Sending Patches): Bug fixes are best as responses to existing bugs. + * emacs.texi (Known Problems): Add menu entry for new section. + 2010-09-09 Glenn Morris * xresources.texi: Untabify. diff -r b7aba7c5d378 -r ccf206bc1b3a doc/emacs/cal-xtra.texi --- a/doc/emacs/cal-xtra.texi Tue Sep 14 06:13:41 2010 +0000 +++ b/doc/emacs/cal-xtra.texi Tue Sep 14 22:46:24 2010 +0000 @@ -613,7 +613,9 @@ @noindent For each day, this sorts diary entries that begin with a recognizable time of day according to their times. Diary entries without times come -first within each day. +first within each day. Note how the sort command is placed at the end +of the hook list, in case earlier members of the list change the order +of the diary entries, or add items. @vindex diary-include-string Your main diary file can include other files. This permits a group of diff -r b7aba7c5d378 -r ccf206bc1b3a doc/emacs/calendar.texi --- a/doc/emacs/calendar.texi Tue Sep 14 06:13:41 2010 +0000 +++ b/doc/emacs/calendar.texi Tue Sep 14 22:46:24 2010 +0000 @@ -1508,7 +1508,14 @@ time by re-enabling appointment notification. Both these actions also display the day's diary buffer, unless you set @code{appt-display-diary} to @code{nil}. The appointments list is -also updated whenever the diary file is saved. +also updated whenever the diary file (or a file it includes; see +@iftex +@inforef{Fancy Diary Display,, emacs-xtra}) +@end iftex +@ifnottex +@ref{Fancy Diary Display}) +@end ifnottex +is saved. @findex appt-add @findex appt-delete diff -r b7aba7c5d378 -r ccf206bc1b3a doc/emacs/emacs.texi --- a/doc/emacs/emacs.texi Tue Sep 14 06:13:41 2010 +0000 +++ b/doc/emacs/emacs.texi Tue Sep 14 22:46:24 2010 +0000 @@ -1137,6 +1137,7 @@ Reporting Bugs +* Known Problems:: How to read about known problems and bugs. * Bug Criteria:: Have you really found a bug? * Understanding Bug Reporting:: How to report a bug effectively. * Checklist:: Steps to follow for a good bug report. diff -r b7aba7c5d378 -r ccf206bc1b3a doc/emacs/trouble.texi --- a/doc/emacs/trouble.texi Tue Sep 14 06:13:41 2010 +0000 +++ b/doc/emacs/trouble.texi Tue Sep 14 22:46:24 2010 +0000 @@ -409,29 +409,76 @@ @section Reporting Bugs @cindex bugs - Sometimes you will encounter a bug in Emacs. Although we cannot -promise we can or will fix the bug, and we might not even agree that it -is a bug, we want to hear about problems you encounter. Often we agree -they are bugs and want to fix them. - - To make it possible for us to fix a bug, you must report it. In order -to do so effectively, you must know when and how to do it. - - Before reporting a bug, it is a good idea to see if it is already -known. You can find the list of known problems in the file -@file{etc/PROBLEMS} in the Emacs distribution; type @kbd{C-h C-p} to read -it. Some additional user-level problems can be found in @ref{Bugs and -problems, , Bugs and problems, efaq, GNU Emacs FAQ}. Looking up your -problem in these two documents might provide you with a solution or a -work-around, or give you additional information about related issues. + If you think you have found a bug in Emacs, please report it. We +cannot promise to fix it, or always to agree that it is a bug, but we +certainly want to hear about it. The same applies for new features +you would like to see added. The following sections will help you to +construct an effective bug report. @menu +* Known Problems:: How to read about known problems and bugs. * Criteria: Bug Criteria. Have you really found a bug? * Understanding Bug Reporting:: How to report a bug effectively. * Checklist:: Steps to follow for a good bug report. * Sending Patches:: How to send a patch for GNU Emacs. @end menu +@node Known Problems +@subsection Reading Existing Bug Reports and Known Problems + + Before reporting a bug, if at all possible please check to see if it +is already known about. Indeed, it may already have been fixed in a +later release of Emacs, or in the development version. Here is a list +of the main places you can read about known issues: + +@itemize +@item +The @file{etc/PROBLEMS} file in the Emacs distribution; type @kbd{C-h +C-p} to read it. This file contains a list of particularly well-known +issues that have been encountered in compiling, installing and running +Emacs. Often, there are suggestions for workarounds and solutions. + +@item +Some additional user-level problems can be found in @ref{Bugs and +problems, , Bugs and problems, efaq, GNU Emacs FAQ}. + +@item +The @samp{bug-gnu-emacs} mailing list (also available as the newsgroup +@samp{gnu.emacs.bug}). This is where you will find most Emacs bug +reports. You can read the list archives at +@url{http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs}. If you +like, you can also subscribe to the list. Be aware that the sole +purpose of this list is to provide the Emacs maintainers with +information about bugs and feature requests. Reports may contain +fairly large amounts of data; spectators should not complain about +this. + +@item +The bug tracker at @url{http://debbugs.gnu.org}. From early 2008, +reports from the @samp{bug-gnu-emacs} list have been sent here. The +tracker contains the same information as the mailing list, just in a +different format. You may prefer to browse and read reports using the +tracker. + +@item +The @samp{emacs-pretest-bug} mailing list. This list is no longer +used, and is mainly of historical interest. At one time, it was used +for bug reports in development (i.e., not yet released) versions of +Emacs. You can read the archives for 2003 to mid 2007 at +@url{http://lists.gnu.org/archive/html/emacs-pretest-bug/}. From +late 2007 to mid 2008, the address was an alias for the +@samp{emacs-devel} mailing list. From mid 2008 onwards, it has been +an alias for @samp{bug-gnu-emacs}. + +@item +The @samp{emacs-devel} mailing list. Sometimes people report bugs to +this mailing list. This is not the main purpose of the list, however, +and it is much better to send bug reports to the bug list. You should +not feel obliged to read this list before reporting a bug. + +@end itemize + + @node Bug Criteria @subsection When Is There a Bug @@ -540,56 +587,81 @@ @subsection Checklist for Bug Reports @cindex reporting bugs - The best way to send a bug report is to mail it electronically to the -Emacs maintainers at @email{bug-gnu-emacs@@gnu.org}. (If you want to -suggest a change as an improvement, use the same address.) + + Before reporting a bug, first try to see if the problem has already +been reported (@pxref{Known Problems}). - If you'd like to read the bug reports, you can find them on the -newsgroup @samp{gnu.emacs.bug}; keep in mind, however, that as a -spectator you should not criticize anything about what you see there. -The purpose of bug reports is to give information to the Emacs -maintainers. Spectators are welcome only as long as they do not -interfere with this. In particular, some bug reports contain fairly -large amounts of data; spectators should not complain about this. - - Please do not post bug reports using netnews; mail is more reliable -than netnews about reporting your correct address, which we may need -in order to ask you for more information. If your data is more than -500,000 bytes, please don't include it directly in the bug report; -instead, offer to send it on request, or make it available by ftp and -say where. +If you are able to, try the latest release of Emacs to see if the +problem has already been fixed. Even better is to try the latest +development version. We recognize that this is not easy for some +people, so do not feel that you absolutely must do this before making +a report. @findex report-emacs-bug - A convenient way to send a bug report for Emacs is to use the command -@kbd{M-x report-emacs-bug}. This sets up a mail buffer (@pxref{Sending -Mail}) and automatically inserts @emph{some} of the essential -information. However, it cannot supply all the necessary information; -you should still read and follow the guidelines below, so you can enter -the other crucial information by hand before you send the message. + The best way to write a bug report for Emacs is to use the command +@kbd{M-x report-emacs-bug}. This sets up a mail buffer +(@pxref{Sending Mail}) and automatically inserts @emph{some} of the +essential information. However, it cannot supply all the necessary +information; you should still read and follow the guidelines below, so +you can enter the other crucial information by hand before you send +the message. You may feel that some of the information inserted by +@kbd{M-x report-emacs-bug} is not relevant, but unless you are +absolutely sure it is best to leave it, so that the developers can +decide for themselves. + +When you have finished writing your report, type @kbd{C-c C-c} and it +will be sent to the Emacs maintainers at @email{bug-gnu-emacs@@gnu.org}. +(If you want to suggest an improvement or new feature, use the same +address.) If you cannot send mail from inside Emacs, you can copy the +text of your report to your normal mail client and send it to that +address. Or you can simply send an email to that address describing +the problem. + +Your report will be sent to the @samp{bug-gnu-emacs} mailing list, and +stored in the tracker at @url{http://debbugs.gnu.org}. Please try to +include a valid reply email address, in case we need to ask you for +more information about your report. Submissions are moderated, so +there may be a delay before your report appears. + +You do not need to know how the @url{http://debbugs.gnu.org} bug +tracker works in order to report a bug, but if you want to, you can +read the tracker's online documentation to see the various features +you can use. + +All mail sent to the @samp{bug-gnu-emacs} mailing list is also +gatewayed to the @samp{bug.gnu.emacs} newsgroup. The reverse is also +true, but we ask you not to post bug reports via the newsgroup. It +can make it much harder to contact you if we need to ask for more +information, and it does not integrate well with the bug tracker. + +If your data is more than 500,000 bytes, please don't include it +directly in the bug report; instead, offer to send it on request, or +make it available by ftp and say where. To enable maintainers to investigate a bug, your report should include all these things: @itemize @bullet @item -The version number of Emacs. Without this, we won't know whether there -is any point in looking for the bug in the current version of GNU -Emacs. +The version number of Emacs. Without this, we won't know whether there is any +point in looking for the bug in the current version of GNU Emacs. -You can get the version number by typing @kbd{M-x emacs-version -@key{RET}}. If that command does not work, you probably have something -other than GNU Emacs, so you will have to report the bug somewhere -else. +@kbd{M-x report-emacs-bug} includes this information automatically, +but if you are not using that command for your report you can get the +version number by typing @kbd{M-x emacs-version @key{RET}}. If that +command does not work, you probably have something other than GNU +Emacs, so you will have to report the bug somewhere else. @item The type of machine you are using, and the operating system name and -version number. @kbd{M-x emacs-version @key{RET}} provides this -information too. Copy its output from the @samp{*Messages*} buffer, so -that you get it all and get it accurately. +version number (again, automatically included by @kbd{M-x +report-emacs-bug}). @kbd{M-x emacs-version @key{RET}} provides this +information too. Copy its output from the @samp{*Messages*} buffer, +so that you get it all and get it accurately. @item The operands given to the @code{configure} command when Emacs was -installed. +installed (automatically included by @kbd{M-x report-emacs-bug}). @item A complete list of any modifications you have made to the Emacs source. @@ -619,12 +691,15 @@ @item The precise commands we need to type to reproduce the bug. +If at all possible, give a full recipe for an Emacs started with the +@samp{-Q} option (@pxref{Initial Options}). This bypasses your +@file{.emacs} customizations. @findex open-dribble-file @cindex dribble file @cindex logging keystrokes -The easy way to record the input to Emacs precisely is to write a -dribble file. To start the file, execute the Lisp expression +One way to record the input to Emacs precisely is to write a dribble +file. To start the file, execute the Lisp expression @example (open-dribble-file "~/dribble") @@ -735,7 +810,7 @@ including your @file{.emacs} file, set any variables that may affect the functioning of Emacs. Also, see whether the problem happens in a freshly started Emacs without loading your @file{.emacs} file (start -Emacs with the @code{-q} switch to prevent loading the init file). If +Emacs with the @code{-Q} switch to prevent loading the init files). If the problem does @emph{not} occur then, you must report the precise contents of any programs that you must load into the Lisp world in order to cause the problem to occur. @@ -907,12 +982,10 @@ @itemize @bullet @item Send an explanation with your changes of what problem they fix or what -improvement they bring about. For a bug fix, just include a copy of the -bug report, and explain why the change fixes the bug. - -(Referring to a bug report is not as good as including it, because then -we will have to look it up, and we have probably already deleted it if -we've already fixed the bug.) +improvement they bring about. For a fix for an existing bug, it is +best to reply to the relevant discussion on the @samp{bug-gnu-emacs} +list, or item in the @url{http://debbugs.gnu.org} tracker. Explain +why your change fixes the bug. @item Always include a proper bug report for the problem you think you have diff -r b7aba7c5d378 -r ccf206bc1b3a etc/NEWS.23 --- a/etc/NEWS.23 Tue Sep 14 06:13:41 2010 +0000 +++ b/etc/NEWS.23 Tue Sep 14 22:46:24 2010 +0000 @@ -40,6 +40,8 @@ * Lisp changes in Emacs 23.3 +** The use of unintern without an obarray arg is declared obsolete. + ** New function byte-to-string, like char-to-string but for bytes. diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/ChangeLog --- a/lisp/ChangeLog Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/ChangeLog Tue Sep 14 22:46:24 2010 +0000 @@ -1,3 +1,77 @@ +2010-09-14 Juanma Barranquero + + * obsolete/old-whitespace.el (whitespace-unload-function): + Explicitly pass `obarray' to `unintern' to avoid a warning. + +2010-09-14 Stefan Monnier + + * emacs-lisp/byte-run.el (set-advertised-calling-convention): + Add `when' argument. Update callers. + + * subr.el (unintern): Declare the obarray arg mandatory. + +2010-09-14 Glenn Morris + + * calendar/diary-lib.el (diary-list-entries-hook, diary-sort-entries): + Doc fixes. + + * calendar/diary-lib.el (diary-included-files): New variable. + (diary-list-entries): Maybe initialize diary-included-files. + (diary-include-other-diary-files): Append to diary-included-files. + * calendar/appt.el (appt-update-list): Also check the members of + diary-included-files. (Bug#6999) + (appt-check): Doc fix. + +2010-09-14 David Reitter + + * simple.el (line-move-visual): Do not truncate goal column to + integer size. (Bug#7020) + +2010-09-14 Stefan Monnier + + * repeat.el (repeat): Allow repeating when the last event is a click. + Suggested by Drew Adams (bug#6256). + +2010-09-14 Sascha Wilde + + * vc/vc-hg.el (vc-hg-state,vc-hg-working-revision): + Replace setting HGRCPATH to "" by some less invasive --config options. + +2010-09-14 Stefan Monnier + + * font-lock.el (font-lock-beginning-of-syntax-function): + Mark as obsolete. + +2010-09-14 Glenn Morris + + * menu-bar.el (menu-bar-options-save): Fix handling of menu-bar + and tool-bar modes. (Bug#6211) + (menu-bar-mode): Move setting of standard-value after the + minor-mode definition, otherwise it seems to have no effect. + +2010-09-14 Masatake YAMATO + + * progmodes/antlr-mode.el (antlr-font-lock-additional-keywords): + Fix typo. (Bug#6976) + +2010-09-14 Vinicius Jose Latorre + + * whitespace.el: Allow cleaning up blanks without blank + visualization (Bug#6651). Adjust help window for + whitespace-toggle-options (Bug#6479). Allow to use fill-column + instead of whitespace-line-column (from EmacsWiki). New version 13.1. + (whitespace-style): Add new value 'face. Adjust docstring. + (whitespace-space, whitespace-hspace, whitespace-tab): + Adjust foreground property face. + (whitespace-line-column): Adjust docstring and type declaration. + (whitespace-style-value-list, whitespace-toggle-option-alist) + (whitespace-help-text): Adjust const initialization. + (whitespace-toggle-options, global-whitespace-toggle-options): + Adjust docstring. + (whitespace-display-window, whitespace-interactive-char) + (whitespace-style-face-p, whitespace-color-on): Adjust code. + (whitespace-help-scroll): New fun. + 2010-09-14 Katsumi Yamaoka * calendar/time-date.el (format-seconds): Comment fix. @@ -116,7 +190,7 @@ (tramp-get-remote-readlink, tramp-get-remote-trash) (tramp-get-remote-id, tramp-get-remote-uid, tramp-get-remote-gid) (tramp-get-local-uid, tramp-get-local-gid) - (tramp-get-inline-compress, tramp-get-inline-coding, ): Move to + (tramp-get-inline-compress, tramp-get-inline-coding): Move to tramp-sh.el. (tramp-methods, tramp-default-method-alist) (tramp-default-user-alist, tramp-foreign-file-name-handler-alist): diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/calendar/appt.el --- a/lisp/calendar/appt.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/calendar/appt.el Tue Sep 14 22:46:24 2010 +0000 @@ -48,8 +48,9 @@ ;; package is activated. Additionally, the appointments list is ;; recreated automatically at 12:01am for those who do not logout ;; every day or are programming late. It is also updated when the -;; `diary-file' is saved. Calling `appt-check' with an argument (or -;; re-enabling the package) forces a re-initialization at any time. +;; `diary-file' (or a file it includes) is saved. Calling +;; `appt-check' with an argument (or re-enabling the package) forces a +;; re-initialization at any time. ;; ;; In order to add or delete items from today's list, without ;; changing the diary file, use `appt-add' and `appt-delete'. @@ -262,7 +263,7 @@ "Check for an appointment and update any reminder display. If optional argument FORCE is non-nil, reparse the diary file for appointments. Otherwise the diary file is only parsed once per day, -and when saved. +or when it (or a file it includes) is saved. Note: the time must be the first thing in the line in the diary for a warning to be issued. The format of the time can be either @@ -346,6 +347,8 @@ (if d-buff ; diary buffer exists (with-current-buffer d-buff diary-selective-display)))) + ;; FIXME why not using diary-list-entries with + ;; non-nil LIST-ONLY? (diary) ;; If the diary buffer existed before this command, ;; restore its display state. Otherwise, kill it. @@ -643,8 +646,10 @@ (defun appt-update-list () "If the current buffer is visiting the diary, update appointments. -This function is intended for use with `write-file-functions'." - (and (string-equal buffer-file-name (expand-file-name diary-file)) +This function also acts on any file listed in `diary-included-files'. +It is intended for use with `write-file-functions'." + (and (member buffer-file-name (append diary-included-files + (list (expand-file-name diary-file)))) appt-timer (let ((appt-display-diary nil)) (appt-check t))) diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/calendar/diary-lib.el --- a/lisp/calendar/diary-lib.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/calendar/diary-lib.el Tue Sep 14 22:46:24 2010 +0000 @@ -187,11 +187,12 @@ (setq diary-display-function 'diary-fancy-display) (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) - (add-hook 'diary-list-entries-hook 'diary-sort-entries) + (add-hook 'diary-list-entries-hook 'diary-sort-entries t) in your `.emacs' file to cause the fancy diary buffer to be displayed with diary entries from various included files, each day's entries sorted into -lexicographic order." +lexicographic order. Note how the sort function is placed last, +so that it can sort the entries included from other files." :type 'hook :options '(diary-include-other-diary-files diary-sort-entries) :group 'diary) @@ -699,6 +700,10 @@ (1+ (calendar-absolute-from-gregorian gdate)))))) (goto-char (point-min))) +(defvar diary-including) ; dynamically bound in diary-include-other-diary-files +(defvar diary-included-files nil + "List of any diary files included in the last call to `diary-list-entries'.") + ;; FIXME non-greg and list hooks run same number of times? (defun diary-list-entries (date number &optional list-only) "Create and display a buffer containing the relevant lines in `diary-file'. @@ -743,6 +748,8 @@ (date-string (calendar-date-string date)) (diary-buffer (find-buffer-visiting diary-file)) diary-entries-list file-glob-attrs) + (or (bound-and-true-p diary-including) + (setq diary-included-files nil)) (message "Preparing diary...") (save-current-buffer (if (not diary-buffer) @@ -828,11 +835,15 @@ (let ((diary-file (match-string-no-properties 1)) (diary-list-entries-hook 'diary-include-other-diary-files) (diary-display-function 'ignore) + (diary-including t) diary-hook diary-list-include-blanks) (if (file-exists-p diary-file) (if (file-readable-p diary-file) (unwind-protect - (setq diary-entries-list + (setq diary-included-files + (append diary-included-files + (list (expand-file-name diary-file))) + diary-entries-list (append diary-entries-list (diary-list-entries original-date number))) (with-current-buffer (find-buffer-visiting diary-file) @@ -1574,7 +1585,10 @@ (string-lessp ts1 ts2))))))) (defun diary-sort-entries () - "Sort the list of diary entries by time of day." + "Sort the list of diary entries by time of day. +If you add this function to `diary-list-entries-hook', it should +be the last item in the hook, in case earlier items add diary +entries, or change the order." (setq diary-entries-list (sort diary-entries-list 'diary-entry-compare))) (define-obsolete-function-alias 'sort-diary-entries 'diary-sort-entries "23.1") diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/emacs-lisp/byte-run.el --- a/lisp/emacs-lisp/byte-run.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/emacs-lisp/byte-run.el Tue Sep 14 22:46:24 2010 +0000 @@ -108,10 +108,11 @@ (defvar advertised-signature-table (make-hash-table :test 'eq :weakness 'key)) -(defun set-advertised-calling-convention (function signature) +(defun set-advertised-calling-convention (function signature when) "Set the advertised SIGNATURE of FUNCTION. This will allow the byte-compiler to warn the programmer when she uses -an obsolete calling convention." +an obsolete calling convention. WHEN specifies since when the calling +convention was modified." (puthash (indirect-function function) signature advertised-signature-table)) @@ -132,7 +133,7 @@ obsolete-name) (set-advertised-calling-convention ;; New code should always provide the `when' argument. - 'make-obsolete '(obsolete-name current-name when)) + 'make-obsolete '(obsolete-name current-name when) "23.1") (defmacro define-obsolete-function-alias (obsolete-name current-name &optional when docstring) @@ -153,7 +154,7 @@ (set-advertised-calling-convention ;; New code should always provide the `when' argument. 'define-obsolete-function-alias - '(obsolete-name current-name when &optional docstring)) + '(obsolete-name current-name when &optional docstring) "23.1") (defun make-obsolete-variable (obsolete-name current-name &optional when) "Make the byte-compiler warn that OBSOLETE-NAME is obsolete. @@ -175,7 +176,7 @@ obsolete-name) (set-advertised-calling-convention ;; New code should always provide the `when' argument. - 'make-obsolete-variable '(obsolete-name current-name when)) + 'make-obsolete-variable '(obsolete-name current-name when) "23.1") (defmacro define-obsolete-variable-alias (obsolete-name current-name &optional when docstring) @@ -210,7 +211,7 @@ (set-advertised-calling-convention ;; New code should always provide the `when' argument. 'define-obsolete-variable-alias - '(obsolete-name current-name when &optional docstring)) + '(obsolete-name current-name when &optional docstring) "23.1") ;; FIXME This is only defined in this file because the variable- and ;; function- versions are too. Unlike those two, this one is not used diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/font-lock.el --- a/lisp/font-lock.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/font-lock.el Tue Sep 14 22:46:24 2010 +0000 @@ -564,6 +564,8 @@ we recommend setting `syntax-begin-function' instead. This is normally set via `font-lock-defaults'.") +(make-obsolete-variable 'font-lock-beginning-of-syntax-function + 'syntax-begin-function "23.3") (defvar font-lock-mark-block-function nil "*Non-nil means use this function to mark a block of text. diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/gnus/.dir-locals.el --- a/lisp/gnus/.dir-locals.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/gnus/.dir-locals.el Tue Sep 14 22:46:24 2010 +0000 @@ -1,1 +1,4 @@ ((emacs-lisp-mode . ((show-trailing-whitespace . t)))) +;; Local Variables: +;; no-byte-compile: t +;; End: diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/gnus/ChangeLog Tue Sep 14 22:46:24 2010 +0000 @@ -1,3 +1,24 @@ +2010-09-14 Juanma Barranquero + + * gnus-registry.el (gnus-registry-install-shortcuts): + Explicitly pass `obarray' to `unintern' to avoid a warning. + +2010-09-14 Lars Magne Ingebrigtsen + + * gnus-start.el (gnus-read-active-for-groups): Reverted the previous + change. + + * nnrss.el (nnrss-request-list): Removed this function and related + functions, including the moreover stuff. + +2010-09-14 Lars Magne Ingebrigtsen + + * nnrss.el (nnrss-retrieve-groups): New function. + +2010-09-14 Juanma Barranquero + + * .dir-locals.el: Add no-byte-compile cookie. + 2010-09-14 Katsumi Yamaoka * gnus-start.el (gnus-read-active-for-groups): Run gnus-activate-group diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/gnus/gnus-registry.el --- a/lisp/gnus/gnus-registry.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/gnus/gnus-registry.el Tue Sep 14 22:46:24 2010 +0000 @@ -783,7 +783,7 @@ (function-name (format function-format variant-name)) (shortcut (format "%c" data)) (shortcut (if remove (upcase shortcut) shortcut))) - (unintern function-name) + (unintern function-name obarray) (eval `(defun ;; function name diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/gnus/gnus-start.el --- a/lisp/gnus/gnus-start.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/gnus/gnus-start.el Tue Sep 14 22:46:24 2010 +0000 @@ -1808,11 +1808,11 @@ (dolist (info infos (nreverse groups)) (push (gnus-group-real-name (gnus-info-group info)) groups)) method))) - ((gnus-check-backend-function 'request-scan (car method)) + ((gnus-check-backend-function 'request-list (car method)) (gnus-read-active-file-1 method nil infos)) (t (dolist (info infos) - (gnus-activate-group (gnus-info-group info) nil nil method)))))) + (gnus-activate-group (gnus-info-group info) nil nil method t)))))) ;; Create a hash table out of the newsrc alist. The `car's of the ;; alist elements are used as keys. diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/gnus/nnrss.el --- a/lisp/gnus/nnrss.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/gnus/nnrss.el Tue Sep 14 22:46:24 2010 +0000 @@ -342,11 +342,6 @@ ;; we return the article number. (cons nnrss-group (car e)))))) -(deffoo nnrss-request-list (&optional server) - (nnrss-possibly-change-group nil server) - (nnrss-generate-active) - t) - (deffoo nnrss-open-server (server &optional defs connectionless) (nnrss-read-server-data server) (nnoo-change-server 'nnrss server defs) @@ -397,6 +392,18 @@ (insert (car elem) "\t" (third elem) "\n")))) t) +(deffoo nnrss-retrieve-groups (groups &optional server) + (nnrss-possibly-change-group nil server) + (dolist (group groups) + (nnrss-check-group group server)) + (save-excursion + (set-buffer nntp-server-buffer) + (erase-buffer) + (dolist (group groups) + (let ((elem (assoc group nnrss-server-data))) + (insert (format "%S %s 1 y\n" group (or (cadr elem) 0))))) + 'active)) + (nnoo-define-skeleton nnrss) ;;; Internal functions @@ -479,20 +486,6 @@ (nnrss-read-group-data group server) (setq nnrss-group group))) -(defvar nnrss-extra-categories '(nnrss-snarf-moreover-categories)) - -(defun nnrss-generate-active () - (when (y-or-n-p "Fetch extra categories? ") - (mapc 'funcall nnrss-extra-categories)) - (save-excursion - (set-buffer nntp-server-buffer) - (erase-buffer) - (dolist (elem nnrss-group-alist) - (insert (prin1-to-string (car elem)) " 0 1 y\n")) - (dolist (elem nnrss-server-data) - (unless (assoc (car elem) nnrss-group-alist) - (insert (prin1-to-string (car elem)) " 0 1 y\n"))))) - (autoload 'timezone-parse-date "timezone") (defun nnrss-normalize-date (date) @@ -868,33 +861,6 @@ (append nnheader-file-name-translation-alist '((?' . ?_))))) (nnheader-translate-file-chars name))) -(defvar nnrss-moreover-url - "http://w.moreover.com/categories/category_list_rss.html" - "The url of moreover.com categories.") - -(defun nnrss-snarf-moreover-categories () - "Snarf RSS links from moreover.com." - (interactive) - (let (category name url changed) - (with-temp-buffer - (nnrss-insert nnrss-moreover-url) - (goto-char (point-min)) - (while (re-search-forward - "\\|" diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/repeat.el --- a/lisp/repeat.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/repeat.el Tue Sep 14 22:46:24 2010 +0000 @@ -335,7 +335,12 @@ (setq real-last-command 'repeat) (setq repeat-undo-count 1) (unwind-protect - (while (eq (read-event) repeat-repeat-char) + (while (let ((evt (read-event))) ;FIXME: read-key maybe? + ;; For clicks, we need to strip the meta-data to + ;; check the underlying event name. + (eq (or (car-safe evt) evt) + (or (car-safe repeat-repeat-char) + repeat-repeat-char))) (repeat repeat-arg)) ;; Make sure `repeat-undo-count' is reset. (setq repeat-undo-count nil)) diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/simple.el --- a/lisp/simple.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/simple.el Tue Sep 14 22:46:24 2010 +0000 @@ -4343,7 +4343,7 @@ (or (and (= (vertical-motion (cons (or goal-column (if (consp temporary-goal-column) - (truncate (car temporary-goal-column)) + (car temporary-goal-column) temporary-goal-column)) arg)) arg) diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/subr.el --- a/lisp/subr.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/subr.el Tue Sep 14 22:46:24 2010 +0000 @@ -239,7 +239,7 @@ for the sake of consistency." (while t (signal 'error (list (apply 'format args))))) -(set-advertised-calling-convention 'error '(string &rest args)) +(set-advertised-calling-convention 'error '(string &rest args) "23.1") ;; We put this here instead of in frame.el so that it's defined even on ;; systems where frame.el isn't loaded. @@ -1039,9 +1039,10 @@ (make-obsolete 'make-variable-frame-local "explicitly check for a frame-parameter instead." "22.2") (make-obsolete 'interactive-p 'called-interactively-p "23.2") -(set-advertised-calling-convention 'called-interactively-p '(kind)) +(set-advertised-calling-convention 'called-interactively-p '(kind) "23.1") (set-advertised-calling-convention - 'all-completions '(string collection &optional predicate)) + 'all-completions '(string collection &optional predicate) "23.1") +(set-advertised-calling-convention 'unintern '(name obarray) "23.3") ;;;; Obsolescence declarations for variables, and aliases. @@ -2064,7 +2065,7 @@ (setq read (cons t read))) (push read unread-command-events) nil)))))) -(set-advertised-calling-convention 'sit-for '(seconds &optional nodisp)) +(set-advertised-calling-convention 'sit-for '(seconds &optional nodisp) "22.1") ;;; Atomic change groups. @@ -2592,7 +2593,7 @@ (start-process name buffer shell-file-name shell-command-switch (mapconcat 'identity args " "))) (set-advertised-calling-convention 'start-process-shell-command - '(name buffer command)) + '(name buffer command) "23.1") (defun start-file-process-shell-command (name buffer &rest args) "Start a program in a subprocess. Return the process object for it. @@ -2603,7 +2604,7 @@ (if (file-remote-p default-directory) "-c" shell-command-switch) (mapconcat 'identity args " "))) (set-advertised-calling-convention 'start-file-process-shell-command - '(name buffer command)) + '(name buffer command) "23.1") (defun call-process-shell-command (command &optional infile buffer display &rest args) diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/url/ChangeLog --- a/lisp/url/ChangeLog Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/url/ChangeLog Tue Sep 14 22:46:24 2010 +0000 @@ -1,3 +1,15 @@ +2010-09-14 Julien Danjou + + * url-cache (url-store-in-cache): Make `buff' argument really optional. + +2010-09-14 Glenn Morris + + * url-cookie.el (url-cookie-expired-p): Tweak previous change. + +2010-09-14 shawn boles (tiny change) + + * url-cookie.el (url-cookie-expired-p): Simplify and fix. (Bug#6957) + 2010-09-11 Glenn Morris * url-cache.el, url-gw.el, url-history.el, url-irc.el, url-util.el: diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/url/url-cache.el --- a/lisp/url/url-cache.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/url/url-cache.el Tue Sep 14 22:46:24 2010 +0000 @@ -62,14 +62,11 @@ ;;;###autoload (defun url-store-in-cache (&optional buff) "Store buffer BUFF in the cache." - (if (not (and buff (get-buffer buff))) - nil - (save-current-buffer - (and buff (set-buffer buff)) - (let* ((fname (url-cache-create-filename (url-view-url t)))) - (if (url-cache-prepare fname) - (let ((coding-system-for-write 'binary)) - (write-region (point-min) (point-max) fname nil 5))))))) + (with-current-buffer (get-buffer (or buff (current-buffer))) + (let ((fname (url-cache-create-filename (url-view-url t)))) + (if (url-cache-prepare fname) + (let ((coding-system-for-write 'binary)) + (write-region (point-min) (point-max) fname nil 5)))))) ;;;###autoload (defun url-is-cached (url) diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/url/url-cookie.el --- a/lisp/url/url-cookie.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/url/url-cookie.el Tue Sep 14 22:46:24 2010 +0000 @@ -1,7 +1,7 @@ ;;; url-cookie.el --- Netscape Cookie support -;; Copyright (C) 1996, 1997, 1998, 1999, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1996, 1997, 1998, 1999, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010 Free Software Foundation, Inc. ;; Keywords: comm, data, processes, hypermedia @@ -24,7 +24,6 @@ ;;; Code: -(require 'timezone) (require 'url-util) (require 'url-parse) (eval-when-compile (require 'cl)) @@ -194,34 +193,9 @@ (setq url-cookie-storage (list (list domain tmp)))))))) (defun url-cookie-expired-p (cookie) - (let* ( - (exp (url-cookie-expires cookie)) - (cur-date (and exp (timezone-parse-date (current-time-string)))) - (exp-date (and exp (timezone-parse-date exp))) - (cur-greg (and cur-date (timezone-absolute-from-gregorian - (string-to-number (aref cur-date 1)) - (string-to-number (aref cur-date 2)) - (string-to-number (aref cur-date 0))))) - (exp-greg (and exp (timezone-absolute-from-gregorian - (string-to-number (aref exp-date 1)) - (string-to-number (aref exp-date 2)) - (string-to-number (aref exp-date 0))))) - (diff-in-days (and exp (- cur-greg exp-greg))) - ) - (cond - ((not exp) nil) ; No expiry == expires at browser quit - ((< diff-in-days 0) nil) ; Expires sometime after today - ((> diff-in-days 0) t) ; Expired before today - (t ; Expires sometime today, check times - (let* ((cur-time (timezone-parse-time (aref cur-date 3))) - (exp-time (timezone-parse-time (aref exp-date 3))) - (cur-norm (+ (* 360 (string-to-number (aref cur-time 2))) - (* 60 (string-to-number (aref cur-time 1))) - (* 1 (string-to-number (aref cur-time 0))))) - (exp-norm (+ (* 360 (string-to-number (aref exp-time 2))) - (* 60 (string-to-number (aref exp-time 1))) - (* 1 (string-to-number (aref exp-time 0)))))) - (> (- cur-norm exp-norm) 1)))))) + "Return non-nil if COOKIE is expired." + (let ((exp (url-cookie-expires cookie))) + (and exp (> (float-time) (float-time (date-to-time exp)))))) (defun url-cookie-retrieve (host &optional localpart secure) "Retrieve all the netscape-style cookies for a specified HOST and LOCALPART." diff -r b7aba7c5d378 -r ccf206bc1b3a lisp/vc/vc-hg.el --- a/lisp/vc/vc-hg.el Tue Sep 14 06:13:41 2010 +0000 +++ b/lisp/vc/vc-hg.el Tue Sep 14 22:46:24 2010 +0000 @@ -171,10 +171,12 @@ (let ((process-environment ;; Avoid localization of messages so we ;; can parse the output. - (append (list "TERM=dumb" "LANGUAGE=C" "HGRCPATH=") + (append (list "TERM=dumb" "LANGUAGE=C") process-environment))) (process-file "hg" nil t nil + "--config" "alias.status=status" + "--config" "defaults.status=" "status" "-A" (file-relative-name file))) ;; Some problem happened. E.g. We can't find an `hg' ;; executable. @@ -199,7 +201,7 @@ ((status nil) (default-directory (file-name-directory file)) ;; Avoid localization of messages so we can parse the output. - (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C" "HGRCPATH=") + (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C") process-environment)) (out (with-output-to-string @@ -211,6 +213,8 @@ ;; Ignore all errors. (process-file "hg" nil t nil + "--config" "alias.parents=parents" + "--config" "defaults.parents=" "parents" "--template" "{rev}" (file-relative-name file))) ;; Some problem happened. E.g. We can't find an `hg' ;; executable. diff -r b7aba7c5d378 -r ccf206bc1b3a src/ChangeLog --- a/src/ChangeLog Tue Sep 14 06:13:41 2010 +0000 +++ b/src/ChangeLog Tue Sep 14 22:46:24 2010 +0000 @@ -1,3 +1,40 @@ +2010-09-14 Juanma Barranquero + + * cmds.c (syms_of_cmds) : Fix typos in docstring. + +2010-09-14 Lars Magne Ingebrigtsen + + * xml.c (parse_buffer): Renamed to parse_string(), since that's + what it does. + (parse_string): Return nil when the document can't be parsed. + +2010-09-14 Jan Djärv + + * xterm.c (get_current_vm_state): New function. + (do_ewmh_fullscreen): Call get_current_vm_state and compare with + want_fullscreen so set_wm_state calls are few (Bug#7013). + (x_handle_net_wm_state): Move code to get_current_vm_state and + call that function. + +2010-09-14 Courtney Bane (tiny change) + + * term.c (tty_set_terminal_modes): Don't initialize twice (bug#7002). + +2010-09-14 Kenichi Handa + + * coding.c (encode_coding_iso_2022): Don't optimize for ASCII if + we may use designation or locking-shift. + +2010-09-14 Kenichi Handa + + * coding.c (detect_coding_emacs_mule): Fix checking of multibyte + sequence when the source is multibyte. + +2010-09-14 Andreas Schwab + + * xml.c (Fxml_parse_string, Fxml_parse_string): Revert last change. + Don't make first argument optional. Doc fix. + 2010-09-14 Leo (tiny change) * xml.c (Fxml_parse_string, Fhtml_parse_string): Fix up the @@ -106,9 +143,9 @@ (produce_stretch_glyph): Set it2.char_to_display too before calling x_produce_glyphs. (x_produce_glyphs): Simplify by using the same code for ASCII and - non-ASCII characters. Don't set it->char_to_display here. Don't - handle unibyte-display-via-language-environment here. For a - charater of no glyph, use font->space_width instead of FONT_WIDTH. + non-ASCII characters. Don't set it->char_to_display here. + Don't handle unibyte-display-via-language-environment here. For a + character of no glyph, use font->space_width instead of FONT_WIDTH. 2010-08-31 Stefan Monnier @@ -20270,7 +20307,7 @@ * search.c (search_buffer): Give up BM search on case-fold-search if one of a target character has a case-equivalence of different - byte length even if that target charcter is an ASCII. + byte length even if that target character is an ASCII. (simple_search): Fix calculation of byte length of matched text. (boyer_moore): Fix handling of case-equivalent multibyte characters. diff -r b7aba7c5d378 -r ccf206bc1b3a src/ChangeLog.10 --- a/src/ChangeLog.10 Tue Sep 14 06:13:41 2010 +0000 +++ b/src/ChangeLog.10 Tue Sep 14 22:46:24 2010 +0000 @@ -6914,7 +6914,7 @@ * search.c (search_buffer): Give up BM search on case-fold-search if one of a target character has a case-equivalence of different - charset even if that target charcter is an ASCII. + charset even if that target character is an ASCII. * casefiddle.c (casify_object): Fix for the case that case conversion change the byte length. diff -r b7aba7c5d378 -r ccf206bc1b3a src/ChangeLog.8 --- a/src/ChangeLog.8 Tue Sep 14 06:13:41 2010 +0000 +++ b/src/ChangeLog.8 Tue Sep 14 22:46:24 2010 +0000 @@ -13869,10 +13869,10 @@ 1998-08-31 Kenichi Handa * charset.c (unibyte_char_to_multibyte): - Vnonacii_translation_table will convert a 7-bit charcater. + Vnonacii_translation_table will convert a 7-bit character. (multibyte_char_to_unibyte): Handle the case that - Vnonacii_translation_table converts a multibyte charcater to a - unibyte charcter of less than 128. + Vnonacii_translation_table converts a multibyte character to a + unibyte character of less than 128. (init_charset_once): Initialize nonascii_insert_offset and Vnonacii_translation_table. diff -r b7aba7c5d378 -r ccf206bc1b3a src/buffer.c --- a/src/buffer.c Tue Sep 14 06:13:41 2010 +0000 +++ b/src/buffer.c Tue Sep 14 22:46:24 2010 +0000 @@ -2345,7 +2345,7 @@ { c = STRING_CHAR_AND_LENGTH (p, bytes); /* Delete all bytes for this 8-bit character but the - last one, and change the last one to the charcter + last one, and change the last one to the character code. */ bytes--; del_range_2 (pos, pos, pos + bytes, pos + bytes, 0); diff -r b7aba7c5d378 -r ccf206bc1b3a src/charset.c --- a/src/charset.c Tue Sep 14 06:13:41 2010 +0000 +++ b/src/charset.c Tue Sep 14 22:46:24 2010 +0000 @@ -427,7 +427,7 @@ /* Read a hexadecimal number (preceded by "0x") from the file FP while - paying attention to comment charcter '#'. */ + paying attention to comment character '#'. */ static INLINE unsigned read_hex (FILE *fp, int *eof) diff -r b7aba7c5d378 -r ccf206bc1b3a src/cmds.c --- a/src/cmds.c Tue Sep 14 06:13:41 2010 +0000 +++ b/src/cmds.c Tue Sep 14 22:46:24 2010 +0000 @@ -524,7 +524,7 @@ DEFVAR_LISP ("post-self-insert-hook", &Vpost_self_insert_hook, doc: /* Hook run at the end of `self-insert-command'. -This run is run after inserting the charater. */); +This is run after inserting the character. */); Vpost_self_insert_hook = Qnil; defsubr (&Sforward_point); diff -r b7aba7c5d378 -r ccf206bc1b3a src/coding.c --- a/src/coding.c Tue Sep 14 06:13:41 2010 +0000 +++ b/src/coding.c Tue Sep 14 22:46:24 2010 +0000 @@ -2008,7 +2008,7 @@ } else { - int more_bytes = emacs_mule_bytes[*src_base] - 1; + int more_bytes = emacs_mule_bytes[c] - 1; while (more_bytes > 0) { @@ -4490,7 +4490,10 @@ charset_list = CODING_ATTR_CHARSET_LIST (attrs); coding->safe_charsets = SDATA (CODING_ATTR_SAFE_CHARSETS (attrs)); - ascii_compatible = ! NILP (CODING_ATTR_ASCII_COMPAT (attrs)); + ascii_compatible + = (! NILP (CODING_ATTR_ASCII_COMPAT (attrs)) + && ! (CODING_ISO_FLAGS (coding) & (CODING_ISO_FLAG_DESIGNATION + | CODING_ISO_FLAG_LOCKING_SHIFT))); while (charbuf < charbuf_end) { diff -r b7aba7c5d378 -r ccf206bc1b3a src/editfns.c --- a/src/editfns.c Tue Sep 14 06:13:41 2010 +0000 +++ b/src/editfns.c Tue Sep 14 22:46:24 2010 +0000 @@ -3517,7 +3517,7 @@ int multibyte = 0; /* When we make a multibyte string, we must pay attention to the byte combining problem, i.e., a byte may be combined with a - multibyte charcter of the previous string. This flag tells if we + multibyte character of the previous string. This flag tells if we must consider such a situation or not. */ int maybe_combine_byte; unsigned char *this_format; diff -r b7aba7c5d378 -r ccf206bc1b3a src/term.c --- a/src/term.c Tue Sep 14 06:13:41 2010 +0000 +++ b/src/term.c Tue Sep 14 22:46:24 2010 +0000 @@ -247,7 +247,6 @@ cmputc ('\n'); } - OUTPUT_IF (tty, tty->TS_termcap_modes); OUTPUT_IF (tty, visible_cursor ? tty->TS_cursor_visible : tty->TS_cursor_normal); OUTPUT_IF (tty, tty->TS_keypad_mode); losecursor (tty); diff -r b7aba7c5d378 -r ccf206bc1b3a src/xml.c --- a/src/xml.c Tue Sep 14 06:13:41 2010 +0000 +++ b/src/xml.c Tue Sep 14 22:46:24 2010 +0000 @@ -69,11 +69,11 @@ } static Lisp_Object -parse_buffer (Lisp_Object string, Lisp_Object base_url, int htmlp) +parse_string (Lisp_Object string, Lisp_Object base_url, int htmlp) { xmlDoc *doc; xmlNode *node; - Lisp_Object result; + Lisp_Object result = Qnil; int ibeg, iend; char *burl = ""; @@ -108,25 +108,23 @@ } DEFUN ("html-parse-string", Fhtml_parse_string, Shtml_parse_string, - 0, 2, 0, - doc: /* Parse the string as an HTML document and return the parse tree. + 1, 2, 0, + doc: /* Parse STRING as an HTML document and return the parse tree. If BASE-URL is non-nil, it will be used to expand relative URLs in -the HTML document.*/) - (string, base_url) - Lisp_Object string, base_url; +the HTML document. */) + (Lisp_Object string, Lisp_Object base_url) { - return parse_buffer (string, base_url, 1); + return parse_string (string, base_url, 1); } DEFUN ("xml-parse-string", Fxml_parse_string, Sxml_parse_string, - 0, 2, 0, - doc: /* Parse the string as an XML document and return the parse tree. + 1, 2, 0, + doc: /* Parse STRING as an XML document and return the parse tree. If BASE-URL is non-nil, it will be used to expand relative URLs in -the XML document.*/) - (string, base_url) - Lisp_Object string, base_url; +the XML document. */) + (Lisp_Object string, Lisp_Object base_url) { - return parse_buffer (string, base_url, 0); + return parse_string (string, base_url, 0); } diff -r b7aba7c5d378 -r ccf206bc1b3a src/xterm.c --- a/src/xterm.c Tue Sep 14 06:13:41 2010 +0000 +++ b/src/xterm.c Tue Sep 14 22:46:24 2010 +0000 @@ -8285,19 +8285,89 @@ "_NET_WM_STATE_STICKY", NULL); } +/* Return the current _NET_WM_STATE. + SIZE_STATE is set to one of the FULLSCREEN_* values. + STICKY is set to 1 if the sticky state is set, 0 if not. */ + +static void +get_current_vm_state (struct frame *f, + Window window, + int *size_state, + int *sticky) +{ + Atom actual_type; + unsigned long actual_size, bytes_remaining; + int i, rc, actual_format; + struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + long max_len = 65536; + Display *dpy = FRAME_X_DISPLAY (f); + unsigned char *tmp_data = NULL; + Atom target_type = XA_ATOM; + + *sticky = 0; + *size_state = FULLSCREEN_NONE; + + BLOCK_INPUT; + x_catch_errors (dpy); + rc = XGetWindowProperty (dpy, window, dpyinfo->Xatom_net_wm_state, + 0, max_len, False, target_type, + &actual_type, &actual_format, &actual_size, + &bytes_remaining, &tmp_data); + + if (rc != Success || actual_type != target_type || x_had_errors_p (dpy)) + { + if (tmp_data) XFree (tmp_data); + x_uncatch_errors (); + UNBLOCK_INPUT; + return; + } + + x_uncatch_errors (); + + for (i = 0; i < actual_size; ++i) + { + Atom a = ((Atom*)tmp_data)[i]; + if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) + { + if (*size_state == FULLSCREEN_HEIGHT) + *size_state = FULLSCREEN_MAXIMIZED; + else + *size_state = FULLSCREEN_WIDTH; + } + else if (a == dpyinfo->Xatom_net_wm_state_maximized_vert) + { + if (*size_state == FULLSCREEN_WIDTH) + *size_state = FULLSCREEN_MAXIMIZED; + else + *size_state = FULLSCREEN_HEIGHT; + } + else if (a == dpyinfo->Xatom_net_wm_state_fullscreen_atom) + *size_state = FULLSCREEN_BOTH; + else if (a == dpyinfo->Xatom_net_wm_state_sticky) + *sticky = 1; + } + + if (tmp_data) XFree (tmp_data); + UNBLOCK_INPUT; +} + /* Do fullscreen as specified in extended window manager hints */ static int do_ewmh_fullscreen (struct frame *f) { int have_net_atom = wm_supports (f, "_NET_WM_STATE"); + Lisp_Object lval = get_frame_param (f, Qfullscreen); + int cur, dummy; + + get_current_vm_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. */ if (!have_net_atom) have_net_atom = wm_supports (f, "_NET_WM_STATE_FULLSCREEN"); - if (have_net_atom) + if (have_net_atom && cur != f->want_fullscreen) { Lisp_Object frame; const char *fs = "_NET_WM_STATE_FULLSCREEN"; @@ -8306,26 +8376,41 @@ XSETFRAME (frame, f); - set_wm_state (frame, 0, fs, NULL); - set_wm_state (frame, 0, fh, NULL); - set_wm_state (frame, 0, fw, NULL); - - /* If there are _NET_ atoms we assume we have extended window manager - hints. */ + /* Keep number of calls to set_wm_state as low as possible. + Some window managers, or possible Gtk+, hangs when too many + are sent at once. */ switch (f->want_fullscreen) { case FULLSCREEN_BOTH: + if (cur == FULLSCREEN_WIDTH || cur == FULLSCREEN_MAXIMIZED + || cur == FULLSCREEN_HEIGHT) + set_wm_state (frame, 0, fw, fh); set_wm_state (frame, 1, fs, NULL); break; case FULLSCREEN_WIDTH: - set_wm_state (frame, 1, fw, NULL); + if (cur == FULLSCREEN_BOTH || cur == FULLSCREEN_HEIGHT + || cur == FULLSCREEN_MAXIMIZED) + set_wm_state (frame, 0, fs, fh); + if (cur != FULLSCREEN_MAXIMIZED) + set_wm_state (frame, 1, fw, NULL); break; case FULLSCREEN_HEIGHT: - set_wm_state (frame, 1, fh, NULL); + if (cur == FULLSCREEN_BOTH || cur == FULLSCREEN_WIDTH + || cur == FULLSCREEN_MAXIMIZED) + set_wm_state (frame, 0, fs, fw); + if (cur != FULLSCREEN_MAXIMIZED) + set_wm_state (frame, 1, fh, NULL); break; case FULLSCREEN_MAXIMIZED: + if (cur == FULLSCREEN_BOTH) + set_wm_state (frame, 0, fs, NULL); set_wm_state (frame, 1, fw, fh); break; + case FULLSCREEN_NONE: + if (cur == FULLSCREEN_BOTH) + set_wm_state (frame, 0, fs, NULL); + else + set_wm_state (frame, 0, fw, fh); } f->want_fullscreen = FULLSCREEN_NONE; @@ -8351,57 +8436,11 @@ static void x_handle_net_wm_state (struct frame *f, XPropertyEvent *event) { - Atom actual_type; - unsigned long actual_size, bytes_remaining; - int i, rc, actual_format, value = FULLSCREEN_NONE; - struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); - long max_len = 65536; - Display *dpy = FRAME_X_DISPLAY (f); - unsigned char *tmp_data = NULL; - Atom target_type = XA_ATOM; + int value = FULLSCREEN_NONE; Lisp_Object lval; int sticky = 0; - BLOCK_INPUT; - x_catch_errors (dpy); - rc = XGetWindowProperty (dpy, event->window, - event->atom, 0, max_len, False, target_type, - &actual_type, &actual_format, &actual_size, - &bytes_remaining, &tmp_data); - - if (rc != Success || actual_type != target_type || x_had_errors_p (dpy)) - { - if (tmp_data) XFree (tmp_data); - x_uncatch_errors (); - UNBLOCK_INPUT; - return; - } - - x_uncatch_errors (); - - for (i = 0; i < actual_size; ++i) - { - Atom a = ((Atom*)tmp_data)[i]; - if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) - { - if (value == FULLSCREEN_HEIGHT) - value = FULLSCREEN_MAXIMIZED; - else - value = FULLSCREEN_WIDTH; - } - else if (a == dpyinfo->Xatom_net_wm_state_maximized_vert) - { - if (value == FULLSCREEN_WIDTH) - value = FULLSCREEN_MAXIMIZED; - else - value = FULLSCREEN_HEIGHT; - } - else if (a == dpyinfo->Xatom_net_wm_state_fullscreen_atom) - value = FULLSCREEN_BOTH; - else if (a == dpyinfo->Xatom_net_wm_state_sticky) - sticky = 1; - } - + get_current_vm_state (f, event->window, &value, &sticky); lval = Qnil; switch (value) { @@ -8421,9 +8460,6 @@ store_frame_param (f, Qfullscreen, lval); store_frame_param (f, Qsticky, sticky ? Qt : Qnil); - - if (tmp_data) XFree (tmp_data); - UNBLOCK_INPUT; } /* Check if we need to resize the frame due to a fullscreen request.