unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9481: 24.0.50; emacs_dir behavior too cumbersome for use within msys
@ 2011-09-12  8:01 CRLF0710
  2011-09-12  8:36 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: CRLF0710 @ 2011-09-12  8:01 UTC (permalink / raw)
  To: 9481

Hello.

emacs_dir is a special environment variable on Win32. If Emacs.exe is
located in a "bin/" directory, it will be calculated, which is not a
desired behavior at all times.

One might want to use it in msys and organize the emacs files in a way
similiar to that of *nix systems. To fulfill this, one might want to
set emacs_dir to the *:/share/emacs/<version>/ directory. This works
unless the emacs.exe is in the *:/bin directory(in fact any directory
which is not with the name "bin" or "i386").

in src/w32.c, the existing code

>  _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname);
>  _putenv (strdup (buf));

will override this settings directly, but i think to modify the
env_vars[] array, which is a copy of dflt_envvars[],
should be the correct behavior.

something like:
>    for (i = 0; i < N_ENV_VARS; i++)
>    {
>      if(strcmp(env_vars[i].name, "emacs_dir")==0)
>      {
>        env_vars[i].def_value = <somewhere on stack>;
>      }
>    }
may solve this.

In GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7601)
 of 2011-04-11 on SHAN-PC
Windowing system distributor `Microsoft Corp.', version 6.1.7601
configured using `configure --with-gcc (3.4)'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: CHS
  value of $XMODIFIERS: nil
  locale-coding-system: cp936
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  recentf-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o <tab> r t - e m <tab> b <tab> <return>

