emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101435: Merge changes from emacs-23


From: Juanma Barranquero
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101435: Merge changes from emacs-23 branch.
Date: Tue, 14 Sep 2010 16:41:53 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101435 [merge]
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Tue 2010-09-14 16:41:53 +0200
message:
  Merge changes from emacs-23 branch.
modified:
  doc/emacs/ChangeLog
  doc/emacs/cal-xtra.texi
  doc/emacs/calendar.texi
  doc/emacs/emacs.texi
  doc/emacs/trouble.texi
  etc/NEWS.23
  lisp/ChangeLog
  lisp/calendar/appt.el
  lisp/calendar/diary-lib.el
  lisp/emacs-lisp/byte-run.el
  lisp/font-lock.el
  lisp/menu-bar.el
  lisp/progmodes/antlr-mode.el
  lisp/repeat.el
  lisp/simple.el
  lisp/subr.el
  lisp/url/ChangeLog
  lisp/url/url-cache.el
  lisp/url/url-cookie.el
  lisp/vc/vc-hg.el
  src/ChangeLog
  src/coding.c
  src/term.c
  src/xterm.c
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog       2010-09-09 02:12:40 +0000
+++ b/doc/emacs/ChangeLog       2010-09-14 14:41:53 +0000
@@ -1,3 +1,19 @@
+2010-09-14  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
 
        * xresources.texi: Untabify.

=== modified file 'doc/emacs/cal-xtra.texi'
--- a/doc/emacs/cal-xtra.texi   2010-01-13 08:35:10 +0000
+++ b/doc/emacs/cal-xtra.texi   2010-09-14 08:02:28 +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

=== modified file 'doc/emacs/calendar.texi'
--- a/doc/emacs/calendar.texi   2010-06-23 02:46:43 +0000
+++ b/doc/emacs/calendar.texi   2010-09-14 07:34:23 +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
address@hidden
address@hidden Diary Display,, emacs-xtra})
address@hidden iftex
address@hidden
address@hidden Diary Display})
address@hidden ifnottex
+is saved.
 
 @findex appt-add
 @findex appt-delete

=== modified file 'doc/emacs/emacs.texi'
--- a/doc/emacs/emacs.texi      2010-07-10 18:52:53 +0000
+++ b/doc/emacs/emacs.texi      2010-09-14 14:41:53 +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.

=== modified file 'doc/emacs/trouble.texi'
--- a/doc/emacs/trouble.texi    2010-06-23 02:46:43 +0000
+++ b/doc/emacs/trouble.texi    2010-09-12 00:31:47 +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
address@hidden/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
 
address@hidden Known Problems
address@hidden 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:
+
address@hidden
address@hidden
+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.
+
address@hidden
+Some additional user-level problems can be found in @ref{Bugs and
+problems, , Bugs and problems, efaq, GNU Emacs FAQ}.
+
address@hidden
+The @samp{bug-gnu-emacs} mailing list (also available as the newsgroup
address@hidden).  This is where you will find most Emacs bug
+reports.  You can read the list archives at
address@hidden://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.
+
address@hidden
+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.
+
address@hidden
+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
address@hidden://lists.gnu.org/archive/html/emacs-pretest-bug/}.  From
+late 2007 to mid 2008, the address was an alias for the
address@hidden mailing list.  From mid 2008 onwards, it has been
+an alias for @samp{bug-gnu-emacs}.
+
address@hidden
+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.
+
address@hidden 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.)
-
-  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.
+
+  Before reporting a bug, first try to see if the problem has already
+been reported (@pxref{Known Problems}).
+
+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
address@hidden 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
address@hidden 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
address@hidden 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
address@hidden  If that command does not work, you probably have something
-other than GNU Emacs, so you will have to report the bug somewhere
-else.
address@hidden 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
address@hidden option (@pxref{Initial Options}).  This bypasses your
address@hidden 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

