From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Guillermo R. Palavecino" Newsgroups: gmane.emacs.devel Subject: Keeping hidden characters visible to the cursor Date: Sun, 15 Nov 2009 20:34:00 -0200 Message-ID: <58e36f420911151434t774614cma327eb36beb8396d@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=000e0cd1f8524c97d70478707d39 X-Trace: ger.gmane.org 1258324462 23802 80.91.229.12 (15 Nov 2009 22:34:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Nov 2009 22:34:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 15 23:34:15 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N9nfg-0003YK-O6 for ged-emacs-devel@m.gmane.org; Sun, 15 Nov 2009 23:34:13 +0100 Original-Received: from localhost ([127.0.0.1]:47766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9nff-0002iM-QI for ged-emacs-devel@m.gmane.org; Sun, 15 Nov 2009 17:34:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N9nfZ-0002hs-2x for emacs-devel@gnu.org; Sun, 15 Nov 2009 17:34:05 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N9nfX-0002hE-4i for emacs-devel@gnu.org; Sun, 15 Nov 2009 17:34:04 -0500 Original-Received: from [199.232.76.173] (port=42718 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N9nfX-0002hB-2l for emacs-devel@gnu.org; Sun, 15 Nov 2009 17:34:03 -0500 Original-Received: from ey-out-1920.google.com ([74.125.78.145]:47681) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N9nfW-0007LO-Gz for emacs-devel@gnu.org; Sun, 15 Nov 2009 17:34:02 -0500 Original-Received: by ey-out-1920.google.com with SMTP id 3so1606662eyh.34 for ; Sun, 15 Nov 2009 14:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=I8+ZuRnVtZEmklmbuZMypPD0WWZo7fqU2X4+sUWWPcw=; b=Z+9NfpwECh4Tda2y373rwJ/I7dROeKYns31OGDPEAKK2HXS+5Nxo+mfoc2GrK/CQHA 6qJRLPy5MPmC1jItdYxHQcMNdi5NLq0Czp3KPZPqj+VH3c9WuE+KdRQLQzab8WkYdIaC 5zjy13f6jbeEIy9cOkzeXCbKLNQQ+fXNl5y8Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=JDydYITLAxoDDijP3Be/X4FXiG3hcGLU1ds3VMwz6ZJFElsG87KHWSoequWjPylg97 E8bB3ZyHYtXY93db9Xw/9uvQqbOZjaaSR7kLsjBjUX6okuaQfDNQYwKlHdw9fsssVJqH ODSJyc/FZAM2OK0Li6CEoZZimnkQa0AWj2Q4o= Original-Received: by 10.213.0.132 with SMTP id 4mr1426296ebb.8.1258324440684; Sun, 15 Nov 2009 14:34:00 -0800 (PST) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:117017 Archived-At: --000e0cd1f8524c97d70478707d39 Content-Type: text/plain; charset=ISO-8859-1 Hel\(lo\|p\)! I've been struggling to implement the following behaviour in emacs for the past 6 days and I've reached the point where neither asking in #emacs nor further manual reading is helping, so I've decided to reach you. Sorry for the html, but this was the best way I thought of to show exactly what I mean. What I'm trying to accomplish is to hide the doublequotes (") delimiting strings so they use _no visual space_ but keep the cursor aware of them. To clarify this I'll show a step by step usage example '|' = cursor '#' = comment start '$' = input start ###### begin ###### $ "stuff" C-M-b C-b | *stuff* # (this is how it's supposed to look like) $ C-f |*stuff* # (here the cursor is right before the hidden '"') $ blah blah blah # (we type some text) blah blah blah |*stuff* # (text goes before the hidden '"') $ C-f blah blah blah *|stuff* # (now cursor is right after the ", inside the string) $ some more text blah blah blah *some more text |stuff* $ "autoquoting?" blah blah blah *some more text "autoquoting?"| stuff* # ^ this should be kept internally as: blah blah blah "some more text \"autoquoting?\" stuff" # search (in general) should of course be able to match the hidden doublequotes and quoted-doublequotes $ M-f blah blah blah *some more text "autoquoting?" stuff| *$ more text blah blah blah *some more text "autoquoting?" stuff more text|* $ C-f etc blah blah blah *some more text "autoquoting?" stuff more text* etc # after saving the file, ^ that line should look like this (in the raw file): # blah blah blah "some more text \"autoquoting?\" stuff more text" etc # Sorry for being redundant, but I had to make sure the example was clear enough to avoid misunderstandings. **####### end ####### The idea is just to mod the way strings are shown, but keep them unaltered in the file representation. I've tried using overlays and text properties for this matter; could hide them successfully and changed font-lock-string-face to get the underlining BUT there's one thing I could not achieve yet: To keep the cursor aware of these hidden characters. Whenever I moved the cursor it skipped the position as if nothing existed in that position, and entering some text right before the string went inside the string. Since I'm not trying to make an overlay where a big bunch of text is shown as some short string or ellipsis, using the intangible property does not help at all. Also tried groups, didn't work. Tried setting space properties and pixel properties (thought setting width to 0 would do the trick) but again didn't work (maybe it doesn't work with fixed fonts). I know it MUST be possible, but during the last 6 days emacs has been a great source of frustration to me. I hope we can find a way to do this. Thanks in advance. - GRP --000e0cd1f8524c97d70478707d39 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hel\(lo\|p\)!
I've been struggling to implement the fo= llowing behaviour in emacs for the past 6 days and I've reached the poi= nt where neither asking in #emacs nor further manual reading is helping, so= I've decided to reach you.
Sorry for the html, but this was the best way I thought of to show exactly = what I mean.

