all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* blue underscores
@ 2007-12-19  9:09 Andreas Röhler
  2007-12-19 10:24 ` Peter Dyballa
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2007-12-19  9:09 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1455 bytes --]


Hi all,

bug happens not with Emacs -Q:

copying indented textes from KMail into Emacs, I it
inserts blue underscores, falsifying intendation.

See attached png.

For the moment I get rid of them with the following

(while (re-search-forward (char-to-string 2208) end t 1)
       	(replace-match ""))


Any ideas what the cause may be?

Thanks

Andreas Röhler

In GNU Emacs 23.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.10.6)
 of 2007-12-09 
Windowing system distributor `The X.Org Foundation', version 11.0.70199902
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Englisch

Minor modes in effect:
  auto-completion-mode: t
  csv-field-index-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  partial-completion-mode: t
  iswitchb-mode: t
  auto-image-file-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:




[-- Attachment #2: zweitausend.png --]
[-- Type: image/png, Size: 42121 bytes --]

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: blue underscores
  2007-12-19  9:09 blue underscores Andreas Röhler
@ 2007-12-19 10:24 ` Peter Dyballa
  2007-12-19 11:22   ` Andreas Röhler
  2007-12-19 11:54   ` Andreas Röhler
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Dyballa @ 2007-12-19 10:24 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs


Am 19.12.2007 um 10:09 schrieb Andreas Röhler:

> Any ideas what the cause may be?


NO-BREAK SPACE (U+00A0)

Position the cursor on such a character and type: C-u C-x =

Probably the environment from which you copy tries to preserve some  
of its beloved features ... (I get brown ones)

--
Greetings

   Pete

Either this man is dead or my watch has stopped.
				- Groucho Marx

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

* Re: blue underscores
  2007-12-19 10:24 ` Peter Dyballa
@ 2007-12-19 11:22   ` Andreas Röhler
  2007-12-19 11:53     ` Peter Dyballa
  2007-12-19 11:54   ` Andreas Röhler
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2007-12-19 11:22 UTC (permalink / raw)
  To: help-gnu-emacs

Am Mittwoch, 19. Dezember 2007 11:24 schrieb Peter Dyballa:
> Am 19.12.2007 um 10:09 schrieb Andreas Röhler:
> > Any ideas what the cause may be?
>
> NO-BREAK SPACE (U+00A0)
>
> Position the cursor on such a character and type: C-u C-x =
>
> Probably the environment from which you copy tries to preserve some
> of its beloved features ... (I get brown ones)
>
> --
> Greetings
>
>    Pete
>

Thanks, I see, according to 

hardcoded face: nobreak-space

Notwithstanding, wouldn't it be good, to have a
mode-hook which weeps them out?

Customized `delete-nobreak-spaces' as text-mode-hook
displays correctly after reload/revert.

(defun delete-nobreak-spaces ()
  "Delete nobreak space, char 2208, #o4240, #x8a0 from buffer or region. "
  (interactive "*")
  (let ((beg (cond ((region-active-p)
		    (region-beginning))
		   (t (point-min))))
	(end (cond ((region-active-p)
		    (region-end))
		   (t (point-max)))))
    (save-excursion
      (goto-char beg)
      (while (re-search-forward (char-to-string 2208) end t 1)
	(replace-match "")))))

(defun region-active-p ()
  "Provide mark-active transient-mark-mode
 (not (eq (region-beginning) (region-end))))"
  (if (featurep 'xemacs)
      'region-active-p
    (and mark-active transient-mark-mode
	 (not (eq (region-beginning) (region-end))))))

Any idea how to realise that on the fly?

Andreas Röhler

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

* Re: blue underscores
  2007-12-19 11:22   ` Andreas Röhler
@ 2007-12-19 11:53     ` Peter Dyballa
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2007-12-19 11:53 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs


Am 19.12.2007 um 12:22 schrieb Andreas Röhler:

> Any idea how to realise that on the fly?

Maybe it's better to understand what happens from marking a region  
for copying from in some application to pasting it into GNU Emacs.  
What is changing TABs to a series of NO-BREAK SPACE characters?  
KMail? KDE? Is the "buffer" on which KMail works accessible somewhere  
in the file system? How does it look like (encoding)? Or what happens  
when you watch the X clipboard and take a copy off it and paste it  
into another application, a terminal emulation (cat > some file) or  
paste this or another copy into some stand-alone text editor? How are  
the original TABs (I presume so) handled? Is KDE missing an option to  
preserve copied TABs?

GNU Emacs also offers some choices to manipulate what was copied  
elsewhere and also what was copied off it ... but the defaults don't  
seem to be so bad outside KDE!

--
Mit friedvollen Grüßen

   Pete

Irgendwer sollte den Kugelschreiber mit einem Kleiderbügel kreuzen,  
dass die Kulis sich vermehren, statt stets nur zu verschwinden!

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

* Re: blue underscores
  2007-12-19 10:24 ` Peter Dyballa
  2007-12-19 11:22   ` Andreas Röhler
@ 2007-12-19 11:54   ` Andreas Röhler
  2007-12-19 11:57     ` Peter Dyballa
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2007-12-19 11:54 UTC (permalink / raw)
  To: help-gnu-emacs

Am Mittwoch, 19. Dezember 2007 11:24 schrieb Peter Dyballa:
> Am 19.12.2007 um 10:09 schrieb Andreas Röhler:
> > Any ideas what the cause may be?
>
> NO-BREAK SPACE (U+00A0)
>
> Position the cursor on such a character and type: C-u C-x =
>
> Probably the environment from which you copy tries to preserve some
> of its beloved features ... (I get brown ones)
>
> --
> Greetings
>
>    Pete
>

Meanwhile I see a much better way is to customize

Nobreak Space face

setting Underline value menue to OFF

Andreas Röhler

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

* Re: blue underscores
  2007-12-19 11:54   ` Andreas Röhler
@ 2007-12-19 11:57     ` Peter Dyballa
  2007-12-19 13:30       ` Andreas Röhler
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Dyballa @ 2007-12-19 11:57 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs


Am 19.12.2007 um 12:54 schrieb Andreas Röhler:

> Meanwhile I see a much better way is to customize
>
> Nobreak Space face
>
> setting Underline value menue to OFF


Isn't this just cheating? Is it handled by tabify the same way as  
real SPACE characters?

--
Mit friedvollen Grüßen

   Pete

Upgraded, adj.:
	Didn't work the first time.

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

* Re: blue underscores
  2007-12-19 11:57     ` Peter Dyballa
@ 2007-12-19 13:30       ` Andreas Röhler
  2007-12-19 13:59         ` Peter Dyballa
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2007-12-19 13:30 UTC (permalink / raw)
  To: help-gnu-emacs

Am Mittwoch, 19. Dezember 2007 12:57 schrieb Peter Dyballa:
> Am 19.12.2007 um 12:54 schrieb Andreas Röhler:
> > Meanwhile I see a much better way is to customize
> >
> > Nobreak Space face
> >
> > setting Underline value menue to OFF
>
> Isn't this just cheating? Is it handled by tabify the same way as
> real SPACE characters?
>
> --


It seems position and indentation are unchanged that
way, so it's looks OK for me. For example if I copy
your name from KMail like this,

   Pete

I get  

Char:   (2208, #o4240, #x8a0, file ...) point=23 of 316 (7%) column=0 line=3
Char: SPC (32, #o40, #x20) point=24 of 316 (7%) column=1 line=3
Char:   (2208, #o4240, #x8a0, file ...) point=25 of 31 (77%) column=2 line=3

for the chars before.

(Line No and point changed as it was checked before writing.)

Andreas Röhler

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

* Re: blue underscores
  2007-12-19 13:30       ` Andreas Röhler
@ 2007-12-19 13:59         ` Peter Dyballa
  2007-12-19 20:27           ` Andreas Röhler
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Dyballa @ 2007-12-19 13:59 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs


Am 19.12.2007 um 14:30 schrieb Andreas Röhler:

> It seems position and indentation are unchanged that
> way, so it's looks OK for me.


That's exactly the purpose of this "translation:" keeping the look.  
(Having some Losedos kiddies in mind?) As you see, there is no SPC  
but #x8a0. So in future you might have problems finding words when  
searching for SPC<some word> or when tabifying. Some shade of grey, a  
bit darker than the default background: wouldn't that be a good  
reminder why some things fail?

--
Mit friedvollen Grüßen

   Pete

Either this man is dead or my watch has stopped.
				- Groucho Marx

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

* Re: blue underscores
  2007-12-19 13:59         ` Peter Dyballa
@ 2007-12-19 20:27           ` Andreas Röhler
  0 siblings, 0 replies; 9+ messages in thread
From: Andreas Röhler @ 2007-12-19 20:27 UTC (permalink / raw)
  To: help-gnu-emacs

Am Mittwoch, 19. Dezember 2007 14:59 schrieb Peter Dyballa:
>    Pete

Finally you convinced me, thanks. I'll file a bug report.

Andreas Röhler

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

end of thread, other threads:[~2007-12-19 20:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-19  9:09 blue underscores Andreas Röhler
2007-12-19 10:24 ` Peter Dyballa
2007-12-19 11:22   ` Andreas Röhler
2007-12-19 11:53     ` Peter Dyballa
2007-12-19 11:54   ` Andreas Röhler
2007-12-19 11:57     ` Peter Dyballa
2007-12-19 13:30       ` Andreas Röhler
2007-12-19 13:59         ` Peter Dyballa
2007-12-19 20:27           ` Andreas Röhler

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.