* Following boxquote links in a message buffer borkes it!
@ 2009-05-08 11:42 Tassilo Horn
2009-05-08 17:10 ` Reiner Steib
0 siblings, 1 reply; 8+ messages in thread
From: Tassilo Horn @ 2009-05-08 11:42 UTC (permalink / raw)
To: Dave Pearson, ding
Hi all,
I wasn't sure if this is a boxquote, gnus or a combination of both
problem, so here we go.
When I write a message and insert a boxquote like this
,----[ C-h v gnus-auto-select-first RET ]
| gnus-auto-select-first is a variable defined in `gnus-sum.el'.
| Its value is t
|
| Documentation:
| If non-nil, select an article on group entry.
| An article is selected automatically when entering a group
| e.g. with SPC, or via `gnus-summary-next-page' or
| `gnus-summary-catchup-and-goto-next-group'.
`----
the two functions are undelined and I can click them (or hit RET on
them) to get the function's docstring. Unfortunately this is not done
in the *Help* buffer, but instead the current buffer (*mail* in this
case) is erased and the help contents are inserted. Then the buffer is
read-only and I cannot undo, thus my mail is lost.
I'm using boxquote.el version 1.21, Emacs 23 from CVS (today) and the
bundled Gnus version.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Following boxquote links in a message buffer borkes it!
2009-05-08 11:42 Following boxquote links in a message buffer borkes it! Tassilo Horn
@ 2009-05-08 17:10 ` Reiner Steib
2009-05-08 18:16 ` Tassilo Horn
0 siblings, 1 reply; 8+ messages in thread
From: Reiner Steib @ 2009-05-08 17:10 UTC (permalink / raw)
To: Dave Pearson; +Cc: ding
On Fri, May 08 2009, Tassilo Horn wrote:
> I wasn't sure if this is a boxquote, gnus or a combination of both
> problem, so here we go.
Try to reproduce it in *scratch*. -> The same. Then it's independent
from Gnus.
> When I write a message and insert a boxquote like this
>
> ,----[ C-h v gnus-auto-select-first RET ]
[...]
> the two functions are undelined and I can click them (or hit RET on
> them) to get the function's docstring. Unfortunately this is not done
> in the *Help* buffer, but instead the current buffer (*mail* in this
> case) is erased and the help contents are inserted. Then the buffer is
> read-only and I cannot undo, thus my mail is lost.
Duh!
`boxquote.el' should probably strip the properties before inserting the
text.
Maybe you can use some boxquote-*-hook to do this.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Following boxquote links in a message buffer borkes it!
2009-05-08 17:10 ` Reiner Steib
@ 2009-05-08 18:16 ` Tassilo Horn
2009-05-08 20:53 ` Reiner Steib
0 siblings, 1 reply; 8+ messages in thread
From: Tassilo Horn @ 2009-05-08 18:16 UTC (permalink / raw)
To: Dave Pearson; +Cc: ding
Reiner Steib <reinersteib+gmane@imap.cc> writes:
Hi Reiner,
>> I wasn't sure if this is a boxquote, gnus or a combination of both
>> problem, so here we go.
>
> Try to reproduce it in *scratch*. -> The same. Then it's independent
> from Gnus.
Indeed, there it's the same. Another observation: The *Help* buffer has
the same contents like *scratch* after following the link.
>> the two functions are undelined and I can click them (or hit RET on
>> them) to get the function's docstring. Unfortunately this is not
>> done in the *Help* buffer, but instead the current buffer (*mail* in
>> this case) is erased and the help contents are inserted. Then the
>> buffer is read-only and I cannot undo, thus my mail is lost.
>
> Duh!
>
> `boxquote.el' should probably strip the properties before inserting
> the text.
Well, I like the possibility to click those links. It simply should
open them in *Help* solely without modifying the current buffer.
Dave, maybe you could provide a simple test case which produces a link
like those in boxquotes?
Bye,
Tassilo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Following boxquote links in a message buffer borkes it!
2009-05-08 18:16 ` Tassilo Horn
@ 2009-05-08 20:53 ` Reiner Steib
2009-05-08 22:19 ` Tassilo Horn
2009-05-10 20:07 ` Dave Pearson
0 siblings, 2 replies; 8+ messages in thread
From: Reiner Steib @ 2009-05-08 20:53 UTC (permalink / raw)
To: Dave Pearson; +Cc: ding
On Fri, May 08 2009, Tassilo Horn wrote:
> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>> `boxquote.el' should probably strip the properties before inserting
>> the text.
>
> Well, I like the possibility to click those links. It simply should
> open them in *Help* solely without modifying the current buffer.
>
> Dave, maybe you could provide a simple test case which produces a link
> like those in boxquotes?
I think `boxquote.el' doesn't do anything WRT this. It simply copies
the text from the *Help* buffer.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Following boxquote links in a message buffer borkes it!
2009-05-08 20:53 ` Reiner Steib
@ 2009-05-08 22:19 ` Tassilo Horn
2009-05-09 10:32 ` Reiner Steib
2009-05-09 12:14 ` Andreas Schwab
2009-05-10 20:07 ` Dave Pearson
1 sibling, 2 replies; 8+ messages in thread
From: Tassilo Horn @ 2009-05-08 22:19 UTC (permalink / raw)
To: Dave Pearson; +Cc: ding
Reiner Steib <reinersteib+gmane@imap.cc> writes:
> I think `boxquote.el' doesn't do anything WRT this. It simply copies
> the text from the *Help* buffer.
But when I kill the text from a *Help* buffer and yank it to *scratch*
the links aren't clickable anymore; RET just insterts a newline. Does
normal `M-< C-SPC M-> C-w' followed by `C-y' not copy the relevant
properties? At least the underlining is still there.
Hm, indeed the properties differ. On a link in *Help* I get:
--8<---------------cut here---------------start------------->8---
There are text properties here:
button (t)
category help-variable-button
help-args (gnus-auto-select-subject)
--8<---------------cut here---------------end--------------->8---
Copied into *scratch* I get:
--8<---------------cut here---------------start------------->8---
There are text properties here:
action help-button-action
button (t)
evaporate t
face button
help-args (gnus-auto-select-subject)
help-function describe-variable
rear-nonsticky t
supertype help-xref
type help-variable
--8<---------------cut here---------------end--------------->8---
And finally boxquoted into *scratch* it is (same as in *Help*):
--8<---------------cut here---------------start------------->8---
There are text properties here:
button (t)
category help-variable-button
help-args (gnus-auto-select-subject)
--8<---------------cut here---------------end--------------->8---
Bye,
Tassilo
--
VI VI VI - The Roman Number Of The Beast
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Following boxquote links in a message buffer borkes it!
2009-05-08 22:19 ` Tassilo Horn
@ 2009-05-09 10:32 ` Reiner Steib
2009-05-09 12:14 ` Andreas Schwab
1 sibling, 0 replies; 8+ messages in thread
From: Reiner Steib @ 2009-05-09 10:32 UTC (permalink / raw)
To: Dave Pearson; +Cc: ding
On Sat, May 09 2009, Tassilo Horn wrote:
> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>
>> I think `boxquote.el' doesn't do anything WRT this. It simply copies
>> the text from the *Help* buffer.
>
> But when I kill the text from a *Help* buffer and yank it to *scratch*
> the links aren't clickable anymore; RET just insterts a newline. Does
> normal `M-< C-SPC M-> C-w' followed by `C-y' not copy the relevant
> properties?
No, see...
,----[ <f1> v yank-excluded-properties RET ]
| yank-excluded-properties is a variable defined in `simple.el'.
| Its value is
| (read-only invisible intangible field mouse-face help-echo local-map
| keymap yank-handler follow-link fontified)
|
| Documentation:
| *Text properties to discard when yanking.
| The value should be a list of text properties to discard or t,
| which means to discard all text properties.
|
| You can customize this variable.
`----
But `boxquote.el' doesn't use `yank' for `boxquote-describe-variable'.
`boxquote-quote-help-buffer' doesn't exclude properties and
`boxquote-text' does an `insert' (not a `yank') which preserves the
properties.
As `boxquote.el' excludes the properties in other functions, I guess
it is an oversight. Dave, I'd suggest to add the following patch.
2009-05-09 Reiner Steib <Reiner.Steib@gmx.de>
* boxquote.el (boxquote-quote-help-buffer): Strip text properties
to avoid destroying the target buffer content when clicking on a
help link. Reported by Tassilo Horn <tassilo@member.fsf.org>.
--8<---------------cut here---------------start------------->8---
--- boxquote.el.~1.21~ 2008-05-21 12:10:13.000000000 +0200
+++ boxquote.el 2009-05-09 12:29:42.000000000 +0200
@@ -1,5 +1,5 @@
;;; boxquote.el --- Quote text with a semi-box.
-;; Copyright 1999-2008 by Dave Pearson <davep@davep.org>
+;; Copyright 1999-2009 by Dave Pearson <davep@davep.org>
;; $Revision: 1.21 $
;; boxquote.el is free software distributed under the terms of the GNU
@@ -428,11 +428,13 @@
(save-window-excursion
(funcall help-call)
(with-current-buffer (boxquote-help-buffer-name (funcall item))
- (buffer-string))))
+ ;; Strip text properties to avoid destroying the target buffer
+ ;; content when clicking on a help link.
+ (buffer-substring-no-properties (point-min) (point-max)))))
(boxquote-title (format title-format (funcall item)))
(when one-window-p
(delete-other-windows))))
-
+
;;;###autoload
(defun boxquote-describe-function ()
"Call `describe-function' and boxquote the output into the current buffer."
--8<---------------cut here---------------end--------------->8---
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Following boxquote links in a message buffer borkes it!
2009-05-08 22:19 ` Tassilo Horn
2009-05-09 10:32 ` Reiner Steib
@ 2009-05-09 12:14 ` Andreas Schwab
1 sibling, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2009-05-09 12:14 UTC (permalink / raw)
To: ding
Tassilo Horn <tassilo@member.fsf.org> writes:
> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>
>> I think `boxquote.el' doesn't do anything WRT this. It simply copies
>> the text from the *Help* buffer.
>
> But when I kill the text from a *Help* buffer and yank it to *scratch*
> the links aren't clickable anymore; RET just insterts a newline. Does
> normal `M-< C-SPC M-> C-w' followed by `C-y' not copy the relevant
> properties? At least the underlining is still there.
yank discards all properties in yank-excluded-properties. boxquote
probably uses insert-buffer-substring.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Following boxquote links in a message buffer borkes it!
2009-05-08 20:53 ` Reiner Steib
2009-05-08 22:19 ` Tassilo Horn
@ 2009-05-10 20:07 ` Dave Pearson
1 sibling, 0 replies; 8+ messages in thread
From: Dave Pearson @ 2009-05-10 20:07 UTC (permalink / raw)
To: ding
* Reiner Steib <reinersteib+gmane@imap.cc> [2009-05-08 22:53:46 +0200]:
> I think `boxquote.el' doesn't do anything WRT this. It simply copies the
> text from the *Help* buffer.
Correct. IIRC I use `buffer-string' to grab the text and work with it. What
I'm failing to do, which I should do (and do in other ways elsewhere in
boxquote) is strip the properties. I'll be making that change.
--
Dave Pearson: | lbdb.el - LBDB interface.
http://www.davep.org/ | sawfish.el - Sawfish mode.
Emacs: | uptimes.el - Record emacs uptimes.
http://www.davep.org/emacs/ | quickurl.el - Recall lists of URLs.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-05-10 20:07 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-08 11:42 Following boxquote links in a message buffer borkes it! Tassilo Horn
2009-05-08 17:10 ` Reiner Steib
2009-05-08 18:16 ` Tassilo Horn
2009-05-08 20:53 ` Reiner Steib
2009-05-08 22:19 ` Tassilo Horn
2009-05-09 10:32 ` Reiner Steib
2009-05-09 12:14 ` Andreas Schwab
2009-05-10 20:07 ` Dave Pearson
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 NNTP newsgroup(s).