From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sanjib Sikder Subject: Re: Bib file path relative to home using tilde ~ in Ubuntu Date: Sun, 14 Oct 2012 12:14:21 +0530 Message-ID: References: <87391i31i3.fsf@yagnesh.org> <87r4p21d9a.fsf@yagnesh.org> <14518.1350190655@alphaville> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d04462ec89a689e04cbff42a8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNHwe-00041X-8P for emacs-orgmode@gnu.org; Sun, 14 Oct 2012 02:45:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TNHwc-0002KP-Cq for emacs-orgmode@gnu.org; Sun, 14 Oct 2012 02:45:04 -0400 Received: from mail-ia0-f169.google.com ([209.85.210.169]:46898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TNHwc-0002JV-0n for emacs-orgmode@gnu.org; Sun, 14 Oct 2012 02:45:02 -0400 Received: by mail-ia0-f169.google.com with SMTP id h37so3735687iak.0 for ; Sat, 13 Oct 2012 23:45:01 -0700 (PDT) In-Reply-To: <14518.1350190655@alphaville> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: Yagnesh Raghava Yakkala , emacs-orgmode@gnu.org --f46d04462ec89a689e04cbff42a8 Content-Type: text/plain; charset=ISO-8859-1 Hi Dokos, o What shell are you using? Yagnesh's recommendation assumes > that you are running bash as your shell (presumably on some > Linux/Unix system). Is this assumption correct? > I am a normal Ubuntu (12.04) user, and recently started to use Emacs (Emacs snapshot) and loving it very much. I am sorry that I do not understand what is "Bash shell". I am starting my Emacs GTK either by right clicking on the .org files or first opening the emacs GTK by clicking on icon. Try starting emacs from a bash > command line.[fn:2] > Now I started emacs from terminal typing $ emacs . Now BIBINPUTS is working with BIBINPUTS lines in .bashrc only (I have removed the BIBINPUTS lines from .profile, to test one by one) THANKS A LOT. IT IS WORKING NOW :) Do I then always need to start emacs from command line ? (I will try with .profile) ============================= The following reply was sent to Yagnesh. I am pasting it below as I understand you also asked these questions. ---------------------------------------------------------------------------------------------------------- > > First of all can you confirm your .bashrc setting is working.? >> >> in the terminal >> --8<---------------cut here---------------start------------->8--- >> echo $BIBINPUTS > > --8<---------------cut here---------------end--------------->8--- >> > > *Here is the output* > > ~$ echo $BIBINPUTS > .//:/home/USERNAME/bst//:.//:/home/USERNAME/bibFiles//: > > ------------------------------------------------------------------------------------------------------------------------------------------ > > and also can you check what is the value of BIBINPUTS in emacs.? Within >> Emacs >> evaluate the following (either in scratch buffer or with key press `M-:' >> or >> with `M-x eval-expression') >> >> --8<---------------cut here---------------start------------->8--- >> (getenv "BIBINPUTS") >> --8<---------------cut here---------------end--------------->8--- >> > > > *OUTPUT* is: nil > > --------------------------------------------------------------------------------------------------------------------------------------------- > > May be the last resort would be setting the variable within your .emacs >> >> --8<---------------cut here---------------start------------->8--- >> (setenv "BIBINPUTS" ".:$HOME/bib:") >> --8<---------------cut here---------------end--------------->8--- >> > > I will try this one > > ----------------------------------------------------------------------------------------------------------------- > > BTW how you are starting emacs? (command line or gui mouse click?) > > > I am starting emacs from GUI mouse click. All the above tests are done > only with the .bashrc, i.e., after removing the lines from .profile and > .gnomerc > ----------------------------- *Sanjib Sikder *Ph.D. Fellow Chemical Engineering IIT Bombay* * On Sun, Oct 14, 2012 at 10:27 AM, Nick Dokos wrote: > Sanjib Sikder wrote: > > > Hi, > > > > "The easiest way to update is logout from the computer, login again and > start emacs." > > > > I did that. Still not working :( > > > > When you have problems like this, you need to take it in small > steps. > > o What shell are you using? Yagnesh's recommendation assumes > that you are running bash as your shell (presumably on some > Linux/Unix system). Is this assumption correct? > > o Assuming you are using bash, there are two relevant initialization > files: a login shell sources $HOME/.profile and any shell (be it a login > shell or one that is started as a descendant of your login shell) sources > $HOME/.bashrc. > > o Adding > > export FOO=bar > > to such an initialization file causes the variable FOO to be defined > (with value "bar") > and to be exported (i.e. it is available in the environment of *any* > subprocess of > this shell). > > o So log out and log back in[fn:2], start a shell and at the prompt say > > echo $FOO > > Does it say "bar"? If not, don't go any further: the problem has nothing > to do with > emacs (note that this is the first time I mention emacs). > > o If this part is OK, start emacs *from this shell*: it should inherit the > variable. > You can check by evaluating this form: > > (getenv "FOO") > > Then the variable will also be available to any subprocesses started by > emacs. > > o In particular, if you define BIBINPUTS as Yagnesh suggests, then the > bibtex invoked > by the latex exporter under emacs will find the bib file where you told > it. > > o What can go wrong? The usual problem is that you use some graphical > desktop environment and start emacs by clicking on some icon. Then > the emacs process does not have a bash shell as its parent, so it does > not inherit the exported variables. Try starting emacs from a bash > command line.[fn:2] > > Nick > > Footnotes: > [fn:1] If you define it in .bashrc, you shouldn't have to log out and log > back in: just start a new bash shell. > > [fn:2] I prefer defining variables in my .profile and I have arranged > for my .profile to be sourced by the appropriate initialization > file of my graphical desktop environment, so I get it whether I > log in at the console or through the graphical login. That > way *every* process, no matter how it is started, has the > variables available to it. I use .bashrc only for aliases (which > I use very rarely, so most of the time I don't have a .bashrc > file at all). > > --f46d04462ec89a689e04cbff42a8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Dokos,

o What s= hell are you using? Yagnesh's recommendation assumes
=A0 that you are running bash as your shell (presumably on some
=A0 Linux/Unix system). Is this assumption correct?

I am a normal Ubuntu (12.04) user, and recently started t= o use Emacs (Emacs snapshot) and loving it very much. I am sorry that I do = not understand what is "Bash shell". I am starting my Emacs GTK e= ither by right clicking on the .org files or first opening the emacs GTK by= clicking on icon.

Try starting emacs fr= om a bash
=A0 command line.[fn:2]

Now I started emacs from termin= al typing
$ emacs .
Now BIBINPUTS is working with BIBINPUTS lines i= n .bashrc only (I have removed the BIBINPUTS lines from .profile, to test o= ne by one)

THANKS A LOT. IT IS WORKING NOW :)

Do I then always need to star= t emacs from command line ? (I will try with .profile)


=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D
The following reply was sent to Yagnesh. I am pasting it below as I = understand you also asked these questions.


-= ---------------------------------------------------------------------------= ------------------------------

First of all can you confirm your .bashrc setting is working.?

in the terminal
--8<---------------cut here---------------start------------->8---
echo $BIBINPUTS
--8<---------------cut here---------------end--------------->8---<= br>

Here is the output
~$ echo $BIBINPUTS
.//:/home/USERNAME/bst//:.//:/hom= e/USERNAME/bibFiles//:
-------------------------------------------------= ---------------------------------------------------------------------------= --------------

and also can you check wh= at is the value of BIBINPUTS in emacs.? Within Emacs
evaluate the following (either in scratch buffer or with key press `M-:'= ; or
with `M-x eval-expression')

--8<---------------cut here---------------start------------->8---
(getenv "BIBINPUTS")
--8<---------------cut here---------------end--------------->8---
=


OUTPUT is: nil
------------------------------------= ---------------------------------------------------------------------------= ------------------------------

May be the last resort would be setting the variable within your .emacs
=
--8<---------------cut here---------------start------------->8---
(setenv "BIBINPUTS" ".:$HOME/bib:")
--8<---------------cut here---------------end--------------->8---
=

I will try this one
-----------------------------------------= ------------------------------------------------------------------------
BTW how you are starting emacs? (command line or gui mouse click?)

I am starting emacs from GUI mouse click. All the above tests are done=20 only with the .bashrc, i.e., after=A0 removing the lines from .profile and .gnomerc



-----------------------------
Sanjib Sikde= r
Ph.D. Fellow
Chem= ical Engineering
IIT Bombay






On Sun, Oct 14, 2012 at 10:27 AM, Nick D= okos <nicholas.dokos@hp.com> wrote:
Sanjib Sikder <sanjibju2002@gmail.com> wrote:

> Hi,
>
> "The easiest way to update is logout from the computer, login aga= in and start emacs."
>
> I did that. Still not working :(
>

When you have problems like this, you need to take it in small
steps.

o What shell are you using? Yagnesh's recommendation assumes
=A0 that you are running bash as your shell (presumably on some
=A0 Linux/Unix system). Is this assumption correct?

o Assuming you are using bash, there are two relevant initialization
=A0 files: a login shell sources $HOME/.profile and any shell (be it a logi= n
=A0 shell or one that is started as a descendant of your login shell) sourc= es
=A0 $HOME/.bashrc.

o Adding

=A0 export FOO=3Dbar

=A0 to such an initialization file causes the variable FOO to be defined (w= ith value "bar")
=A0 and to be exported (i.e. it is available in the environment of *any* su= bprocess of
=A0 this shell).

o So log out and log back in[fn:2], start a shell and at the prompt say

=A0 echo $FOO

=A0 Does it say "bar"? If not, don't go any further: the prob= lem has nothing to do with
=A0 emacs (note that this is the first time I mention emacs).

o If this part is OK, start emacs *from this shell*: it should inherit the = variable.
=A0 You can check by evaluating this form:

=A0 (getenv "FOO")

=A0 Then the variable will also be available to any subprocesses started by= emacs.

o In particular, if you define BIBINPUTS as Yagnesh suggests, then the bibt= ex invoked
=A0 by the latex exporter under emacs will find the bib file where you told= it.

o What can go wrong? The usual problem is that you use some graphical
=A0 desktop environment and start emacs by clicking on some icon. Then
=A0 the emacs process does not have a bash shell as its parent, so it does<= br> =A0 not inherit the exported variables. Try starting emacs from a bash
=A0 command line.[fn:2]

Nick

Footnotes:
[fn:1] If you define it in .bashrc, you shouldn't have to log out and l= og
=A0 =A0 =A0 =A0back in: just start a new bash shell.

[fn:2] I prefer defining variables in my .profile and I have arranged
=A0 =A0 =A0 =A0for my .profile to be sourced by the appropriate initializat= ion
=A0 =A0 =A0 =A0file of my graphical desktop environment, so I get it whethe= r I
=A0 =A0 =A0 =A0log in at the console or through the graphical login. That =A0 =A0 =A0 =A0way *every* process, no matter how it is started, has the =A0 =A0 =A0 =A0variables available to it. I use .bashrc only for aliases (w= hich
=A0 =A0 =A0 =A0I use very rarely, so most of the time I don't have a .b= ashrc
=A0 =A0 =A0 =A0file at all).


--f46d04462ec89a689e04cbff42a8--