all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* xelatex menu option does not show
@ 2010-04-26 19:03 Tariq
  2010-04-26 20:45 ` Andreas Politz
  0 siblings, 1 reply; 7+ messages in thread
From: Tariq @ 2010-04-26 19:03 UTC (permalink / raw)
  To: help-gnu-emacs

Hi Everyone,

I have this code in my .emacs file and it worked very well until a few
days ago. It was kindly given to me on this forum. With this code,
when a buffer with fontspec package is opened, I used to see an option
XeLaTeX under the Command menu. Today, however, I do not see such
option. I have opened and closed Emacs just to make sure.

My computer had crashed yesterday when I was working in Emacs but I
did not see any other issue with Emacs performance. I have been
working on other LaTeX files since reboot without any apparent
problems. Still, something is not right. Could the computer crash have
done some damage to my Emacs? How can I fix it? BTW, I am running
Ubuntu 9.10.

Thanks for your help. Regards,

Tariq

;;Code from .emacs

;;set xetex mode in tex/latex
(defun my-latex-mode-hook ()
      (add-to-list 'TeX-command-list
                   '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil
t))
      (setq TeX-command-default
            (save-excursion
              (save-restriction
                (widen)
                (goto-char (point-min))
                (let ((re (concat "^\\s-*\\\\usepackage\\(?:\\[.*\\]\
\)?"
                                  "{.*\\<\\(?:font\\|math\\)spec\
\>.*}")))
                  (if (re-search-forward re 3000 t)
                      "XeLaTeX"
                    "LaTeX"))))))
;;


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

* Re: xelatex menu option does not show
  2010-04-26 19:03 xelatex menu option does not show Tariq
@ 2010-04-26 20:45 ` Andreas Politz
  2010-04-27  1:58   ` Tariq
  2010-04-27 15:49   ` Tariq
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Politz @ 2010-04-26 20:45 UTC (permalink / raw)
  To: help-gnu-emacs

Tariq <tariq.perwez@gmail.com> writes:

> Hi Everyone,
>
> I have this code in my .emacs file and it worked very well until a few
> days ago. It was kindly given to me on this forum. With this code,
> when a buffer with fontspec package is opened, I used to see an option
> XeLaTeX under the Command menu. Today, however, I do not see such
> option. I have opened and closed Emacs just to make sure.
>
> My computer had crashed yesterday when I was working in Emacs but I
> did not see any other issue with Emacs performance. I have been
> working on other LaTeX files since reboot without any apparent
> problems. Still, something is not right. Could the computer crash have
> done some damage to my Emacs? How can I fix it? BTW, I am running
> Ubuntu 9.10.
>
> Thanks for your help. Regards,
>
> Tariq
>
> ;;Code from .emacs
>
> ;;set xetex mode in tex/latex
> (defun my-latex-mode-hook ()
>       (add-to-list 'TeX-command-list
>                    '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil
> t))
>       (setq TeX-command-default
>             (save-excursion
>               (save-restriction
>                 (widen)
>                 (goto-char (point-min))
>                 (let ((re (concat "^\\s-*\\\\usepackage\\(?:\\[.*\\]\
> \)?"
>                                   "{.*\\<\\(?:font\\|math\\)spec\
> \>.*}")))
>                   (if (re-search-forward re 3000 t)
>                       "XeLaTeX"
>                     "LaTeX"))))))
> ;;

I think you simply forgot to

(add-hook 'LaTeX-mode-hook 'my-latex-mode-hook)

.

-ap


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