Recent messages:
Loading recentf...done
Loading d:/home/CrLFWorkshop/.recentf...done
Cleaning up the recentf list...done (0 removed)
Ido mode enabled
Loading d:/progra~1/emacs/site-lisp/proofgeneral/generic/proof-site.el
(source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Load-path shadows:
d:/Program Files/Emacs/site-lisp/emacs-jabber-0.8.0/compat/sha1 hides
d:/Program Files/Emacs/lisp/sha1
d:/Program Files/Emacs/site-lisp/emacs-jabber-0.8.0/compat/hex-util
hides d:/Program Files/Emacs/lisp/hex-util
d:/Program Files/Emacs/site-lisp/emms/tq hides d:/Program
Files/Emacs/lisp/emacs-lisp/tq
d:/Program Files/Emacs/site-lisp/emacs-w3m/attic/rfc2368 hides
d:/Program Files/Emacs/lisp/mail/rfc2368

Features:
(shadow mail-extr message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev
mail-utils gmm-utils mailheader emacsbug help-mode view multi-term term
ehelp electric proof-site proof-autoloads pg-vars lyric-mode
emms-bookmarks emms-lastfm-client emms-lastfm-scrobbler w3m doc-view
jka-compr image-mode timezone w3m-hist w3m-fb bookmark-w3m w3m-ems
w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util xml parse-time
emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort
emms-last-played emms-player-xine emms-player-mpd tq emms-playing-time
emms-streams emms-tag-editor format-spec emms-info-metaflac emms-mark
emms-mode-line emms-cache emms-info-ogginfo emms-info-mp3info emms-info
later-do emms-playlist-mode emms-player-vlc emms-player-mplayer
emms-source-playlist emms-lyrics emms-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-util url-parse
auth-source eieio assoc gnus-util password-cache url-vars mm-util
mail-prsvr mailcap time-date emms-source-file locate dired
emms-player-simple hl-line emms-setup emms emms-compat jabber-autoloads
anything warnings ido inferior-slime inf-lisp info-look info
slime-autodoc advice advice-preload slime-parse slime-autoloads slime
byte-opt bytecomp byte-compile cconv macroexp derived help-fns edmacro
kmacro easy-mmode hideshow pp comint ring hyperspec thingatpt browse-url
cl cc-mode cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs regexp-opt recentf tree-widget wid-edit easymenu
cus-start cus-load china-util tooltip ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer button faces cus-face files
text-properties overlay md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process multi-tty
emacs)
--
Wir müssen wissen; wir werden wissen!
CrLF.0710





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

* bug#9481: 24.0.50; emacs_dir behavior too cumbersome for use within msys
  2011-09-12  8:01 bug#9481: 24.0.50; emacs_dir behavior too cumbersome for use within msys CRLF0710
@ 2011-09-12  8:36 ` Eli Zaretskii
       [not found]   ` <CAE1rE+H9fcaZj+XUvy6+rxMg5nv4iAf_nMMM88SJG1ON6GWeUQ@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2011-09-12  8:36 UTC (permalink / raw)
  To: CRLF0710; +Cc: 9481

> From: CRLF0710 <crlf0710@gmail.com>
> Date: Mon, 12 Sep 2011 16:01:44 +0800
> 
> emacs_dir is a special environment variable on Win32. If Emacs.exe is
> located in a "bin/" directory, it will be calculated, which is not a
> desired behavior at all times.
> 
> One might want to use it in msys and organize the emacs files in a way
> similiar to that of *nix systems. To fulfill this, one might want to
> set emacs_dir to the *:/share/emacs/<version>/ directory. This works
> unless the emacs.exe is in the *:/bin directory(in fact any directory
> which is not with the name "bin" or "i386").

Sorry, I don't follow your use case and the problems you are
experiencing due to the setting of emacs_dir.  Please describe in more
details:

  . in which directory you want to install the emacs.exe binary
  . why do you need to break the structure of the Emacs tree that is
    assumed by the current code
  . what does this all have to do with MSYS

IOW, this installation should work:

   X:/share/emacs/<version>/bin/emacs.exe
   X:/share/emacs/<version>/lisp/
   X:/share/emacs/<version>/etc/

This should also work:

   X:/usr/local/bin/emacs.exe
   X:/share/emacs/<version>/lisp/
   X:/share/emacs/<version>/etc/
   set EMACSLOADPATH=X:/share/emacs/<version>/lisp
   set EMACSDATA=X:/share/emacs/<version>/etc
   set EMACSDOC=X:/share/emacs/<version>/etc

Both of the above should work without any need to change anything in
the code.

If you need some different configuration, please describe it and the
rationale for using it rather than the supported ones.

Thanks.





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

* bug#9481: Fwd: bug#9481: 24.0.50; emacs_dir behavior too cumbersome for use within msys
       [not found]   ` <CAE1rE+H9fcaZj+XUvy6+rxMg5nv4iAf_nMMM88SJG1ON6GWeUQ@mail.gmail.com>
@ 2011-09-12  9:15     ` CRLF0710
  2011-09-12 10:40       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: CRLF0710 @ 2011-09-12  9:15 UTC (permalink / raw)
  To: 9481

---------- Forwarded message ----------
From: CRLF0710 <crlf0710@gmail.com>
Date: 2011/9/12
Subject: Re: bug#9481: 24.0.50; emacs_dir behavior too cumbersome for
use within msys
To: Eli Zaretskii <eliz@gnu.org>


What i met is exactly the second case, however one of the environment
variables should be(according to the code):

set EMACSLOADPATH=X:/share/emacs/<version>/site-lisp;X:/share/emacs/<version>/../site-lisp;X:/share/emacs/<version>/lisp;X:/share/emacs/<version>/leim

And with the other two paths, I'll have to repeat the string
"X:/share/emacs/<version>" for six times, by hand. which is exactly
the emacs_dir variable.

"addpm.exe" won't help in this case because it will generate incorrect
path variables in the registry which will be overridden by the code i
mentioned above. At the same time it will overwrite old settings.

So this is a little inconvenient. If you think this case is not TOO
rare, maybe you can consider fixing it from the code?


2011/9/12 Eli Zaretskii <eliz@gnu.org>:
>> From: CRLF0710 <crlf0710@gmail.com>
>> Date: Mon, 12 Sep 2011 16:01:44 +0800
>>
>> emacs_dir is a special environment variable on Win32. If Emacs.exe is
>> located in a "bin/" directory, it will be calculated, which is not a
>> desired behavior at all times.
>>
>> One might want to use it in msys and organize the emacs files in a way
>> similiar to that of *nix systems. To fulfill this, one might want to
>> set emacs_dir to the *:/share/emacs/<version>/ directory. This works
>> unless the emacs.exe is in the *:/bin directory(in fact any directory
>> which is not with the name "bin" or "i386").
>
> Sorry, I don't follow your use case and the problems you are
> experiencing due to the setting of emacs_dir.  Please describe in more
> details:
>
>  . in which directory you want to install the emacs.exe binary
>  . why do you need to break the structure of the Emacs tree that is
>    assumed by the current code
>  . what does this all have to do with MSYS
>
> IOW, this installation should work:
>
>   X:/share/emacs/<version>/bin/emacs.exe
>   X:/share/emacs/<version>/lisp/
>   X:/share/emacs/<version>/etc/
>
> This should also work:
>
>   X:/usr/local/bin/emacs.exe
>   X:/share/emacs/<version>/lisp/
>   X:/share/emacs/<version>/etc/
>   set EMACSLOADPATH=X:/share/emacs/<version>/lisp
>   set EMACSDATA=X:/share/emacs/<version>/etc
>   set EMACSDOC=X:/share/emacs/<version>/etc
>
> Both of the above should work without any need to change anything in
> the code.
>
> If you need some different configuration, please describe it and the
> rationale for using it rather than the supported ones.
>
> Thanks.
>



--
Wir müssen wissen; wir werden wissen!
CrLF.0710





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

* bug#9481: Fwd: bug#9481: 24.0.50; emacs_dir behavior too cumbersome for use within msys
  2011-09-12  9:15     ` bug#9481: Fwd: " CRLF0710
@ 2011-09-12 10:40       ` Eli Zaretskii
  2011-09-12 11:27         ` CRLF0710
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2011-09-12 10:40 UTC (permalink / raw)
  To: CRLF0710; +Cc: 9481

> From: CRLF0710 <crlf0710@gmail.com>
> Date: Mon, 12 Sep 2011 17:15:46 +0800
> 
> What i met is exactly the second case, however one of the environment
> variables should be(according to the code):
> 
> set EMACSLOADPATH=X:/share/emacs/<version>/site-lisp;X:/share/emacs/<version>/../site-lisp;X:/share/emacs/<version>/lisp;X:/share/emacs/<version>/leim
> 
> And with the other two paths, I'll have to repeat the string
> "X:/share/emacs/<version>" for six times, by hand. which is exactly
> the emacs_dir variable.

You set these variables in some startup script or in .bash_rc, and
that's it.  It's a one-time thing.

> So this is a little inconvenient. If you think this case is not TOO
> rare, maybe you can consider fixing it from the code?

I don't mind adding something, but what you originally suggested is a
non-starter, because the current operation with forceful setting of
emacs_dir must stay, as most users need it.  You cannot blindly obey
an external setting of emacs_dir, because it could come from an
incompatible Emacs version, e.g., if one version of Emacs spawns a
shell that then runs another version.

So if you can suggest a way that leaves the emacs_dir variable alone,
but still lets you do what you want more conveniently, please do.
Personally, I don't think that setting 3 environment variables is such
a grave problem, but that's me.

By the way, you didn't tell why you need this configuration and what
does it have to do with MSYS.





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

* bug#9481: Fwd: bug#9481: 24.0.50; emacs_dir behavior too cumbersome for use within msys
  2011-09-12 10:40       ` Eli Zaretskii
@ 2011-09-12 11:27         ` CRLF0710
  2011-09-12 11:58           ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: CRLF0710 @ 2011-09-12 11:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 9481

Yeah, I guess you are right.

I thought about adding a parameter to addpm.exe that enables resolving
%emacs_dir% to the program_path parameter provided before writing to
the registry. Then i thought maybe this is too much unnecessary.

By the way, the reason i need this configuration is just because i
want to create a personal package that follows the *nix habit. (So
that i can run /usr/bin/emacs and work under Win32 in the familiar
way. That's what msys and cygwin and similar environment provide. )
When i saw %emacs_dir%, i thought this was not reasonable at the time.
Now i understand the reason. Maybe i'll drop the entire directory to
/usr/local.

Anyway, thank you for your time.

2011/9/12 Eli Zaretskii <eliz@gnu.org>:
-- 
Wir müssen wissen; wir werden wissen!
CrLF.0710





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

* bug#9481: Fwd: bug#9481: 24.0.50; emacs_dir behavior too cumbersome for use within msys
  2011-09-12 11:27         ` CRLF0710
@ 2011-09-12 11:58           ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2011-09-12 11:58 UTC (permalink / raw)
  To: CRLF0710; +Cc: 9481-done

> From: CRLF0710 <crlf0710@gmail.com>
> Date: Mon, 12 Sep 2011 19:27:04 +0800
> Cc: 9481@debbugs.gnu.org
> 
> By the way, the reason i need this configuration is just because i
> want to create a personal package that follows the *nix habit. (So
> that i can run /usr/bin/emacs and work under Win32 in the familiar
> way. That's what msys and cygwin and similar environment provide. )
> When i saw %emacs_dir%, i thought this was not reasonable at the time.
> Now i understand the reason. Maybe i'll drop the entire directory to
> /usr/local.

You could also make a symlink, if MSYS supports them.

> Anyway, thank you for your time.

You are welcome.  Closing the bug.





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

end of thread, other threads:[~2011-09-12 11:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-12  8:01 bug#9481: 24.0.50; emacs_dir behavior too cumbersome for use within msys CRLF0710
2011-09-12  8:36 ` Eli Zaretskii
     [not found]   ` <CAE1rE+H9fcaZj+XUvy6+rxMg5nv4iAf_nMMM88SJG1ON6GWeUQ@mail.gmail.com>
2011-09-12  9:15     ` bug#9481: Fwd: " CRLF0710
2011-09-12 10:40       ` Eli Zaretskii
2011-09-12 11:27         ` CRLF0710
2011-09-12 11:58           ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).