------------------------------------------------------------ revno: 116450 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Sat 2014-02-15 21:46:05 -0800 message: Make closing dbus buses actually work diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-02-13 20:54:07 +0000 +++ src/ChangeLog 2014-02-16 05:43:44 +0000 @@ -1,3 +1,11 @@ +2014-02-16 Daniel Colascione + + * dbusbind.c (xd_lisp_dbus_to_dbus): New function. + (xd_get_connection_address): Use it. + (xd_close_bus): Use xd_lisp_dbus_to_dbus to instead of + xd_get_connection_address because the latter signals if the bus + we're trying to close is already disconnected. + 2014-02-13 Eli Zaretskii * w32proc.c (start_timer_thread): Pass a non-NULL pointer as last === modified file 'src/dbusbind.c' --- src/dbusbind.c 2014-01-01 07:43:34 +0000 +++ src/dbusbind.c 2014-02-16 05:43:44 +0000 @@ -973,6 +973,13 @@ return *refcount; } +/* Convert a Lisp dbus object to a pointer */ +static DBusConnection* +xd_lisp_dbus_to_dbus (Lisp_Object bus) +{ + return (DBusConnection *) (intptr_t) XFASTINT (bus); +} + /* Return D-Bus connection address. BUS is either a Lisp symbol, :system or :session, or a string denoting the bus address. */ static DBusConnection * @@ -985,7 +992,7 @@ if (NILP (val)) XD_SIGNAL2 (build_string ("No connection to bus"), bus); else - connection = (DBusConnection *) (intptr_t) XFASTINT (val); + connection = xd_lisp_dbus_to_dbus (val); if (!dbus_connection_get_is_connected (connection)) XD_SIGNAL2 (build_string ("No connection to bus"), bus); @@ -1080,14 +1087,21 @@ { DBusConnection *connection; Lisp_Object val; + Lisp_Object busobj; /* Check whether we are connected. */ val = Fassoc (bus, xd_registered_buses); if (NILP (val)) return; + busobj = CDR_SAFE(val); + if (NILP (val)) { + xd_registered_buses = Fdelete (val, xd_registered_buses); + return; + } + /* Retrieve bus address. */ - connection = xd_get_connection_address (bus); + connection = xd_lisp_dbus_to_dbus (busobj); if (xd_get_connection_references (connection) == 1) { ------------------------------------------------------------ revno: 116449 fixes bug: http://debbugs.gnu.org/16747 committer: Dmitry Gutov branch nick: trunk timestamp: Sun 2014-02-16 06:15:47 +0200 message: * lisp/ido.el (ido-file-internal): Don't add the name of an existing directory twice. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-16 03:09:27 +0000 +++ lisp/ChangeLog 2014-02-16 04:15:47 +0000 @@ -1,3 +1,8 @@ +2014-02-16 Dmitry Gutov + + * ido.el (ido-file-internal): Don't add the name of an existing + directory twice. (Bug#16747) + 2014-02-16 Glenn Morris * vc/ediff-init.el (ediff-use-faces, ediff-highlight-all-diffs): === modified file 'lisp/ido.el' --- lisp/ido.el 2014-01-31 06:34:44 +0000 +++ lisp/ido.el 2014-02-16 04:15:47 +0000 @@ -2375,14 +2375,14 @@ (if (eq ido-use-filename-at-point 'guess) (ffap-guesser) (ffap-string-at-point)))) - (not (string-match "^http:/" fn)) - (let ((absolute-fn (expand-file-name fn))) - (setq d (if (file-directory-p absolute-fn) - (file-name-as-directory absolute-fn) - (file-name-directory absolute-fn)))) - (file-directory-p d)) - (setq ido-current-directory d) - (setq initial (file-name-nondirectory fn)))))) + (not (string-match "^http:/" fn))) + (let ((absolute-fn (expand-file-name fn))) + (cond + ((file-directory-p absolute-fn) + (setq ido-current-directory (file-name-as-directory absolute-fn))) + ((file-directory-p (file-name-directory absolute-fn)) + (setq ido-current-directory (file-name-directory absolute-fn)) + (setq initial (file-name-nondirectory absolute-fn))))))))) (let (ido-saved-vc-hb (vc-handled-backends (and (boundp 'vc-handled-backends) vc-handled-backends)) ------------------------------------------------------------ revno: 116448 fixes bug: http://debbugs.gnu.org/16744 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-02-15 19:09:27 -0800 message: * lisp/vc/ediff-init.el (ediff-use-faces, ediff-highlight-all-diffs): Do not use ediff-defvar-local on pre-defined variables. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-15 22:50:45 +0000 +++ lisp/ChangeLog 2014-02-16 03:09:27 +0000 @@ -1,4 +1,9 @@ -2014-02-14 Michael R. Mauger +2014-02-16 Glenn Morris + + * vc/ediff-init.el (ediff-use-faces, ediff-highlight-all-diffs): + Do not use ediff-defvar-local on pre-defined variables. (Bug#16744) + +2014-02-15 Michael R. Mauger * progmodes/sql.el: Version 3.4 (sql-oracle-options): New default value ("-L"). === modified file 'lisp/vc/ediff-init.el' --- lisp/vc/ediff-init.el 2014-01-01 07:43:34 +0000 +++ lisp/vc/ediff-init.el 2014-02-16 03:09:27 +0000 @@ -567,7 +567,8 @@ highlighted using ASCII flags." :type 'boolean :group 'ediff-highlighting) -(ediff-defvar-local ediff-use-faces t "") +(make-variable-buffer-local 'ediff-use-faces) +(put 'ediff-use-faces 'permanent-local t) ;; this indicates that diff regions are word-size, so fine diffs are ;; permanently nixed; used in ediff-windows-wordwise and ediff-regions-wordwise @@ -610,7 +611,8 @@ shown in brighter colors." :type 'boolean :group 'ediff-highlighting) -(ediff-defvar-local ediff-highlight-all-diffs t "") +(make-variable-buffer-local 'ediff-highlight-all-diffs) +(put 'ediff-highlight-all-diffs 'permanent-local t) ;; The suffix of the control buffer name. ------------------------------------------------------------ revno: 116447 committer: Michael Mauger branch nick: trunk timestamp: Sat 2014-02-15 17:50:45 -0500 message: * progmodes/sql.el: Version 3.4 (sql-oracle-options): New default value ("-L"). (sql-mode-oracle-font-lock-keywords): Added placeholder highlighting. (sql-placeholders-filter): Correct placeholder pattern. (sql-read-table-name): Bug fix. Detect absence of SQLi process. (sql-login-delay): New variable. (sql-product-interactive): Use it. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-02-14 07:36:42 +0000 +++ etc/NEWS 2014-02-15 22:50:45 +0000 @@ -807,6 +807,19 @@ with an indented sample file. --- +** SQL +Improved login monitoring and appropriate response to login failures. +Includes `sql-login-delay' to define maximum wait for a connection. + +*** Oracle support +SQL*Plus script placeholders are properly highlighted and identified +in `sql-placeholders-filter' correctly. When SQL*Plus is started, +options specified in `sql-oracle-options' are passed before the logon +parameter, as SQL*Plus expects. The default setting for +`sql-oracle-options' has been altered to pass the `-L' option to limit +the number of logon attempts per invocation. + +--- ** New Term mode option `term-suppress-hard-newline'. +++ === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-15 04:16:46 +0000 +++ lisp/ChangeLog 2014-02-15 22:50:45 +0000 @@ -1,3 +1,14 @@ +2014-02-14 Michael R. Mauger + + * progmodes/sql.el: Version 3.4 + (sql-oracle-options): New default value ("-L"). + (sql-mode-oracle-font-lock-keywords): Added placeholder + highlighting. + (sql-placeholders-filter): Correct placeholder pattern. + (sql-read-table-name): Bug fix. Detect absence of SQLi process. + (sql-login-delay): New variable. + (sql-product-interactive): Use it. + 2014-02-15 Juanma Barranquero * frameset.el (frameset--jump-to-register): Check that buffer is live === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2014-01-03 05:37:58 +0000 +++ lisp/progmodes/sql.el 2014-02-15 22:50:45 +0000 @@ -4,7 +4,7 @@ ;; Author: Alex Schroeder ;; Maintainer: Michael Mauger -;; Version: 3.3 +;; Version: 3.4 ;; Keywords: comm languages processes ;; URL: http://savannah.gnu.org/projects/emacs/ @@ -724,6 +724,8 @@ Globally should be set to nil; it will be non-nil in `sql-mode', `sql-interactive-mode' and list all buffers.") +(defvar sql-login-delay 7.5 ;; Secs + "Maximum number of seconds you are willing to wait for a login connection.") (defcustom sql-pop-to-buffer-after-send-region nil "When non-nil, pop to the buffer SQL statements are sent to. @@ -849,10 +851,10 @@ :type 'file :group 'SQL) -(defcustom sql-oracle-options nil +(defcustom sql-oracle-options '("-L") "List of additional options for `sql-oracle-program'." :type '(repeat string) - :version "20.8" + :version "24.4" :group 'SQL) (defcustom sql-oracle-login-params '(user password database) @@ -1601,6 +1603,7 @@ "\\)\\(?:\\s-.*\\)?\\(?:[-]\n.*\\)*$") 0 'font-lock-doc-face t) + '("&?&\\(?:\\sw\\|\\s_\\)+[.]?" 0 font-lock-preprocessor-face t) ;; Oracle Functions (sql-font-lock-keywords-builder 'font-lock-builtin-face nil @@ -3208,7 +3211,7 @@ Placeholders are words starting with an ampersand like &this." (when sql-oracle-scan-on - (while (string-match "&\\(\\sw+\\)" string) + (while (string-match "&?&\\(\\(?:\\sw\\|\\s_\\)+\\)[.]?" string) (setq string (replace-match (read-from-minibuffer (format "Enter value for %s: " (match-string 1 string)) @@ -3681,13 +3684,16 @@ (buffer-substring-no-properties (match-beginning 0) (match-end 0)))) (sql-completion-sqlbuf (sql-find-sqli-buffer)) - (product (with-current-buffer sql-completion-sqlbuf sql-product)) + (product (when sql-completion-sqlbuf + (with-current-buffer sql-completion-sqlbuf sql-product))) (completion-ignore-case t)) - (if (sql-get-product-feature product :completion-object) - (completing-read prompt #'sql--completion-table - nil nil tname) - (read-from-minibuffer prompt tname)))) + (if product + (if (sql-get-product-feature product :completion-object) + (completing-read prompt #'sql--completion-table + nil nil tname) + (read-from-minibuffer prompt tname)) + (user-error "There is no active SQLi buffer")))) (defun sql-list-all (&optional enhanced) "List all database objects. @@ -4145,14 +4151,15 @@ ;; We have a new name or sql-buffer doesn't exist or match ;; Start by remembering where we start (let ((start-buffer (current-buffer)) - new-sqli-buffer) + new-sqli-buffer rpt) ;; Get credentials. (apply #'sql-get-login (sql-get-product-feature product :sqli-login)) ;; Connect to database. - (message "Login...") + (setq rpt (make-progress-reporter "Login")) + (let ((sql-user (default-value 'sql-user)) (sql-password (default-value 'sql-password)) (sql-server (default-value 'sql-server)) @@ -4182,15 +4189,25 @@ ;; Make sure the connection is complete ;; (Sometimes start up can be slow) ;; and call the login hook - (let ((proc (get-buffer-process new-sqli-buffer))) + (let ((proc (get-buffer-process new-sqli-buffer)) + (secs sql-login-delay) + (step 0.3)) (while (and (memq (process-status proc) '(open run)) - (accept-process-output proc 2.5) + (or (accept-process-output proc step) + (<= 0.0 (setq secs (- secs step)))) (progn (goto-char (point-max)) - (not (looking-back sql-prompt-regexp)))))) - (run-hooks 'sql-login-hook) + (not (re-search-backward sql-prompt-regexp 0 t)))) + (progress-reporter-update rpt))) + + (goto-char (point-max)) + (when (re-search-backward sql-prompt-regexp nil t) + (run-hooks 'sql-login-hook)) + ;; All done. - (message "Login...done") - (pop-to-buffer new-sqli-buffer))))) + (progress-reporter-done rpt) + (pop-to-buffer new-sqli-buffer) + (goto-char (point-max)) + (current-buffer))))) (user-error "No default SQL product defined. Set `sql-product'."))) (defun sql-comint (product params) @@ -4262,8 +4279,9 @@ (setq parameter sql-user))) (if (and parameter (not (string= "" sql-database))) (setq parameter (concat parameter "@" sql-database))) + ;; options must appear before the logon parameters (if parameter - (setq parameter (nconc (list parameter) options)) + (setq parameter (append options (list parameter))) (setq parameter options)) (sql-comint product parameter) ;; Set process coding system to agree with the interpreter ------------------------------------------------------------ revno: 116446 fixes bug: http://debbugs.gnu.org/16749 committer: Juanma Barranquero branch nick: trunk timestamp: Sat 2014-02-15 05:16:46 +0100 message: frameset.el (frameset--jump-to-register): Check that buffer is live (bug#16749). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-02-15 03:58:38 +0000 +++ lisp/ChangeLog 2014-02-15 04:16:46 +0000 @@ -1,3 +1,8 @@ +2014-02-15 Juanma Barranquero + + * frameset.el (frameset--jump-to-register): Check that buffer is live + (bug#16749). + 2014-02-15 Glenn Morris * info.el (info-initialize): Revert 2014-01-10 change. === modified file 'lisp/frameset.el' --- lisp/frameset.el 2014-02-11 20:48:23 +0000 +++ lisp/frameset.el 2014-02-15 04:16:46 +0000 @@ -1213,15 +1213,14 @@ :filters frameset-session-filter-alist :reuse-frames (if delete t :keep)) (mapc #'iconify-frame iconify-list) - (let ((frame (frameset-frame-with-id (aref data 1)))) + (let ((frame (frameset-frame-with-id (aref data 1))) + buffer window) (when frame (select-frame-set-input-focus frame) - (let* ((position (aref data 2)) - (buffer (marker-buffer position)) - (window (get-buffer-window buffer frame))) - (when (and window (window-live-p window)) - (set-frame-selected-window frame window) - (with-current-buffer buffer (goto-char position)))))))) + (when (and (buffer-live-p (setq buffer (marker-buffer (aref data 2)))) + (window-live-p (setq window (get-buffer-window buffer frame)))) + (set-frame-selected-window frame window) + (with-current-buffer buffer (goto-char (aref data 2)))))))) ;;;###autoload (defun frameset-to-register (register) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.