[comp.emacs] GNU emacs on a 3B2

rjk@mrstve.UUCP (Richard Kuhns) (10/15/87)

I've got 2 problems running GNU emacs on a 3B2/400, System V Rel 3.1,
4 MB RAM, and I'd greatly appreciate some help.

First, substitute-command-keys doesn't work -- the only character it
can substitute is RET (meaning, where I should normally get
`C-X 4 B RET', all that comes out is RET).

Second, rnews always thinks I have no unread news.  I downloaded
v18.41 several months ago, and it has run perfectly except for the
above problems.  I've just finished getting & installing the diffs
to bring it up to 18.49.  substitute-command-keys still works (actually,
doesn't work) the same, and rnews wouldn't run at all -- it informed me
that push didn't have a function definition.  I defined push as follows:

(defun push (item ref) (setq ref (cons item ref)))

which let rnews run -- it just once again informed me that I had no unread
news.  Rn still thinks I have plenty of unread news (I can't keep up).
I always save a copy of my .newsrc before experimenting with rnews, tho
that hasn't been a problem yet -- since I never read any news, emacs
says `no changes to write' after it finishes `updating' my .newsrc.

Any help would be greatly appreciated.

By the way -- rmail works perfectly...
-- 
				       !pur-ee!pur-phy!mrstve!rjk
Rich Kuhns	{ihnp4, decvax, etc...}
				       !itivax!mrstve!rjk

lewis@rocky.STANFORD.EDU (Bil Lewis) (10/15/87)

Posting-Front-End: GNU Emacs 18.36.1 of Fri Feb  6 1987 on rocky (berkeley-unix)



R,

  Re: your second point.

  Sure enough, your definition wouldn't work too well.  Consider:

(defun push (item ref) (setq ref (cons item ref)))
=> push
(setq foo nil)
=> nil
(push 5 foo)
=> (5)
foo
=> nil


	What you've actually done is change the value of the locally
bound variable ref.  What you WANT is to change foo.  push must be a
macro.  It's actually defined in cl.el, but here's a simple def:

(defmacro push (item ref) (list 'setq ref (list 'cons item ref)))
=> push
(push 5 foo)
==> (setq foo (cons 5 foo))
=> (5)
foo
=> (5)


  Right?

  Now, the REAL question, why doesn't the def of push get loaded?  Well,
what you have to do is to compile rnews.el with the definition of push
loaded.  Afterwards, when the compiled file is loaded, push will already
be expanded, so you won't need the definition of push around.  Got
that?

(load-file "cl.el")
(byte-compile-file "rnews.el")

ought to do the trick.

-Bil
-- 

lewis@rocky.STANFORD.EDU (Bil Lewis) (10/16/87)

Posting-Front-End: GNU Emacs 18.36.1 of Fri Feb  6 1987 on rocky (berkeley-unix)



As to your first problem, substitute-command-keys.  Are you quite sure?
It is not a normal thing for a user to call.  Check out the examples
below & be certain that they REALLY don't work.


@defun substitute-command-keys string 
  This function returns @var{string} with modifications made to allow
documentation messages to contain information about the current key
bindings.  (The key bindings may change between the time Emacs is
built and the time that the documentation is asked for.)

 Substrings of the form \[@var{COMMAND}] replaced by either:

@itemize

@item
a keystroke sequence that will invoke @var{COMMAND}

@item
@code{M-x @var{COMMAND}} if @var{COMMAND} is not bound to a key sequence.

@end itemize

  Substrings of the form \{@var{MAPVAR}} are replaced by summaries (made by
@code{describe-bindings}) of the value of @var{MAPVAR}, taken as a keymap.

  Substrings of the form \<@var{MAPVAR}> make
@code{substitute-command-keys} use the value of @var{MAPVAR} as the keymap
for future [@var{COMMAND}] substrings. @refill

@example
(substitute-command-keys "
To move forward one character type:
  \\[forward-char]")
=> "
To move forward one character type:
  C-f"

(substitute-command-keys "
To read news, type: \\[rnews]")
=> "
To read news, type: M-x rnews"

(substitute-command-keys "
The keys which are defined for the minibuffer here are:
  \\{minibuffer-local-must-match-map}")
=> "
The keys which are defined for the minibuffer here are:
  
?               minibuffer-completion-help
SPC             minibuffer-complete-word
TAB             minibuffer-complete
LFD             minibuffer-complete-and-exit
RET             minibuffer-complete-and-exit
C-g             abort-recursive-edit
"

"

(substitute-command-keys "
To abort a recursive edit, type:
\\[abort-recursive-edit]")
=> "
To abort a recursive edit, type:
C-]"

(substitute-command-keys "
To abort a recursive edit from the minibuffer, type
    \\<minibuffer-local-must-match-map>
    \\[abort-recursive-edit]")
=> "
To abort a recursive edit from the minibuffer, type
    
    C-g"


@end example
@end defun



-Bil
-- 

storm@ambush.UUCP (Kim F. Storm) (10/22/87)

In article <806@mrstve.UUCP> rjk@mrstve.UUCP (Richard Kuhns) writes:

>I've got 2 problems running GNU emacs on a 3B2/400, System V Rel 3.1,
>4 MB RAM, and I'd greatly appreciate some help.

>First, substitute-command-keys doesn't work -- the only character it
>can substitute is RET (meaning, where I should normally get
>`C-X 4 B RET', all that comes out is RET).

My guess is that you have compiled GNU with "cc -O " which among other
problems causes substitute-command-keys to behave exactly as you describe.

Be shure that C_OPTIMIZE_SWITCH is defined to *nothing* in m-att3b.h, and
that you don't change it elsewhere.  To quote from m-att3b.h:

	-O has been observed to make correct C code in Emacs not work.
	So don't try to use it. 

When I got issue 4 of the 3B2 C compiler, I tried it anyway to see if the 
problems had gone away, but NO LUCK:

I got the problem you describe, and many others of a similar kind.

I tracked most of these problems (including yours) to the function
'mapconcat' which did not work, but I never figured out why (except
that it seems that nargs == -1, but ...).


Another effect of using -O was that the command-history contains a meaningless
expression like

	((eval-expression (quote eval-expression)) ...)

which I don't think I ever tracked down (perhaps it was mapconcat as well?).


Any comments from AT&T ?

--
Kim F. Storm, storm@ambush.uucp (or ..!mcvax!diku!ambush!storm)
AmbraSoft A/S, Rojelskaer 15, DK-2840 Holte, Denmark.  tel: +45 2424 111

dougm@ico.UUCP (Doug McCallum) (10/25/87)

In article <535@ambush.UUCP> storm@ambush.UUCP (Kim F. Storm) writes:
>In article <806@mrstve.UUCP> rjk@mrstve.UUCP (Richard Kuhns) writes:
>
...
>
>I tracked most of these problems (including yours) to the function
>'mapconcat' which did not work, but I never figured out why (except
>that it seems that nargs == -1, but ...).
>
>
>Another effect of using -O was that the command-history contains a meaningless
>expression like

I've seen the same problem on V.3 on a 386.  If the file fns.c is compiled
with -O, the problem is seen (on 18.40 but not 18.44).  What is happening
is that the call to Fconcat in mapconcat is getting expanded inline to
a direct call to concat.  During the expansion, the optimizer is blowing
the stack.  At least this is what happens on the 386 compiler.  This sounds
like a generic RCC optimizer bug.