* Re: xelatex menu option does not show
  2010-04-26 20:45 ` Andreas Politz
@ 2010-04-27  1:58   ` Tariq
  2010-04-27 15:49   ` Tariq
  1 sibling, 0 replies; 7+ messages in thread
From: Tariq @ 2010-04-27  1:58 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 26, 4:45 pm, Andreas Politz <poli...@fh-trier.de> wrote:
> Tariq <tariq.per...@gmail.com> writes:
> > Hi Everyone,
>
> > I have this code in my .emacs file and it worked very well until a few
> > days ago. It was kindly given to me on this forum. With this code,
> > when a buffer with fontspec package is opened, I used to see an option
> > XeLaTeX under the Command menu. Today, however, I do not see such
> > option. I have opened and closed Emacs just to make sure.
>
> > My computer had crashed yesterday when I was working in Emacs but I
> > did not see any other issue with Emacs performance. I have been
> > working on other LaTeX files since reboot without any apparent
> > problems. Still, something is not right. Could the computer crash have
> > done some damage to my Emacs? How can I fix it? BTW, I am running
> > Ubuntu 9.10.
>
> > Thanks for your help. Regards,
>
> > Tariq
>
> > ;;Code from .emacs
>
> > ;;set xetex mode in tex/latex
> > (defun my-latex-mode-hook ()
> >       (add-to-list 'TeX-command-list
> >                    '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil
> > t))
> >       (setq TeX-command-default
> >             (save-excursion
> >               (save-restriction
> >                 (widen)
> >                 (goto-char (point-min))
> >                 (let ((re (concat "^\\s-*\\\\usepackage\\(?:\\[.*\\]\
> > \)?"
> >                                   "{.*\\<\\(?:font\\|math\\)spec\
> > \>.*}")))
> >                   (if (re-search-forward re 3000 t)
> >                       "XeLaTeX"
> >                     "LaTeX"))))))
> > ;;
>
> I think you simply forgot to
>
> (add-hook 'LaTeX-mode-hook 'my-latex-mode-hook)
>
> .
>
> -ap

Hi Andreas

Strange that I did not do anything to the code and it was working
until I opened a xelatex file in Emacs today.

Where do I add that line in the code? Does it come after the code I
posted?

Thanks a lot for your help. Regards,

Tariq



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

* Re: xelatex menu option does not show
  2010-04-26 20:45 ` Andreas Politz
  2010-04-27  1:58   ` Tariq
@ 2010-04-27 15:49   ` Tariq
  2010-04-27 16:08     ` Tariq
  1 sibling, 1 reply; 7+ messages in thread
From: Tariq @ 2010-04-27 15:49 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 26, 4:45 pm, Andreas Politz <poli...@fh-trier.de> wrote:
> Tariq <tariq.per...@gmail.com> writes:
> > Hi Everyone,
>
> > I have this code in my .emacs file and it worked very well until a few
> > days ago. It was kindly given to me on this forum. With this code,
> > when a buffer with fontspec package is opened, I used to see an option
> > XeLaTeX under the Command menu. Today, however, I do not see such
> > option. I have opened and closed Emacs just to make sure.
>
> > My computer had crashed yesterday when I was working in Emacs but I
> > did not see any other issue with Emacs performance. I have been
> > working on other LaTeX files since reboot without any apparent
> > problems. Still, something is not right. Could the computer crash have
> > done some damage to my Emacs? How can I fix it? BTW, I am running
> > Ubuntu 9.10.
>
> > Thanks for your help. Regards,
>
> > Tariq
>
> > ;;Code from .emacs
>
> > ;;set xetex mode in tex/latex
> > (defun my-latex-mode-hook ()
> >       (add-to-list 'TeX-command-list
> >                    '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil
> > t))
> >       (setq TeX-command-default
> >             (save-excursion
> >               (save-restriction
> >                 (widen)
> >                 (goto-char (point-min))
> >                 (let ((re (concat "^\\s-*\\\\usepackage\\(?:\\[.*\\]\
> > \)?"
> >                                   "{.*\\<\\(?:font\\|math\\)spec\
> > \>.*}")))
> >                   (if (re-search-forward re 3000 t)
> >                       "XeLaTeX"
> >                     "LaTeX"))))))
> > ;;
>
> I think you simply forgot to
>
> (add-hook 'LaTeX-mode-hook 'my-latex-mode-hook)
>
> .
>
> -ap

Here is the code I have now in .emacs. However, the problem is only
partly solved; that is, the option XeLaTeX does show up in the Command
menu but when I do C-c C-c, I still get this in the minibuffer:

Command: (default LaTeX)

As I understand the matter, this should be:

Command: (default XeLaTeX)

What is missing? I would appreciate any help.

Tariq


(I must add that previously, C-c C-c used to give me the expected
default XeLaTeX  as default in the minibuffer.)

;; Part of the code snippet in .emacs
;;set xetex mode in tex/latex
(add-hook 'LaTeX-mode-hook #'my-latex-mode-hook) ;; removal of # does
not do any good/harm (why?)
(defun my-latex-mode-hook ()
      (add-to-list 'TeX-command-list
                   '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil
t))
      (setq TeX-command-default
            (save-excursion
              (save-restriction
                (widen)
                (goto-char (point-min))
                (let ((re (concat "^\\s-*\\\\usepackage\\(?:\\[.*\\]\
\)?"
                                  "{.*\\<\\(?:font\\|math\\)spec\
\>.*}")))
                  (if (re-search-forward re 3000 t)
                      "XeLaTeX"
                    "LaTeX"))))))
;;



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

* Re: xelatex menu option does not show
  2010-04-27 15:49   ` Tariq
