HowTo: Avoid packages like TPU

View: New views
14 Messages — Rating Filter:   Alert me  

HowTo: Avoid packages like TPU

by T. V. Raman-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


With loaddefs.el in Emacs 22, rarely used packages
like tpu end up showing up in the default obarray operated upon
by mapatoms. Is there a way to avoid this?

I use reflection via mapatoms to find interactive commands that
need to be speech-enabled in Emacspeak, and one unfortunate
consequence is the following:

0) mapatoms finds commands like "set cursor free" from tpu-extras
1) In using reflection, it ends up loading tpu-extras.el (even
   though I have no intention of using tpu)
2) Worse, tpu-extras is evil -- it redefines things like newline
3) And even worse, tpu-current-line (used by the redefined newline)
       raises errors at times when called from display-warning.

In the minimum it would be nice if optional packages that
redefine core functionality such as command `newline' didn't get
accidentally pulled in.


In GNU Emacs 22.1.50.11 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
 of 2007-08-04 on labrador
configured using `configure  '--prefix=/usr/local' '--with-toolkit=gtk''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: nil

Major mode: Shell

Minor modes in effect:
  jabber-activity-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  dired-omit-mode: t
  dynamic-completion-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-readonly-mode: t
  shell-dirtrack-mode: t
  display-time-mode: t
  desktop-save-mode: t
  auto-insert-mode: t
  encoded-kbd-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t

Recent input:
SPC a t t a c h i n g SPC a SPC s t a c k - t r a c
e ; SPC t h o u g h SPC I SPC n o w SPC h a v e SPC
a SPC f i x SPC f o r SPC e m a c s p e a k , SPC i
t SPC w o u l d SPC b e SPC ESC DEL p r o b a b l y
SPC b e SPC u s e f u l SPC t o SPC f i x SPC t h e
DEL DEL DEL SPC t h e SPC s i g n a l SPC t h a t SPC
i s SPC b e i n g SPC r a i s e d SPC f o DEL r o m
SPC a SPC c o d e SPC h y g e n e SPC p o i n t SPC
o f SPC v i e w . RET RET C-c C-a ~ / . s i g n a l
TAB ESC DEL s i g n TAB C-g C-x @ h s c d RET l s SPC
. s i g TAB * RET C-p ESC > ESC [ [ C C-c C-a ~ / .
s i g n a l TAB DEL C-g C-g ESC m C-p C-x i ~ / . s
i g n a l TAB RET ESC m C-p C-p C-c C-c y y e s RET
C-e m c d RET C-x m C-g C-g C-e m ESC [ [ D ESC x r
e p o r t - e m a c s - b TAB RET

Recent messages:
Completing file name...
Partially completed
Quit [2 times]
Convert non-ASCII letters to hexadecimal? (y or n)
Sending...
Added to /home/raman/Mail/outgoing
Sending...done
~
Composing a message
Quit
Quit

--
Best Regards,
--raman

     
Email:  raman@...
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@...
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC:    irc://irc.freenode.net/#emacs


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by Richard Stallman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    With loaddefs.el in Emacs 22, rarely used packages
    like tpu end up showing up in the default obarray operated upon
    by mapatoms. Is there a way to avoid this?

The only easy way is to delete the autoloads.
But why do that?  There are not very many of them.

    0) mapatoms finds commands like "set cursor free" from tpu-extras
    1) In using reflection, it ends up loading tpu-extras.el (even
       though I have no intention of using tpu)

What is "reflection"?

Perhaps we should put the tpu-extras.el autoloads into tpu-edt.el
instead of into loaddefs.el.  I think that only tpu users
would want to call those entry points.

Stefan, you know how to do that.  Would you please do that?


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by Richard Stallman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    2) Worse, tpu-extras is evil -- it redefines things like newline

That is ugly, the same way advice is ugly, but the change to the
behavior of `newline' is harmless enough.

    3) And even worse, tpu-current-line (used by the redefined newline)
           raises errors at times when called from display-warning.

How does it happen that tpu-current-line is not loaded?
tpu-extras starts with (require 'tpu-edt).

It looks like the redefinition of `newline' is done as part
of a scheme to implement scroll margins.  Emacs nowadays
has scroll margins as a built-in feature.  So I think
all that code could be replaced by a few variable aliases.

Would someone like to do that, and ack?


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by Stefan Monnier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> With loaddefs.el in Emacs 22, rarely used packages  like tpu end up
> showing up in the default obarray operated upon by mapatoms.  Is there
> a way to avoid this?

Not without increasing the amount of work people need to do to enable TPU
emulation, so I think this is not an option.

> 0) mapatoms finds commands like "set cursor free" from tpu-extras
> 1) In using reflection, it ends up loading tpu-extras.el (even
>    though I have no intention of using tpu)

