all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xah Lee <xah@xahlee.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Help with keybinding to delete between {}
Date: Thu, 13 Dec 2007 02:39:13 -0800 (PST)	[thread overview]
Message-ID: <8f720f53-129e-4d17-b6c3-96ebbaea4724@i29g2000prf.googlegroups.com> (raw)
In-Reply-To: mailman.4961.1197518641.18990.help-gnu-emacs@gnu.org

Google Groups diddles with my unicode chars.

The unadulterated code can be found here:
http://xahlee.org/emacs/elisp_examples.html

--------------

am not sure what's the prob with google. Don't know if they are still
experimenting with unicode chars in posts or what. I often use U+00AB
and U+00BB (french double angle quotes, here: <<>>). But starting about
2007-09, google groups either deletes them, or replace them with <<
and >>, or botched the replacement lopsided. (and this transformation
apparantly took place before it is posted, so it's distributed to all
other places, not just a displaying issue on goople groups) This week
i also noticed that they replace my bullet char "*" by a asterisk "*".

i'll be using one of the chinese quotations "「」『』〈〉《》" for posting i
think. For the bullet i might use a start "★" or heart "♥".

  Xah
  xah@xahlee.org
∑ http://xahlee.org/

On Dec 12, 7:59 pm, Mike Mattie <codermat...@gmail.com> wrote:
> On Thu, 6 Dec 2007 09:14:12 -0800 (PST)
>
>
>
> Xah Lee <x...@xahlee.org> wrote:
> > for some reason my code in the previous post is completely non-
> > functional. (i swear i used it for few months. Perhaps when i put on
> > the website i got smart and edited it "for the better" without
> > testing)
>
> > Here's the correct version:
>
> > (defun delete-enclosed-text ()
> >   "Delete texts between any pair of delimiters.
> > Note: if you have nested matching pairs, the cursor
> > should be inside the inner most one. Else it gets confused.
> > This code should to be fixed in the future."
> >   (interactive)
> >   (save-excursion
> >     (let (p1 p2)
> >       (skip-chars-backward "^(<["<<") (setq p1 (point))
> >       (skip-chars-forward "^)>]">>") (setq p2 (point))
> >       (delete-region p1 p2)
> >     )
> >   )
> > )
>
> I don't this this can be right. on a single line it has three string quotation characters.
>
> (defun delete-enclosed-text ()
>    "Delete texts between any pair of delimiters.
>  Note: if you have nested matching pairs, the cursor
>  should be inside the inner most one. Else it gets confused.
>  This code should to be fixed in the future."
>    (interactive)
>   (skip-chars-forward "^)>>")
>   (delete-backward-char (skip-chars-backward "^(<<")))
>
> this version doesn't change the mark so I dropped the save-excursion. It is not quite right because
> it does not handle nested sexp at all. I don't understand the elisp flavor of regex yet, so it's
> probably an easy fix.

  parent reply	other threads:[~2007-12-13 10:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-05  1:33 Help with keybinding to delete between {} lampshade
2007-12-05 10:48 ` Bernardo Bacic
2007-12-05 12:55 ` William Xu
2007-12-05 13:30 ` Andreas Röhler
2007-12-05 23:50 ` Ilya Zakharevich
2007-12-06  6:33 ` Xah Lee
2007-12-06 17:14   ` Xah Lee
2007-12-12  9:20     ` lampshade
2007-12-13  3:59     ` Mike Mattie
     [not found]     ` <mailman.4961.1197518641.18990.help-gnu-emacs@gnu.org>
2007-12-13 10:39       ` Xah Lee [this message]
2007-12-13 10:44     ` Mike Mattie
2007-12-13 12:46       ` Mike Mattie
2007-12-13 13:01       ` Peter Dyballa
2007-12-14 11:43   ` Xah Lee
2007-12-07 16:30 ` Stefan Monnier

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=8f720f53-129e-4d17-b6c3-96ebbaea4724@i29g2000prf.googlegroups.com \
    --to=xah@xahlee.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.