Merge from trunk.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 18 Aug 2011 08:41:19 +0000 (01:41 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 18 Aug 2011 08:41:19 +0000 (01:41 -0700)
16 files changed:
lisp/ChangeLog
lisp/calc/calc-ext.el
lisp/epa-mail.el
lisp/gnus/ChangeLog
lisp/gnus/auth-source.el
lisp/gnus/message.el
lisp/gnus/nndraft.el
lisp/mail/smtpmail.el
lisp/net/network-stream.el
lisp/progmodes/cc-engine.el
lisp/progmodes/grep.el
lisp/window.el
src/ChangeLog
src/eval.c
src/gmalloc.c
src/lread.c

index 70d34fb..f57bd43 100644 (file)
@@ -1,3 +1,42 @@
+2011-08-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * mail/smtpmail.el (auth-source): Require to avoid problems with
+       binding variables (bug#9298).  Also clean up some unused
+       autoloads.
+
+       * net/network-stream.el (network-stream-open-starttls): Support
+       using starttls.el without using gnutls-cli.
+
+2011-08-17  Juri Linkov  <juri@jurta.org>
+
+       * progmodes/grep.el (rgrep): Handle the case when
+       `grep-find-command' is a cons cell (bug#9278).
+
+2011-08-17  Martin Rudalics  <rudalics@gmx.at>
+
+       * window.el (display-buffer-pop-up-frame): Run frame creation
+       function with BUFFER current (as special-display-popup-frame
+       does).  Reported by Drew Adams.
+
+2011-08-17  Daiki Ueno  <ueno@unixuser.org>
+
+       * epa-mail.el: Simplify GnuPG group expansion using
+       epg-expand-group.
+       (epa-mail-group-alist, epa-mail-group-modtime)
+       (epa-mail-gnupg-conf-file, epa-mail-parse-groups)
+       (epa-mail-sync-groups, epa-mail-expand-recipient-1)
+       (epa-mail-expand-recipients-2, epa-mail-expand-recipients):
+       Remove.
+
+2011-08-16  Feng Li <fengli@gmail.com> (tiny change)
+
+       * calc/calc-ext.el (math-defintegral-2): Remove nested backquote.
+
+2011-08-16  Alan Mackenzie  <acm@muc.de>
+
+       * progmodes/cc-engine.el (c-state-cache-non-literal-place):
+       Correct, to avoid the inside of macros.
+
 2011-08-16  Richard Stallman  <rms@gnu.org>
 
        * epa-mail.el: Handle GnuPG group definitions.
index 6e05cdb..8b81666 100644 (file)
@@ -2887,7 +2887,7 @@ If X is not an error form, return 1."
   (cons 'progn
         (mapcar #'(lambda (func)
                     `(put ',func 'math-integral-2
-                          `(nconc
+                          (nconc
                             (get ',func 'math-integral-2)
                             (list #'(lambda (u v) ,@code)))))
                 (if (symbolp funcs) (list funcs) funcs))))
index e6f6c0e..9d7542b 100644 (file)
   "A minor-mode for composing encrypted/clearsigned mails."
   nil " epa-mail" epa-mail-mode-map)
 
-;;; ??? Could someone please clarify this doc string?
-;;; In particular, what does USAGE look like
-;;; and what does it mean?  -- rms
 (defun epa-mail--find-usable-key (keys usage)
-  "Find a usable key from KEYS for USAGE."
+  "Find a usable key from KEYS for USAGE.
+USAGE would be `sign' or `encrypt'."
   (catch 'found
     (while keys
       (let ((pointer (epg-key-sub-key-list (car keys))))
          (setq pointer (cdr pointer))))
       (setq keys (cdr keys)))))
 
-(defvar epa-mail-group-alist nil
-  "Alist of GnuPG mail groups (`group' commands in `.gnupg/gpg.conf').
-Each element has the form (GROUPNAME ADDRESSES...).
-t means the list is not yet read in.")
-
-(defvar epa-mail-group-modtime nil
-  "The modification time of `~/.gnupg/gpg.conf' file when last examined.")
-
-(defvar epa-mail-gnupg-conf-file "~/.gnupg/gpg.conf"
-  "File name of GnuPG configuration file that specifies recipient groups.")
-
-(defun epa-mail-parse-groups ()
-  "Parse `~/.gnupg/gpg.conf' and set `epa-mail-group-alist' from it."
-  (let (aliases)
-    (with-temp-buffer
-      (insert-file-contents-literally epa-mail-gnupg-conf-file)
-
-      (while (re-search-forward "^[ \t]*group[ \t]*" nil t)
-       (if (looking-at "\\([^= \t]+\\)[ \t]*=[ \t]*\\([^ \t\n]+\\)")
-           (push (cons (match-string-no-properties 1)
-                       (split-string (match-string-no-properties 2)))
-                 aliases))))
-    (setq epa-mail-group-alist aliases)))
-
-(defun epa-mail-sync-groups ()
-  "Update GnuPG groups from file if necessary."
-  (if (file-exists-p epa-mail-gnupg-conf-file)
-      (let ((modtime (nth 5 (file-attributes epa-mail-gnupg-conf-file))))
-       (if (not (equal epa-mail-group-modtime modtime))
-           (progn
-             (setq epa-mail-group-modtime modtime)
-             (epa-mail-parse-groups))))
-    (setq epa-mail-group-alist nil)))
-
-(defun epa-mail-expand-recipient-1 (recipient)
-  "Expand RECIPIENT once thru `epa-mail-group-alist'.
-Returns the list of names it stands for, or nil if it isn't a group."
-  ;; Load the alias list if not loaded before.
-  (let (alist-elt)
-    (setq alist-elt (assoc recipient epa-mail-group-alist))
-    (cdr alist-elt)))
-
-(defun epa-mail-expand-recipients-2 (recipients)
-  "Expand list RECIPIENTS once thru `epa-mail-group-alist'.
-Returns the list of names they stand for."
-  ;; Load the alias list if not loaded before.
-  (let (output)
-    (dolist (r recipients)
-      (let ((expanded (epa-mail-expand-recipient-1 r)))
-       (if expanded
-           (dolist (xr expanded)
-             (unless (member xr output)
-               (push xr output)))
-         (unless (member r output)
-           (push r output)))))
-    (nreverse output)))
-
-(defun epa-mail-expand-recipients (recipients)
-  "Expand RECIPIENTS thru `epa-mail-group-alist' until it stops changing."
-  (epa-mail-sync-groups)
-  (while (not (equal recipients
-                    (setq recipients
-                          (epa-mail-expand-recipients-2 recipients)))))
-  recipients)
-
 ;;;###autoload
 (defun epa-mail-decrypt ()
   "Decrypt OpenPGP armors in the current buffer.
@@ -184,6 +117,7 @@ Don't use this command in Lisp programs!"
   (interactive
    (save-excursion
      (let ((verbose current-prefix-arg)
+          (config (epg-configuration))
           (context (epg-make-context epa-protocol))
           recipients-string recipients recipient-key sign)
        (goto-char (point-min))
@@ -211,9 +145,13 @@ Don't use this command in Lisp programs!"
 
        ;; Process all the recipients thru the list of GnuPG groups.
        ;; Expand GnuPG group names to what they stand for.
-       ;; The code below, and elsewhere, that checks that names have keys
-       ;; does not know about these group names.
-       (setq recipients (epa-mail-expand-recipients recipients))
+       (setq recipients
+            (apply #'nconc
+                   (mapcar
+                    (lambda (recipient)
+                      (or (epg-expand-group config recipient)
+                          (list recipient)))
+                    recipients)))
 
        (goto-char (point-min))
        (if (search-forward mail-header-separator nil t)
index 660bc89..744f94d 100644 (file)
@@ -1,3 +1,19 @@
+2011-08-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * message.el (message-is-yours-p): Allow disabling canlock checking
+       (bug#9295).
+       (message-shoot-gnksa-feet): Add `canlock-verify'.
+       (message-auto-save-directory): Use ~/ as the auto-save directory if the
+       message directory isn't writable (bug#9304).
+
+       * auth-source.el (auth-source-netrc-saver): Make the .authinfo file
+       non-world-readable.
+
+2011-08-17  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * nndraft.el (nndraft-update-unread-articles): Don't send delayed
+       articles.
+
 2011-08-13  Andreas Schwab  <schwab@linux-m68k.org>
 
        * gnus-score.el (gnus-all-score-files): Use copy-sequence instead of
index e249e97..4bd13cd 100644 (file)
@@ -1377,6 +1377,8 @@ Respects `auth-source-save-behavior'.  Uses
                 (insert "\n"))
               (insert add "\n")
               (write-region (point-min) (point-max) file nil 'silent)
+             ;; Make the .authinfo file non-world-readable.
+             (set-file-modes file #o600)
               (auth-source-do-debug
                "auth-source-netrc-create: wrote 1 new line to %s"
                file)
index 47c4de0..a157afe 100644 (file)
@@ -1310,7 +1310,7 @@ text and it replaces `self-insert-command' with the other command, e.g.
   :type '(repeat function))
 
 (defcustom message-auto-save-directory
-  (if (file-exists-p message-directory)
+  (if (file-writable-p message-directory)
       (file-name-as-directory (expand-file-name "drafts" message-directory))
     "~/")
   "*Directory where Message auto-saves buffers if Gnus isn't running.
@@ -1353,7 +1353,8 @@ candidates:
 `quoted-text-only'  Allow you to post quoted text only;
 `multiple-copies'   Allow you to post multiple copies;
 `cancel-messages'   Allow you to cancel or supersede messages from
-                   your other email addresses.")
+                   your other email addresses;
+`canlock-verify'    Allow you to cancel messages without verifying canlock.")
 
 (defsubst message-gnksa-enable-p (feature)
   (or (not (listp message-shoot-gnksa-feet))
@@ -7037,7 +7038,8 @@ regexp to match all of yours addresses."
   (save-excursion
     (save-restriction
       (message-narrow-to-head-1)
-      (if (message-fetch-field "Cancel-Lock")
+      (if (and (message-fetch-field "Cancel-Lock")
+              (message-gnksa-enable-p 'canlock-verify))
          (if (null (canlock-verify))
              t
            (error "Failed to verify Cancel-lock: This article is not yours"))
index f528222..0b47062 100644 (file)
@@ -177,6 +177,8 @@ are generated if and only if they are also in `message-draft-headers'.")
                                                       (list 'nndraft "")))
                           (nnmail-get-active)))
           (gnus-group-marked (copy-sequence groups))
+          ;; Don't send delayed articles.
+          (gnus-get-new-news-hook nil)
           (inhibit-read-only t))
       (gnus-group-get-new-news-this-group nil t)
       (dolist (group groups)
index 3b406fa..637d101 100644 (file)
 ;;; Code:
 
 (require 'sendmail)
+(require 'auth-source)
 (autoload 'mail-strip-quoted-names "mail-utils")
 (autoload 'message-make-date "message")
 (autoload 'message-make-message-id "message")
 (autoload 'rfc2104-hash "rfc2104")
-(autoload 'netrc-parse "netrc")
-(autoload 'netrc-machine "netrc")
-(autoload 'netrc-get "netrc")
 (autoload 'password-read "password-cache")
-(autoload 'auth-source-search "auth-source")
 
 ;;;
 (defgroup smtpmail nil
index ceb094c..0c3d028 100644 (file)
@@ -237,13 +237,13 @@ functionality.
       (unless builtin-starttls
        (delete-process stream)
        (setq start (with-current-buffer buffer (point-max)))
-       (let* ((starttls-use-gnutls t)
-              (starttls-extra-arguments
+       (let* ((starttls-extra-arguments
                (if require-tls
                    starttls-extra-arguments
                  ;; For opportunistic TLS upgrades, we don't really
                  ;; care about the identity of the peer.
                  (cons "--insecure" starttls-extra-arguments)))
+              (starttls-extra-args starttls-extra-args)
               (cert (network-stream-certificate host service parameters)))
          ;; There are client certificates requested, so add them to
          ;; the command line.
@@ -251,7 +251,11 @@ functionality.
            (setq starttls-extra-arguments
                  (nconc (list "--x509keyfile" (expand-file-name (nth 0 cert))
                               "--x509certfile" (expand-file-name (nth 1 cert)))
-                        starttls-extra-arguments)))
+                        starttls-extra-arguments)
+                 starttls-extra-args
+                 (nconc (list "--key-file" (expand-file-name (nth 0 cert))
+                              "--cert-file" (expand-file-name (nth 1 cert)))
+                        starttls-extra-args)))
          (setq stream (starttls-open-stream name buffer host service)))
        (network-stream-get-response stream start eoc)
        ;; Requery capabilities for protocols that require it; i.e.,
index 0236a2b..0d88f85 100644 (file)
@@ -2130,13 +2130,17 @@ comment at the start of cc-engine.el for more info."
       pos))
 
 (defsubst c-state-cache-non-literal-place (pos state)
-  ;; Return a position outside of a string/comment at or before POS.
+  ;; Return a position outside of a string/comment/macro at or before POS.
   ;; STATE is the parse-partial-sexp state at POS.
-  (if (or (nth 3 state)                        ; in a string?
-         (nth 4 state))                ; in a comment?
-      (nth 8 state)
-    pos))
-
+  (let ((res (if (or (nth 3 state)     ; in a string?
+                    (nth 4 state))     ; in a comment?
+                (nth 8 state)
+              pos)))
+    (save-excursion
+      (goto-char res)
+      (if (c-beginning-of-macro)
+         (point)
+       res))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Stuff to do with point-min, and coping with any literal there.
index db8e821..31100f3 100644 (file)
@@ -965,7 +965,9 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]."
     (unless (and dir (file-directory-p dir) (file-readable-p dir))
       (setq dir default-directory))
     (if (null files)
-       (if (not (string= regexp grep-find-command))
+       (if (not (string= regexp (if (consp grep-find-command)
+                                    (car grep-find-command)
+                                  grep-find-command)))
            (compilation-start regexp 'grep-mode))
       (setq dir (file-name-as-directory (expand-file-name dir)))
       (require 'find-dired)            ; for `find-name-arg'
index 7e666af..eca3dcb 100644 (file)
@@ -5087,9 +5087,10 @@ documentation of `display-buffer-alist' for a description."
            (when (symbolp function)
              (cdr (assq 'pop-up-frame-alist specifiers))))
           (frame
-           (if (symbolp function)
-               (funcall function parameters)
-             (funcall function))))
+           (with-current-buffer buffer
+             (if (symbolp function)
+                 (funcall function parameters)
+               (funcall function)))))
       (when frame
        (let ((window (frame-selected-window frame)))
          (set-window-parameter
index 2677f03..fe8df6f 100644 (file)
@@ -1,4 +1,4 @@
-2011-08-16  Paul Eggert  <eggert@cs.ucla.edu>
+2011-08-18  Paul Eggert  <eggert@cs.ucla.edu>
 
        Integer and memory overflow issues (Bug#9196).
 
        (gs_load): Use printmax_t to print the widest integers possible.
        Check for integer overflow when computing image height and width.
 
+2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
+
+       * eval.c (internal_condition_case, internal_condition_case_1)
+       (internal_condition_case_2, internal_condition_case_n): Remove
+       unnecessary aborts (Bug#9081).
+
+2011-08-17  Eli Zaretskii  <eliz@gnu.org>
+
+       * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
+       has no `load' handler, try opening the file locally.  (Bug#9311)
+
+2011-08-16  Ken Brown  <kbrown@cornell.edu>
+
+       * gmalloc.c: Expand comment.
+
 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
 2011-08-14  Kenichi Handa  <handa@m17n.org>
 
        * process.c (create_process): Call setup_process_coding_systems
-       after the pid of the process is set to -1.
+       after the pid of the process is set to -1 (Bug#8162).
 
 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
 
index 94039b3..8149683 100644 (file)
@@ -1462,13 +1462,6 @@ internal_condition_case (Lisp_Object (*bfun) (void), Lisp_Object handlers,
   struct catchtag c;
   struct handler h;
 
-  /* Since Fsignal will close off all calls to x_catch_errors,
-     we will get the wrong results if some are not closed now.  */
-#if HAVE_X_WINDOWS
-  if (x_catching_errors ())
-    abort ();
-#endif
-
   c.tag = Qnil;
   c.val = Qnil;
   c.backlist = backtrace_list;
@@ -1507,13 +1500,6 @@ internal_condition_case_1 (Lisp_Object (*bfun) (Lisp_Object), Lisp_Object arg,
   struct catchtag c;
   struct handler h;
 
-  /* Since Fsignal will close off all calls to x_catch_errors,
-     we will get the wrong results if some are not closed now.  */
-#if HAVE_X_WINDOWS
-  if (x_catching_errors ())
-    abort ();
-#endif
-
   c.tag = Qnil;
   c.val = Qnil;
   c.backlist = backtrace_list;
@@ -1556,13 +1542,6 @@ internal_condition_case_2 (Lisp_Object (*bfun) (Lisp_Object, Lisp_Object),
   struct catchtag c;
   struct handler h;
 
-  /* Since Fsignal will close off all calls to x_catch_errors,
-     we will get the wrong results if some are not closed now.  */
-#if HAVE_X_WINDOWS
-  if (x_catching_errors ())
-    abort ();
-#endif
-
   c.tag = Qnil;
   c.val = Qnil;
   c.backlist = backtrace_list;
@@ -1605,13 +1584,6 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *),
   struct catchtag c;
   struct handler h;
 
-  /* Since Fsignal will close off all calls to x_catch_errors,
-     we will get the wrong results if some are not closed now.  */
-#if HAVE_X_WINDOWS
-  if (x_catching_errors ())
-    abort ();
-#endif
-
   c.tag = Qnil;
   c.val = Qnil;
   c.backlist = backtrace_list;
index 61046ad..d49259b 100644 (file)
@@ -356,7 +356,11 @@ Fifth Floor, Boston, MA 02110-1301, USA.
    emacs uses the Cygwin heap (managed with sbrk).  When emacs starts
    on Cygwin, it reinitializes malloc, and we save the old info for
    use by free and realloc if they're called with a pointer into the
-   static heap. */
+   static heap.
+
+   Currently (2011-08-16) the Cygwin build doesn't use ralloc.c; if
+   this is changed in the future, we'll have to similarly deal with
+   reinitializing ralloc. */
 #ifdef CYGWIN
 extern __ptr_t bss_sbrk PP ((ptrdiff_t __size));
 extern int bss_sbrk_did_unexec;
index f2a5278..d24da72 100644 (file)
@@ -1124,6 +1124,22 @@ Return t if the file exists and loads successfully.  */)
        handler = Ffind_file_name_handler (found, Qload);
       if (! NILP (handler))
        return call5 (handler, Qload, found, noerror, nomessage, Qt);
+#ifdef DOS_NT
+      /* Tramp has to deal with semi-broken packages that prepend
+        drive letters to remote files.  For that reason, Tramp
+        catches file operations that test for file existence, which
+        makes openp think X:/foo.elc files are remote.  However,
+        Tramp does not catch `load' operations for such files, so we
+        end up with a nil as the `load' handler above.  If we would
+        continue with fd = -2, we will behave wrongly, and in
+        particular try reading a .elc file in the "rt" mode instead
+        of "rb".  See bug #9311 for the results.  To work around
+        this, we try to open the file locally, and go with that if it
+        succeeds.  */
+      fd = emacs_open (SSDATA (ENCODE_FILE (found)), O_RDONLY, 0);
+      if (fd == -1)
+       fd = -2;
+#endif
     }
 
   /* Check if we're stuck in a recursive load cycle.
@@ -1247,9 +1263,17 @@ Return t if the file exists and loads successfully.  */)
   GCPRO3 (file, found, hist_file_name);
 
 #ifdef WINDOWSNT
-  emacs_close (fd);
   efound = ENCODE_FILE (found);
-  stream = fopen (SSDATA (efound), fmode);
+  /* If we somehow got here with fd == -2, meaning the file is deemed
+     to be remote, don't even try to reopen the file locally; just
+     force a failure instead.  */
+  if (fd >= 0)
+    {
+      emacs_close (fd);
+      stream = fopen (SSDATA (efound), fmode);
+    }
+  else
+    stream = NULL;
 #else  /* not WINDOWSNT */
   stream = fdopen (fd, fmode);
 #endif /* not WINDOWSNT */