unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6304: 23.2; advising yank
@ 2010-05-29 20:03 Leo
       [not found] ` <871vcuck79.fsf@gnu.org>
  2011-01-22  3:50 ` bug#6304: 23.2; [PATCH] " Leo
  0 siblings, 2 replies; 4+ messages in thread
From: Leo @ 2010-05-29 20:03 UTC (permalink / raw)
  To: 6304

I have been seeing this for a while but just find this reproducible
case:

1. (defadvice yank (after random-advice activate)
      (message "hello world"))

2. C-h f yank RET

The string "This function is advised." is not highlighted with the
warning face.

In GNU Emacs 23.2.5 (x86_64-apple-darwin10.3.0)
 of 2010-05-28

Leo





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

* bug#6304: 23.2; advising yank
       [not found] ` <871vcuck79.fsf@gnu.org>
@ 2010-05-30  5:57   ` Leo
  0 siblings, 0 replies; 4+ messages in thread
From: Leo @ 2010-05-30  5:57 UTC (permalink / raw)
  To: Johan Bockgård; +Cc: 6304

On 30 May 2010 01:22, Johan Bockgård <bojohan@gnu.org> wrote:
> The highlighting is removed by substitute-command-keys:
>
>    Returns original STRING if no substitutions were made. Otherwise, a
>    new string, without any text properties, is returned.

That explains a lot.

Looks like an oversight/bug on substitute-command-keys. The new
additional doc-string from advice was added quite recently.

Thanks.

Leo





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

* bug#6304: 23.2; [PATCH] advising yank
  2010-05-29 20:03 bug#6304: 23.2; advising yank Leo
       [not found] ` <871vcuck79.fsf@gnu.org>
@ 2011-01-22  3:50 ` Leo
  2011-01-28 21:42   ` Chong Yidong
  1 sibling, 1 reply; 4+ messages in thread
From: Leo @ 2011-01-22  3:50 UTC (permalink / raw)
  To: 6304; +Cc: Johan Bockgård

From 238f221401cbdafe1df6634cbb69480e2748cced Mon Sep 17 00:00:00 2001
Date: Sat, 22 Jan 2011 11:40:15 +0800
Subject: [PATCH] Fix bug #6304

The text property in the documentation string may be removed by
substitute-command-keys.
---
 lisp/emacs-lisp/advice.el |    4 +---
 lisp/help-mode.el         |    7 +++++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 9267bc8a..02696d9e 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -3007,9 +3007,7 @@ (defun ad-make-advised-docstring (function &optional style)
     (setq usage (if (null usage) t (setq origdoc (cdr usage)) (car usage)))
     (if origdoc (setq paragraphs (list origdoc)))
     (unless (eq style 'plain)
-      (push (propertize (concat "This " origtype " is advised.")
-			'face 'font-lock-warning-face)
-	    paragraphs))
+      (push (concat "This " origtype " is advised.") paragraphs))
     (ad-dolist (class ad-advice-classes)
       (ad-dolist (advice (ad-get-enabled-advices function class))
 	(setq advice-docstring
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index f115e425..14ff164e 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -302,6 +302,13 @@ (defun help-mode-finish ()
     ;; View mode's read-only status of existing *Help* buffer is lost
     ;; by with-output-to-temp-buffer.
     (toggle-read-only 1)
+    (save-excursion
+      (goto-char (point-min))
+      (let ((inhibit-read-only t))
+	(when (re-search-forward "^This \\w+ is advised.$" nil t)
+	  (put-text-property (match-beginning 0)
+			     (match-end 0)
+			     'face 'font-lock-warning-face))))
     (help-make-xrefs (current-buffer))))
 \f
 ;; Grokking cross-reference information in doc strings and
-- 
1.7.4.rc1






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

* bug#6304: 23.2; [PATCH] advising yank
  2011-01-22  3:50 ` bug#6304: 23.2; [PATCH] " Leo
@ 2011-01-28 21:42   ` Chong Yidong
  0 siblings, 0 replies; 4+ messages in thread
From: Chong Yidong @ 2011-01-28 21:42 UTC (permalink / raw)
  To: Leo; +Cc: 6304, Johan Bockgård

Leo <sdl.web@gmail.com> writes:

> From 238f221401cbdafe1df6634cbb69480e2748cced Mon Sep 17 00:00:00 2001
> Date: Sat, 22 Jan 2011 11:40:15 +0800
> Subject: [PATCH] Fix bug #6304
>
> The text property in the documentation string may be removed by
> substitute-command-keys.

Committed, thanks.





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

end of thread, other threads:[~2011-01-28 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-29 20:03 bug#6304: 23.2; advising yank Leo
     [not found] ` <871vcuck79.fsf@gnu.org>
2010-05-30  5:57   ` Leo
2011-01-22  3:50 ` bug#6304: 23.2; [PATCH] " Leo
2011-01-28 21:42   ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).