bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18240: sql-postgres does not prompt for password


From: Matthew Smiglarski
Subject: bug#18240: sql-postgres does not prompt for password
Date: Mon, 22 Sep 2014 09:10:11 +0100

This bug does not happen on the 24.3 release but does happen on 24.3.93.

The problem is with sql-interactive-remove-continuation-prompt, one of
the functions configured to be called by comint-output-filter.

It is caused by code introduced by this git revision.

commit 34499a8eb3c10db8c79a7aa87e1bbce0ae499fb6
Author: Michael Mauger <address@hidden>
Date:   Tue Jul 23 20:25:53 2013 -0400

One workaround is to type the password in anyway. Another workaround
is to remove some of the code with the following patch:

diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 13d4178..2fd755d 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -3337,18 +3337,7 @@ to avoid deleting non-prompt output."
         (unless prompt-found
           (setq sql-output-newline-count nil
                 oline (concat oline sql-preoutput-hold)
-                sql-preoutput-hold ""))
-
-        ;; Break up output by physical lines if we haven't hit the final prompt
-        (unless (and (not (string= oline ""))
-                     (string-match (sql-ends-with-prompt-re) oline)
-                     (>= (match-end 0) (length oline)))
-          (setq last-nl 0)
-          (while (string-match "\n" oline last-nl)
-            (setq last-nl (match-end 0)))
-          (setq sql-preoutput-hold (concat (substring oline last-nl)
-                                           sql-preoutput-hold)
-                oline (substring oline 0 last-nl))))))
+                sql-preoutput-hold "")))))
    oline)

This sql-interactive-remove-continuation-prompt function removes
continuation prompt (the prompt sent when halfway through a command)
and this improves the usability of multi-line SQL statements on the
interpreter.

There is another small bug with that code where the continuation line
sneaks through, throwing the alignment out.

By this, I mean the "template1->" prompt in the following examples:

template1=> select 42;
 ?column?
----------
       42
(1 row)

template1=> select
42;
template1->  ?column?
----------
       42
(1 row)

template1=> select
42,
43;
template1->  ?column? | ?column?
----------+----------
       42 |       43
(1 row)

That happens because of the following lines:

        ;; Add this text to what's left from the last pass
        (setq oline (concat sql-preoutput-hold oline)
              sql-preoutput-hold "")

I hope this helps.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]