all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Mauger <michael@mauger.com>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Proposal: emacsclient --readonly
Date: Tue, 26 Mar 2013 09:10:31 -0400	[thread overview]
Message-ID: <jwvr4j2gw4t.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <1364266566.22342.YahooMailNeo@web160905.mail.bf1.yahoo.com> (Michael Mauger's message of "Mon, 25 Mar 2013 19:56:06 -0700 (PDT)")

> So with this structure, how would I implement the --readonly custom
> argument?

Good question.

> My guess is that the server-custom-option-function would scan the
> incoming list of options for the -nowait entry because that will
> determine our exit action.

Hmm... why do we care about -nowait?

> We will then look for the --readonly entry and record that we want to
> view files rather than edit them.  We will then remove the --readonly
> entry from the list to allow the remainder of the processing
> to continue.

Right, we check (equal "--readonly" (car args)) and if non-nil, we (pop
args) and somehow register the "put in read-only mode" somewhere.

> behavior.  Or we could essentially duplicate the server processing by
> consuming all of the arguments and replicating their actions with the
> wrinkles we wish to introduce which is obviously not a great solution.

Right, we don't want to go there.

> So it looks with the solution may be more flexible but requires global
> variables specific to the feature and two hook functions to implement
> it. My goal was for a solution the declares the options we want to add
> and somewhat automate the parsing and validation of the option value
> so that custom options behave as other command line arguments do.  It
> then provides a handler function that implements the feature either
> globally or on a per-buffer basis.  With this design, features could
> be added to emacsclient by loading a library and adding an entry to a
> list that defines the syntax and handling.

Obviously, my proposal is incomplete indeed because it does not address
the need to "register the `put in read-only mode' somewhere".

But I think your design is too narrowly constrained by the needs you see
now.  I think we should aim for a design that could at least accommodate
some of the features currently hard-coded such as --eval.

Ideally it should also accommodate something like "--diff FILE1 FILE2"
which would call `diff' on the two files and might even be made to
accept "--diff FILE1 FILE2 FILE3" to do a 3-way merge.


        Stefan



  reply	other threads:[~2013-03-26 13:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87zjxtq304.fsf@michael-laptop.hsd1.ma.comcast.net>
     [not found] ` <jwv38vlpnpl.fsf-monnier+emacs@gnu.org>
2013-03-24 16:22   ` Proposal: emacsclient --readonly Michael Mauger
2013-03-25 13:15     ` Stefan Monnier
2013-03-26  2:56       ` Michael Mauger
2013-03-26 13:10         ` Stefan Monnier [this message]
2013-03-27  2:02           ` Michael Mauger
2013-03-27  2:33             ` Stefan Monnier
2013-03-27 13:47               ` Michael Mauger
2013-03-30 23:03                 ` Michael Mauger
2013-09-27 18:22 Rüdiger Sonderfeld
  -- strict thread matches above, loose matches on Subject: below --
2013-03-14  2:23 michael
2013-03-14  2:45 ` W. Greenhouse
2013-03-14  3:31 ` Stefan Monnier
2013-03-24  3:45   ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvr4j2gw4t.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=michael@mauger.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.