=== modified file 'etc/NEWS.23'
--- a/etc/NEWS.23       2010-06-16 20:08:41 +0000
+++ b/etc/NEWS.23       2010-09-14 14:41:53 +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.
 
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-09-14 06:01:14 +0000
+++ b/lisp/ChangeLog    2010-09-14 14:41:53 +0000
@@ -1,3 +1,72 @@
+2010-09-14  Stefan Monnier  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * simple.el (line-move-visual): Do not truncate goal column to
+       integer size.  (Bug#7020)
+
+2010-09-14  Stefan Monnier  <address@hidden>
+
+       * repeat.el (repeat): Allow repeating when the last event is a click.
+       Suggested by Drew Adams (bug#6256).
+
+2010-09-14  Sascha Wilde  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * font-lock.el (font-lock-beginning-of-syntax-function):
+       Mark as obsolete.
+
+2010-09-14  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * progmodes/antlr-mode.el (antlr-font-lock-additional-keywords):
+       Fix typo.  (Bug#6976)
+
+2010-09-14  Vinicius Jose Latorre  <address@hidden>
+
+       * 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  <address@hidden>
 
        * calendar/time-date.el (format-seconds): Comment fix.
@@ -116,7 +185,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):

=== modified file 'lisp/calendar/appt.el'
--- a/lisp/calendar/appt.el     2010-08-29 16:17:13 +0000
+++ b/lisp/calendar/appt.el     2010-09-14 14:41:53 +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)))

=== modified file 'lisp/calendar/diary-lib.el'
--- a/lisp/calendar/diary-lib.el        2010-08-14 02:23:56 +0000
+++ b/lisp/calendar/diary-lib.el        2010-09-14 08:02:28 +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")

=== modified file 'lisp/emacs-lisp/byte-run.el'
--- a/lisp/emacs-lisp/byte-run.el       2010-08-30 13:03:05 +0000
+++ b/lisp/emacs-lisp/byte-run.el       2010-09-14 14:41:53 +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

=== modified file 'lisp/font-lock.el'
--- a/lisp/font-lock.el 2010-09-10 23:13:42 +0000
+++ b/lisp/font-lock.el 2010-09-14 14:41:53 +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.

=== modified file 'lisp/menu-bar.el'
--- a/lisp/menu-bar.el  2010-08-30 18:11:34 +0000
+++ b/lisp/menu-bar.el  2010-09-14 14:41:53 +0000
@@ -664,13 +664,23 @@
     ;; put on a customized-value property.
     (dolist (elt '(line-number-mode column-number-mode size-indication-mode
                   cua-mode show-paren-mode transient-mark-mode
-                  blink-cursor-mode display-time-mode display-battery-mode))
+                  blink-cursor-mode display-time-mode display-battery-mode
+                  ;; These are set by other functions that don't set
+                  ;; the customized state.  Having them here has the
+                  ;; side-effect that turning them off via X
+                  ;; resources acts like having customized them, but
+                  ;; that seems harmless.
+                  menu-bar-mode tool-bar-mode))
+      ;; FIXME ? It's a little annoying that running this command
+      ;; always loads cua-base, paren, time, and battery, even if they
+      ;; have not been customized in any way.  (Due to custom-load-symbol.)
       (and (customize-mark-to-save elt)
           (setq need-save t)))
     ;; These are set with `customize-set-variable'.
     (dolist (elt '(scroll-bar-mode
                   debug-on-quit debug-on-error
-                  tooltip-mode menu-bar-mode tool-bar-mode
+                  ;; Somehow this works, when tool-bar and menu-bar don't.
+                  tooltip-mode
                   save-place uniquify-buffer-name-style fringe-mode
                   indicate-empty-lines indicate-buffer-boundaries
                   case-fold-search font-use-system-font
@@ -2037,6 +2047,16 @@
     (run-with-idle-timer 0 nil 'message
                         "Menu-bar mode disabled.  Use M-x menu-bar-mode to 
make the menu bar appear.")))
 
+;;;###autoload
+;; (This does not work right unless it comes after the above definition.)
+;; This comment is taken from tool-bar.el near
+;; (put 'tool-bar-mode ...)
+;; We want to pretend the menu bar by standard is on, as this will make
+;; customize consider disabling the menu bar a customization, and save
+;; that.  We could do this for real by setting :init-value above, but
+;; that would overwrite disabling the menu bar from X resources.
+(put 'menu-bar-mode 'standard-value '(t))
+
 (defun toggle-menu-bar-mode-from-frame (&optional arg)
   "Toggle menu bar on or off, based on the status of the current frame.
 See `menu-bar-mode' for more information."

