diff options
| author | Paul Eggert | 2011-05-03 23:13:23 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-05-03 23:13:23 -0700 |
| commit | 53a35e81c90cec67a21bbc8518bc516ed335d756 (patch) | |
| tree | bdf44bf84d4a2c11efdce99245da34e39cb17041 | |
| parent | 19548d0861ced228dd0598240a410bf6a720b59e (diff) | |
| parent | f330b642bb28e3b9ee5e14ac55c8103e6dcde412 (diff) | |
| download | emacs-53a35e81c90cec67a21bbc8518bc516ed335d756.tar.gz emacs-53a35e81c90cec67a21bbc8518bc516ed335d756.zip | |
Merge from mainline.
| -rw-r--r-- | doc/misc/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/ChangeLog | 36 | ||||
| -rw-r--r-- | lisp/calendar/diary-lib.el | 55 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 37 | ||||
| -rw-r--r-- | lisp/net/gnutls.el | 34 | ||||
| -rw-r--r-- | lisp/net/network-stream.el | 6 | ||||
| -rw-r--r-- | lisp/progmodes/fortran.el | 2 | ||||
| -rw-r--r-- | lisp/whitespace.el | 28 | ||||
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/gnutls.c | 65 |
10 files changed, 180 insertions, 91 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index defdabc4d8f..ca9dbba9692 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 2011-05-03 Peter Münster <pmlists@free.fr> | 1 | 2011-05-03 Peter Münster <pmlists@free.fr> (tiny change) |
| 2 | 2 | ||
| 3 | * gnus.texi (Summary Buffer Lines): | 3 | * gnus.texi (Summary Buffer Lines): |
| 4 | gnus-summary-user-date-format-alist does not exist. | 4 | gnus-summary-user-date-format-alist does not exist. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2c1ab1c7f6f..3d7b2c33832 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,39 @@ | |||
| 1 | 2011-05-04 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * calendar/diary-lib.el (diary-fancy-date-pattern): Turn it into a | ||
| 4 | function, so it follows changes in calendar-date-style. | ||
| 5 | (diary-fancy-date-matcher): New function. | ||
| 6 | (diary-fancy-font-lock-keywords): Use diary-fancy-date-matcher. | ||
| 7 | (diary-fancy-font-lock-fontify-region-function): | ||
| 8 | Use diary-fancy-date-pattern as a function. | ||
| 9 | |||
| 10 | * calendar/diary-lib.el (diary-fancy-date-pattern): Do not use | ||
| 11 | non-numbers for `year' etc pseudo-variables. (Bug#8583) | ||
| 12 | |||
| 13 | 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 14 | |||
| 15 | * net/gnutls.el (gnutls-negotiate): Use CL-style keyword arguments | ||
| 16 | instead of positional arguments. Allow :keylist and :crlfiles | ||
| 17 | arguments. | ||
| 18 | (open-gnutls-stream): Call it. | ||
| 19 | |||
| 20 | * net/network-stream.el (network-stream-open-starttls): Adjust to | ||
| 21 | call `gnutls-negotiate' with :process and :hostname arguments. | ||
| 22 | |||
| 23 | 2011-05-04 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 24 | |||
| 25 | * minibuffer.el (completion--message): New function. | ||
| 26 | (completion--do-completion, minibuffer-complete) | ||
| 27 | (minibuffer-force-complete, minibuffer-complete-word): Use it. | ||
| 28 | (completion--do-completion): Don't ignore completion-auto-help when in | ||
| 29 | icomplete-mode. | ||
| 30 | |||
| 31 | * whitespace.el (whitespace-trailing-regexp): Don't rely on the | ||
| 32 | internal encoding (e.g. tibetan zero is not whitespace). | ||
| 33 | (global-whitespace-mode): Prefer save-current-buffer. | ||
| 34 | (whitespace-trailing-regexp): Remove useless save-match-data. | ||
| 35 | (whitespace-empty-at-bob-regexp): Minor simplification. | ||
| 36 | |||
| 1 | 2011-05-03 Chong Yidong <cyd@stupidchicken.com> | 37 | 2011-05-03 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 38 | ||
| 3 | * emacs-lisp/autoload.el (generated-autoload-file): Doc fix (Bug#7989). | 39 | * emacs-lisp/autoload.el (generated-autoload-file): Doc fix (Bug#7989). |
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index a2528ac22ca..43c0682277c 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -2090,7 +2090,7 @@ Optional symbol TYPE is either `monthly' or `yearly'." | |||
| 2090 | '(day " " monthname)) | 2090 | '(day " " monthname)) |
| 2091 | (t '(monthname " " day)))) | 2091 | (t '(monthname " " day)))) |
| 2092 | ;; Iso cannot contain "-", because this form used eg by | 2092 | ;; Iso cannot contain "-", because this form used eg by |
| 2093 | ;; insert-anniversary-diary-entry. | 2093 | ;; diary-insert-anniversary-entry. |
| 2094 | (t (cond ((eq calendar-date-style 'iso) | 2094 | (t (cond ((eq calendar-date-style 'iso) |
| 2095 | '((format "%s %.2d %.2d" year | 2095 | '((format "%s %.2d %.2d" year |
| 2096 | (string-to-number month) (string-to-number day)))) | 2096 | (string-to-number month) (string-to-number day)))) |
| @@ -2364,36 +2364,45 @@ return a font-lock pattern matching array of MONTHS and marking SYMBOL." | |||
| 2364 | 2364 | ||
| 2365 | ;;; Fancy Diary Mode. | 2365 | ;;; Fancy Diary Mode. |
| 2366 | 2366 | ||
| 2367 | ;; FIXME does not update upon changes to the name-arrays. | 2367 | (defun diary-fancy-date-pattern () |
| 2368 | (defvar diary-fancy-date-pattern | 2368 | "Return a regexp matching the first line of a fancy diary date header. |
| 2369 | This depends on the calendar date style." | ||
| 2369 | (concat | 2370 | (concat |
| 2370 | (let ((dayname (diary-name-pattern calendar-day-name-array nil t)) | 2371 | (let ((dayname (diary-name-pattern calendar-day-name-array nil t)) |
| 2371 | (monthname (diary-name-pattern calendar-month-name-array nil t)) | 2372 | (monthname (diary-name-pattern calendar-month-name-array nil t)) |
| 2372 | (day "[0-9]+") | 2373 | (day "1") |
| 2373 | (month "[0-9]+") | 2374 | (month "2") |
| 2374 | (year "-?[0-9]+")) | 2375 | ;; FIXME? This used to be "-?[0-9]+" - what was the "-?" for? |
| 2375 | (mapconcat 'eval calendar-date-display-form "")) | 2376 | (year "3")) |
| 2377 | ;; This is ugly. c-d-d-form expects `day' etc to be "numbers in | ||
| 2378 | ;; string form"; eg the iso version calls string-to-number on some. | ||
| 2379 | ;; Therefore we cannot eg just let day = "[0-9]+". (Bug#8583). | ||
| 2380 | ;; Assumes no integers in c-day/month-name-array. | ||
| 2381 | (replace-regexp-in-string "[0-9]+" "[0-9]+" | ||
| 2382 | (mapconcat 'eval calendar-date-display-form "") | ||
| 2383 | nil t)) | ||
| 2376 | ;; Optional ": holiday name" after the date. | 2384 | ;; Optional ": holiday name" after the date. |
| 2377 | "\\(: .*\\)?") | 2385 | "\\(: .*\\)?")) |
| 2378 | "Regular expression matching a date header in Fancy Diary.") | 2386 | |
| 2387 | (defun diary-fancy-date-matcher (limit) | ||
| 2388 | "Search for a fancy diary data header, up to LIMIT." | ||
| 2389 | ;; Any number of " other holiday name" lines, followed by "==" line. | ||
| 2390 | (when (re-search-forward | ||
| 2391 | (format "%s\\(\n +.*\\)*\n=+$" (diary-fancy-date-pattern)) limit t) | ||
| 2392 | (put-text-property (match-beginning 0) (match-end 0) 'font-lock-multiline t) | ||
| 2393 | t)) | ||
| 2379 | 2394 | ||
| 2380 | (define-obsolete-variable-alias 'fancy-diary-font-lock-keywords | 2395 | (define-obsolete-variable-alias 'fancy-diary-font-lock-keywords |
| 2381 | 'diary-fancy-font-lock-keywords "23.1") | 2396 | 'diary-fancy-font-lock-keywords "23.1") |
| 2382 | 2397 | ||
| 2383 | (defvar diary-fancy-font-lock-keywords | 2398 | (defvar diary-fancy-font-lock-keywords |
| 2384 | (list | 2399 | `((diary-fancy-date-matcher . diary-face) |
| 2385 | (list | 2400 | ("^.*\\([aA]nniversary\\|[bB]irthday\\).*$" . 'diary-anniversary) |
| 2386 | ;; Any number of " other holiday name" lines, followed by "==" line. | 2401 | ("^.*Yahrzeit.*$" . font-lock-reference-face) |
| 2387 | (concat diary-fancy-date-pattern "\\(\n +.*\\)*\n=+$") | 2402 | ("^\\(Erev \\)?Rosh Hodesh.*" . font-lock-function-name-face) |
| 2388 | '(0 (progn (put-text-property (match-beginning 0) (match-end 0) | 2403 | ("^Day.*omer.*$" . font-lock-builtin-face) |
| 2389 | 'font-lock-multiline t) | 2404 | ("^Parashat.*$" . font-lock-comment-face) |
| 2390 | diary-face))) | 2405 | (,(format "\\(^\\|\\s-\\)%s\\(-%s\\)?" diary-time-regexp |
| 2391 | '("^.*\\([aA]nniversary\\|[bB]irthday\\).*$" . 'diary-anniversary) | ||
| 2392 | '("^.*Yahrzeit.*$" . font-lock-reference-face) | ||
| 2393 | '("^\\(Erev \\)?Rosh Hodesh.*" . font-lock-function-name-face) | ||
| 2394 | '("^Day.*omer.*$" . font-lock-builtin-face) | ||
| 2395 | '("^Parashat.*$" . font-lock-comment-face) | ||
| 2396 | `(,(format "\\(^\\|\\s-\\)%s\\(-%s\\)?" diary-time-regexp | ||
| 2397 | diary-time-regexp) . 'diary-time)) | 2406 | diary-time-regexp) . 'diary-time)) |
| 2398 | "Keywords to highlight in fancy diary display.") | 2407 | "Keywords to highlight in fancy diary display.") |
| 2399 | 2408 | ||
| @@ -2409,7 +2418,7 @@ Fontify the region between BEG and END, quietly unless VERBOSE is non-nil." | |||
| 2409 | (while (and (looking-at " +[^ ]") | 2418 | (while (and (looking-at " +[^ ]") |
| 2410 | (zerop (forward-line -1)))) | 2419 | (zerop (forward-line -1)))) |
| 2411 | ;; This check not essential. | 2420 | ;; This check not essential. |
| 2412 | (if (looking-at diary-fancy-date-pattern) | 2421 | (if (looking-at (diary-fancy-date-pattern)) |
| 2413 | (setq beg (line-beginning-position))) | 2422 | (setq beg (line-beginning-position))) |
| 2414 | (goto-char end) | 2423 | (goto-char end) |
| 2415 | (forward-line 0) | 2424 | (forward-line 0) |
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 7bd256afc79..41399f3f141 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -558,6 +558,10 @@ candidates than this number." | |||
| 558 | (defvar completion-fail-discreetly nil | 558 | (defvar completion-fail-discreetly nil |
| 559 | "If non-nil, stay quiet when there is no match.") | 559 | "If non-nil, stay quiet when there is no match.") |
| 560 | 560 | ||
| 561 | (defun completion--message (msg) | ||
| 562 | (if completion-show-inline-help | ||
| 563 | (minibuffer-message msg))) | ||
| 564 | |||
| 561 | (defun completion--do-completion (&optional try-completion-function) | 565 | (defun completion--do-completion (&optional try-completion-function) |
| 562 | "Do the completion and return a summary of what happened. | 566 | "Do the completion and return a summary of what happened. |
| 563 | M = completion was performed, the text was Modified. | 567 | M = completion was performed, the text was Modified. |
| @@ -585,9 +589,9 @@ E = after completion we now have an Exact match. | |||
| 585 | (cond | 589 | (cond |
| 586 | ((null comp) | 590 | ((null comp) |
| 587 | (minibuffer-hide-completions) | 591 | (minibuffer-hide-completions) |
| 588 | (when (and (not completion-fail-discreetly) completion-show-inline-help) | 592 | (unless completion-fail-discreetly |
| 589 | (ding) | 593 | (ding) |
| 590 | (minibuffer-message "No match")) | 594 | (completion--message "No match")) |
| 591 | (minibuffer--bitset nil nil nil)) | 595 | (minibuffer--bitset nil nil nil)) |
| 592 | ((eq t comp) | 596 | ((eq t comp) |
| 593 | (minibuffer-hide-completions) | 597 | (minibuffer-hide-completions) |
| @@ -657,15 +661,13 @@ E = after completion we now have an Exact match. | |||
| 657 | (minibuffer-hide-completions)) | 661 | (minibuffer-hide-completions)) |
| 658 | ;; Show the completion table, if requested. | 662 | ;; Show the completion table, if requested. |
| 659 | ((not exact) | 663 | ((not exact) |
| 660 | (if (cond (icomplete-mode t) | 664 | (if (case completion-auto-help |
| 661 | ((null completion-show-inline-help) t) | 665 | (lazy (eq this-command last-command)) |
| 662 | ((eq completion-auto-help 'lazy) | 666 | (t completion-auto-help)) |
| 663 | (eq this-command last-command)) | ||
| 664 | (t completion-auto-help)) | ||
| 665 | (minibuffer-completion-help) | 667 | (minibuffer-completion-help) |
| 666 | (minibuffer-message "Next char not unique"))) | 668 | (completion--message "Next char not unique"))) |
| 667 | ;; If the last exact completion and this one were the same, it | 669 | ;; If the last exact completion and this one were the same, it |
| 668 | ;; means we've already given a "Next char not unique" message | 670 | ;; means we've already given a "Complete, but not unique" message |
| 669 | ;; and the user's hit TAB again, so now we give him help. | 671 | ;; and the user's hit TAB again, so now we give him help. |
| 670 | ((eq this-command last-command) | 672 | ((eq this-command last-command) |
| 671 | (if completion-auto-help (minibuffer-completion-help)))) | 673 | (if completion-auto-help (minibuffer-completion-help)))) |
| @@ -703,11 +705,9 @@ scroll the window of possible completions." | |||
| 703 | t) | 705 | t) |
| 704 | (t (case (completion--do-completion) | 706 | (t (case (completion--do-completion) |
| 705 | (#b000 nil) | 707 | (#b000 nil) |
| 706 | (#b001 (if completion-show-inline-help | 708 | (#b001 (completion--message "Sole completion") |
| 707 | (minibuffer-message "Sole completion")) | ||
| 708 | t) | 709 | t) |
| 709 | (#b011 (if completion-show-inline-help | 710 | (#b011 (completion--message "Complete, but not unique") |
| 710 | (minibuffer-message "Complete, but not unique")) | ||
| 711 | t) | 711 | t) |
| 712 | (t t))))) | 712 | (t t))))) |
| 713 | 713 | ||
| @@ -765,9 +765,8 @@ Repeated uses step through the possible completions." | |||
| 765 | (end (field-end)) | 765 | (end (field-end)) |
| 766 | (all (completion-all-sorted-completions))) | 766 | (all (completion-all-sorted-completions))) |
| 767 | (if (not (consp all)) | 767 | (if (not (consp all)) |
| 768 | (if completion-show-inline-help | 768 | (completion--message |
| 769 | (minibuffer-message | 769 | (if all "No more completions" "No completions")) |
| 770 | (if all "No more completions" "No completions"))) | ||
| 771 | (setq completion-cycling t) | 770 | (setq completion-cycling t) |
| 772 | (goto-char end) | 771 | (goto-char end) |
| 773 | (insert (car all)) | 772 | (insert (car all)) |
| @@ -955,11 +954,9 @@ Return nil if there is no valid completion, else t." | |||
| 955 | (interactive) | 954 | (interactive) |
| 956 | (case (completion--do-completion 'completion--try-word-completion) | 955 | (case (completion--do-completion 'completion--try-word-completion) |
| 957 | (#b000 nil) | 956 | (#b000 nil) |
| 958 | (#b001 (if completion-show-inline-help | 957 | (#b001 (completion--message "Sole completion") |
| 959 | (minibuffer-message "Sole completion")) | ||
| 960 | t) | 958 | t) |
| 961 | (#b011 (if completion-show-inline-help | 959 | (#b011 (completion--message "Complete, but not unique") |
| 962 | (minibuffer-message "Complete, but not unique")) | ||
| 963 | t) | 960 | t) |
| 964 | (t t))) | 961 | (t t))) |
| 965 | 962 | ||
diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el index 8b662795665..67d7b2d20d3 100644 --- a/lisp/net/gnutls.el +++ b/lisp/net/gnutls.el | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | 35 | ||
| 36 | ;;; Code: | 36 | ;;; Code: |
| 37 | 37 | ||
| 38 | (eval-when-compile (require 'cl)) | ||
| 39 | |||
| 38 | (defgroup gnutls nil | 40 | (defgroup gnutls nil |
| 39 | "Emacs interface to the GnuTLS library." | 41 | "Emacs interface to the GnuTLS library." |
| 40 | :prefix "gnutls-" | 42 | :prefix "gnutls-" |
| @@ -72,9 +74,9 @@ This is a very simple wrapper around `gnutls-negotiate'. See its | |||
| 72 | documentation for the specific parameters you can use to open a | 74 | documentation for the specific parameters you can use to open a |
| 73 | GnuTLS connection, including specifying the credential type, | 75 | GnuTLS connection, including specifying the credential type, |
| 74 | trust and key files, and priority string." | 76 | trust and key files, and priority string." |
| 75 | (gnutls-negotiate (open-network-stream name buffer host service) | 77 | (gnutls-negotiate :process (open-network-stream name buffer host service) |
| 76 | 'gnutls-x509pki | 78 | :type 'gnutls-x509pki |
| 77 | host)) | 79 | :hostname host)) |
| 78 | 80 | ||
| 79 | (put 'gnutls-error | 81 | (put 'gnutls-error |
| 80 | 'error-conditions | 82 | 'error-conditions |
| @@ -85,16 +87,23 @@ trust and key files, and priority string." | |||
| 85 | (declare-function gnutls-boot "gnutls.c" (proc type proplist)) | 87 | (declare-function gnutls-boot "gnutls.c" (proc type proplist)) |
| 86 | (declare-function gnutls-errorp "gnutls.c" (error)) | 88 | (declare-function gnutls-errorp "gnutls.c" (error)) |
| 87 | 89 | ||
| 88 | (defun gnutls-negotiate (proc type hostname &optional priority-string | 90 | (defun* gnutls-negotiate |
| 89 | trustfiles keyfiles verify-flags | 91 | (&rest spec |
| 90 | verify-error verify-hostname-error) | 92 | &key process type hostname priority-string |
| 93 | trustfiles crlfiles keylist verify-flags | ||
| 94 | verify-error verify-hostname-error | ||
| 95 | &allow-other-keys) | ||
| 91 | "Negotiate a SSL/TLS connection. Returns proc. Signals gnutls-error. | 96 | "Negotiate a SSL/TLS connection. Returns proc. Signals gnutls-error. |
| 97 | |||
| 98 | Note arguments are passed CL style, :type TYPE instead of just TYPE. | ||
| 99 | |||
| 92 | TYPE is `gnutls-x509pki' (default) or `gnutls-anon'. Use nil for the default. | 100 | TYPE is `gnutls-x509pki' (default) or `gnutls-anon'. Use nil for the default. |
| 93 | PROC is a process returned by `open-network-stream'. | 101 | PROCESS is a process returned by `open-network-stream'. |
| 94 | HOSTNAME is the remote hostname. It must be a valid string. | 102 | HOSTNAME is the remote hostname. It must be a valid string. |
| 95 | PRIORITY-STRING is as per the GnuTLS docs, default is \"NORMAL\". | 103 | PRIORITY-STRING is as per the GnuTLS docs, default is \"NORMAL\". |
| 96 | TRUSTFILES is a list of CA bundles. | 104 | TRUSTFILES is a list of CA bundles. |
| 97 | KEYFILES is a list of client keys. | 105 | CRLFILES is a list of CRL files. |
| 106 | KEYLIST is an alist of (client key file, client cert file) pairs. | ||
| 98 | 107 | ||
| 99 | When VERIFY-HOSTNAME-ERROR is not nil, an error will be raised | 108 | When VERIFY-HOSTNAME-ERROR is not nil, an error will be raised |
| 100 | when the hostname does not match the presented certificate's host | 109 | when the hostname does not match the presented certificate's host |
| @@ -141,7 +150,8 @@ defaults to GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT." | |||
| 141 | :hostname ,hostname | 150 | :hostname ,hostname |
| 142 | :loglevel ,gnutls-log-level | 151 | :loglevel ,gnutls-log-level |
| 143 | :trustfiles ,trustfiles | 152 | :trustfiles ,trustfiles |
| 144 | :keyfiles ,keyfiles | 153 | :crlfiles ,crlfiles |
| 154 | :keylist ,keylist | ||
| 145 | :verify-flags ,verify-flags | 155 | :verify-flags ,verify-flags |
| 146 | :verify-error ,verify-error | 156 | :verify-error ,verify-error |
| 147 | :verify-hostname-error ,verify-hostname-error | 157 | :verify-hostname-error ,verify-hostname-error |
| @@ -149,14 +159,14 @@ defaults to GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT." | |||
| 149 | ret) | 159 | ret) |
| 150 | 160 | ||
| 151 | (gnutls-message-maybe | 161 | (gnutls-message-maybe |
| 152 | (setq ret (gnutls-boot proc type params)) | 162 | (setq ret (gnutls-boot process type params)) |
| 153 | "boot: %s" params) | 163 | "boot: %s" params) |
| 154 | 164 | ||
| 155 | (when (gnutls-errorp ret) | 165 | (when (gnutls-errorp ret) |
| 156 | ;; This is a error from the underlying C code. | 166 | ;; This is a error from the underlying C code. |
| 157 | (signal 'gnutls-error (list proc ret))) | 167 | (signal 'gnutls-error (list process ret))) |
| 158 | 168 | ||
| 159 | proc)) | 169 | process)) |
| 160 | 170 | ||
| 161 | (declare-function gnutls-error-string "gnutls.c" (error)) | 171 | (declare-function gnutls-error-string "gnutls.c" (error)) |
| 162 | 172 | ||
diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 2071f790656..f3cfd7d058f 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el | |||
| @@ -45,9 +45,7 @@ | |||
| 45 | (require 'tls) | 45 | (require 'tls) |
| 46 | (require 'starttls) | 46 | (require 'starttls) |
| 47 | 47 | ||
| 48 | (declare-function gnutls-negotiate "gnutls" | 48 | (declare-function gnutls-negotiate "gnutls" (&rest spec)) |
| 49 | (proc type host &optional priority-string trustfiles keyfiles | ||
| 50 | verify-flags verify-error verify-hostname-error)) | ||
| 51 | 49 | ||
| 52 | ;;;###autoload | 50 | ;;;###autoload |
| 53 | (defun open-network-stream (name buffer host service &rest parameters) | 51 | (defun open-network-stream (name buffer host service &rest parameters) |
| @@ -203,7 +201,7 @@ asynchronously, if possible." | |||
| 203 | (network-stream-command stream starttls-command eoc)) | 201 | (network-stream-command stream starttls-command eoc)) |
| 204 | ;; The server said it was OK to begin STARTTLS negotiations. | 202 | ;; The server said it was OK to begin STARTTLS negotiations. |
| 205 | (if (fboundp 'open-gnutls-stream) | 203 | (if (fboundp 'open-gnutls-stream) |
| 206 | (gnutls-negotiate stream nil host) | 204 | (gnutls-negotiate :process stream :hostname host) |
| 207 | (unless (starttls-negotiate stream) | 205 | (unless (starttls-negotiate stream) |
| 208 | (delete-process stream))) | 206 | (delete-process stream))) |
| 209 | (if (memq (process-status stream) '(open run)) | 207 | (if (memq (process-status stream) '(open run)) |
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index 7c305ec3f6e..f03d2013467 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el | |||
| @@ -492,7 +492,7 @@ This varies according to the value of LINE-LENGTH. | |||
| 492 | This is used to fontify fixed-format Fortran comments." | 492 | This is used to fontify fixed-format Fortran comments." |
| 493 | ;; This results in a non-byte-compiled function. We could pass it through | 493 | ;; This results in a non-byte-compiled function. We could pass it through |
| 494 | ;; `byte-compile', but simple benchmarks indicate that it's probably not | 494 | ;; `byte-compile', but simple benchmarks indicate that it's probably not |
| 495 | ;; worth the trouble (about ½% of slow down). | 495 | ;; worth the trouble (about 0.5% of slow down). |
| 496 | (eval ;I hate `eval', but it's hard to avoid it here. | 496 | (eval ;I hate `eval', but it's hard to avoid it here. |
| 497 | `(syntax-propertize-rules | 497 | `(syntax-propertize-rules |
| 498 | ("^[cd\\*]" (0 "<")) | 498 | ("^[cd\\*]" (0 "<")) |
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index f5788eb1ee2..89f078a5063 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -800,13 +800,12 @@ Used when `whitespace-style' includes `tabs'." | |||
| 800 | 800 | ||
| 801 | 801 | ||
| 802 | (defcustom whitespace-trailing-regexp | 802 | (defcustom whitespace-trailing-regexp |
| 803 | "\\(\\(\t\\| \\|\xA0\\|\x8A0\\|\x920\\|\xE20\\|\xF20\\)+\\)$" | 803 | "\\([\t \u00A0]+\\)$" |
| 804 | "Specify trailing characters regexp. | 804 | "Specify trailing characters regexp. |
| 805 | 805 | ||
| 806 | If you're using `mule' package, there may be other characters besides: | 806 | If you're using `mule' package, there may be other characters besides: |
| 807 | 807 | ||
| 808 | \" \" \"\\t\" \"\\xA0\" \"\\x8A0\" \"\\x920\" \"\\xE20\" \ | 808 | \" \" \"\\t\" \"\\u00A0\" |
| 809 | \"\\xF20\" | ||
| 810 | 809 | ||
| 811 | that should be considered blank. | 810 | that should be considered blank. |
| 812 | 811 | ||
| @@ -1133,7 +1132,7 @@ See also `whitespace-style', `whitespace-newline' and | |||
| 1133 | (noninteractive ; running a batch job | 1132 | (noninteractive ; running a batch job |
| 1134 | (setq global-whitespace-mode nil)) | 1133 | (setq global-whitespace-mode nil)) |
| 1135 | (global-whitespace-mode ; global-whitespace-mode on | 1134 | (global-whitespace-mode ; global-whitespace-mode on |
| 1136 | (save-excursion | 1135 | (save-current-buffer |
| 1137 | (add-hook 'find-file-hook 'whitespace-turn-on-if-enabled) | 1136 | (add-hook 'find-file-hook 'whitespace-turn-on-if-enabled) |
| 1138 | (add-hook 'after-change-major-mode-hook 'whitespace-turn-on-if-enabled) | 1137 | (add-hook 'after-change-major-mode-hook 'whitespace-turn-on-if-enabled) |
| 1139 | (dolist (buffer (buffer-list)) ; adjust all local mode | 1138 | (dolist (buffer (buffer-list)) ; adjust all local mode |
| @@ -1141,7 +1140,7 @@ See also `whitespace-style', `whitespace-newline' and | |||
| 1141 | (unless whitespace-mode | 1140 | (unless whitespace-mode |
| 1142 | (whitespace-turn-on-if-enabled))))) | 1141 | (whitespace-turn-on-if-enabled))))) |
| 1143 | (t ; global-whitespace-mode off | 1142 | (t ; global-whitespace-mode off |
| 1144 | (save-excursion | 1143 | (save-current-buffer |
| 1145 | (remove-hook 'find-file-hook 'whitespace-turn-on-if-enabled) | 1144 | (remove-hook 'find-file-hook 'whitespace-turn-on-if-enabled) |
| 1146 | (remove-hook 'after-change-major-mode-hook 'whitespace-turn-on-if-enabled) | 1145 | (remove-hook 'after-change-major-mode-hook 'whitespace-turn-on-if-enabled) |
| 1147 | (dolist (buffer (buffer-list)) ; adjust all local mode | 1146 | (dolist (buffer (buffer-list)) ; adjust all local mode |
| @@ -1526,7 +1525,7 @@ documentation." | |||
| 1526 | ;; whole buffer | 1525 | ;; whole buffer |
| 1527 | (t | 1526 | (t |
| 1528 | (save-excursion | 1527 | (save-excursion |
| 1529 | (save-match-data | 1528 | (save-match-data ;FIXME: Why? |
| 1530 | ;; PROBLEM 1: empty lines at bob | 1529 | ;; PROBLEM 1: empty lines at bob |
| 1531 | ;; PROBLEM 2: empty lines at eob | 1530 | ;; PROBLEM 2: empty lines at eob |
| 1532 | ;; ACTION: remove all empty lines at bob and/or eob | 1531 | ;; ACTION: remove all empty lines at bob and/or eob |
| @@ -1598,7 +1597,7 @@ documentation." | |||
| 1598 | overwrite-mode ; enforce no overwrite | 1597 | overwrite-mode ; enforce no overwrite |
| 1599 | tmp) | 1598 | tmp) |
| 1600 | (save-excursion | 1599 | (save-excursion |
| 1601 | (save-match-data | 1600 | (save-match-data ;FIXME: Why? |
| 1602 | ;; PROBLEM 1: 8 or more SPACEs at bol | 1601 | ;; PROBLEM 1: 8 or more SPACEs at bol |
| 1603 | (cond | 1602 | (cond |
| 1604 | ;; ACTION: replace 8 or more SPACEs at bol by TABs, if | 1603 | ;; ACTION: replace 8 or more SPACEs at bol by TABs, if |
| @@ -1870,7 +1869,7 @@ cleaning up these problems." | |||
| 1870 | (interactive "r") | 1869 | (interactive "r") |
| 1871 | (setq force (or current-prefix-arg force)) | 1870 | (setq force (or current-prefix-arg force)) |
| 1872 | (save-excursion | 1871 | (save-excursion |
| 1873 | (save-match-data | 1872 | (save-match-data ;FIXME: Why? |
| 1874 | (let* ((has-bogus nil) | 1873 | (let* ((has-bogus nil) |
| 1875 | (rstart (min start end)) | 1874 | (rstart (min start end)) |
| 1876 | (rend (max start end)) | 1875 | (rend (max start end)) |
| @@ -2412,9 +2411,8 @@ resultant list will be returned." | |||
| 2412 | "Match trailing spaces which do not contain the point at end of line." | 2411 | "Match trailing spaces which do not contain the point at end of line." |
| 2413 | (let ((status t)) | 2412 | (let ((status t)) |
| 2414 | (while (if (re-search-forward whitespace-trailing-regexp limit t) | 2413 | (while (if (re-search-forward whitespace-trailing-regexp limit t) |
| 2415 | (save-match-data | 2414 | (= whitespace-point (match-end 1)) ;; Loop if point at eol. |
| 2416 | (= whitespace-point (match-end 1))) ;; loop if point at eol | 2415 | (setq status nil))) ;; End of buffer. |
| 2417 | (setq status nil))) ;; end of buffer | ||
| 2418 | status)) | 2416 | status)) |
| 2419 | 2417 | ||
| 2420 | 2418 | ||
| @@ -2428,9 +2426,7 @@ beginning of buffer." | |||
| 2428 | ((= b 1) | 2426 | ((= b 1) |
| 2429 | (setq r (and (/= whitespace-point 1) | 2427 | (setq r (and (/= whitespace-point 1) |
| 2430 | (looking-at whitespace-empty-at-bob-regexp))) | 2428 | (looking-at whitespace-empty-at-bob-regexp))) |
| 2431 | (if r | 2429 | (set-marker whitespace-bob-marker (if r (match-end 1) b))) |
| 2432 | (set-marker whitespace-bob-marker (match-end 1)) | ||
| 2433 | (set-marker whitespace-bob-marker b))) | ||
| 2434 | ;; inside bob empty region | 2430 | ;; inside bob empty region |
| 2435 | ((<= limit whitespace-bob-marker) | 2431 | ((<= limit whitespace-bob-marker) |
| 2436 | (setq r (looking-at whitespace-empty-at-bob-regexp)) | 2432 | (setq r (looking-at whitespace-empty-at-bob-regexp)) |
| @@ -2441,9 +2437,7 @@ beginning of buffer." | |||
| 2441 | ;; intersection with end of bob empty region | 2437 | ;; intersection with end of bob empty region |
| 2442 | ((<= b whitespace-bob-marker) | 2438 | ((<= b whitespace-bob-marker) |
| 2443 | (setq r (looking-at whitespace-empty-at-bob-regexp)) | 2439 | (setq r (looking-at whitespace-empty-at-bob-regexp)) |
| 2444 | (if r | 2440 | (set-marker whitespace-bob-marker (if r (match-end 1) b))) |
| 2445 | (set-marker whitespace-bob-marker (match-end 1)) | ||
| 2446 | (set-marker whitespace-bob-marker b))) | ||
| 2447 | ;; it is not inside bob empty region | 2441 | ;; it is not inside bob empty region |
| 2448 | (t | 2442 | (t |
| 2449 | (setq r nil))) | 2443 | (setq r nil))) |
diff --git a/src/ChangeLog b/src/ChangeLog index c1f43f4313d..f8135ee2ab0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -108,6 +108,12 @@ | |||
| 108 | 108 | ||
| 109 | * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long. | 109 | * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long. |
| 110 | 110 | ||
| 111 | 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 112 | |||
| 113 | * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options | ||
| 114 | instead of :keyfiles. Give GnuTLS the keylist and the CRL lists | ||
| 115 | as passed in. | ||
| 116 | |||
| 111 | 2011-05-03 Jan Djärv <jan.h.d@swipnet.se> | 117 | 2011-05-03 Jan Djärv <jan.h.d@swipnet.se> |
| 112 | 118 | ||
| 113 | * xterm.c (x_set_frame_alpha): Do not set property on anything | 119 | * xterm.c (x_set_frame_alpha): Do not set property on anything |
diff --git a/src/gnutls.c b/src/gnutls.c index 8e41be20505..fd970910d24 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -44,7 +44,8 @@ static int gnutls_global_initialized; | |||
| 44 | /* The following are for the property list of `gnutls-boot'. */ | 44 | /* The following are for the property list of `gnutls-boot'. */ |
| 45 | static Lisp_Object Qgnutls_bootprop_priority; | 45 | static Lisp_Object Qgnutls_bootprop_priority; |
| 46 | static Lisp_Object Qgnutls_bootprop_trustfiles; | 46 | static Lisp_Object Qgnutls_bootprop_trustfiles; |
| 47 | static Lisp_Object Qgnutls_bootprop_keyfiles; | 47 | static Lisp_Object Qgnutls_bootprop_keylist; |
| 48 | static Lisp_Object Qgnutls_bootprop_crlfiles; | ||
| 48 | static Lisp_Object Qgnutls_bootprop_callbacks; | 49 | static Lisp_Object Qgnutls_bootprop_callbacks; |
| 49 | static Lisp_Object Qgnutls_bootprop_loglevel; | 50 | static Lisp_Object Qgnutls_bootprop_loglevel; |
| 50 | static Lisp_Object Qgnutls_bootprop_hostname; | 51 | static Lisp_Object Qgnutls_bootprop_hostname; |
| @@ -412,7 +413,10 @@ PROPLIST is a property list with the following keys: | |||
| 412 | 413 | ||
| 413 | :trustfiles is a list of PEM-encoded trust files for `gnutls-x509pki'. | 414 | :trustfiles is a list of PEM-encoded trust files for `gnutls-x509pki'. |
| 414 | 415 | ||
| 415 | :keyfiles is a list of PEM-encoded key files for `gnutls-x509pki'. | 416 | :crlfiles is a list of PEM-encoded CRL lists for `gnutls-x509pki'. |
| 417 | |||
| 418 | :keylist is an alist of PEM-encoded key files and PEM-encoded | ||
| 419 | certificates for `gnutls-x509pki'. | ||
| 416 | 420 | ||
| 417 | :callbacks is an alist of callback functions, see below. | 421 | :callbacks is an alist of callback functions, see below. |
| 418 | 422 | ||
| @@ -471,7 +475,8 @@ one trustfile (usually a CA bundle). */) | |||
| 471 | /* Placeholders for the property list elements. */ | 475 | /* Placeholders for the property list elements. */ |
| 472 | Lisp_Object priority_string; | 476 | Lisp_Object priority_string; |
| 473 | Lisp_Object trustfiles; | 477 | Lisp_Object trustfiles; |
| 474 | Lisp_Object keyfiles; | 478 | Lisp_Object crlfiles; |
| 479 | Lisp_Object keylist; | ||
| 475 | /* Lisp_Object callbacks; */ | 480 | /* Lisp_Object callbacks; */ |
| 476 | Lisp_Object loglevel; | 481 | Lisp_Object loglevel; |
| 477 | Lisp_Object hostname; | 482 | Lisp_Object hostname; |
| @@ -486,7 +491,8 @@ one trustfile (usually a CA bundle). */) | |||
| 486 | hostname = Fplist_get (proplist, Qgnutls_bootprop_hostname); | 491 | hostname = Fplist_get (proplist, Qgnutls_bootprop_hostname); |
| 487 | priority_string = Fplist_get (proplist, Qgnutls_bootprop_priority); | 492 | priority_string = Fplist_get (proplist, Qgnutls_bootprop_priority); |
| 488 | trustfiles = Fplist_get (proplist, Qgnutls_bootprop_trustfiles); | 493 | trustfiles = Fplist_get (proplist, Qgnutls_bootprop_trustfiles); |
| 489 | keyfiles = Fplist_get (proplist, Qgnutls_bootprop_keyfiles); | 494 | keylist = Fplist_get (proplist, Qgnutls_bootprop_keylist); |
| 495 | crlfiles = Fplist_get (proplist, Qgnutls_bootprop_crlfiles); | ||
| 490 | /* callbacks = Fplist_get (proplist, Qgnutls_bootprop_callbacks); */ | 496 | /* callbacks = Fplist_get (proplist, Qgnutls_bootprop_callbacks); */ |
| 491 | loglevel = Fplist_get (proplist, Qgnutls_bootprop_loglevel); | 497 | loglevel = Fplist_get (proplist, Qgnutls_bootprop_loglevel); |
| 492 | verify_flags = Fplist_get (proplist, Qgnutls_bootprop_verify_flags); | 498 | verify_flags = Fplist_get (proplist, Qgnutls_bootprop_verify_flags); |
| @@ -614,15 +620,41 @@ one trustfile (usually a CA bundle). */) | |||
| 614 | } | 620 | } |
| 615 | } | 621 | } |
| 616 | 622 | ||
| 617 | for (tail = keyfiles; !NILP (tail); tail = Fcdr (tail)) | 623 | for (tail = crlfiles; !NILP (tail); tail = Fcdr (tail)) |
| 618 | { | 624 | { |
| 619 | Lisp_Object keyfile = Fcar (tail); | 625 | Lisp_Object crlfile = Fcar (tail); |
| 620 | if (STRINGP (keyfile)) | 626 | if (STRINGP (crlfile)) |
| 621 | { | 627 | { |
| 622 | GNUTLS_LOG2 (1, max_log_level, "setting the keyfile: ", | 628 | GNUTLS_LOG2 (1, max_log_level, "setting the CRL file: ", |
| 623 | SSDATA (keyfile)); | 629 | SSDATA (crlfile)); |
| 624 | ret = gnutls_certificate_set_x509_crl_file | 630 | ret = gnutls_certificate_set_x509_crl_file |
| 625 | (x509_cred, | 631 | (x509_cred, |
| 632 | SSDATA (crlfile), | ||
| 633 | file_format); | ||
| 634 | |||
| 635 | if (ret < GNUTLS_E_SUCCESS) | ||
| 636 | return gnutls_make_error (ret); | ||
| 637 | } | ||
| 638 | else | ||
| 639 | { | ||
| 640 | error ("Sorry, GnuTLS can't use non-string CRL file %s", | ||
| 641 | SDATA (crlfile)); | ||
| 642 | } | ||
| 643 | } | ||
| 644 | |||
| 645 | for (tail = keylist; !NILP (tail); tail = Fcdr (tail)) | ||
| 646 | { | ||
| 647 | Lisp_Object keyfile = Fcar (Fcar (tail)); | ||
| 648 | Lisp_Object certfile = Fcar (Fcdr (tail)); | ||
| 649 | if (STRINGP (keyfile) && STRINGP (certfile)) | ||
| 650 | { | ||
| 651 | GNUTLS_LOG2 (1, max_log_level, "setting the client key file: ", | ||
| 652 | SSDATA (keyfile)); | ||
| 653 | GNUTLS_LOG2 (1, max_log_level, "setting the client cert file: ", | ||
| 654 | SSDATA (certfile)); | ||
| 655 | ret = gnutls_certificate_set_x509_key_file | ||
| 656 | (x509_cred, | ||
| 657 | SSDATA (certfile), | ||
| 626 | SSDATA (keyfile), | 658 | SSDATA (keyfile), |
| 627 | file_format); | 659 | file_format); |
| 628 | 660 | ||
| @@ -631,8 +663,12 @@ one trustfile (usually a CA bundle). */) | |||
| 631 | } | 663 | } |
| 632 | else | 664 | else |
| 633 | { | 665 | { |
| 634 | error ("Sorry, GnuTLS can't use non-string keyfile %s", | 666 | if (STRINGP (keyfile)) |
| 635 | SDATA (keyfile)); | 667 | error ("Sorry, GnuTLS can't use non-string client cert file %s", |
| 668 | SDATA (certfile)); | ||
| 669 | else | ||
| 670 | error ("Sorry, GnuTLS can't use non-string client key file %s", | ||
| 671 | SDATA (keyfile)); | ||
| 636 | } | 672 | } |
| 637 | } | 673 | } |
| 638 | } | 674 | } |
| @@ -868,8 +904,11 @@ syms_of_gnutls (void) | |||
| 868 | Qgnutls_bootprop_trustfiles = intern_c_string (":trustfiles"); | 904 | Qgnutls_bootprop_trustfiles = intern_c_string (":trustfiles"); |
| 869 | staticpro (&Qgnutls_bootprop_trustfiles); | 905 | staticpro (&Qgnutls_bootprop_trustfiles); |
| 870 | 906 | ||
| 871 | Qgnutls_bootprop_keyfiles = intern_c_string (":keyfiles"); | 907 | Qgnutls_bootprop_keylist = intern_c_string (":keylist"); |
| 872 | staticpro (&Qgnutls_bootprop_keyfiles); | 908 | staticpro (&Qgnutls_bootprop_keylist); |
| 909 | |||
| 910 | Qgnutls_bootprop_crlfiles = intern_c_string (":crlfiles"); | ||
| 911 | staticpro (&Qgnutls_bootprop_crlfiles); | ||
| 873 | 912 | ||
| 874 | Qgnutls_bootprop_callbacks = intern_c_string (":callbacks"); | 913 | Qgnutls_bootprop_callbacks = intern_c_string (":callbacks"); |
| 875 | staticpro (&Qgnutls_bootprop_callbacks); | 914 | staticpro (&Qgnutls_bootprop_callbacks); |