unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21024: help-xref-button in header line doesn't work (PATCH attached)
@ 2015-07-09 17:34 Vaidheeswaran C
  2016-02-23  9:46 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Vaidheeswaran C @ 2015-07-09 17:34 UTC (permalink / raw)
  To: 21024

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


1. Copy this snippet to scratch buffer and eval it.

(define-button-type 'hello-world
  :supertype 'help-xref
  'help-function (lambda ()
		   (message "Hello World")))

(setq header-line-format
      (make-text-button "Hello World" nil 'type 'hello-world))

2. Click on the header buton

3. Note the following stack trace


Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p
(#("Hello World" 0 11 (button (t) category hello-world-button)) . 10))
  button-start((#("Hello World" 0 11 (button (t) category
hello-world-button)) . 10))
  help-button-action((#("Hello World" 0 11 (button (t) category
hello-world-button)) . 10))
  button-activate((#("Hello World" 0 11 (button (t) category
hello-world-button)) . 10) t)
  push-button((mouse-2 (#<window 18 on *Backtrace*> header-line (103 .
14) 11071944 (#("Hello World" 0 11 (button (t) category
hello-world-button)) . 10) nil (10 . -1) nil (3 . 14) (10 . 18))))
  funcall-interactively(push-button (mouse-2 (#<window 18 on
*Backtrace*> header-line (103 . 14) 11071944 (#("Hello World" 0 11
(button (t) category hello-world-button)) . 10) nil (10 . -1) nil (3 .
14) (10 . 18))))
  call-interactively(push-button nil nil)
  command-execute(push-button)

----------------------------------------------------------------

This bug is related to bug#12817: 24.2; The button library does not
work on the header line.  The sole difference here is that button is a
help-xref button.

See http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-12/msg00203.html

The related commit is 24fc948039

----------------------------------------------------------------

Without getting in to nitty gritties of the "area buttons", the fix is
fairly simple once you notice that `help-do-xref' doesn't use the
first argument.

See the attached patch.

----------------------------------------------------------------

(I am working on a dictionary client for Emacs.  I will circulate the
module -- I call it edictc.el -- in another week.  The package uses
xref links in header line, FWIW.)



[-- Attachment #2: help-mode.diff --]
[-- Type: text/x-patch, Size: 393 bytes --]

diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index e1fc9fd..ac74e03 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -107,7 +107,7 @@ The format is (FUNCTION ARGS...).")
 
 (defun help-button-action (button)
   "Call BUTTON's help function."
-  (help-do-xref (button-start button)
+  (help-do-xref nil
 		(button-get button 'help-function)
 		(button-get button 'help-args)))
 

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

* bug#21024: help-xref-button in header line doesn't work (PATCH attached)
  2015-07-09 17:34 bug#21024: help-xref-button in header line doesn't work (PATCH attached) Vaidheeswaran C
@ 2016-02-23  9:46 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-23  9:46 UTC (permalink / raw)
  To: Vaidheeswaran C; +Cc: 21024

Vaidheeswaran C <vaidheeswaran.chinnaraju@gmail.com> writes:

> This bug is related to bug#12817: 24.2; The button library does not
> work on the header line.  The sole difference here is that button is a
> help-xref button.
>
> See http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-12/msg00203.html
>
> The related commit is 24fc948039

Thanks for the patch; applied to emacs-25.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2016-02-23  9:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 17:34 bug#21024: help-xref-button in header line doesn't work (PATCH attached) Vaidheeswaran C
2016-02-23  9:46 ` Lars Ingebrigtsen

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).