all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wolfgang Jenkner <wjenkner@inode.at>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 11408@debbugs.gnu.org
Subject: bug#11408: 24.1.50; [PATCH] Don't inherit faces when untabifying the man page
Date: Sun, 06 May 2012 17:31:38 +0200	[thread overview]
Message-ID: <857gwp7199.fsf@iznogoud.viz> (raw)
In-Reply-To: <85d36jyh9z.fsf@iznogoud.viz>

On Sun, May 06 2012, Stefan Monnier wrote:

>> 	* man.el (Man-unindent): Use text-property-default-nonsticky to
>> 	prevent untabify from inheriting `face' text properties.
>> 	In particular, underlined white space didn't look so hot.
>
> Thanks.  The BTW, I think this should be fixed in untabify.

The following idea is perhaps obvious or silly or obviously silly,
but...

Here's a simple test

#+begin_src emacs-lisp
(with-temp-buffer
  (insert-string "foo\t\tbar")
  (put-text-property 1 4 'face 'underline)
  (put-text-property 4 6 'face '(:background "red"))
  (put-text-property 6 9 'face '(:foreground "blue"))
  (untabify (point-min) (point-max))
  (message "%s" (buffer-string)))
#+end_src

Wolfgang

diff --git a/lisp/tabify.el b/lisp/tabify.el
index 26762ac..6d27084 100644
--- a/lisp/tabify.el
+++ b/lisp/tabify.el
@@ -46,7 +46,9 @@ The variable `tab-width' controls the spacing of tab stops."
                 column)
             (skip-chars-forward "\t")
             (setq column (current-column))
-            (delete-region tab-beg (point))
+            ;; Inherit from the last tab in a run.
+            (insert-char ?\s 1 t)
+            (delete-region tab-beg (1- (point)))
             (indent-to column)))))
     (move-to-column c)))
 






      reply	other threads:[~2012-05-06 15:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 17:04 bug#11408: 24.1.50; [PATCH] Don't inherit faces when untabifying the man page Wolfgang Jenkner
2012-05-06  4:19 ` Chong Yidong
2012-05-06 13:57 ` Stefan Monnier
2012-05-06 15:31   ` Wolfgang Jenkner [this message]

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=857gwp7199.fsf@iznogoud.viz \
    --to=wjenkner@inode.at \
    --cc=11408@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.