What I'm trying to accomplish is to hide the double= quotes (") delimiting strings so they use _no visual space_ but keep t= he cursor aware of them. To clarify this I'll show a step by step usage= example

'|' =3D cursor
'#' =3D comment start
'$' = =3D input start
###### begin ######
$=A0 "stuff" C-M-b C-b<= br>| stuff=A0 # (this is how it's supposed to look like)

= $ C-f

=A0|stuff=A0=A0 # (here the cursor is right before the hidden &#= 39;"')

$ blah blah blah=A0 # (we type some text)

bla= h blah blah |stuff =A0 # (text goes before the hidden '"= 9;)

$ C-f

blah blah blah |stuff=A0=A0 # (now cursor is right = after the ", inside the string)

$ some more text

blah b= lah blah some more text |stuff

$ "autoquoting?"
blah blah blah some more text "autoquoting?"| stuff# ^ this should be kept internally as: blah blah blah "some more text= \"autoquoting?\" stuff"
# search (in general) should of = course be able to match the hidden doublequotes and quoted-doublequotes
$ M-f
blah blah blah some more text "autoquoting?" stuff|$=A0 more text
blah blah blah some more text "autoquoting?= " stuff more text|
$ C-f etc
blah blah blah some more tex= t "autoquoting?" stuff more text etc
# after saving the file, ^ that line should look like this (in the raw file= ):
# blah blah blah "some more text \"autoquoting?\" stuf= f more text" etc

# Sorry for being redundant, but I had to make= sure the example was clear enough to avoid misunderstandings.
####### end #######

The idea is just to mod the way strings a= re shown, but keep them unaltered in the file representation. I've trie= d using overlays and text properties for this matter; could hide them succe= ssfully and changed font-lock-string-face to get the underlining BUT there&= #39;s one thing I could not achieve yet: To keep the cursor aware of these = hidden characters. Whenever I moved the cursor it skipped the position as i= f nothing existed in that position, and entering some text right before the= string went inside the string. Since I'm not trying to make an overlay= where a big bunch of text is shown as some short string or ellipsis, using= the intangible property does not help at all. Also tried groups, didn'= t work. Tried setting space properties and pixel properties (thought settin= g width to 0 would do the trick) but again didn't work (maybe it doesn&= #39;t work with fixed fonts).

I know it MUST be possible, but during the last 6 days emacs has been a= great source of frustration to me.
I hope we can find a way to do this.=

Thanks in advance.

- GRP
--000e0cd1f8524c97d70478707d39--