Now on revision 106763. ------------------------------------------------------------ revno: 106763 fixes bug(s): http://debbugs.gnu.org/10417 committer: Chong Yidong branch nick: trunk timestamp: Tue 2012-01-03 14:31:08 +0800 message: Fix shell completion regression. * lisp/shell.el (shell-dynamic-complete-functions): Put pcomplete-completions-at-point, so as to try comint-filename-completion first (Bug#10417). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-01-03 02:14:40 +0000 +++ lisp/ChangeLog 2012-01-03 06:31:08 +0000 @@ -1,3 +1,9 @@ +2012-01-03 Chong Yidong + + * shell.el (shell-dynamic-complete-functions): Put + pcomplete-completions-at-point, so as to try + comint-filename-completion first (Bug#10417). + 2012-01-02 Richard Stallman * battery.el (battery-status-function): === modified file 'lisp/shell.el' --- lisp/shell.el 2012-01-02 09:27:32 +0000 +++ lisp/shell.el 2012-01-03 06:31:08 +0000 @@ -187,10 +187,11 @@ shell-environment-variable-completion shell-command-completion shell-c-a-p-replace-by-expanded-directory - pcomplete-completions-at-point shell-filename-completion - ;; Not sure when this one would still be useful. --Stef - comint-filename-completion) + comint-filename-completion + ;; This goes last, so that `comint-filename-completion' can handle + ;; `shell-completion-execonly' (Bug#10417). + pcomplete-completions-at-point) "List of functions called to perform completion. This variable is used to initialize `comint-dynamic-complete-functions' in the shell buffer. ------------------------------------------------------------ revno: 106762 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2012-01-03 03:14:40 +0100 message: Fix typos. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-01-02 23:18:48 +0000 +++ lisp/ChangeLog 2012-01-03 02:14:40 +0000 @@ -65,8 +65,8 @@ (gdb-var-delete-children, gdb-edit-value, gdb-var-update) (gdb-stopped, def-gdb-auto-update-trigger) (gdb-place-breakpoints, gdb-select-thread, gdb-select-frame) - (gdb-get-changed-registers, gdb-get-main-selected-frame): Callers - changed. + (gdb-get-changed-registers, gdb-get-main-selected-frame): + Callers changed. (gud-gdbmi-completions): New function. (gdb): Use it for generating the completion table. @@ -76,22 +76,22 @@ locking. Use this to protect declarations from losing their contexts. - * progmodes/cc-langs.el (c-before-font-lock-functions): replace + * progmodes/cc-langs.el (c-before-font-lock-functions): Replace c-set-fl-decl-start with c-change-set-fl-decl-start (Renaming). - (c-before-context-fontification-functions): new defvar, a list of + (c-before-context-fontification-functions): New defvar, a list of functions to be run just before context (etc.) font locking. * progmodes/cc-mode.el (c-extend-font-lock-region-for-macros): - new, functionality extracted from + New, functionality extracted from c-neutralize-syntax-in-and-mark-CPP. - (c-in-after-change-fontification): new variable. + (c-in-after-change-fontification): New variable. (c-after-change): Set c-in-after-change-fontification. (c-set-fl-decl-start): Rejig its interface, so it can be called from both after-change and context fontifying. - (c-change-set-fl-decl-start, c-context-set-fl-decl-start): new - functions. - (c-standard-font-lock-fontify-region-function): new variable. - (c-font-lock-fontify-region): new function. + (c-change-set-fl-decl-start, c-context-set-fl-decl-start): + New functions. + (c-standard-font-lock-fontify-region-function): New variable. + (c-font-lock-fontify-region): New function. 2011-12-24 Juri Linkov @@ -107,17 +107,17 @@ Fix unstable fontification inside templates. - * progmodes/cc-langs.el (c-before-font-lock-functions): newly - created from the singular version. The (c c++ objc) entry now + * progmodes/cc-langs.el (c-before-font-lock-functions): + Newly created from the singular version. The (c c++ objc) entry now additionally has c-set-fl-decl-start. The other languages (apart from AWK) have that as a single entry. - * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): The - functionality for "local" declarations has been extracted to + * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): + The functionality for "local" declarations has been extracted to c-set-fl-decl-start. - * progmodes/cc-mode.el: (c-common-init, c-after-change): Changes - due to pluralisation of c-before-font-lock-functions. + * progmodes/cc-mode.el (c-common-init, c-after-change): + Changes due to pluralisation of c-before-font-lock-functions. (c-set-fl-decl-start): New function, extracted from c-font-lock-enclosing-decls and enhanced. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-01-01 16:26:51 +0000 +++ src/ChangeLog 2012-01-03 02:14:40 +0000 @@ -41,8 +41,8 @@ 2011-12-21 Jan Djärv - * nsterm.m (x_free_frame_resources): Release - f->output_data.ns->miniimage + * nsterm.m (x_free_frame_resources): + Release f->output_data.ns->miniimage. (ns_index_color): Fix indentation. Do not retain color_table->colors[i]. @@ -94,10 +94,10 @@ Fns_store_cut_buffer_internal. (ns_get_foreign_selection, Fx_own_selection_internal) (Fx_disown_selection_internal, Fx_selection_exists_p) - (Fns_get_selection_internal, Fns_store_selection_internal): Use - ns_symbol_to_pb and check if return value is nil. - (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove - defsubr Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal + (Fns_get_selection_internal, Fns_store_selection_internal): + Use ns_symbol_to_pb and check if return value is nil. + (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr + Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal renamed to Sns_store_selection_internal. (ns_handle_selection_request): Move code to Fx_own_selection_internal === modified file 'src/lread.c' --- src/lread.c 2011-12-12 05:32:49 +0000 +++ src/lread.c 2012-01-03 02:14:40 +0000 @@ -3113,7 +3113,7 @@ if (uninterned_symbol && ! NILP (Vpurify_flag)) name = make_pure_string (read_buffer, nchars, nbytes, multibyte); else - name = make_specified_string (read_buffer, nchars, nbytes,multibyte); + name = make_specified_string (read_buffer, nchars, nbytes, multibyte); result = (uninterned_symbol ? Fmake_symbol (name) : Fintern (name, Qnil)); ------------------------------------------------------------ revno: 106761 committer: Richard Stallman branch nick: trunk timestamp: Mon 2012-01-02 18:18:48 -0500 message: Handle battery capacity on Lemote Yeeloong. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-01-02 09:27:32 +0000 +++ lisp/ChangeLog 2012-01-02 23:18:48 +0000 @@ -1,3 +1,11 @@ +2012-01-02 Richard Stallman + + * battery.el (battery-status-function): + Detect when to use battery-yeeloong-sysfs. + (battery-echo-area-format): Add string for Yeeloong. + (battery-linux-proc-apm, battery-linux-proc-acpi): Doc fixes. + (battery-yeeloong-sysfs): New function. + 2012-01-02 Chong Yidong * dirtrack.el (dirtrack-list): Eliminate unused third element. === modified file 'lisp/battery.el' --- lisp/battery.el 2011-12-21 12:20:40 +0000 +++ lisp/battery.el 2012-01-02 23:18:48 +0000 @@ -50,6 +50,10 @@ (file-directory-p "/sys/class/power_supply/") (directory-files "/sys/class/power_supply/" nil "BAT[0-9]$")) 'battery-linux-sysfs) + ((and (eq system-type 'gnu/linux) + (file-directory-p "/sys/class/power_supply/yeeloong-bat/") + (directory-files "/sys/class/power_supply/yeeloong-bat/" nil "charge_")) + 'battery-yeeloong-sysfs) ((and (eq system-type 'darwin) (condition-case nil (with-temp-buffer @@ -77,6 +81,8 @@ "Power %L, battery %B (%p%% load)") ((eq battery-status-function 'battery-pmset) "%L power, battery %B (%p%% load, remaining time %t)") + ((eq battery-status-function 'battery-yeeloong-sysfs) + "%L power, battery %B (%p%% load, remaining time %t)") (battery-status-function "Power %L, battery %B (%p%% load, remaining time %t)")) "Control string formatting the string to display in the echo area. @@ -226,7 +232,7 @@ "Regular expression matching contents of `/proc/apm'.") (defun battery-linux-proc-apm () - "Get APM status information from Linux kernel. + "Get APM status information from Linux (the kernel). This function works only with the new `/proc/apm' format introduced in Linux version 1.3.58. @@ -297,7 +303,7 @@ ;;; `/proc/acpi/' interface for Linux. (defun battery-linux-proc-acpi () - "Get ACPI status information from Linux kernel. + "Get ACPI status information from Linux (the kernel). This function works only with the `/proc/acpi/' format introduced in Linux version 2.4.20 and 2.6.0. @@ -518,7 +524,90 @@ "BAT") "N/A"))))) - +(defun battery-yeeloong-sysfs () + "Get ACPI status information from Linux (the kernel). +This function works only on the Lemote Yeeloong. + +The following %-sequences are provided: +%c Current capacity (mAh) +%r Current rate +%B Battery status (verbose) +%b Battery status, empty means high, `-' means low, + `!' means critical, and `+' means charging +%L AC line status (verbose) +%p Battery load percentage +%m Remaining time (to charge or discharge) in minutes +%h Remaining time (to charge or discharge) in hours +%t Remaining time (to charge or discharge) in the form `h:min'" + + (let (capacity + capacity-level + status + ac-online + hours + current-now + charge-full + charge-now) + + (with-temp-buffer + (ignore-errors + (insert-file-contents "/sys/class/power_supply/yeeloong-bat/uevent") + (goto-char 1) + (search-forward "POWER_SUPPLY_CHARGE_NOW=") + (setq charge-now (read (current-buffer))) + (goto-char 1) + (search-forward "POWER_SUPPLY_CHARGE_FULL=") + (setq charge-full (read (current-buffer))) + (goto-char 1) + (search-forward "POWER_SUPPLY_CURRENT_NOW=") + (setq current-now (read (current-buffer))) + (goto-char 1) + (search-forward "POWER_SUPPLY_CAPACITY_LEVEL=") + (setq capacity-level (buffer-substring (point) (line-end-position))) + (goto-char 1) + (search-forward "POWER_SUPPLY_STATUS=") + (setq status (buffer-substring (point) (line-end-position)))) + + (erase-buffer) + (ignore-errors + (insert-file-contents + "/sys/class/power_supply/yeeloong-ac/online") + (goto-char 1) + (setq ac-online (read (current-buffer))) + (erase-buffer))) + + + (setq capacity (round (/ (* charge-now 100.0) charge-full))) + (when (and current-now (not (= current-now 0))) + (if (< current-now 0) + ;; Charging + (setq hours (/ (- charge-now charge-full) (+ 0.0 current-now))) + ;; Discharging + (setq hours (/ charge-now (+ 0.0 current-now))))) + + (list (cons ?c (if charge-now + (number-to-string charge-now) + "N/A")) + (cons ?r current-now) + (cons ?B (cond ((equal capacity-level "Full") "full") + ((equal status "Charging") "charging") + ((equal capacity-level "Low") "low") + ((equal capacity-level "Critical") "critical") + (t "high"))) + (cons ?b (cond ((equal capacity-level "Full") " ") + ((equal status "Charging") "+") + ((equal capacity-level "Low") "-") + ((equal capacity-level "Critical") "!") + (t " "))) + (cons ?h (if hours (number-to-string hours) "N/A")) + (cons ?m (if hours (number-to-string (* 60 hours)) "N/A")) + (cons ?t (if hours + (format "%d:%d" + (/ (round (* 60 hours)) 60) + (% (round (* 60 hours)) 60)) + "N/A")) + (cons ?p (if capacity (number-to-string capacity) "N/A")) + (cons ?L (if (eq ac-online 1) "AC" "BAT"))))) ;;; `pmset' interface for Darwin (OS X). ------------------------------------------------------------ revno: 106760 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-01-02 17:27:32 +0800 message: Move shell-dir-cookie-re feature into Dirtrack mode. * lisp/dirtrack.el (dirtrack-list): Eliminate unused third element. (dirtrack): Merge code for handling relative filenames in prompt from shell-dir-cookie-watcher. (dirtrack-debug-message): New arg to avoid excess format calls. * lisp/shell.el (shell-dir-cookie-re): Variable deleted. (shell-dir-cookie-watcher): Function deleted. (shell-mode): Don't use shell-dir-cookie-re, since it is redundant with dirtrack-mode. diff: === modified file 'etc/NEWS' --- etc/NEWS 2011-12-30 10:19:42 +0000 +++ etc/NEWS 2012-01-02 09:27:32 +0000 @@ -749,10 +749,6 @@ directory is a remote file name and neither the environment variable $ESHELL nor the variable `explicit-shell-file-name' is set. -*** New variable `shell-dir-cookie-re'. -If set to an appropriate regexp, Shell mode can track your cwd by -reading it from your prompt. - --- ** SQL Mode enhancements. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-01-01 16:26:51 +0000 +++ lisp/ChangeLog 2012-01-02 09:27:32 +0000 @@ -1,3 +1,15 @@ +2012-01-02 Chong Yidong + + * dirtrack.el (dirtrack-list): Eliminate unused third element. + (dirtrack): Merge code for handling relative filenames in prompt + from shell-dir-cookie-watcher. + (dirtrack-debug-message): New arg to avoid excess format calls. + + * shell.el (shell-dir-cookie-re): Variable deleted. + (shell-dir-cookie-watcher): Function deleted. + (shell-mode): Don't use shell-dir-cookie-re, since it is redundant + with dirtrack-mode. + 2012-01-01 Eli Zaretskii * term/w32-win.el (dynamic-library-alist) : Load === modified file 'lisp/dirtrack.el' --- lisp/dirtrack.el 2011-10-19 12:54:24 +0000 +++ lisp/dirtrack.el 2012-01-02 09:27:32 +0000 @@ -122,13 +122,11 @@ (defcustom dirtrack-list (list "^emacs \\([a-zA-Z]:.*\\)>" 1) "List for directory tracking. First item is a regexp that describes where to find the path in a prompt. -Second is a number, the regexp group to match. Optional third item is -whether the prompt is multi-line. If nil or omitted, prompt is assumed to -be on a single line." +Second is a number, the regexp group to match." :group 'dirtrack :type '(sexp (regexp :tag "Prompt Expression") - (integer :tag "Regexp Group") - (boolean :tag "Multiline Prompt"))) + (integer :tag "Regexp Group")) + :version "24.1") (make-variable-buffer-local 'dirtrack-list) @@ -188,11 +186,13 @@ positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. -This method requires that your shell prompt contain the full -current working directory at all times, and that `dirtrack-list' -is set to match the prompt. This is an alternative to -`shell-dirtrack-mode', which works differently, by tracking `cd' -and similar commands which change the shell working directory." +This method requires that your shell prompt contain the current +working directory at all times, and that you set the variable +`dirtrack-list' to match the prompt. + +This is an alternative to `shell-dirtrack-mode', which works by +tracking `cd' and similar commands which change the shell working +directory." nil nil nil (if dirtrack-mode (add-hook 'comint-preoutput-filter-functions 'dirtrack nil t) @@ -213,63 +213,67 @@ (define-obsolete-variable-alias 'dirtrack-debug 'dirtrack-debug-mode "23.1") -(defun dirtrack-debug-message (string) - "Insert string at the end of `dirtrack-debug-buffer'." +(defun dirtrack-debug-message (msg1 msg2) + "Insert strings at the end of `dirtrack-debug-buffer'." (when dirtrack-debug-mode (with-current-buffer (get-buffer-create dirtrack-debug-buffer) (goto-char (point-max)) - (insert (concat string "\n"))))) + (insert msg1 msg2 "\n")))) ;;;###autoload (defun dirtrack (input) - "Determine the current directory by scanning the process output for a prompt. -The prompt to look for is the first item in `dirtrack-list'. - -You can toggle directory tracking by using the function `dirtrack-mode'. - -If directory tracking does not seem to be working, you can use the -function `dirtrack-debug-mode' to turn on debugging output." - (unless (or (null dirtrack-mode) - (eq (point) (point-min))) ; no output? - (let (prompt-path orig-prompt-path - (current-dir default-directory) - (dirtrack-regexp (nth 0 dirtrack-list)) - (match-num (nth 1 dirtrack-list))) - ;; Currently unimplemented, it seems. --Stef - ;; (multi-line (nth 2 dirtrack-list))) - (save-excursion - ;; No match - (if (not (string-match dirtrack-regexp input)) - (dirtrack-debug-message - (format "Input `%s' failed to match `dirtrack-list'" input)) - (setq prompt-path (match-string match-num input)) - ;; Empty string - (if (not (> (length prompt-path) 0)) - (dirtrack-debug-message "Match is empty string") - ;; Transform prompts into canonical forms - (setq orig-prompt-path (funcall dirtrack-directory-function - prompt-path) - prompt-path (shell-prefixed-directory-name orig-prompt-path) - current-dir (funcall dirtrack-canonicalize-function - current-dir)) - (dirtrack-debug-message - (format "Prompt is %s\nCurrent directory is %s" - prompt-path current-dir)) - ;; Compare them - (if (or (string= current-dir prompt-path) - (string= current-dir (abbreviate-file-name prompt-path))) - (dirtrack-debug-message (format "Not changing directory")) - ;; It's possible that Emacs will think the directory - ;; won't exist (eg, rlogin buffers) - (if (file-accessible-directory-p prompt-path) - ;; Change directory. shell-process-cd adds the prefix, so we - ;; need to give it the original (un-prefixed) path. - (and (shell-process-cd orig-prompt-path) - (run-hooks 'dirtrack-directory-change-hook) - (dirtrack-debug-message - (format "Changing directory to %s" prompt-path))) - (warn "Directory %s does not exist" prompt-path))) - ))))) + "Determine the current directory from the process output for a prompt. +This filter function is used by `dirtrack-mode'. It looks for +the prompt specified by `dirtrack-list', and calls +`shell-process-cd' if the directory seems to have changed away +from `default-directory'." + (when (and dirtrack-mode + (not (eq (point) (point-min)))) ; there must be output + (save-excursion ; What's this for? -- cyd + (if (not (string-match (nth 0 dirtrack-list) input)) + ;; No match + (dirtrack-debug-message + "Input failed to match `dirtrack-list': " input) + (let ((prompt-path (match-string (nth 1 dirtrack-list) input)) + temp) + (cond + ;; Don't do anything for empty string + ((string-equal prompt-path "") + (dirtrack-debug-message "Prompt match gives empty string: " input)) + ;; If the prompt contains an absolute file name, call + ;; `shell-process-cd' if the directory has changed. + ((file-name-absolute-p prompt-path) + ;; Transform prompts into canonical forms + (let ((orig-prompt-path (funcall dirtrack-directory-function + prompt-path)) + (current-dir (funcall dirtrack-canonicalize-function + default-directory))) + (setq prompt-path (shell-prefixed-directory-name orig-prompt-path)) + ;; Compare them + (if (or (string-equal current-dir prompt-path) + (string-equal (expand-file-name current-dir) + (expand-file-name prompt-path))) + (dirtrack-debug-message "Not changing directory: " current-dir) + ;; It's possible that Emacs thinks the directory + ;; doesn't exist (e.g. rlogin buffers) + (if (file-accessible-directory-p prompt-path) + ;; `shell-process-cd' adds the prefix, so we need + ;; to give it the original (un-prefixed) path. + (progn + (shell-process-cd orig-prompt-path) + (run-hooks 'dirtrack-directory-change-hook) + (dirtrack-debug-message "Changing directory to " + prompt-path)) + (dirtrack-debug-message "Not changing to non-existent directory: " + prompt-path))))) + ;; If the file name is non-absolute, try and see if it + ;; seems to be up or down from where we were. + ((string-match "\\`\\(.*\\)\\(?:/.*\\)?\n\\(.*/\\)\\1\\(?:/.*\\)?\\'" + (setq temp + (concat prompt-path "\n" default-directory))) + (shell-process-cd (concat (match-string 2 temp) + prompt-path)) + (run-hooks 'dirtrack-directory-change-hook))))))) input) (provide 'dirtrack) === modified file 'lisp/shell.el' --- lisp/shell.el 2011-12-12 05:32:49 +0000 +++ lisp/shell.el 2012-01-02 09:27:32 +0000 @@ -372,18 +372,6 @@ ;;; Basic Procedures -(defcustom shell-dir-cookie-re nil - "Regexp matching your prompt, including some part of the current directory. -If your prompt includes the current directory or the last few elements of it, -set this to a pattern that matches your prompt and whose subgroup 1 matches -the directory part of it. -This is used by `shell-dir-cookie-watcher' to try and use this info -to track your current directory. It can be used instead of or in addition -to `dirtrack-mode'." - :group 'shell - :type '(choice (const nil) regexp) - :version "24.1") - (defun shell-parse-pcomplete-arguments () "Parse whitespace separated arguments in the current region." (let ((begin (save-excursion (shell-backward-command 1) (point))) @@ -546,10 +534,6 @@ (when (string-equal shell "bash") (add-hook 'comint-preoutput-filter-functions 'shell-filter-ctrl-a-ctrl-b nil t))) - (when shell-dir-cookie-re - ;; Watch for magic cookies in the output to track the current dir. - (add-hook 'comint-output-filter-functions - 'shell-dir-cookie-watcher nil t)) (comint-read-input-ring t))) (defun shell-filter-ctrl-a-ctrl-b (string) @@ -710,20 +694,6 @@ ;; replace it with a process filter that watches for and strips out ;; these messages. -(defun shell-dir-cookie-watcher (text) - ;; This is fragile: the TEXT could be split into several chunks and we'd - ;; miss it. Oh well. It's a best effort anyway. I'd expect that it's - ;; rather unusual to have the prompt split into several packets, but - ;; I'm sure Murphy will prove me wrong. - (when (and shell-dir-cookie-re (string-match shell-dir-cookie-re text)) - (let ((dir (match-string 1 text))) - (cond - ((file-name-absolute-p dir) (shell-cd dir)) - ;; Let's try and see if it seems to be up or down from where we were. - ((string-match "\\`\\(.*\\)\\(?:/.*\\)?\n\\(.*/\\)\\1\\(?:/.*\\)?\\'" - (setq text (concat dir "\n" default-directory))) - (shell-cd (concat (match-string 2 text) dir))))))) - (defun shell-directory-tracker (str) "Tracks cd, pushd and popd commands issued to the shell. This function is called on each input passed to the shell. ------------------------------------------------------------ revno: 106759 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2012-01-01 18:26:51 +0200 message: Allow Emacs on w32 to build against and work with GnuTLS 3.x. src/gnutls.c (init_gnutls_functions): Load gnutls_check_version. Load gnutls_transport_set_lowat only if GnuTLS version is below 2.11.1. (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for GnuTLS versions below 2.11.1. lisp/term/w32-win.el (dynamic-library-alist) : Load libgnutls-28.dll, from GnuTLS version 3.x, in preference to libgnutls-26.dll. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-31 14:43:38 +0000 +++ lisp/ChangeLog 2012-01-01 16:26:51 +0000 @@ -1,3 +1,9 @@ +2012-01-01 Eli Zaretskii + + * term/w32-win.el (dynamic-library-alist) : Load + libgnutls-28.dll, from GnuTLS version 3.x, in preference to + libgnutls-26.dll. + 2011-12-31 Andreas Schwab * emacs-lisp/bytecomp.el (byte-compile-file): Fix indentation. === modified file 'lisp/term/w32-win.el' --- lisp/term/w32-win.el 2011-10-26 13:42:33 +0000 +++ lisp/term/w32-win.el 2012-01-01 16:26:51 +0000 @@ -210,7 +210,7 @@ '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") '(glib "libglib-2.0-0.dll") '(gobject "libgobject-2.0-0.dll") - '(gnutls "libgnutls-26.dll"))) + '(gnutls "libgnutls-28.dll" "libgnutls-26.dll"))) ;;; multi-tty support (defvar w32-initialized nil === modified file 'src/ChangeLog' --- src/ChangeLog 2011-12-31 08:36:43 +0000 +++ src/ChangeLog 2012-01-01 16:26:51 +0000 @@ -1,3 +1,11 @@ +2012-01-01 Eli Zaretskii + + * gnutls.c (init_gnutls_functions): Load gnutls_check_version. + Load gnutls_transport_set_lowat only if GnuTLS version is below + 2.11.1. + (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for + GnuTLS versions below 2.11.1. + 2011-12-31 Antoine Levitt * xdisp.c (syms_of_xdisp) : Add warning === modified file 'src/gnutls.c' --- src/gnutls.c 2011-10-27 08:07:28 +0000 +++ src/gnutls.c 2012-01-01 16:26:51 +0000 @@ -125,6 +125,7 @@ (gnutls_session_t, const void *, size_t)); DEF_GNUTLS_FN (const char *, gnutls_strerror, (int)); DEF_GNUTLS_FN (void, gnutls_transport_set_errno, (gnutls_session_t, int)); +DEF_GNUTLS_FN (const char *, gnutls_check_version, (const char *)); DEF_GNUTLS_FN (void, gnutls_transport_set_lowat, (gnutls_session_t, int)); DEF_GNUTLS_FN (void, gnutls_transport_set_ptr2, (gnutls_session_t, gnutls_transport_ptr_t, @@ -184,7 +185,11 @@ LOAD_GNUTLS_FN (library, gnutls_record_send); LOAD_GNUTLS_FN (library, gnutls_strerror); LOAD_GNUTLS_FN (library, gnutls_transport_set_errno); - LOAD_GNUTLS_FN (library, gnutls_transport_set_lowat); + LOAD_GNUTLS_FN (library, gnutls_check_version); + /* We don't need to call gnutls_transport_set_lowat in GnuTLS 2.11.1 + and later, and the function was removed entirely in 3.0.0. */ + if (!fn_gnutls_check_version ("2.11.1")) + LOAD_GNUTLS_FN (library, gnutls_transport_set_lowat); LOAD_GNUTLS_FN (library, gnutls_transport_set_ptr2); LOAD_GNUTLS_FN (library, gnutls_transport_set_pull_function); LOAD_GNUTLS_FN (library, gnutls_transport_set_push_function); @@ -282,7 +287,12 @@ (Note: this is probably not strictly necessary as the lowat value is only used when no custom pull/push functions are set.) */ - fn_gnutls_transport_set_lowat (state, 0); + /* According to GnuTLS NEWS file, lowat level has been set to + zero by default in version 2.11.1, and the function + gnutls_transport_set_lowat was removed from the library in + version 2.99.0. */ + if (!fn_gnutls_check_version ("2.11.1")) + fn_gnutls_transport_set_lowat (state, 0); #else /* This is how GnuTLS takes sockets: as file descriptors passed in. For an Emacs process socket, infd and outfd are the