This is a problem in Emacspeak: it should not itself load packages.

> 2) Worse, tpu-extras is evil -- it redefines things like newline

That's a bug.  All such bugs should be reported via M-x report-emacs-bug.
By principle, loading an elisp package should not have any adverse affect
(it should basically have no effect other than the expected ones: define
additional functions and variables and maybe a few more).

> 3) And even worse, tpu-current-line (used by the redefined newline)
>        raises errors at times when called from display-warning.

I do not understand this one.  Can you expand on it?


        Stefan


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by Stefan Monnier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 2) Worse, tpu-extras is evil -- it redefines things like newline

Should be "fixed" now (it uses advice and only activates it when needed).


        Stefan


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by Stefan Monnier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Perhaps we should put the tpu-extras.el autoloads into tpu-edt.el
> instead of into loaddefs.el.  I think that only tpu users
> would want to call those entry points.

> Stefan, you know how to do that.  Would you please do that?

It's done here, I'm just waiting for syncs and a few other things before
committing it.


        Stefan


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by T. V. Raman-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks for the fix.


>>>>> "Stefan" == Stefan Monnier <monnier@...> writes:
    >> 2) Worse, tpu-extras is evil -- it redefines things like
    >> newline
    Stefan> Should be "fixed" now (it uses advice and only
    Stefan> activates it when needed).
    Stefan>
    Stefan>
    Stefan>         Stefan
    Stefan>
    Stefan>
    Stefan> _______________________________________________
    Stefan> emacs-pretest-bug mailing list
    Stefan> emacs-pretest-bug@...
    Stefan> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

--
Best Regards,
--raman

     
Email:  raman@...
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@...
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC:    irc://irc.freenode.net/#emacs


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by T. V. Raman-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Just did a CVS update, and I still see the old version of
tpu-extras  in the sources i.e. it defines newline.

Thanks for the fix.


>>>>> "Stefan" == Stefan Monnier <monnier@...> writes:
    >> 2) Worse, tpu-extras is evil -- it redefines things like
    >> newline
    Stefan> Should be "fixed" now (it uses advice and only
    Stefan> activates it when needed).
    Stefan>
    Stefan>
    Stefan>         Stefan
    Stefan>
    Stefan>
    Stefan> _______________________________________________
    Stefan> emacs-pretest-bug mailing list
    Stefan> emacs-pretest-bug@...
    Stefan> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

--
Best Regards,
--raman

     
Email:  raman@...
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@...
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC:    irc://irc.freenode.net/#emacs

--
Best Regards,
--raman

     
Email:  raman@...
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@...
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC:    irc://irc.freenode.net/#emacs


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by Stefan Monnier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Just did a CVS update, and I still see the old version of
> tpu-extras  in the sources i.e. it defines newline.

I fixed it in the 22 branch, so it may take a few more days for it to get
merged into the trunk.


        Stefan


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by T. V. Raman-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


There is perhaps something I dont quite understand about the
Emacs CVS repos.

I'm using:
:pserver:anoncvs@...:/sources/emacs

and building this results in a version that calls itself
22.1.50.x -- is that a "branch" or a "trunk"?

Also, is there something newer called Emacs 23 in the CVS
repository that I could be using?

emacs


>>>>> "Stefan" == Stefan Monnier <monnier@...> writes:
    >> Just did a CVS update, and I still see the old version of
    >> tpu-extras in the sources i.e. it defines newline.
    Stefan>
    Stefan> I fixed it in the 22 branch, so it may take a few
    Stefan> more days for it to get merged into the trunk.
    Stefan>
    Stefan>
    Stefan>         Stefan
    Stefan>
    Stefan>
    Stefan> _______________________________________________
    Stefan> emacs-pretest-bug mailing list
    Stefan> emacs-pretest-bug@...
    Stefan> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


 Thanks,
 --Raman

--
Best Regards,
--raman

     
Email:  raman@...
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@...
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC:    irc://irc.freenode.net/#emacs


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by Kevin Rodgers-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stefan Monnier wrote:
>> 1) In using reflection, it ends up loading tpu-extras.el (even
>>    though I have no intention of using tpu)
>
> This is a problem in Emacspeak: it should not itself load packages.

