* [sisyphus] GNU emacs load-path variable: How it works
@ 2003-03-11 17:38 Pavel S. Khmelinsky
2003-03-11 17:52 ` [sisyphus] " Sergey Vlasov
0 siblings, 1 reply; 3+ messages in thread
From: Pavel S. Khmelinsky @ 2003-03-11 17:38 UTC (permalink / raw)
To: sisyphus
В мастере есть емакс, к нему есть дополнения, например ecb. РПМка с
дополнением содержит в себе файл, который прописывается в
/etc/emacs/site-start.d для инициализации данного дополнения на стадии
старта емакса. Часто этот файл просто содержит что-то вроде
(setq load-path (append load-path
'("<path_to_elcs_files_to_load_on_start")))
Т.е. добавляет папку с файлами дополнения в переменную load-path,
которая, по идее, должна использоваться для нахождения папок в которых
хранятся файлы для загрузки их на стадии старта емакса.
Теперь берем конкретный пакет emacs-ecb. Смотрим:
[hmepas@localhost hmepas]$ rpm -ql emacs-ecb
/etc/emacs/site-start.d/ecb.el <----------
ага тот самый файл для инициализации
/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
<skiped>
/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/
Но, как мне видится, это не самый изящный способ.
Может кто меня просветлит? Я вообще с емаксом только начал разбираться,
может чего очевидного не вижу?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [sisyphus] Re: GNU emacs load-path variable: How it works
2003-03-11 17:38 [sisyphus] GNU emacs load-path variable: How it works Pavel S. Khmelinsky
@ 2003-03-11 17:52 ` Sergey Vlasov
2003-03-11 17:59 ` Pavel S. Khmelinsky
0 siblings, 1 reply; 3+ messages in thread
From: Sergey Vlasov @ 2003-03-11 17:52 UTC (permalink / raw)
To: sisyphus
On Tue, 11 Mar 2003 20:38:13 +0300
"Pavel S. Khmelinsky" <hmepas@yauza.ru> wrote:
> Смотрим в /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 -- команда не найдена.
Всё правильно - чтобы находились команды, одной настройки load-path
недостаточно; нужно либо сразу загрузить соответствующий файл через
(require 'ecb), либо использовать autoload. В README от ecb всё
написано.
Кстати, возможно, эти autoload всё-таки стоит занести в
/etc/emacs/site-start.d/ecb.el ?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [sisyphus] Re: GNU emacs load-path variable: How it works
2003-03-11 17:52 ` [sisyphus] " Sergey Vlasov
@ 2003-03-11 17:59 ` Pavel S. Khmelinsky
0 siblings, 0 replies; 3+ messages in thread
From: Pavel S. Khmelinsky @ 2003-03-11 17:59 UTC (permalink / raw)
To: sisyphus
Sergey Vlasov wrote:
>On Tue, 11 Mar 2003 20:38:13 +0300
>"Pavel S. Khmelinsky" <hmepas@yauza.ru> wrote:
>
>
>
>>Смотрим в /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 -- команда не найдена.
>>
>>
>
>Всё правильно - чтобы находились команды, одной настройки load-path
>недостаточно; нужно либо сразу загрузить соответствующий файл через
>(require 'ecb), либо использовать autoload. В README от ecb всё
>написано.
>
>
Big Thanx!
>Кстати, возможно, эти autoload всё-таки стоит занести в
>/etc/emacs/site-start.d/ecb.el ?
>
Мдя, новичками вроде меня это облегчило бы жизнь.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-03-11 17:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-11 17:38 [sisyphus] GNU emacs load-path variable: How it works Pavel S. Khmelinsky
2003-03-11 17:52 ` [sisyphus] " Sergey Vlasov
2003-03-11 17:59 ` Pavel S. Khmelinsky
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