all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* show tabs and white space
@ 2005-04-14 19:26 mgrd
  2005-04-14 21:34 ` rgb
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: mgrd @ 2005-04-14 19:26 UTC (permalink / raw)


For editing a Makefile I need to display/show the tabs and white spaces
within it.

Does anybody know how to obtain this?

-- 
reply to usenet only

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

* Re: show tabs and white space
  2005-04-14 19:26 show tabs and white space mgrd
@ 2005-04-14 21:34 ` rgb
  2005-04-14 22:05   ` mgrd
  2005-04-17 23:47 ` Miles Bader
       [not found] ` <mailman.1803.1113782366.2895.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 5+ messages in thread
From: rgb @ 2005-04-14 21:34 UTC (permalink / raw)


mgrd wrote:
> For editing a Makefile I need to display/show the tabs and white
spaces
> within it.
>
> Does anybody know how to obtain this?
>

If you want to be able to spot the difference between a tab
and a space character you could highlight tabs like this.

(defface tab-face '((t (:background "red")))
  "highlight tabs")
(font-lock-add-keywords 'tacl-mode '(("\t" 0 tab-face   prepend)))
;;                       ^^^ substitute your mode name here

;; spaces can be highlighted too if you really want.
(defface space-face '((t (:background "grey" )))
  "highlight whitespace")
(font-lock-add-keywords 'tacl-mode '((" "  0 space-face prepend)))
;;                       ^^^ substitute your mode name here

If you only want to see trailing whitespace I use this
(defun stw () "Toggles `show-trailing-whitespace' on/off"
  (interactive)
  (setq show-trailing-whitespace (not show-trailing-whitespace)))

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

* Re: show tabs and white space
  2005-04-14 21:34 ` rgb
@ 2005-04-14 22:05   ` mgrd
  0 siblings, 0 replies; 5+ messages in thread
From: mgrd @ 2005-04-14 22:05 UTC (permalink / raw)


rgb wrote:
> If you want to be able to spot the difference between a tab
> and a space character you could highlight tabs like this.
> 
> (defface tab-face '((t (:background "red")))
>   "highlight tabs")
> (font-lock-add-keywords 'tacl-mode '(("\t" 0 tab-face   prepend)))
> ;;                       ^^^ substitute your mode name here
> 
> ;; spaces can be highlighted too if you really want.
> (defface space-face '((t (:background "grey" )))
>   "highlight whitespace")
> (font-lock-add-keywords 'tacl-mode '((" "  0 space-face prepend)))
> ;;                       ^^^ substitute your mode name here
> 
> If you only want to see trailing whitespace I use this
> (defun stw () "Toggles `show-trailing-whitespace' on/off"
>   (interactive)
>   (setq show-trailing-whitespace (not show-trailing-whitespace)))

Actually I'm looking for a similar minibuffer cmd like the xemacs:
   M-x old-whitespace-mode RET
which highlights both white space and tabs.

Anyway, thanks a lot!

-- 
reply to usenet only

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

* Re: show tabs and white space
  2005-04-14 19:26 show tabs and white space mgrd
  2005-04-14 21:34 ` rgb
@ 2005-04-17 23:47 ` Miles Bader
       [not found] ` <mailman.1803.1113782366.2895.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Miles Bader @ 2005-04-17 23:47 UTC (permalink / raw)


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

Try the attached mode, `visible-whitespace-mode'.  It is intended for
the latest CVS Emacs, but may work ok for Emacs 21.

It's somewhat different from typical "highlight whitespace" packages in
that each whitespace character is indicated individually, even when
they're adjacent to each other, which makes it easy to see otherwise
hard to find whitespace problems.

-Miles



[-- Attachment #2: Emacs mode to indicate individual whitespace characters --]
[-- Type: application/emacs-lisp, Size: 4196 bytes --]

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



-- 
A zen-buddhist walked into a pizza shop and
said, "Make me one with everything."

[-- Attachment #4: 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] 5+ messages in thread

* Re: show tabs and white space
       [not found] ` <mailman.1803.1113782366.2895.help-gnu-emacs@gnu.org>
@ 2005-04-18 15:47   ` mgrd
  0 siblings, 0 replies; 5+ messages in thread
From: mgrd @ 2005-04-18 15:47 UTC (permalink / raw)


Miles Bader wrote:
> Try the attached mode, `visible-whitespace-mode'.  It is intended for
> the latest CVS Emacs, but may work ok for Emacs 21.
> 
> It's somewhat different from typical "highlight whitespace" packages in
> that each whitespace character is indicated individually, even when
> they're adjacent to each other, which makes it easy to see otherwise
> hard to find whitespace problems.

Thanks a lot Miles.

But I don't have root rights on the machine in question (alpha--netbsd).
So I can't install it in the normal place.
But I'll try to keep it running by placing it somewhere in ~/.emacs.d/

-- 
reply to usenet only

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

end of thread, other threads:[~2005-04-18 15:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-14 19:26 show tabs and white space mgrd
2005-04-14 21:34 ` rgb
2005-04-14 22:05   ` mgrd
2005-04-17 23:47 ` Miles Bader
     [not found] ` <mailman.1803.1113782366.2895.help-gnu-emacs@gnu.org>
2005-04-18 15:47   ` mgrd

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.