GNU bug report logs - #9481
24.0.50; emacs_dir behavior too cumbersome for use within msys

Previous Next

Package: emacs;

Reported by: CRLF0710 <crlf0710 <at> gmail.com>

Date: Mon, 12 Sep 2011 08:08:01 UTC

Severity: normal

Found in version 24.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9481 in the body.
You can then email your comments to 9481 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9481; Package emacs. (Mon, 12 Sep 2011 08:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to CRLF0710 <crlf0710 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 12 Sep 2011 08:08:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: CRLF0710 <crlf0710 <at> gmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 24.0.50; emacs_dir behavior too cumbersome for use within msys
Date: Mon, 12 Sep 2011 16:01:44 +0800
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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9481; Package emacs. (Mon, 12 Sep 2011 08:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 9481 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: CRLF0710 <crlf0710 <at> gmail.com>
Cc: 9481 <at> debbugs.gnu.org
Subject: Re: bug#9481: 24.0.50;
	emacs_dir behavior too cumbersome for use within msys
Date: Mon, 12 Sep 2011 04:36:31 -0400
> From: CRLF0710 <crlf0710 <at> 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.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9481; Package emacs. (Mon, 12 Sep 2011 09:21:02 GMT) Full text and rfc822 format available.

Message #11 received at 9481 <at> debbugs.gnu.org (full text, mbox):

From: CRLF0710 <crlf0710 <at> gmail.com>
To: 9481 <at> debbugs.gnu.org
Subject: Fwd: bug#9481: 24.0.50; emacs_dir behavior too cumbersome for use
	within msys
Date: Mon, 12 Sep 2011 17:15:46 +0800
---------- Forwarded message ----------
From: CRLF0710 <crlf0710 <at> 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 <at> 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 <at> gnu.org>:
>> From: CRLF0710 <crlf0710 <at> 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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9481; Package emacs. (Mon, 12 Sep 2011 10:46:03 GMT) Full text and rfc822 format available.

Message #14 received at 9481 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: CRLF0710 <crlf0710 <at> gmail.com>
Cc: 9481 <at> debbugs.gnu.org
Subject: Re: bug#9481: Fwd: bug#9481: 24.0.50;
	emacs_dir behavior too cumbersome for use within msys
Date: Mon, 12 Sep 2011 06:40:55 -0400
> From: CRLF0710 <crlf0710 <at> 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.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9481; Package emacs. (Mon, 12 Sep 2011 11:32:02 GMT) Full text and rfc822 format available.

Message #17 received at 9481 <at> debbugs.gnu.org (full text, mbox):

From: CRLF0710 <crlf0710 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9481 <at> debbugs.gnu.org
Subject: Re: bug#9481: Fwd: bug#9481: 24.0.50; emacs_dir behavior too
	cumbersome for use within msys
Date: Mon, 12 Sep 2011 19:27:04 +0800
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 <at> gnu.org>:
-- 
Wir müssen wissen; wir werden wissen!
CrLF.0710




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 12 Sep 2011 12:03:02 GMT) Full text and rfc822 format available.

Notification sent to CRLF0710 <crlf0710 <at> gmail.com>:
bug acknowledged by developer. (Mon, 12 Sep 2011 12:03:03 GMT) Full text and rfc822 format available.

Message #22 received at 9481-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: CRLF0710 <crlf0710 <at> gmail.com>
Cc: 9481-done <at> debbugs.gnu.org
Subject: Re: bug#9481: Fwd: bug#9481: 24.0.50; emacs_dir behavior too
	cumbersome for use within msys
Date: Mon, 12 Sep 2011 07:58:24 -0400
> From: CRLF0710 <crlf0710 <at> gmail.com>
> Date: Mon, 12 Sep 2011 19:27:04 +0800
> Cc: 9481 <at> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 Oct 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 255 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.