@ 2010-04-27 16:08     ` Tariq
  2010-04-27 17:59       ` Andreas Politz
  0 siblings, 1 reply; 7+ messages in thread
From: Tariq @ 2010-04-27 16:08 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 27, 11:49 am, Tariq <tariq.per...@gmail.com> wrote:
> On Apr 26, 4:45 pm, Andreas Politz <poli...@fh-trier.de> wrote:
>
>
>
> > Tariq <tariq.per...@gmail.com> writes:
> > > Hi Everyone,
>
> > > I have this code in my .emacs file and it worked very well until a few
> > > days ago. It was kindly given to me on this forum. With this code,
> > > when a buffer with fontspec package is opened, I used to see an option
> > > XeLaTeX under the Command menu. Today, however, I do not see such
> > > option. I have opened and closed Emacs just to make sure.
>
> > > My computer had crashed yesterday when I was working in Emacs but I
> > > did not see any other issue with Emacs performance. I have been
> > > working on other LaTeX files since reboot without any apparent
> > > problems. Still, something is not right. Could the computer crash have
> > > done some damage to my Emacs? How can I fix it? BTW, I am running
> > > Ubuntu 9.10.
>
> > > Thanks for your help. Regards,
>
> > > Tariq
>
> > > ;;Code from .emacs
>
> > > ;;set xetex mode in tex/latex
> > > (defun my-latex-mode-hook ()
> > >       (add-to-list 'TeX-command-list
> > >                    '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil
> > > t))
> > >       (setq TeX-command-default
> > >             (save-excursion
> > >               (save-restriction
> > >                 (widen)
> > >                 (goto-char (point-min))
> > >                 (let ((re (concat "^\\s-*\\\\usepackage\\(?:\\[.*\\]\
> > > \)?"
> > >                                   "{.*\\<\\(?:font\\|math\\)spec\
> > > \>.*}")))
> > >                   (if (re-search-forward re 3000 t)
> > >                       "XeLaTeX"
> > >                     "LaTeX"))))))
> > > ;;
>
> > I think you simply forgot to
>
> > (add-hook 'LaTeX-mode-hook 'my-latex-mode-hook)
>
> > .
>
> > -ap
>
> Here is the code I have now in .emacs. However, the problem is only
> partly solved; that is, the option XeLaTeX does show up in the Command
> menu but when I do C-c C-c, I still get this in the minibuffer:
>
> Command: (default LaTeX)
>
> As I understand the matter, this should be:
>
> Command: (default XeLaTeX)
>
> What is missing? I would appreciate any help.
>
> Tariq
>
> (I must add that previously, C-c C-c used to give me the expected
> default XeLaTeX  as default in the minibuffer.)
>
> ;; Part of the code snippet in .emacs
> ;;set xetex mode in tex/latex
> (add-hook 'LaTeX-mode-hook #'my-latex-mode-hook) ;; removal of # does
> not do any good/harm (why?)
> (defun my-latex-mode-hook ()
>       (add-to-list 'TeX-command-list
>                    '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil
> t))
>       (setq TeX-command-default
>             (save-excursion
>               (save-restriction
>                 (widen)
>                 (goto-char (point-min))
>                 (let ((re (concat "^\\s-*\\\\usepackage\\(?:\\[.*\\]\
> \)?"
>                                   "{.*\\<\\(?:font\\|math\\)spec\
> \>.*}")))
>                   (if (re-search-forward re 3000 t)
>                       "XeLaTeX"
>                     "LaTeX"))))))
> ;;