=== modified file 'lisp/progmodes/antlr-mode.el'
--- a/lisp/progmodes/antlr-mode.el      2010-08-29 16:17:13 +0000
+++ b/lisp/progmodes/antlr-mode.el      2010-09-14 14:41:53 +0000
@@ -951,7 +951,7 @@
       (3 antlr-keyword-face)
       (4 (if (member (match-string 4) '("Lexer" "Parser" "TreeParser"))
             antlr-keyword-face
-          type-face)))
+          font-lock-type-face)))
      (,(lambda (limit)
         (antlr-re-search-forward
          "\\<\\(header\\|options\\|tokens\\|exception\\|catch\\|returns\\)\\>"

=== modified file 'lisp/repeat.el'
--- a/lisp/repeat.el    2010-08-29 16:17:13 +0000
+++ b/lisp/repeat.el    2010-09-14 14:41:53 +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))

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2010-09-08 16:14:44 +0000
+++ b/lisp/simple.el    2010-09-14 14:41:53 +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)

=== modified file 'lisp/subr.el'
--- a/lisp/subr.el      2010-09-12 14:35:37 +0000
+++ b/lisp/subr.el      2010-09-14 14:41:53 +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)

=== modified file 'lisp/url/ChangeLog'
--- a/lisp/url/ChangeLog        2010-09-11 01:58:42 +0000
+++ b/lisp/url/ChangeLog        2010-09-14 14:41:53 +0000
@@ -1,3 +1,15 @@
+2010-09-14  Julien Danjou  <address@hidden>
+
+       * url-cache (url-store-in-cache): Make `buff' argument really optional.
+
+2010-09-14  Glenn Morris  <address@hidden>
+
+       * url-cookie.el (url-cookie-expired-p): Tweak previous change.
+
+2010-09-14  shawn boles  <address@hidden>  (tiny change)
+
+       * url-cookie.el (url-cookie-expired-p): Simplify and fix.  (Bug#6957)
+
 2010-09-11  Glenn Morris  <address@hidden>
 
        * url-cache.el, url-gw.el, url-history.el, url-irc.el, url-util.el:

=== modified file 'lisp/url/url-cache.el'
--- a/lisp/url/url-cache.el     2010-09-11 01:58:42 +0000
+++ b/lisp/url/url-cache.el     2010-09-14 14:41:53 +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)

=== modified file 'lisp/url/url-cookie.el'
--- a/lisp/url/url-cookie.el    2010-01-13 08:35:10 +0000
+++ b/lisp/url/url-cookie.el    2010-09-09 05:38:43 +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."

=== modified file 'lisp/vc/vc-hg.el'
--- a/lisp/vc/vc-hg.el  2010-08-29 16:17:13 +0000
+++ b/lisp/vc/vc-hg.el  2010-09-14 14:41:53 +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.

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-09-14 07:53:39 +0000
+++ b/src/ChangeLog     2010-09-14 14:41:53 +0000
@@ -1,7 +1,29 @@
+2010-09-14  Jan Djärv  <address@hidden>
+
+       * 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  <address@hidden>  (tiny change)
+
+       * term.c (tty_set_terminal_modes): Don't initialize twice (bug#7002).
+
+2010-09-14  Kenichi Handa  <address@hidden>
+
+       * coding.c (encode_coding_iso_2022): Don't optimize for ASCII if
+       we may use designation or locking-shift.
+
+2010-09-14  Kenichi Handa  <address@hidden>
+
+       * coding.c (detect_coding_emacs_mule): Fix checking of multibyte
+       sequence when the source is multibyte.
+
 2010-09-14  Andreas Schwab  <address@hidden>
 
-       * xml.c (Fxml_parse_string, Fxml_parse_string): Revert last
-       change.  Don't make first argument optional.  Doc fix.
+       * xml.c (Fxml_parse_string, Fxml_parse_string): Revert last change.
+       Don't make first argument optional.  Doc fix.
 
 2010-09-14  Leo  <address@hidden>  (tiny change)
 
@@ -111,8 +133,8 @@
        (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
+       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.
 
 2010-08-31  Stefan Monnier  <address@hidden>

=== modified file 'src/coding.c'
--- a/src/coding.c      2010-08-08 21:15:44 +0000
+++ b/src/coding.c      2010-09-14 14:41:53 +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)
     {

=== modified file 'src/term.c'
--- a/src/term.c        2010-09-01 07:13:21 +0000
+++ b/src/term.c        2010-09-14 14:41:53 +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);

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2010-09-02 09:47:08 +0000
+++ b/src/xterm.c       2010-09-14 14:41:53 +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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]