Indeed.  Raman, compare the results of

        (functionp 'tpu-edt)
        (functionp (symbol-function 'tpu-edt))
        (functionp (indirect-function 'tpu-edt))

--
Kevin Rodgers
Denver, Colorado, USA



_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by T. V. Raman-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks for the tip!


>>>>> "Kevin" == Kevin Rodgers <kevin.d.rodgers@...> writes:
    Kevin> Stefan Monnier wrote:
    >>> 1) In using reflection, it ends up loading tpu-extras.el
    >>> (even though I have no intention of using tpu)
    >>
    >> This is a problem in Emacspeak: it should not itself load
    >> packages.
    Kevin>
    Kevin> Indeed.  Raman, compare the results of
    Kevin>
    Kevin> (functionp 'tpu-edt) (functionp (symbol-function
    Kevin> 'tpu-edt)) (functionp (indirect-function 'tpu-edt))
    Kevin>
    Kevin> -- Kevin Rodgers Denver, Colorado, USA
    Kevin>
    Kevin>
    Kevin>
    Kevin> _______________________________________________
    Kevin> emacs-pretest-bug mailing list
    Kevin> emacs-pretest-bug@...
    Kevin> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

--
Best Regards,
--raman

     
Email:  raman@...
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@...
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC:    irc://irc.freenode.net/#emacs


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by T. V. Raman-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


But here is the problem though:
How do I find out after having called (functionp sym)
and getting back T if the function is already loaded? I was using
symbol-function as a guard to make sure I only called
(interactive-form on true functions

>>>>> "Kevin" == Kevin Rodgers <kevin.d.rodgers@...> writes:
    Kevin> Stefan Monnier wrote:
    >>> 1) In using reflection, it ends up loading tpu-extras.el
    >>> (even though I have no intention of using tpu)
    >>
    >> This is a problem in Emacspeak: it should not itself load
    >> packages.
    Kevin>
    Kevin> Indeed.  Raman, compare the results of
    Kevin>
    Kevin> (functionp 'tpu-edt) (functionp (symbol-function
    Kevin> 'tpu-edt)) (functionp (indirect-function 'tpu-edt))
    Kevin>
    Kevin> -- Kevin Rodgers Denver, Colorado, USA
    Kevin>
    Kevin>
    Kevin>
    Kevin> _______________________________________________
    Kevin> emacs-pretest-bug mailing list
    Kevin> emacs-pretest-bug@...
    Kevin> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

--
Best Regards,
--raman

     
Email:  raman@...
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@...
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC:    irc://irc.freenode.net/#emacs


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Re: HowTo: Avoid packages like TPU

by T. V. Raman-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I think I finally got this right (I hope) someone please confirm
--
(I check (functionp (indirect-function sym))
before I do anything like calling interactive-form --
incidentally calling interactive-form was also automatically
loading files.

While debugging this, I also noticed that there is a problem with
cal-bahai.el (not a module I need to load anymore given that I
dont load anything unecessarily)--
but the problem if users of cal-bahai care is that functions like
insert-yearly-diary-entry for that module have some bizarre
naming problem.

>>>>> "tvr" == T V Raman <raman@...> writes:
    tvr> But here is the problem though: How do I find out after
    tvr> having called (functionp sym) and getting back T if the
    tvr> function is already loaded? I was using symbol-function
    tvr> as a guard to make sure I only called (interactive-form
    tvr> on true functions
    tvr>
    >>>>>> "Kevin" == Kevin Rodgers <kevin.d.rodgers@...>
    >>>>>> writes:
    Kevin> Stefan Monnier wrote:
    >>>> 1) In using reflection, it ends up loading tpu-extras.el
    >>>> (even though I have no intention of using tpu)
    >>>
    >>> This is a problem in Emacspeak: it should not itself load
    >>> packages.
    Kevin>
    Kevin> Indeed.  Raman, compare the results of
    Kevin>
    Kevin> (functionp 'tpu-edt) (functionp (symbol-function
    Kevin> 'tpu-edt)) (functionp (indirect-function 'tpu-edt))
    Kevin>
    Kevin> -- Kevin Rodgers Denver, Colorado, USA
    Kevin>
    Kevin>
    Kevin>
    Kevin> _______________________________________________
    Kevin> emacs-pretest-bug mailing list
    Kevin> emacs-pretest-bug@...
    Kevin> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
    tvr>
    tvr> -- Best Regards, --raman
    tvr>
    tvr>      
    tvr> Email: raman@... WWW:
    tvr> http://emacspeak.sf.net/raman/ AIM: emacspeak GTalk:
    tvr> tv.raman.tv@... PGP:
    tvr> http://emacspeak.sf.net/raman/raman-almaden.asc Google:
    tvr> tv+raman IRC: irc://irc.freenode.net/#emacs
    tvr>
    tvr>
    tvr> _______________________________________________
    tvr> emacs-pretest-bug mailing list emacs-pretest-bug@...
    tvr> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

--
Best Regards,
--raman

     
Email:  raman@...
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@...
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman
IRC:    irc://irc.freenode.net/#emacs


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@...
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug