all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* .emacs handling multiple versions
@ 2007-04-04 15:15 perldev
  2007-04-04 15:31 ` Kai Grossjohann
  2007-04-04 17:21 ` Peter Dyballa
  0 siblings, 2 replies; 5+ messages in thread
From: perldev @ 2007-04-04 15:15 UTC (permalink / raw)
  To: help-gnu-emacs

Hey, gang:

I'm running Carbon Emacs on OS X as my main emacs, thus my .emacs  
file has a bunch of carbon only hooks in it. However, sometimes I'll  
use the terminal emacs (shipped with OS X) and the .emacs file causes  
problems calling things that the terminal version can't handle. I'd  
like to keep the ability to use both... any suggestions for having  
the .emacs file know which version is calling it and respond  
accordingly?

Thanks so much for the help.

PS: I know I can forgo the .emacs file with "emacs -q", but most of  
my problems occur when some other application calls emacs  
automatically via the environmental $EDITOR....

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

* Re: .emacs handling multiple versions
  2007-04-04 15:15 perldev
@ 2007-04-04 15:31 ` Kai Grossjohann
  2007-04-04 17:21 ` Peter Dyballa
  1 sibling, 0 replies; 5+ messages in thread
From: Kai Grossjohann @ 2007-04-04 15:31 UTC (permalink / raw)
  To: help-gnu-emacs

IMVHO the best method is to check for the presence/absence of a
specific feature.

For example, if the problem is that sometimes a function doesn't
exist, then do

(when (fboundp 'foo)
  (foo ...))

Kai

"perldev@monkeybytes.org" <perldev@monkeybytes.org> writes:

> Hey, gang:
>
> I'm running Carbon Emacs on OS X as my main emacs, thus my .emacs file
> has a bunch of carbon only hooks in it. However, sometimes I'll  use
> the terminal emacs (shipped with OS X) and the .emacs file causes
> problems calling things that the terminal version can't handle. I'd
> like to keep the ability to use both... any suggestions for having
> the .emacs file know which version is calling it and respond
> accordingly?
>
> Thanks so much for the help.
>
> PS: I know I can forgo the .emacs file with "emacs -q", but most of my
> problems occur when some other application calls emacs  automatically
> via the environmental $EDITOR....

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

* Re: .emacs handling multiple versions
       [not found] <mailman.1747.1175699939.7795.help-gnu-emacs@gnu.org>
@ 2007-04-04 15:42 ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2007-04-04 15:42 UTC (permalink / raw)
  To: help-gnu-emacs

> I'm running Carbon Emacs on OS X as my main Emacs, thus my .emacs file has
> a bunch of carbon only hooks in it.  However, sometimes I'll use the
> terminal emacs (shipped with OS X) and the .emacs file causes problems
> calling things that the terminal version can't handle.

You can also use CarbonEmacs in a terminal, so you'll get the exact same
version in both cases.

> I'd like to keep the ability to use both... any suggestions for having
> the .emacs file know which version is calling it and respond accordingly?

Typically, you'll want to use things like (fboundp 'foo) to check whether
the function `foo' exists, before calling it.
Tell us more and we'll tell you more.


        Stefan

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

* Re: .emacs handling multiple versions
  2007-04-04 15:15 perldev
  2007-04-04 15:31 ` Kai Grossjohann
@ 2007-04-04 17:21 ` Peter Dyballa
  2007-04-04 18:12   ` perldev
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Dyballa @ 2007-04-04 17:21 UTC (permalink / raw)
  To: perldev@monkeybytes.org; +Cc: help-gnu-emacs


Am 04.04.2007 um 17:15 schrieb perldev@monkeybytes.org:

> I'm running Carbon Emacs on OS X as my main emacs, thus my .emacs  
> file has a bunch of carbon only hooks in it. However, sometimes  
> I'll use the terminal emacs (shipped with OS X) and the .emacs file  
> causes problems calling things that the terminal version can't  
> handle. I'd like to keep the ability to use both... any suggestions  
> for having the .emacs file know which version is calling it and  
> respond accordingly?

As Stefan already mentioned:

	/Applications/Emacs.app/Contents/MacOS/Emacs -nw

works as well! Use it with a shell alias or a shell function.

The other option is to check (compare) the emacs major version  
number. Apple's version of GNU Emacs without any windowing support is  
of version 21, the Carbon Emacsen are since some time of version 22:

	(cond ((< 21 emacs-major-version)
	    (progn
	      (message "This GNU Emacs is greater no. 21")
	      (some thing)
	    )
	      (some thing else, if needed)
	)

There are more conditionals.


Could be on Leopard, the coming Mac OS X 10.5, Apple's version of GNU  
Emacs will be 22. Then you could use emacs-minor-version.

There is also the symbol window-system. Without a windowing system  
it's nil, otherwise one of mac, ns, x11, or ? (don't know) for MS.

--
Greetings

   Pete

There's something the technicians need to learn from the artists. If  
it isn't aesthetically pleasing, it's probably wrong.

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

* Re: .emacs handling multiple versions
  2007-04-04 17:21 ` Peter Dyballa
@ 2007-04-04 18:12   ` perldev
  0 siblings, 0 replies; 5+ messages in thread
From: perldev @ 2007-04-04 18:12 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Ah... thanks for the tip. Setting EDITOR equal to this in my .cshrc  
resolved all problems... plus, terminal emacs is a much newer version  
now. Thanks!


> As Stefan already mentioned:
>
> 	/Applications/Emacs.app/Contents/MacOS/Emacs -nw
>
> works as well! Use it with a shell alias or a shell function.

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

end of thread, other threads:[~2007-04-04 18:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1747.1175699939.7795.help-gnu-emacs@gnu.org>
2007-04-04 15:42 ` .emacs handling multiple versions Stefan Monnier
2007-04-04 15:15 perldev
2007-04-04 15:31 ` Kai Grossjohann
2007-04-04 17:21 ` Peter Dyballa
2007-04-04 18:12   ` perldev

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.