ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: "Pavel S. Khmelinsky" <hmepas@yauza.ru>
To: sisyphus@altlinux.ru
Subject: [sisyphus] GNU emacs load-path variable: How it works
Date: Tue, 11 Mar 2003 20:36:06 +0300
Message-ID: <3E6E1E86.7000905@yauza.ru> (raw)


В мастере есть емакс, к нему есть дополнения, например ecb. РПМка с 
дополнением содержит в себе файл, который прописывается в 
/etc/emacs/site-start.d для инициализации данного дополнения на стадии 
старта емакса. Часто этот файл просто содержит что-то вроде
(setq load-path (append load-path 
'("<---------- 
ага тот самый файл для инициализации
/usr/share/doc/emacs-ecb-1.80
/usr/share/doc/emacs-ecb-1.80/HISTORY
/usr/share/doc/emacs-ecb-1.80/README
/usr/share/doc/emacs-ecb-1.80/RELEASE_NOTES
/usr/share/doc/emacs-ecb-1.80/ecb.html
/usr/share/emacs/site-lisp/ecb/ecb-buffertab.elc

/usr/share/emacs/site-lisp/ecb/ecb.elc
/usr/share/emacs/site-lisp/ecb/tree-buffer.elc
/usr/share/info/ecb.info.bz2


Заглядываем  в README этого пакета, видим там строчки
____________________________________
You MUST add the ECB-install-directory to the 'load-path' either by
   changing the 'load-path' variable directly in your .emacs or
   site-lisp/site-start.el or by working with a file subdirs.el.
________________________________________

Ага, это подтверждает мою гипотезу о переменной load-path. Вроде как 
добавим /usr/share/emacs/site-lisp/ecb в load-path и все у нас будет 
работать.
Смотрим в /etc/emacs/site-start.d/ecb.el :
(setq load-path (append load-path '("/usr/share/emacs/site-lisp/ecb")))

Т.е. работать все должно из коробки, переменная сама добавляется 
стартовым скриптом.

Заходим в емакс, набираем C-h v load-path , и среди прочих директорий 
действительно видим нашу /usr/share/emacs/site-lisp/ecb . Что опять же 
доказывает то что все установленно правильно, 
/etc/emacs/site-start.d/ecb.el в момент старта отработал, переменную 
load-path настроил.

Набираем M-x ecb-activate -- команда не найдена.
Пробуем
M-x load-file /usr/share/emacs/site-lisp/ecb/ecb.elc
M-x ecb-activate
получаем то что хотели. Выходит файлы из /usr/share/emacs/site-lisp/ecb 
не были загружены? Тогда зачем нужна эта переменная? И как вообще тогда 
работает добавление доп. пакетов?

И все бы хорошо, да вот в том же README написано что способ загрузки a 
la load-file /usr/share/emacs/site-lisp/ecb/ecb.elc не правелен и надо 
настраивать именно через load-path.....

Можно конечно в .emacs или тот же /etc/emacs/site-start.d/ecb.el добавить
(load "/usr/share/emacs/site-lisp/ecb/ecb.elc")
(load "/usr/share/emacs/site-lisp/ecb/ecb-buffertab.elc")
(load "/usr/share/emacs/site-lisp/ecb/ecb-compilation.elc")
и т.д все файлы из /usr/share/emacs/site-lisp/ecb/

Но, как мне видится, это не самый изящный способ.

Может кто меня просветлит? Я вообще с емаксом только начал разбираться, 
может чего очевидного не вижу?

_______________________________________________
Community mailing list
Community@altlinux.ru
http://www.altlinux.ru/mailman/listinfo/community






             reply	other threads:[~2003-03-11 17:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-11 17:36 Pavel S. Khmelinsky [this message]
2003-03-11 17:44 ` Pavel S. Khmelinsky
2003-03-12  9:58 ` Alex Ott
2003-03-12 13:37   ` [sisyphus] " Sergey Vlasov
2003-03-12 13:43     ` Alex Ott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E6E1E86.7000905@yauza.ru \
    --to=hmepas@yauza.ru \
    --cc=sisyphus@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git