[Top][All Lists]

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

Re: Best practices for sql-list-(table|all)?

From: Trevor Murphy
Subject: Re: Best practices for sql-list-(table|all)?
Date: Thu, 30 May 2013 22:42:24 -0400

One would think!  I tracked the issue to the `sql-redirect-one' function, which is responsible for re-populating the buffer.  Unfortunately I wasn't able to fix the problem for myself.

I tested including an (inhibit-read-only t) in the opening let form, but still no joy.  Seems the call to `comint-redirect-send-command-to-process' redirects output to the target buffer then calls `process-send-string' (shocking, I know) and that *latter* call gives the same error.

I don't know nearly enough about Emacs, but my current best guess is that `process-send-string' just won't respect `inhibit-read-only' because the former's a built-in C function.  Right now I'm trying to figure out how best to manage the read-only status on the buffer (I'm really new to the nuances of view-mode and toggling the read-only flag).

Any pointers?  Right now I'm just jamming a (read-only-mode -1) and (read-only-mode 1) at the top and bottom of `sql-redirect-one', but it feels too gross to share.  I'd love to find out that I can get away with a simple `inhibit-read-only' solution.

On Thu, May 30, 2013 at 9:35 AM, Stefan Monnier <address@hidden> wrote:
> schema and table elements as I learn the database layout).  If instead
> of quitting out of view-mode I just switch back to my sql-mode buffer,
> the second call to the sql-list-foo command gives a "Buffer is
> read-only" error.

Sounds like a bug.  Either it shouldn't use view-mode, or (more likely)
it should let-bind inhibit-read-only around the code that (re)populates
the buffer.


reply via email to

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