From: Deniz Dogan <deniz.a.m.dogan@gmail.com>
To: Leo <sdl.web@gmail.com>
Cc: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: Signaling text-read-only
Date: Tue, 15 Feb 2011 11:38:03 +0100 [thread overview]
Message-ID: <AANLkTi=99V05_WRgzd2iwttgvmYEgGF-A0rCNQ=pUXjZ@mail.gmail.com> (raw)
In-Reply-To: <m14o85j3vc.fsf@gmail.com>
2011/2/15 Leo <sdl.web@gmail.com>:
> On 2011-02-15 11:35 +0800, Deniz Dogan wrote:
>> I have a situation here where I need to tell the user that the part of
>> the buffer where point is located is read-only. This is what I am
>> thinking right now:
>>
>> (unless (rcirc-looking-at-input)
>> (error (error-message-string (list 'text-read-only)))
>>
>> or:
>>
>> (unless (rcirc-looking-at-input)
>> (signal 'text-read-only nil)))
>>
>> I haven't found any examples of this explicit sort of signaling in the
>> other Lisp files in Emacs, but I might have missed something.
>>
>> The reason why I need this is that `rcirc-complete' shouldn't be
>> called in read-only areas of the buffer.
>>
>> What is the right way to do this?
>
> The question arose when Deniz and I discussed the patch here:
> http://paste.pocoo.org/raw/gUNWgGTy4zMSI0ApR3vZ/ in #emacs.
>
> As required by completion-at-point-functions, it makes sense for
> rcirc-completion-at-point to return nil when re-search-backward errs and
> therefore for rcirc-complete to handle the case when completion table is
> nil so I think the patch is applicable regardless of whether or not to
> signal an error.
>
> I think it is good idea to give some feedback to user but I think
> text-read-only is not the right one (the error is not caused by
> text-read-only). It should probably be something like:
>
> (unless (rcirc-looking-at-input)
> (error "Point not located after rcirc prompt"))
>
> to be added at the very beginning of rcirc-complete function body.
>
> What do you think?
>
I'm fine with your error suggestion as well. I just figured it would
make sense to signal text-read-only, since whatever the command
completed to wouldn't be inserted at point, as that part of the buffer
is read-only.
--
Deniz Dogan
next prev parent reply other threads:[~2011-02-15 10:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-15 3:35 Signaling text-read-only Deniz Dogan
2011-02-15 4:52 ` Leo
2011-02-15 10:38 ` Deniz Dogan [this message]
2011-03-22 11:56 ` Leo
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='AANLkTi=99V05_WRgzd2iwttgvmYEgGF-A0rCNQ=pUXjZ@mail.gmail.com' \
--to=deniz.a.m.dogan@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=sdl.web@gmail.com \
/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).