Re: python-mode in emacs

2006-10-17 Thread Giorgos Keramidas
On 2006-10-17 02:20, Svein Halvor Halvorsen [EMAIL PROTECTED] wrote:
cpghost wrote:
 Well, it doesn't cause any harm to add to your ~/.emacs

 ;; Add python-mode
 (autoload 'python-mode python-mode Python editing mode. t)
 (setq auto-mode-alist
   (cons '(\\.py$ . python-mode) auto-mode-alist))
 (add-hook 'python-mode-hook 'turn-on-font-lock)

 Are there any way to get emacs to automatically read files in this
 directory? Am I missing something? Shouldn't the ports system by
 default be setup in a way that this would work?

 I don't know. But having Emacs auto-load every mode from there
 doesn't seem a good idea. And the port can't do that either, since
 it's a per-user decision.

 I wasn't suggesting emacs autoload every mode, but rather that emacs
 simply read the files, and offer me the choice of using modes defines
 in such files.

 E.g. do the same as
 $emacs -l /usr/local/share/emacs/site-lisp/python-mode.el

 If I start emacs by just typing emacs, and then use esc-x
 python-mode is not an option. However, If I use the -l option,
 python-mode is not automatically loaded, but emacs will then offer me
 the option of loading it later.

 Your suggested additions to my .emacs file, seems to work, though.

The newer versions of GNU Emacs include `python-mode' in the core Emacs
distribution, so you might want to try the editors/emacs-devel port :)

The distfiles of this port are generated from CVS snapshots of Emacs
22.X, which is going to be the next release of GNU Emacs.  This version
of Emacs still has a few rough edges (i.e. the GTK+ UI crashes on
FreeBSD 7.0-CURRENT), but it has worked remarkably well for several
months here.

If you give it a try, please let me know, as all the testing we can get
is nice.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: python-mode in emacs

2006-10-17 Thread Giorgos Keramidas
On 2006-10-17 00:21, Alex Zbyslaw [EMAIL PROTECTED] wrote:
 Svein Halvor Halvorsen wrote:
 Emacs doesn't seem to load files in /usr/local/share/emacs/site-lisp
 installed by ports. [...]

 In emacs do ESC-x describe-variable load-path which tells you where 
 emacs is looking.  Mine is
 
 (/usr/local/share/emacs/21.3/site-lisp 
 /usr/local/share/emacs/site-lisp /usr/local/share/emacs/21.3/leim 
 /usr/local/share/emacs/21.3/lisp 
 /usr/local/share/emacs/21.3/lisp/toolbar 
 /usr/local/share/emacs/21.3/lisp/textmodes 
 /usr/local/share/emacs/21.3/lisp/progmodes 
 /usr/local/share/emacs/21.3/lisp/play 
 /usr/local/share/emacs/21.3/lisp/obsolete 
 /usr/local/share/emacs/21.3/lisp/net 
 /usr/local/share/emacs/21.3/lisp/mail 
 /usr/local/share/emacs/21.3/lisp/language 
 /usr/local/share/emacs/21.3/lisp/international 
 /usr/local/share/emacs/21.3/lisp/gnus 
 /usr/local/share/emacs/21.3/lisp/eshell 
 /usr/local/share/emacs/21.3/lisp/emulation 
 /usr/local/share/emacs/21.3/lisp/emacs-lisp 
 /usr/local/share/emacs/21.3/lisp/calendar)
 
 and as you can see second entry is /usr/local/share/emacs/site-lisp
 
 Assuming it is missing for you, then you could add something like this 
 to your .emacs
 
 (set-variable 'load-path (append '(/usr/local/share/emacs/site-lisp) 
 load-path))
 
 but that sticks it at the end, so anything there won't override 
 defaults, which is not so good.

FWIW, one way to add a path to the beginning of the `load-path' list is:

(add-to-list 'load-path /usr/local/share/emacs/site-lisp)

The `add-to-list' function can also append stuff to a list by:

(add-to-list 'load-path /usr/local/share/emacs/site-lisp t)

See the documentation of `add-to-list' for more details :)

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: python-mode in emacs

2006-10-16 Thread cpghost
On Tue, Oct 17, 2006 at 12:56:01AM +0200, Svein Halvor Halvorsen wrote:
 Emacs doesn't seem to load files in /usr/local/share/emacs/site-lisp
 installed by ports. E.g python-mode installs files in this directory,
 but python-mode is not available in emacs afterwards. I have to manually
 tell emacs to look in these files.

Well, it doesn't cause any harm to add to your ~/.emacs

;; Add python-mode
(autoload 'python-mode python-mode Python editing mode. t)
(setq auto-mode-alist
  (cons '(\\.py$ . python-mode) auto-mode-alist))
(add-hook 'python-mode-hook 'turn-on-font-lock)

 Are there any way to get emacs to automatically read files in this
 directory? Am I missing something? Shouldn't the ports system by default
 be setup in a way that this would work?

I don't know. But having Emacs auto-load every mode from there
doesn't seem a good idea. And the port can't do that either, since
it's a per-user decision.

   Svein Halvor

Regards,
-cpghost.

-- 
Cordula's Web. http://www.cordula.ws/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: python-mode in emacs

2006-10-16 Thread Alex Zbyslaw

Svein Halvor Halvorsen wrote:


Emacs doesn't seem to load files in /usr/local/share/emacs/site-lisp
installed by ports. E.g python-mode installs files in this directory,
but python-mode is not available in emacs afterwards. I have to manually
tell emacs to look in these files.

Are there any way to get emacs to automatically read files in this
directory? Am I missing something? Shouldn't the ports system by default
be setup in a way that this would work?


My emacs compiled out of ports does look in that directory by default.

In emacs do ESC-x describe-variable load-path which tells you where 
emacs is looking.  Mine is


(/usr/local/share/emacs/21.3/site-lisp 
/usr/local/share/emacs/site-lisp /usr/local/share/emacs/21.3/leim 
/usr/local/share/emacs/21.3/lisp 
/usr/local/share/emacs/21.3/lisp/toolbar 
/usr/local/share/emacs/21.3/lisp/textmodes 
/usr/local/share/emacs/21.3/lisp/progmodes 
/usr/local/share/emacs/21.3/lisp/play 
/usr/local/share/emacs/21.3/lisp/obsolete 
/usr/local/share/emacs/21.3/lisp/net 
/usr/local/share/emacs/21.3/lisp/mail 
/usr/local/share/emacs/21.3/lisp/language 
/usr/local/share/emacs/21.3/lisp/international 
/usr/local/share/emacs/21.3/lisp/gnus 
/usr/local/share/emacs/21.3/lisp/eshell 
/usr/local/share/emacs/21.3/lisp/emulation 
/usr/local/share/emacs/21.3/lisp/emacs-lisp 
/usr/local/share/emacs/21.3/lisp/calendar)


and as you can see second entry is /usr/local/share/emacs/site-lisp

Assuming it is missing for you, then you could add something like this 
to your .emacs


(set-variable 'load-path (append '(/usr/local/share/emacs/site-lisp) 
load-path))


but that sticks it at the end, so anything there won't override 
defaults, which is not so good.


Make sure you environment does not set EMACSLOADPATH which would 
override compile-time defaults.


hth,

--Alex





___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: python-mode in emacs

2006-10-16 Thread Svein Halvor Halvorsen
cpghost wrote:
 Well, it doesn't cause any harm to add to your ~/.emacs
 
 ;; Add python-mode
 (autoload 'python-mode python-mode Python editing mode. t)
 (setq auto-mode-alist
   (cons '(\\.py$ . python-mode) auto-mode-alist))
 (add-hook 'python-mode-hook 'turn-on-font-lock)
 
 Are there any way to get emacs to automatically read files in this
 directory? Am I missing something? Shouldn't the ports system by default
 be setup in a way that this would work?
 
 I don't know. But having Emacs auto-load every mode from there
 doesn't seem a good idea. And the port can't do that either, since
 it's a per-user decision.

I wasn't suggesting emacs autoload every mode, but rather that emacs
simply read the files, and offer me the choice of using modes defines in
such files.

E.g. do the same as
$emacs -l /usr/local/share/emacs/site-lisp/python-mode.el

If I start emacs by just typing emacs, and then use esc-x
python-mode is not an option. However, If I use the -l option,
python-mode is not automatically loaded, but emacs will then offer me
the option of loading it later.


Your suggested additions to my .emacs file, seems to work, though.


Svein Halvor



signature.asc
Description: OpenPGP digital signature


Re: python-mode in emacs

2006-10-16 Thread Svein Halvor Halvorsen
Alex Zbyslaw wrote:
 In emacs do ESC-x describe-variable load-path which tells you where
 emacs is looking.

/usr/local/share/emacs/site-lisp shows up!

 Make sure you environment does not set EMACSLOADPATH which would
 override compile-time defaults.

This is not set.

Svein Halvor



signature.asc
Description: OpenPGP digital signature