help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problem with second-sel.el


From: Drew Adams
Subject: RE: Problem with second-sel.el
Date: Tue, 19 Aug 2008 08:45:25 -0700

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]