I must add to the above the following observation. With the above code
in my .emacs file, if I open a XeLaTeX file and compile once using the
XeLaTeX option in the Command menu (i.e. using mouse) and then for the
subsequent compilations, C-c C-c does give me

Command: (default XeLaTeX)

in the minibuffer. Otherwise, if I just open a XeLaTeX file and press
C-c C-c all I get is

Command: (default LaTeX)

in the minibuffer.

This is not a desirable behaviour at all. I should be able to get
Command: (default XeLaTeX) the very first time I press C-c C-c if the
file I have is XeLaTeX file!

How can I correct this? Best regards,

Tariq



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

* Re: xelatex menu option does not show
  2010-04-27 16:08     ` Tariq
@ 2010-04-27 17:59       ` Andreas Politz
  2010-04-27 18:22         ` Tariq
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Politz @ 2010-04-27 17:59 UTC (permalink / raw)
  To: help-gnu-emacs

Tariq <tariq.perwez@gmail.com> writes:

> I must add to the above the following observation. With the above code
> in my .emacs file, if I open a XeLaTeX file and compile once using the
> XeLaTeX option in the Command menu (i.e. using mouse) and then for the
> subsequent compilations, C-c C-c does give me
>
> Command: (default XeLaTeX)
>
> in the minibuffer. Otherwise, if I just open a XeLaTeX file and press
> C-c C-c all I get is
>
> Command: (default LaTeX)
>
> in the minibuffer.
>
> This is not a desirable behaviour at all. I should be able to get
> Command: (default XeLaTeX) the very first time I press C-c C-c if the
> file I have is XeLaTeX file!
>
> How can I correct this? Best regards,
>
> Tariq


Maybe the criteria for what constitutes a XeLaTeX file in your head, is
different from what your code specifies.  In other words, the regexp is
not able to match and thus, "LaTeX" becomes the default command.

-ap


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

* Re: xelatex menu option does not show
  2010-04-27 17:59       ` Andreas Politz
@ 2010-04-27 18:22         ` Tariq
  0 siblings, 0 replies; 7+ messages in thread
From: Tariq @ 2010-04-27 18:22 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 27, 1:59 pm, Andreas Politz <poli...@fh-trier.de> wrote:
> Tariq <tariq.per...@gmail.com> writes:
> > I must add to the above the following observation. With the above code
> > in my .emacs file, if I open a XeLaTeX file and compile once using the
> > XeLaTeX option in the Command menu (i.e. using mouse) and then for the
> > subsequent compilations, C-c C-c does give me
>
> > Command: (default XeLaTeX)
>
> > in the minibuffer. Otherwise, if I just open a XeLaTeX file and press
> > C-c C-c all I get is
>
> > Command: (default LaTeX)
>
> > in the minibuffer.
>
> > This is not a desirable behaviour at all. I should be able to get
> > Command: (default XeLaTeX) the very first time I press C-c C-c if the
> > file I have is XeLaTeX file!
>
> > How can I correct this? Best regards,
>
> > Tariq
>
> Maybe the criteria for what constitutes a XeLaTeX file in your head, is
> different from what your code specifies.  In other words, the regexp is
> not able to match and thus, "LaTeX" becomes the default command.
>
> -ap

Hi Andreas

Perhaps so,  but I thought the code specified that the presence of the
fontspec package should constitute the file being a XeLaTeX file and
hence C-c C-c should result in XeLaTeX as the default engine. Is this
not right? The mouse click does work. And, after one compilation with
mouse click, C-c C-c also works. Puzzling.

Or, can some change be made to the code to make it work as I want?

Regards,

Tariq


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

end of thread, other threads:[~2010-04-27 18:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-26 19:03 xelatex menu option does not show Tariq
2010-04-26 20:45 ` Andreas Politz
2010-04-27  1:58   ` Tariq
2010-04-27 15:49   ` Tariq
2010-04-27 16:08     ` Tariq
2010-04-27 17:59       ` Andreas Politz
2010-04-27 18:22         ` Tariq

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.