Skip to main content
Corrected a mistake I made reporting on sudo emacs <myfile>.
Source Link
Chap
  • 389
  • 3
  • 14

Here is my problem on a server running CentOS 7 with emacs 24.3.1.:

  • When I run sudo emacs <protected_file> on a file that I don't have write permissions, emacs doesn't read my .emacs file, nor does it recognize the commands defined in .emacs.d/elpa/.
  • When I run sudo emacs -u myuserid <protected_file> on that file, emacs reads my .emacs file but still doesn't know about my elpa packages.
  • When I run emacs <protected_file>, it reads .emacs and knows about .emacs.d/elpa packages. (But the file is opened in read-only mode, of course.)
  • When I run sudo emacs <myfile> on a file I have write permission on, everything works fineemacs doesn't read my . Same withemacs file, nor does it recognize the commands defined in .emacs.d/elpa/.
  • emacs <myfile> works as expected.

However, on the server that I copied my home directory from, which runs CentOS 6 with emacs 23.1.1, everything works fine. sudo emacs <protected_file> reads .emacs and it recognizes the commands within .emacs.d/elpa/.

I've verified that the file and directory permissions in my home directory are identical on both servers.

Since both the OS level and the emacs level are different, it seems like it could be either sudo or emacs where the problem lies (or in the way the systems people configured the new server).

Any ideas about this odd behavior?

UPDATE: Original post stated in bullet 4 that sudo emacs <myfile> worked as expected. This wasn't true, and I've amended that above.

Here is my problem on a server running CentOS 7 with emacs 24.3.1.:

  • When I run sudo emacs <protected_file> on a file that I don't have write permissions, emacs doesn't read my .emacs file, nor does it recognize the commands defined in .emacs.d/elpa/.
  • When I run sudo emacs -u myuserid <protected_file> on that file, emacs reads my .emacs file but still doesn't know about my elpa packages.
  • When I run emacs <protected_file>, it reads .emacs and knows about .emacs.d/elpa packages. (But the file is opened in read-only mode, of course.)
  • When I run sudo emacs <myfile> on a file I have write permission on, everything works fine. Same with emacs <myfile>.

However, on the server that I copied my home directory from, which runs CentOS 6 with emacs 23.1.1, everything works fine. sudo emacs <protected_file> reads .emacs and it recognizes the commands within .emacs.d/elpa/.

I've verified that the file and directory permissions in my home directory are identical on both servers.

Since both the OS level and the emacs level are different, it seems like it could be either sudo or emacs where the problem lies (or in the way the systems people configured the new server).

Any ideas about this odd behavior?

Here is my problem on a server running CentOS 7 with emacs 24.3.1.:

  • When I run sudo emacs <protected_file> on a file that I don't have write permissions, emacs doesn't read my .emacs file, nor does it recognize the commands defined in .emacs.d/elpa/.
  • When I run sudo emacs -u myuserid <protected_file> on that file, emacs reads my .emacs file but still doesn't know about my elpa packages.
  • When I run emacs <protected_file>, it reads .emacs and knows about .emacs.d/elpa packages. (But the file is opened in read-only mode, of course.)
  • When I run sudo emacs <myfile> on a file I have write permission on, emacs doesn't read my .emacs file, nor does it recognize the commands defined in .emacs.d/elpa/.
  • emacs <myfile> works as expected.

However, on the server that I copied my home directory from, which runs CentOS 6 with emacs 23.1.1, everything works fine. sudo emacs <protected_file> reads .emacs and it recognizes the commands within .emacs.d/elpa/.

I've verified that the file and directory permissions in my home directory are identical on both servers.

Since both the OS level and the emacs level are different, it seems like it could be either sudo or emacs where the problem lies (or in the way the systems people configured the new server).

Any ideas about this odd behavior?

UPDATE: Original post stated in bullet 4 that sudo emacs <myfile> worked as expected. This wasn't true, and I've amended that above.

Source Link
Chap
  • 389
  • 3
  • 14

sudo emacs doesn't read my elpa packages

Here is my problem on a server running CentOS 7 with emacs 24.3.1.:

  • When I run sudo emacs <protected_file> on a file that I don't have write permissions, emacs doesn't read my .emacs file, nor does it recognize the commands defined in .emacs.d/elpa/.
  • When I run sudo emacs -u myuserid <protected_file> on that file, emacs reads my .emacs file but still doesn't know about my elpa packages.
  • When I run emacs <protected_file>, it reads .emacs and knows about .emacs.d/elpa packages. (But the file is opened in read-only mode, of course.)
  • When I run sudo emacs <myfile> on a file I have write permission on, everything works fine. Same with emacs <myfile>.

However, on the server that I copied my home directory from, which runs CentOS 6 with emacs 23.1.1, everything works fine. sudo emacs <protected_file> reads .emacs and it recognizes the commands within .emacs.d/elpa/.

I've verified that the file and directory permissions in my home directory are identical on both servers.

Since both the OS level and the emacs level are different, it seems like it could be either sudo or emacs where the problem lies (or in the way the systems people configured the new server).

Any ideas about this odd behavior?