From: Trevor Murphy <trevor.m.murphy@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Michael Mauger <michael@mauger.com>, emacs-devel@gnu.org
Subject: Re: Best practices for sql-list-(table|all)?
Date: Thu, 30 May 2013 22:42:24 -0400 [thread overview]
Message-ID: <CA+MaCJftOhZHfka9cD0VWd5FR=CJZAngMLviJPMzg2CC6-YsuQ@mail.gmail.com> (raw)
In-Reply-To: <jwv38t48ud2.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]
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 <monnier@iro.umontreal.ca>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.
>
>
> Stefan
>
[-- Attachment #2: Type: text/html, Size: 2106 bytes --]
next prev parent reply other threads:[~2013-05-31 2:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 3:41 Best practices for sql-list-(table|all)? Trevor Murphy
2013-05-30 13:35 ` Stefan Monnier
2013-05-31 2:42 ` Trevor Murphy [this message]
2013-05-31 3:50 ` Stefan Monnier
2013-07-03 3:34 ` Michael Mauger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+MaCJftOhZHfka9cD0VWd5FR=CJZAngMLviJPMzg2CC6-YsuQ@mail.gmail.com' \
--to=trevor.m.murphy@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=michael@mauger.com \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).