ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: "Pavel S. Khmelinsky" <hmepas@yauza.ru>
To: community@altlinux.ru
Subject: [Comm] GNU emacs load-path variable: How it works
Date: Tue, 11 Mar 2003 01:33:50 +0300
Message-ID: <3E6D12CE.9050301@yauza.ru> (raw)

В мастере есть емакс, к нему есть дополнения, например 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/

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

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



                 reply	other threads:[~2003-03-10 22:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3E6D12CE.9050301@yauza.ru \
    --to=hmepas@yauza.ru \
    --cc=community@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 Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/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 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

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


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