all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Problem with second-sel.el
@ 2008-08-19  8:18 Nordlöw
  2008-08-19 15:45 ` Drew Adams
       [not found] ` <mailman.17058.1219162086.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Nordlöw @ 2008-08-19  8:18 UTC (permalink / raw)
  To: help-gnu-emacs

I am trying to trace an annoying bug regarding secondary selection.
The problem occurs on a number of places in my settings if I have
second-sel.el in my load path otherwise it does not.

For example the following happens when nxhtml is loaded:

Debugger entered--Lisp error: (error "No `SECONDARY' selection")
  x-get-selection-internal(SECONDARY STRING)
  x-get-selection(SECONDARY)
  (and (fboundp (quote x-get-selection)) (x-get-selection (quote
SECONDARY)) (not buffer-read-only))
  message("Loading %s (source)...done" "/home/per/pnw/emacs/nxhtml/etc/
schema/schema-path-patch.el")
  load-with-code-conversion("/home/per/pnw/emacs/nxhtml/etc/schema/
schema-path-patch.el" "/home/per/pnw/emacs/nxhtml/etc/schema/schema-
path-patch.el" nil nil)
  load("/home/per/pnw/emacs/nxhtml/etc/schema/schema-path-patch.el"
nil nil t)
  load-file("/home/per/pnw/emacs/nxhtml/etc/schema/schema-path-
patch.el")

Because of this I have deactivated second-sel.el for now; Am I missing
out on something, Drew Adams?

Thanks in advance,
Nordlöw


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

* RE: Problem with second-sel.el
  2008-08-19  8:18 Problem with second-sel.el Nordlöw
@ 2008-08-19 15:45 ` Drew Adams
       [not found] ` <mailman.17058.1219162086.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams @ 2008-08-19 15:45 UTC (permalink / raw)
  To: 'Nordlöw', help-gnu-emacs

> I am trying to trace an annoying bug regarding secondary selection.
> The problem occurs on a number of places in my settings if I have
> second-sel.el in my load path otherwise it does not.
> 
> For example the following happens when nxhtml is loaded:
> 
> Debugger entered--Lisp error: (error "No `SECONDARY' selection")
>   x-get-selection-internal(SECONDARY STRING)
>   x-get-selection(SECONDARY)
>   (and (fboundp (quote x-get-selection)) (x-get-selection (quote
> SECONDARY)) (not buffer-read-only))
>   message("Loading %s (source)...done" 
> "/home/per/pnw/emacs/nxhtml/etc/
> schema/schema-path-patch.el")
>   load-with-code-conversion("/home/per/pnw/emacs/nxhtml/etc/schema/
> schema-path-patch.el" "/home/per/pnw/emacs/nxhtml/etc/schema/schema-
> path-patch.el" nil nil)
>   load("/home/per/pnw/emacs/nxhtml/etc/schema/schema-path-patch.el"
> nil nil t)
>   load-file("/home/per/pnw/emacs/nxhtml/etc/schema/schema-path-
> patch.el")
> 
> Because of this I have deactivated second-sel.el for now; Am I missing
> out on something, Drew Adams?

Hi Per,

We can take this off list to try to debug your problem.

This code: (and (fboundp (quote x-get-selection)) (x-get-selection (quote
> SECONDARY)) (not buffer-read-only)) is not from second-sel.el. It is no doubt
from menu-bar+.el:

(when (fboundp 'yank-secondary)
  (define-key-after menu-bar-edit-menu [yank-secondary] ; In `second-sel.el'
    '(menu-item "Paste Secondary" yank-secondary
      :help "Paste secondary selection."
      :enable
      (and (fboundp 'x-get-selection) (x-get-selection 'SECONDARY)
           (not buffer-read-only))
      :keys "\\[yank-secondary-or-swap-w-region]")
    'paste))

Library second-sel.el has similar, but not identical error message: "No
secondary selection" (notice the lowercase and lack of quotes). This message
appears when you try to use the secondary selection but there is none.

My guess is this:

1. The :enable code is run when the menu-bar is created.

2. (fboundp 'x-get-selection) succeeds on your platform.

3. (x-get-selection on your platform raises an error if there is no secondary
selection. It should not, I believe - it should return nil. On Windows, at
least, it returns nil.

4. This occurs only when second-sel.el is loaded, because of the (fboundp
'yank-secondary) test at the beginning of the :enable sexp.

Try just evaluating M-: (x-get-selection 'SECONDARY) in Emacs -Q (with no
secondary). Does it raise an error or return nil? If the former, then I'd
suggest that you file an Emacs bug.

Experiment a bit more and contact me off list, and we'll see what we can do. If
you just want a workaround for now, just remove the :enable sexp from
menu-bar+.el.





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

* Re: Problem with second-sel.el
       [not found] ` <mailman.17058.1219162086.18990.help-gnu-emacs@gnu.org>
@ 2008-08-20 10:27   ` Nordlöw
  2008-08-20 14:26     ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Nordlöw @ 2008-08-20 10:27 UTC (permalink / raw)
  To: help-gnu-emacs

On 19 Aug, 17:45, "Drew Adams" <drew.ad...@oracle.com> wrote:
> > I am trying to trace an annoying bug regarding secondary selection.
> > The problem occurs on a number of places in my settings if I have
> > second-sel.el in my load path otherwise it does not.
>
> > For example the following happens when nxhtml is loaded:
>
> > Debugger entered--Lisp error: (error "No `SECONDARY' selection")
> >   x-get-selection-internal(SECONDARY STRING)
> >   x-get-selection(SECONDARY)
> >   (and (fboundp (quote x-get-selection)) (x-get-selection (quote
> > SECONDARY)) (not buffer-read-only))
> >   message("Loading %s (source)...done"
> > "/home/per/pnw/emacs/nxhtml/etc/
> > schema/schema-path-patch.el")
> >   load-with-code-conversion("/home/per/pnw/emacs/nxhtml/etc/schema/
> > schema-path-patch.el" "/home/per/pnw/emacs/nxhtml/etc/schema/schema-
> > path-patch.el" nil nil)
> >   load("/home/per/pnw/emacs/nxhtml/etc/schema/schema-path-patch.el"
> > nil nil t)
> >   load-file("/home/per/pnw/emacs/nxhtml/etc/schema/schema-path-
> > patch.el")
>
> > Because of this I have deactivated second-sel.el for now; Am I missing
> > out on something, Drew Adams?
>
> Hi Per,
>
> We can take this off list to try to debug your problem.
>
> This code: (and (fboundp (quote x-get-selection)) (x-get-selection (quote> SECONDARY)) (not buffer-read-only)) is not from second-sel.el. It is no doubt
>
> from menu-bar+.el:
>
> (when (fboundp 'yank-secondary)
>   (define-key-after menu-bar-edit-menu [yank-secondary] ; In `second-sel.el'
>     '(menu-item "Paste Secondary" yank-secondary
>       :help "Paste secondary selection."
>       :enable
>       (and (fboundp 'x-get-selection) (x-get-selection 'SECONDARY)
>            (not buffer-read-only))
>       :keys "\\[yank-secondary-or-swap-w-region]")
>     'paste))
>
> Library second-sel.el has similar, but not identical error message: "No
> secondary selection" (notice the lowercase and lack of quotes). This message
> appears when you try to use the secondary selection but there is none.
>
> My guess is this:
>
> 1. The :enable code is run when the menu-bar is created.
>
> 2. (fboundp 'x-get-selection) succeeds on your platform.
>
> 3. (x-get-selection on your platform raises an error if there is no secondary
> selection. It should not, I believe - it should return nil. On Windows, at
> least, it returns nil.
>
> 4. This occurs only when second-sel.el is loaded, because of the (fboundp
> 'yank-secondary) test at the beginning of the :enable sexp.
>
> Try just evaluating M-: (x-get-selection 'SECONDARY) in Emacs -Q (with no
> secondary). Does it raise an error or return nil? If the former, then I'd
> suggest that you file an Emacs bug.
>
> Experiment a bit more and contact me off list, and we'll see what we can do. If
> you just want a workaround for now, just remove the :enable sexp from
> menu-bar+.el.

You are right! Evaluating the expression

   (x-get-selection 'SECONDARY)

does raise an error in emacs -Q on my Ubuntu Linux (using my daily
emacs CVS-build)! I agree that this is strange.

How do I file an emacs bug?

Thanks again Drew,
Nordlöw


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

* RE: Problem with second-sel.el
  2008-08-20 10:27   ` Nordlöw
@ 2008-08-20 14:26     ` Drew Adams
  0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2008-08-20 14:26 UTC (permalink / raw)
  To: 'Nordlöw', help-gnu-emacs

> You are right! Evaluating the expression
>    (x-get-selection 'SECONDARY)
> does raise an error in emacs -Q on my Ubuntu Linux (using my
> daily emacs CVS-build)! I agree that this is strange.
> 
> How do I file an emacs bug?

Per! You should know that by now. ;-)

Menu: Help > Send Bug Report...

Keyboard: M-x report-emacs-bug

And the Emacs manual tells you so:
C-h i, choose Emacs
`i' bug TAB, choose `bugs' takes you to Reporting Bugs

I recommend reading Reporting Bugs to everyone who hasn't
(and to some who have). ;-)





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

end of thread, other threads:[~2008-08-20 14:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-19  8:18 Problem with second-sel.el Nordlöw
2008-08-19 15:45 ` Drew Adams
     [not found] ` <mailman.17058.1219162086.18990.help-gnu-emacs@gnu.org>
2008-08-20 10:27   ` Nordlöw
2008-08-20 14:26     ` Drew Adams

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.