unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Quote Selection Do What I Mean (DWIM)
@ 2009-10-23 11:51 Nordlöw
  2009-10-23 12:27 ` Benjamin Andresen
  2009-10-23 14:19 ` Pascal J. Bourguignon
  0 siblings, 2 replies; 5+ messages in thread
From: Nordlöw @ 2009-10-23 11:51 UTC (permalink / raw)
  To: help-gnu-emacs

If transient-mark-mode is activate it would be nice to have some
clever major-mode-sensitive auto-insertion of single quotes and
backquotes.

in emacs-lisp-mode we want the following mappings
- ' => `symbol' in comment-syntax
- ' => 'symbol in code-syntax (no change
- " => "string" everywhere

Does emacs have a suitable before/after/replace hook related to self-
insert-command that can be used to realize this behaviour?

Suitable function name could be quote-dwim().

Has anybody already done this? Reflections...

Thanks in advance,
Nordlöw


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Quote Selection Do What I Mean (DWIM)
  2009-10-23 11:51 Quote Selection Do What I Mean (DWIM) Nordlöw
@ 2009-10-23 12:27 ` Benjamin Andresen
  2009-10-23 14:19 ` Pascal J. Bourguignon
  1 sibling, 0 replies; 5+ messages in thread
From: Benjamin Andresen @ 2009-10-23 12:27 UTC (permalink / raw)
  To: help-gnu-emacs

Nordlöw <per.nordlow@gmail.com> writes:

> Has anybody already done this? Reflections...

Maybe this? http://github.com/rejeep/wrap-region

Or at least it might be a good starting place to get some major-mode
sensitive wrapping going on.

> Thanks in advance,
> Nordlöw

br,
benny


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Quote Selection Do What I Mean (DWIM)
  2009-10-23 11:51 Quote Selection Do What I Mean (DWIM) Nordlöw
  2009-10-23 12:27 ` Benjamin Andresen
@ 2009-10-23 14:19 ` Pascal J. Bourguignon
  2009-10-23 14:55   ` Nordlöw
  1 sibling, 1 reply; 5+ messages in thread
From: Pascal J. Bourguignon @ 2009-10-23 14:19 UTC (permalink / raw)
  To: help-gnu-emacs

Nordlöw <per.nordlow@gmail.com> writes:

> If transient-mark-mode is activate it would be nice to have some
> clever major-mode-sensitive auto-insertion of single quotes and
> backquotes.
>
> in emacs-lisp-mode we want the following mappings
> - ' => `symbol' in comment-syntax
> - ' => 'symbol in code-syntax (no change
> - " => "string" everywhere
>
> Does emacs have a suitable before/after/replace hook related to self-
> insert-command that can be used to realize this behaviour?
>
> Suitable function name could be quote-dwim().
>
> Has anybody already done this? Reflections...

In paredit, " behaves differently in code-syntax than in comment-syntax.
' behave the same everywhere.

You could easily propose a patch to paredit to add the wanted behavior for '.

-- 
__Pascal Bourguignon__


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Quote Selection Do What I Mean (DWIM)
  2009-10-23 14:19 ` Pascal J. Bourguignon
@ 2009-10-23 14:55   ` Nordlöw
  2009-10-23 16:38     ` Pascal J. Bourguignon
  0 siblings, 1 reply; 5+ messages in thread
From: Nordlöw @ 2009-10-23 14:55 UTC (permalink / raw)
  To: help-gnu-emacs

On Oct 23, 4:19 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> Nordlöw <per.nord...@gmail.com> writes:
> > If transient-mark-mode is activate it would be nice to have some
> > clever major-mode-sensitive auto-insertion of single quotes and
> > backquotes.
>
> > in emacs-lisp-mode we want the following mappings
> > - ' => `symbol' in comment-syntax
> > - ' => 'symbol in code-syntax (no change
> > - " => "string" everywhere
>
> > Does emacs have a suitable before/after/replace hook related to self-
> > insert-command that can be used to realize this behaviour?
>
> > Suitable function name could be quote-dwim().
>
> > Has anybody already done this? Reflections...
>
> In paredit, " behaves differently in code-syntax than in comment-syntax.
> ' behave the same everywhere.
>
> You could easily propose a patch to paredit to add the wanted behavior for '.
>
> --
> __Pascal Bourguignon__

I can't find the email related to the author paredit.el. Where should
I file the request for inclusion in paredit.el?

/Nordlöw


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Quote Selection Do What I Mean (DWIM)
  2009-10-23 14:55   ` Nordlöw
@ 2009-10-23 16:38     ` Pascal J. Bourguignon
  0 siblings, 0 replies; 5+ messages in thread
From: Pascal J. Bourguignon @ 2009-10-23 16:38 UTC (permalink / raw)
  To: help-gnu-emacs

Nordlöw <per.nordlow@gmail.com> writes:

> On Oct 23, 4:19 pm, p...@informatimago.com (Pascal J. Bourguignon)
> wrote:
>> Nordlöw <per.nord...@gmail.com> writes:
>> > If transient-mark-mode is activate it would be nice to have some
>> > clever major-mode-sensitive auto-insertion of single quotes and
>> > backquotes.
>>
>> > in emacs-lisp-mode we want the following mappings
>> > - ' => `symbol' in comment-syntax
>> > - ' => 'symbol in code-syntax (no change
>> > - " => "string" everywhere
>>
>> > Does emacs have a suitable before/after/replace hook related to self-
>> > insert-command that can be used to realize this behaviour?
>>
>> > Suitable function name could be quote-dwim().
>>
>> > Has anybody already done this? Reflections...
>>
>> In paredit, " behaves differently in code-syntax than in comment-syntax.
>> ' behave the same everywhere.
>>
>> You could easily propose a patch to paredit to add the wanted behavior for '.
>
> I can't find the email related to the author paredit.el. Where should
> I file the request for inclusion in paredit.el?

$ wget http://mumble.net/~campbell/riastradh.pgp
$ gpg ~/riastradh.pgp 
pub  1024D/BD2D02B0 2007-06-19 Taylor R Campbell <campbell@mumble.net>
uid                            Taylor R Campbell <riastradh@csail.mit.edu>
sub  4096g/C38F1908 2007-06-19


-- 
__Pascal Bourguignon__


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-23 16:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-23 11:51 Quote Selection Do What I Mean (DWIM) Nordlöw
2009-10-23 12:27 ` Benjamin Andresen
2009-10-23 14:19 ` Pascal J. Bourguignon
2009-10-23 14:55   ` Nordlöw
2009-10-23 16:38     ` Pascal J. Bourguignon

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).