aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2011-08-17 12:20:17 +0200
committerJoakim Verona2011-08-17 12:20:17 +0200
commit8d157abb63ee54dbc27a05de24734800f4a1350c (patch)
tree71f3fb1d008e91675b5e42b38d8116129011b769
parent66a5c19422ef1290b0ead02d408751a3ab4dd20c (diff)
parent35774242f9065a941c7a34acc9089647acf04b43 (diff)
downloademacs-8d157abb63ee54dbc27a05de24734800f4a1350c.tar.gz
emacs-8d157abb63ee54dbc27a05de24734800f4a1350c.zip
upstream
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/epa-mail.el82
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/nndraft.el2
-rw-r--r--lisp/window.el7
-rw-r--r--src/ChangeLog5
-rw-r--r--src/lread.c28
7 files changed, 68 insertions, 77 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3f603a6ad64..f3d37a77b24 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,19 @@
12011-08-17 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (display-buffer-pop-up-frame): Run frame creation
4 function with BUFFER current (as special-display-popup-frame
5 does). Reported by Drew Adams.
6
72011-08-17 Daiki Ueno <ueno@unixuser.org>
8
9 * epa-mail.el: Simplify GnuPG group expansion using
10 epg-expand-group.
11 (epa-mail-group-alist, epa-mail-group-modtime)
12 (epa-mail-gnupg-conf-file, epa-mail-parse-groups)
13 (epa-mail-sync-groups, epa-mail-expand-recipient-1)
14 (epa-mail-expand-recipients-2, epa-mail-expand-recipients):
15 Remove.
16
12011-08-16 Feng Li <fengli@gmail.com> (tiny change) 172011-08-16 Feng Li <fengli@gmail.com> (tiny change)
2 18
3 * calc/calc-ext.el (math-defintegral-2): Remove nested backquote. 19 * calc/calc-ext.el (math-defintegral-2): Remove nested backquote.
diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el
index e6f6c0ec2b1..9d7542b3980 100644
--- a/lisp/epa-mail.el
+++ b/lisp/epa-mail.el
@@ -50,11 +50,9 @@
50 "A minor-mode for composing encrypted/clearsigned mails." 50 "A minor-mode for composing encrypted/clearsigned mails."
51 nil " epa-mail" epa-mail-mode-map) 51 nil " epa-mail" epa-mail-mode-map)
52 52
53;;; ??? Could someone please clarify this doc string?
54;;; In particular, what does USAGE look like
55;;; and what does it mean? -- rms
56(defun epa-mail--find-usable-key (keys usage) 53(defun epa-mail--find-usable-key (keys usage)
57 "Find a usable key from KEYS for USAGE." 54 "Find a usable key from KEYS for USAGE.
55USAGE would be `sign' or `encrypt'."
58 (catch 'found 56 (catch 'found
59 (while keys 57 (while keys
60 (let ((pointer (epg-key-sub-key-list (car keys)))) 58 (let ((pointer (epg-key-sub-key-list (car keys))))
@@ -66,71 +64,6 @@
66 (setq pointer (cdr pointer)))) 64 (setq pointer (cdr pointer))))
67 (setq keys (cdr keys))))) 65 (setq keys (cdr keys)))))
68 66
69(defvar epa-mail-group-alist nil
70 "Alist of GnuPG mail groups (`group' commands in `.gnupg/gpg.conf').
71Each element has the form (GROUPNAME ADDRESSES...).
72t means the list is not yet read in.")
73
74(defvar epa-mail-group-modtime nil
75 "The modification time of `~/.gnupg/gpg.conf' file when last examined.")
76
77(defvar epa-mail-gnupg-conf-file "~/.gnupg/gpg.conf"
78 "File name of GnuPG configuration file that specifies recipient groups.")
79
80(defun epa-mail-parse-groups ()
81 "Parse `~/.gnupg/gpg.conf' and set `epa-mail-group-alist' from it."
82 (let (aliases)
83 (with-temp-buffer
84 (insert-file-contents-literally epa-mail-gnupg-conf-file)
85
86 (while (re-search-forward "^[ \t]*group[ \t]*" nil t)
87 (if (looking-at "\\([^= \t]+\\)[ \t]*=[ \t]*\\([^ \t\n]+\\)")
88 (push (cons (match-string-no-properties 1)
89 (split-string (match-string-no-properties 2)))
90 aliases))))
91 (setq epa-mail-group-alist aliases)))
92
93(defun epa-mail-sync-groups ()
94 "Update GnuPG groups from file if necessary."
95 (if (file-exists-p epa-mail-gnupg-conf-file)
96 (let ((modtime (nth 5 (file-attributes epa-mail-gnupg-conf-file))))
97 (if (not (equal epa-mail-group-modtime modtime))
98 (progn
99 (setq epa-mail-group-modtime modtime)
100 (epa-mail-parse-groups))))
101 (setq epa-mail-group-alist nil)))
102
103(defun epa-mail-expand-recipient-1 (recipient)
104 "Expand RECIPIENT once thru `epa-mail-group-alist'.
105Returns the list of names it stands for, or nil if it isn't a group."
106 ;; Load the alias list if not loaded before.
107 (let (alist-elt)
108 (setq alist-elt (assoc recipient epa-mail-group-alist))
109 (cdr alist-elt)))
110
111(defun epa-mail-expand-recipients-2 (recipients)
112 "Expand list RECIPIENTS once thru `epa-mail-group-alist'.
113Returns the list of names they stand for."
114 ;; Load the alias list if not loaded before.
115 (let (output)
116 (dolist (r recipients)
117 (let ((expanded (epa-mail-expand-recipient-1 r)))
118 (if expanded
119 (dolist (xr expanded)
120 (unless (member xr output)
121 (push xr output)))
122 (unless (member r output)
123 (push r output)))))
124 (nreverse output)))
125
126(defun epa-mail-expand-recipients (recipients)
127 "Expand RECIPIENTS thru `epa-mail-group-alist' until it stops changing."
128 (epa-mail-sync-groups)
129 (while (not (equal recipients
130 (setq recipients
131 (epa-mail-expand-recipients-2 recipients)))))
132 recipients)
133
134;;;###autoload 67;;;###autoload
135(defun epa-mail-decrypt () 68(defun epa-mail-decrypt ()
136 "Decrypt OpenPGP armors in the current buffer. 69 "Decrypt OpenPGP armors in the current buffer.
@@ -184,6 +117,7 @@ Don't use this command in Lisp programs!"
184 (interactive 117 (interactive
185 (save-excursion 118 (save-excursion
186 (let ((verbose current-prefix-arg) 119 (let ((verbose current-prefix-arg)
120 (config (epg-configuration))
187 (context (epg-make-context epa-protocol)) 121 (context (epg-make-context epa-protocol))
188 recipients-string recipients recipient-key sign) 122 recipients-string recipients recipient-key sign)
189 (goto-char (point-min)) 123 (goto-char (point-min))
@@ -211,9 +145,13 @@ Don't use this command in Lisp programs!"
211 145
212 ;; Process all the recipients thru the list of GnuPG groups. 146 ;; Process all the recipients thru the list of GnuPG groups.
213 ;; Expand GnuPG group names to what they stand for. 147 ;; Expand GnuPG group names to what they stand for.
214 ;; The code below, and elsewhere, that checks that names have keys 148 (setq recipients
215 ;; does not know about these group names. 149 (apply #'nconc
216 (setq recipients (epa-mail-expand-recipients recipients)) 150 (mapcar
151 (lambda (recipient)
152 (or (epg-expand-group config recipient)
153 (list recipient)))
154 recipients)))
217 155
218 (goto-char (point-min)) 156 (goto-char (point-min))
219 (if (search-forward mail-header-separator nil t) 157 (if (search-forward mail-header-separator nil t)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 660bc8966e7..04ba929e392 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12011-08-17 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * nndraft.el (nndraft-update-unread-articles): Don't send delayed
4 articles.
5
12011-08-13 Andreas Schwab <schwab@linux-m68k.org> 62011-08-13 Andreas Schwab <schwab@linux-m68k.org>
2 7
3 * gnus-score.el (gnus-all-score-files): Use copy-sequence instead of 8 * gnus-score.el (gnus-all-score-files): Use copy-sequence instead of
diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el
index f528222dd16..0b47062a919 100644
--- a/lisp/gnus/nndraft.el
+++ b/lisp/gnus/nndraft.el
@@ -177,6 +177,8 @@ are generated if and only if they are also in `message-draft-headers'.")
177 (list 'nndraft ""))) 177 (list 'nndraft "")))
178 (nnmail-get-active))) 178 (nnmail-get-active)))
179 (gnus-group-marked (copy-sequence groups)) 179 (gnus-group-marked (copy-sequence groups))
180 ;; Don't send delayed articles.
181 (gnus-get-new-news-hook nil)
180 (inhibit-read-only t)) 182 (inhibit-read-only t))
181 (gnus-group-get-new-news-this-group nil t) 183 (gnus-group-get-new-news-this-group nil t)
182 (dolist (group groups) 184 (dolist (group groups)
diff --git a/lisp/window.el b/lisp/window.el
index 7e666af6abf..eca3dcb435d 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5087,9 +5087,10 @@ documentation of `display-buffer-alist' for a description."
5087 (when (symbolp function) 5087 (when (symbolp function)
5088 (cdr (assq 'pop-up-frame-alist specifiers)))) 5088 (cdr (assq 'pop-up-frame-alist specifiers))))
5089 (frame 5089 (frame
5090 (if (symbolp function) 5090 (with-current-buffer buffer
5091 (funcall function parameters) 5091 (if (symbolp function)
5092 (funcall function)))) 5092 (funcall function parameters)
5093 (funcall function)))))
5093 (when frame 5094 (when frame
5094 (let ((window (frame-selected-window frame))) 5095 (let ((window (frame-selected-window frame)))
5095 (set-window-parameter 5096 (set-window-parameter
diff --git a/src/ChangeLog b/src/ChangeLog
index ac9864f9f95..2aa0e157afe 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12011-08-17 Eli Zaretskii <eliz@gnu.org>
2
3 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
4 has no `load' handler, try opening the file locally. (Bug#9311)
5
12011-08-16 Ken Brown <kbrown@cornell.edu> 62011-08-16 Ken Brown <kbrown@cornell.edu>
2 7
3 * gmalloc.c: Expand comment. 8 * gmalloc.c: Expand comment.
diff --git a/src/lread.c b/src/lread.c
index 78ff195e990..6d1a7b102d7 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1124,6 +1124,22 @@ Return t if the file exists and loads successfully. */)
1124 handler = Ffind_file_name_handler (found, Qload); 1124 handler = Ffind_file_name_handler (found, Qload);
1125 if (! NILP (handler)) 1125 if (! NILP (handler))
1126 return call5 (handler, Qload, found, noerror, nomessage, Qt); 1126 return call5 (handler, Qload, found, noerror, nomessage, Qt);
1127#ifdef DOS_NT
1128 /* Tramp has to deal with semi-broken packages that prepend
1129 drive letters to remote files. For that reason, Tramp
1130 catches file operations that test for file existence, which
1131 makes openp think X:/foo.elc files are remote. However,
1132 Tramp does not catch `load' operations for such files, so we
1133 end up with a nil as the `load' handler above. If we would
1134 continue with fd = -2, we will behave wrongly, and in
1135 particular try reading a .elc file in the "rt" mode instead
1136 of "rb". See bug #9311 for the results. To work around
1137 this, we try to open the file locally, and go with that if it
1138 succeeds. */
1139 fd = emacs_open (SSDATA (ENCODE_FILE (found)), O_RDONLY, 0);
1140 if (fd == -1)
1141 fd = -2;
1142#endif
1127 } 1143 }
1128 1144
1129 /* Check if we're stuck in a recursive load cycle. 1145 /* Check if we're stuck in a recursive load cycle.
@@ -1247,9 +1263,17 @@ Return t if the file exists and loads successfully. */)
1247 GCPRO3 (file, found, hist_file_name); 1263 GCPRO3 (file, found, hist_file_name);
1248 1264
1249#ifdef WINDOWSNT 1265#ifdef WINDOWSNT
1250 emacs_close (fd);
1251 efound = ENCODE_FILE (found); 1266 efound = ENCODE_FILE (found);
1252 stream = fopen (SSDATA (efound), fmode); 1267 /* If we somehow got here with fd == -2, meaning the file is deemed
1268 to be remote, don't even try to reopen the file locally; just
1269 force a failure instead. */
1270 if (fd >= 0)
1271 {
1272 emacs_close (fd);
1273 stream = fopen (SSDATA (efound), fmode);
1274 }
1275 else
1276 stream = NULL;
1253#else /* not WINDOWSNT */ 1277#else /* not WINDOWSNT */
1254 stream = fdopen (fd, fmode); 1278 stream = fdopen (fd, fmode);
1255#endif /* not WINDOWSNT */ 1279#endif /* not WINDOWSNT */