bug#71436: Fwd: preview in LuaTeX with RTL as main language does not work

2024-06-12 Thread Ikumi Keita
Hi Udicoudco,

>>>>> Udicoudco  writes:
> Oh, there was another typo. I did not test that the documentation
> is typesetting properly, and there was a "\begn{macro}" instead
> of `\begin{macro}`. I also updated the checksum of preview.dtx.
> Tested now with the various engines and things seems to be working
> (but please test thoroughly :)

Thanks, it works well with my brief test.

>> By the way, I suppose we need copyright assignment if this contribution
>> is to be incorporated into AUCTeX. Have you signed FSF copyright
>> assignment form before? If not, please have a look at
>> https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.future

> Just sent an email, but in case it is suffice, when I'll get an answer
> I'll attach the assignment.

I see. After the paperwork is done, I'll install your proposal.

> BTW, it is not that important, but why is my postal address needed?

I'm not sure :-) Probably some US legal matter is concerned.

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#71467: Value of `LaTeX-math-menu-unicode' on macOS

2024-06-11 Thread Ikumi Keita
>>>>> Arash Esbati  writes:
> Thanks for your response.  Then the patch would look like this:
> diff --git a/latex.el b/latex.el
> index da202219..1fa7cc2f 100644
> --- a/latex.el
> +++ b/latex.el
> @@ -6426,8 +6426,10 @@ Each entry should be a list with upto four elements, 
> KEY, VALUE,
>  MENU and CHARACTER, see `LaTeX-math-list' for details.")

>  (defcustom LaTeX-math-menu-unicode
> -  (or (string-match "\\" (emacs-version))
> -  (eq window-system 'w32))
> +  (if (or (string-match "\\" (emacs-version))
> +  (memq system-type '(darwin windows-nt)))
> +  t
> +nil)
>"Whether the LaTeX menu should try using Unicode for effect."
>:type 'boolean
>:group 'LaTeX-math)
> Or is there another reliable way to check for GTK?  As an upside, the
> math menu looks like this in terminal:

Looks good 

Bye,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#71467: Value of `LaTeX-math-menu-unicode' on macOS

2024-06-11 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> So I'd like to install the following change:
> diff --git a/latex.el b/latex.el
> index da202219..cfd7ee5c 100644
> --- a/latex.el
> +++ b/latex.el
> @@ -6426,8 +6426,7 @@ Each entry should be a list with upto four elements, 
> KEY, VALUE,
>  MENU and CHARACTER, see `LaTeX-math-list' for details.")

>  (defcustom LaTeX-math-menu-unicode
> -  (or (string-match "\\" (emacs-version))
> -  (eq window-system 'w32))
> +  (if (memq window-system '(pgtk ns w32)) t nil)
>"Whether the LaTeX menu should try using Unicode for effect."
>:type 'boolean
>:group 'LaTeX-math)
> Any comments?

Maybe we should use `system-type' instead of `window-system', because
`window-system' is terminal-local variable. Users can launch an emacs
session with -nw option, do `server-start' and attach a graphical frame
to that session by "emacsclient -c" afterwards. If the `defcustom' was
evaluated in terminal frame, unicode characters wouldn't appear in the
menu in graphical frame due to `LaTeX-math-menu-unicode' being nil.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#71436: Fwd: preview in LuaTeX with RTL as main language does not work

2024-06-11 Thread Ikumi Keita
Hi Udicoudco,

>>>>> Udicoudco  writes:
> On Sat, Jun 8, 2024 at 1:20 PM Udicoudco  wrote:
>> In LuaTeX, when \pagedirection is right to left then \pagerightoffset is
>> used instead of \hoffset to position the page. I attached a patch and an
>> example
>> that demonstrates the problem.
>> 
>> 
> There is a typo in the patch, so I attached a new one.

Thanks for your proposal, but "make" doesn't run with this patch:
,
| gmake[1]: *** [Makefile:91: preview.pdf] Error 1
| gmake[1]: Leaving directory '/usr/home/keita/repo/auctex/auctex/latex'
| gmake: *** [Makefile:247: texmf] Error 2
`

By the way, I suppose we need copyright assignment if this contribution
is to be incorporated into AUCTeX. Have you signed FSF copyright
assignment form before? If not, please have a look at
https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.future

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#71363: 14.0.5; AUCTeX 14.05 and LaTeX Mode

2024-06-04 Thread Ikumi Keita
Hi Robert and Paul,

>>>>> Paul Nelson  writes:
>> Functionally, version 14.0.5 has at least one shortcoming that makes it
>> unusable for me: invoking org-edit-special from an org-mode latex src block
>> opens a buffer in latex-mode (not LaTeX-mode). This is a change from
>> version 13.3.

> In case it's of any help, I've been using (add-hook 'latex-mode-hook
> #'LaTeX-mode) as a workaround for the source block issue that you
> mention

I'm afraid that isn't a suuposed way to call a major function in emacs.
The doc string of `org-edit-special' says:
,
| The LaTeX environment is copied into a new buffer.  Major mode is
| set to the one associated to "latex" in ‘org-src-lang-modes’,
| or to ‘latex-mode’ if there is none.
`
Thus I expect
(with-eval-after-load 'org-src
  (push '("latex" . LaTeX) org-src-lang-modes))
in your init file does the job. (Maybe you have also to put
  (setcdr (assoc "beamer" org-src-lang-modes) 'LaTeX)
in the `with-eval-after-load' form if you have beamer src block in your
org file.)

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


master 56debb63: Populate `semantic-symref-filepattern-alist' (bug#71245)

2024-06-03 Thread Ikumi Keita
branch: master
commit 56debb635d3d768500c86bce54cf4eaf42502e86
Author: David Fussner 
Commit: Ikumi Keita 

Populate `semantic-symref-filepattern-alist' (bug#71245)

* context.el:
* latex.el:
* plain-tex.el: Make sure all modes have an entry in the alist, and also
that the ".tex" extension is included where necessary.
---
 context.el   |  7 +++
 latex.el |  3 ++-
 plain-tex.el | 14 ++
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/context.el b/context.el
index 8b0c88ee..0caab223 100644
--- a/context.el
+++ b/context.el
@@ -1861,6 +1861,13 @@ that is, you do _not_ have to cater for this yourself by 
adding \\=' or $."
 
 (TeX-abbrev-mode-setup ConTeXt-mode context-mode-abbrev-table)
 
+(defvar semantic-symref-filepattern-alist) ; Silence compiler
+(with-eval-after-load 'semantic/symref/grep
+  ;; This entry is necessary for M-? to work.
+  ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg2.html>
+  ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg5.html>
+  (push '(ConTeXt-mode "*.[tT]e[xX]") semantic-symref-filepattern-alist))
+
 (defun ConTeXt-mode-common-initialization ()
   "Initialization code that is common for all ConTeXt interfaces."
   (plain-TeX-common-initialization)
diff --git a/latex.el b/latex.el
index d0a9ee6f..ba759291 100644
--- a/latex.el
+++ b/latex.el
@@ -8195,7 +8195,8 @@ This happens when \\left is inserted."
   ;; This entry is necessary for M-? to work.
   ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg2.html>
   ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg5.html>
-  (push '(LaTeX-mode "*.ltx" "*.sty" "*.cls" "*.clo" "*.bbl" "*.drv" "*.hva")
+  (push '(LaTeX-mode "*.[tT]e[xX]" "*.ltx" "*.sty" "*.cl[so]" "*.bbl"
+ "*.drv" "*.hva")
 semantic-symref-filepattern-alist))
 
 (declare-function LaTeX-preview-setup "preview")
diff --git a/plain-tex.el b/plain-tex.el
index 2b777869..9bd48eb3 100644
--- a/plain-tex.el
+++ b/plain-tex.el
@@ -118,6 +118,14 @@ plain-TeX file, or any mode derived thereof.  See variable
 
 (TeX-abbrev-mode-setup plain-TeX-mode plain-tex-mode-abbrev-table)
 
+(defvar semantic-symref-filepattern-alist) ; Silence compiler
+(with-eval-after-load 'semantic/symref/grep
+  ;; This entry is necessary for M-? to work.
+  ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg2.html>
+  ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg5.html>
+  (push '(plain-TeX-mode "*.[tT]e[xX]" "*.ins")
+semantic-symref-filepattern-alist))
+
 ;; Delete alias predefined in tex-mode.el so that AUCTeX autoload
 ;; takes precedence.
 ;;;###autoload (if (eq (symbol-function 'plain-TeX-mode) 'plain-tex-mode)
@@ -318,6 +326,12 @@ that is, you do _not_ have to cater for this yourself by 
adding \\=' or $."
   :type 'hook
   :group 'TeX-misc)
 
+(with-eval-after-load 'semantic/symref/grep
+  ;; This entry is necessary for M-? to work.
+  ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg2.html>
+  ;; https://lists.gnu.org/r/auctex-devel/2023-09/msg5.html>
+  (push '(AmSTeX-mode "*.[tT]e[xX]") semantic-symref-filepattern-alist))
+
 ;;;###autoload
 (define-derived-mode AmSTeX-mode plain-TeX-mode "AmS-TeX"
   "Major mode in AUCTeX for editing AmSTeX files.



bug#71240: Keeping track of class and packages, even w/o options

2024-06-02 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> This adds entries like ("package/class" "") to the variables when no
> options are given, and styles can check against them.

> WDYT?

I haven't tried it for myself, but I suppose it's a reasonable idea to
carry out.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#71245: 2024-03-17; Populate `semantic-symref-filepattern-alist'

2024-06-02 Thread Ikumi Keita
Hi David,

>>>>> David Fussner  writes:
> Thanks very much Keita. In the meantime, if there's any related feedback on
> the Emacs thread I'll get back to you.

I've installed your proposal and pushed to the git repo. I'll close this
bug. Thank you.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#71245: 2024-03-17; Populate `semantic-symref-filepattern-alist'

2024-05-29 Thread Ikumi Keita
Hi David,

>>>>> David Fussner  writes:
> 1. How false are these false positives? If it's a project with plain
> TeX and LaTeX files, there's always a certain amount of overlap
> anyway, and that includes amsTeX, too. ConTeXt is another problem, so
> it will depend somewhat on the nature of the project.

> 2. If you create a TAGS file in the project, then typically that will
> cover all the .tex files, too, so the other xref commands may find
> hits across the various TeX varieties, and therefore
> `xref-find-references' won't be an outlier in that respect.

> 3. I also feel -- quite strongly as it happens -- that false negatives
> are worse than false positives. If you've a .tex file open and do M-?
> in it then you won't even see the hit point is on, but only hits from
> whatever other file extensions happen to belong to the initial file's
> major mode. Currently, in the case of plain TeX or ams TeX, that means
> no hits, which is sort of weird and very frustrating when you're
> looking at one on your screen. In a LaTeX .tex file you'll also not
> get the hit you're actually looking at on your screen, but this might
> be disguised by hits from other file extensions. I think this is much
> more misleading than any false positives, but I concede that others
> may not feel as strongly about this as I do.

Thank you for your reply. I understand your concern about false
negatives and think that I'll apply your patch to AUCTeX repository if
there are no objections. There would be only small amount of false
positives under practical situations and we can add a new customize
option mentioned in my previous message if there are many complaints
about them anyway.

Let's wait for 3-4 days to see whether there are objections or not.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#71245: 2024-03-17; Populate `semantic-symref-filepattern-alist'

2024-05-29 Thread Ikumi Keita
Hi David,

>>>>> David Fussner via bug-auctex via Bug reporting list for AUCTeX 
>>>>>  writes:
> The patchset for the new xref backend in tex-mode.el is still pending,
> but no matter what the eventual outcome of that I think we still need to
> have a complete set of AUCTeX modes included in
> `semantic-symref-filepattern-alist'. Without them we just get the
> cryptic message about customizing that variable when we try to use
> `xref-find-references'. Also, I don't know whether it was decided not to
> include the .tex extension where relevant, but this does mean that,
> without further intervention, `xref-find-references' won't search .tex
> files in any of the modes, even when you are actually searching from,
> say, a LaTeX-mode .tex file. This seems suboptimal to me. I attach a
> patch for your consideration.

Thanks for your proposal. Actually, I'm not sure what to do with this
issue.

As you say, .tex extension is shared among LaTeX, plain TeX and ConTeXt.
(I think we can ignore SliTeX and AmSTeX.) When AUCTeX adds .tex to
`semantic-symref-filepattern-alist', `xref-find-references' searches all
.tex files, if I understand correctly. Therefore, if LaTeX files and
plain TeX files are in the same directory, M-? typed in the LaTeX file
buffers would look into plain TeX files as well. In theory, this can
lead to false positive result. Is this legitimate behavior for xref.el?
If it is for sure, I think AUCTeX can accept your patch.
(Or, maybe AUCTeX should have a new customize option to control to have
.tex extension in `semantic-symref-filepattern-alist' so that users
can decide to allow such false positives or not?)

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: tex-site.elc generation on main branch

2024-05-25 Thread Ikumi Keita
>>>>> Arash Esbati  writes:
> Uwe Brauer  writes:
>> Ok, the compilation takes awfully long. Tassilo explained why, but it
>> is really annoying and makes testing a bit cumbersome .

> Do you run make with the '-j' switch?  I tried building AUCTeX on my old
> Windows box with 'time make -j8' and it took around 2:20 minutes.  The
> same process takes 0:22 minutes on my Macbook Air M2.  I agree, it takes
> longer than it used to, but there are reasons to do so.

>> But it works! 
>> tex-site.elc is generated
>> 
>> So I think your patch provides  a working solution.

> Thanks for testing, I also think Keita's patch is good.

Thank you both. I pushed the fix.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



main 6b1c1f6d: Tune byte compile condition

2024-05-25 Thread Ikumi Keita
branch: main
commit 6b1c1f6da312fc113a80bedabf703f8cff5cd6d6
Author: Ikumi Keita 
Commit: Ikumi Keita 

Tune byte compile condition

* lpath.el: Add appropriate file local variables section to suppress
spurious byte compile.
* GNUmakefile: Make sure that tex-site.elc is generated.
---
 GNUmakefile | 2 +-
 lpath.el| 6 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/GNUmakefile b/GNUmakefile
index 4f90cd07..73bdeace 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -42,7 +42,7 @@ ALL_GENERATED_FILES=$(MAIN_GENERATED_FILES)   \
 # Generate & compile everything including the manuals below doc/.
 all: $(ALL_GENERATED_FILES) compile auctex-autoloads.el
 
-compile: $(patsubst %.el,%.elc,$(wildcard *.el style/*.el))
+compile: $(patsubst %.el,%.elc,$(wildcard *.el style/*.el)) tex-site.elc
 
 # If we were depending on emacs 29.1, we could simply use
 # loaddefs-generate.  If we were depending on 28.1, we could still use
diff --git a/lpath.el b/lpath.el
index f43a9841..021ed463 100644
--- a/lpath.el
+++ b/lpath.el
@@ -11,3 +11,9 @@
   (add-to-list 'load-path (expand-file-name "style" auctex-dir))
   (setq TeX-lisp-directory ""
 TeX-auto-global ""))
+
+;; Local Variables:
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; no-native-compile: t
+;; End:



Re: tex-site.elc generation on main branch

2024-05-25 Thread Ikumi Keita
>>>>> Uwe Brauer  writes:
> Difficult to say, because there is no attached patch 

Sorry!

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

>From 6b1c1f6da312fc113a80bedabf703f8cff5cd6d6 Mon Sep 17 00:00:00 2001
From: Ikumi Keita 
Date: Sat, 27 Apr 2024 18:23:45 +0900
Subject: [PATCH] Tune byte compile condition

* lpath.el: Add appropriate file local variables section to suppress
spurious byte compile.
* GNUmakefile: Make sure that tex-site.elc is generated.
---
 GNUmakefile | 2 +-
 lpath.el| 6 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/GNUmakefile b/GNUmakefile
index 4f90cd07..73bdeace 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -42,7 +42,7 @@ ALL_GENERATED_FILES=$(MAIN_GENERATED_FILES)	\
 # Generate & compile everything including the manuals below doc/.
 all: $(ALL_GENERATED_FILES) compile auctex-autoloads.el
 
-compile: $(patsubst %.el,%.elc,$(wildcard *.el style/*.el))
+compile: $(patsubst %.el,%.elc,$(wildcard *.el style/*.el)) tex-site.elc
 
 # If we were depending on emacs 29.1, we could simply use
 # loaddefs-generate.  If we were depending on 28.1, we could still use
diff --git a/lpath.el b/lpath.el
index f43a9841..021ed463 100644
--- a/lpath.el
+++ b/lpath.el
@@ -11,3 +11,9 @@
   (add-to-list 'load-path (expand-file-name "style" auctex-dir))
   (setq TeX-lisp-directory ""
 TeX-auto-global ""))
+
+;; Local Variables:
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; no-native-compile: t
+;; End:
-- 
2.44.0



tex-site.elc generation on main branch

2024-05-25 Thread Ikumi Keita
Hi all,

On the main branch, tex-site.elc isn't generated at the first "make"
after "make clean" because expansion of $(wildcard *.el style/*.el) in
GNUmakefile doesn't include tex-site.el which doesn't exist yet when we
issue the "make".

Does it make sense to apply the attached patch for the reproducibility?
(It includes addition to lpath.el to suppress spurious generation of
lpath.elc as well.)

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: master 45ee2f9e 3/3: Update documentaion on changes related to delete-selection

2024-05-24 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
>> +When @code{TeX-electric-math} is a pair of dollars and the point is in
>> +inline math (without active region, @kbd{$} inserts two dollars, not one
>^
> Thanks for the change.  Is the above possibly a typo or is closing
> parenthesis missing?

Ah, I think so. I just pushed the fix. Thanks for spotting this.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



master 8485b4bb: ; * doc/changes.texi: Fix typo.

2024-05-24 Thread Ikumi Keita
branch: master
commit 8485b4bbdf6a38c741a62a37fdfdafafdca9d168
Author: Ikumi Keita 
Commit: Ikumi Keita 

; * doc/changes.texi: Fix typo.
---
 doc/changes.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/changes.texi b/doc/changes.texi
index 7a5f95fe..a8de7322 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -241,7 +241,7 @@ while it inserts @samp{\(} and @samp{\)} when 
@code{TeX-electric-math} is
 @code{("\(" . "\)")}.
 @item
 When @code{TeX-electric-math} is a pair of dollars and the point is in
-inline math (without active region, @kbd{$} inserts two dollars, not one
+inline math (without active region), @kbd{$} inserts two dollars, not one
 dollar which just closes the math mode.
 @end itemize
 



bug#71164: 14.0.5; Font lock annoyance

2024-05-24 Thread Ikumi Keita
Hi Derek and Paul,

> If I don't turn on font locking when I use AUCTeX, I'm getting
> annoying messages almost every keystroke:

>   Error during redisplay: (internal--syntax-propertize 7526) signaled (error 
> "Font-lock trying to use keywords before setting them up”)

Thanks for your report. I admit AUCTeX isn't good at this point. It
depends on font lock facility to perform syntax propertizing. :-(

>>>>> Paul Nelson  writes:
> Another workaround might be M-: (font-lock-set-defaults).

It seems it does work while font lock itself is still disabled. I
speculate that the current syntax propertize function only needs that
font lock variables are set up. Then I hope the patch below does the
trick.

Derek, can you try it?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

diff --git a/font-latex.el b/font-latex.el
index ccddd8b1..7a02e3f4 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1313,7 +1313,10 @@ triggers Font Lock to recognize the change."
   (let ((kws ;; (if (derived-mode-p 'docTeX-mode)
  ;; font-latex-doctex-syntactic-keywords
font-latex-syntactic-keywords)) ;; )
-(syntax-propertize-via-font-lock kws)))
+(let ((func (syntax-propertize-via-font-lock kws)))
+  (lambda (start end)
+(or font-lock-set-defaults (font-lock-set-defaults))
+(funcall func start end)
 
 ;;;###autoload
 (defun font-latex-setup ()



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: [PATCH] fix delete-property handling

2024-05-16 Thread Ikumi Keita
>>>>> Artem Yurchenko  writes:
> Hi, Ikumi,
> I have finally got my assignment back!

Thank you! I pushed your changesets to the git repository. I'm happy to
have your nice contribution and thank for your patiance.

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



master 45ee2f9e 3/3: Update documentaion on changes related to delete-selection

2024-05-16 Thread Ikumi Keita
branch: master
commit 45ee2f9e674a82037c5d67d8851721255b8237d0
Author: Artem Yurchenko 
Commit: Ikumi Keita 

Update documentaion on changes related to delete-selection

* doc/auctex.texi:
* doc/changes.texi:
Update documentaion on changes related to delete-selection.
---
 doc/auctex.texi  | 17 ++---
 doc/changes.texi | 34 +-
 2 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/doc/auctex.texi b/doc/auctex.texi
index ca1eb339..e6bd045a 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -413,7 +413,7 @@ first dollar sign.
 
 @deffn Command TeX-insert-dollar @var{arg}
 @kindex $
-(@kbd{$}) Insert dollar sign.
+(@kbd{$}) Insert dollar sign (or another math delimiter).
 
 Show matching dollar sign if this dollar sign end the @TeX{} math mode.
 
@@ -437,14 +437,6 @@ Besides @code{nil}, possible values for this variable are 
@code{("$"
 . "$")} for @TeX{} inline equations @samp{$...$}, and @code{("\(" . "\)")}
 for @LaTeX{} inline equations @samp{\(...\)}.
 
-If the variable is non-@code{nil} and point is inside math mode right
-between a couple of single dollars, pressing @kbd{$} will insert another
-pair of dollar signs and leave the point between them.  Thus, if
-@code{TeX-electric-math} is set to @code{("$" . "$")} you can easily
-obtain a @TeX{} display equation @samp{$$...$$} by pressing @kbd{$} twice
-in a row.  (Note that you should not use double dollar signs in @LaTeX{}
-because this practice can lead to wrong spacing in typeset documents.)
-
 In addition, when the variable is non-@code{nil} and there is an active
 region outside math mode, typing @kbd{$} will put around the active region
 symbols for opening and closing inline equation and keep the region
@@ -469,6 +461,9 @@ following to your init file
 
 Math mode which didn't start with dollar(s) shouldn't be closed with dollar.
 @defopt TeX-refuse-unmatched-dollar
+This option @emph{has no effect} when @code{TeX-electric-math} is
+non-@code{nil}.
+
 This option determines the behavior when the user types @kbd{$} at a
 position where @AUCTeX{} thinks that it is in math mode which didn't start
 with dollar(s).
@@ -5326,7 +5321,7 @@ Here is a simple example of a style file.
 
 (TeX-add-style-hook
  "book"
- (lambda () 
+ (lambda ()
(LaTeX-largest-level-set "part"))
  TeX-dialect)
 @end lisp
@@ -6290,7 +6285,7 @@ buffer.  Note that you can make, say @samp{Makeinfo}, the 
default by
 adding this statement in your init file:
 
 @lisp
-(add-hook 'Texinfo-mode-hook 
+(add-hook 'Texinfo-mode-hook
   (lambda () (setq TeX-command-default "Makeinfo")))
 @end lisp
 
diff --git a/doc/changes.texi b/doc/changes.texi
index 0d57a654..7a5f95fe 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -213,6 +213,38 @@ Now synctex option is @option{--synctex=repeat} instead of
 ignores @option{--synctex} option if @option{--nonstop} is present.
 @end itemize
 
+@item
+@code{LaTeX-insert-left-brace}, @code{TeX-insert-dollar} and
+@code{TeX-insert-backslash} now have appropriate @code{delete-selection}
+properties, that differentiate between the ``electric'' and
+``just-insert-the-symbol'' behavior.  That should simplify cooperation
+with other electric modes.
+
+As a result of this adjustment, the behavior of @code{TeX-insert-dollar}
+is affected in some ways:
+@itemize @minus
+@item
+With raw prefix argument @kbd{C-u}, @kbd{$} (@code{TeX-insert-dollar}) now
+inserts four dollars as opposed to one.  This behavior is in-line with
+other symbols, in particular @kbd{"} (@code{TeX-insert-quote}) and @kbd{\}
+(@code{TeX-insert-backslash}).  If you need one literal @samp{$}, you can
+type @kbd{C-1 $} or @kbd{C-q $}.
+@item
+We no longer have explicit support of the special behavior that
+if @code{TeX-electric-math} is non-nil and point is inside math
+mode right between a couple of single dollars, pressing @kbd{$}
+will insert another pair of dollar signs and leave the point
+between them.
+
+It still works as before if @code{TeX-electric-math} is pair of dollars
+while it inserts @samp{\(} and @samp{\)} when @code{TeX-electric-math} is
+@code{("\(" . "\)")}.
+@item
+When @code{TeX-electric-math} is a pair of dollars and the point is in
+inline math (without active region, @kbd{$} inserts two dollars, not one
+dollar which just closes the math mode.
+@end itemize
+
 @item
 @AUCTeX{} now requires GNU Emacs 27.1 or higher.
 @end itemize
@@ -1621,7 +1653,7 @@ Verbatim commands like @samp{\verb|...|} will not be 
broken anymore
 during filling.
 
 @item
-You can customize the completion for graphic files with 
+You can customize the completion for graphic files with
 @code{LaTeX-includegraphics-read-file}.
 
 @item



master updated (dc1a8ee5 -> 45ee2f9e)

2024-05-16 Thread Ikumi Keita
ikumi pushed a change to branch master.

  from  dc1a8ee5  Delete `LaTeX-env-contents'
   new  3b0becf0  Split out the electric version of 
`LaTeX-insert-left-brace'
   new  7b8ae52d  Amend TeX electric commands to allow alternative electric 
modes
   new  45ee2f9e  Update documentaion on changes related to delete-selection


Summary of changes:
 doc/auctex.texi  |  17 ++-
 doc/changes.texi |  34 +-
 latex.el | 123 ++
 tex.el   | 313 +++
 4 files changed, 270 insertions(+), 217 deletions(-)



master 7b8ae52d 2/3: Amend TeX electric commands to allow alternative electric modes

2024-05-16 Thread Ikumi Keita
branch: master
commit 7b8ae52d828db69294abf0f79d8111e105a9595a
Author: Artem Yurchenko 
Commit: Ikumi Keita 

Amend TeX electric commands to allow alternative electric modes

1. In particular, we are splitting out the electric logic of
`TeX-insert-dollar'.

2. We've clarified that `TeX-refuse-unmatched-dollar' doesn't have an
effect when `TeX-electric-math' is non-nil.  The reason is that it's
complicated to support all math delimiters consistently, and the need
for this feature is unclear.  If there is a demand to support this in
the future, it can be done.  It's explained below in Appendix I.

3. We've removed the special case where
> If [[`TeX-electric-math']] non-nil and point is inside math
> mode right between a couple of single dollars, pressing `$'
> will insert another pair of dollar signs and leave the point
> between them.

4. We've changed `C-u $' to insert four dollars as opposed to one.  This
behavior is in-line with other symbols, in particular
`TeX-insert-quote' and `TeX-insert-backslash'.  If someone needs one
literal `$', they can type `C-1 $' or `C-q $'.

5. We've set appropriate `delete-selection' properties for
`TeX-insert-backslash', `TeX-newline' and `TeX-insert-dollar'.  See the
backstory below or the docstring for
`TeX--put-electric-delete-selection'.

6. We didn't fix `TeX-insert-quote'. Maybe later.

The backstory.

When a function bound to SYMBOL has optional «electric»
behavior, it might interfere with other «electric» modes,
e.g. `electric-pair-mode', `smartparens-mode'; see bug#47936.

As a way to «override» those modes, we use raw `insert' instead
of `self-insert-command'.  That prevents those electric modes
from running their hooks tied to `self-insert-command'.

However, when /our/ electric behavior is disabled (ELECTRICP is
nil), we want other electric modes to operate freely.  That
means, on the non-electric path, we should use
`self-insert-command' instead of `insert'.

Now, there arises an issue of `delete-selection'.  The electric
path usually doesn't want to delete selection, it wants to
operate some electricity on it; see bug#36385, bug#23177.  Now,
we could think that `delete-selection' for the non-electric path
should be t.  That would disable other electric modes from
working, as they also need to operate on selection.  The decision
is to inherit `delete-selection' from `self-insert-command',
which queries hooks from other electric modes to determine
whether deletion is necessary.

Appendix I.

To support a (generalized) TeX-insert-dollar with electric-math, we
would want the following.  We would want to forbid /arbitrary/ math mode
nesting, independent of the delimiter in TeX-electric-math.  However,
the naive approach causes issues with display math via "$$ bla-bla $$".
When the user presses $ once, they get "$-!-$".  When they press $
again, they can't get "$$-!-$$", because that is considered as "nested
math".  A simple way to fix this would be to special-case handling of a
dollar insert.  However, a more satisfactory way would be to "cycle"
through inline math, display math and no math on $ presses.  We actually
already implement that behavior on $ presses on a region.

* tex.el: (TeX-insert-dollar-electric-region, TeX-insert-dollar-electric):
(TeX--blink-matching-dollar, TeX-insert-dollar-action):
New function to refactor `TeX-insert-dollar'.
(TeX-insert-dollar): Use them.
(TeX-insert-dollar-1): Remove.
(TeX-electric-math, TeX-refuse-unmatched-dollar): Adjust the doc stirng.
(): Add appropriate `delete-selection' property to
`TeX-insert-backslash', `TeX-insert-dollar' and `TeX-insert-quote'.
---
 tex.el | 271 -
 1 file changed, 135 insertions(+), 136 deletions(-)

diff --git a/tex.el b/tex.el
index 2235df27..503a54b3 100644
--- a/tex.el
+++ b/tex.el
@@ -5141,6 +5141,9 @@ This function implements the idea from the last 
paragraph."
   (TeX-electric-macro)
 (self-insert-command arg)))
 
+(TeX--put-electric-delete-selection
+ #'TeX-insert-backslash (lambda () TeX-electric-escape))
+
 (defun TeX-insert-sub-or-superscript (arg)
   "Insert typed key ARG times and possibly a pair of braces.
 Brace insertion is only done if point is in a math construct and
@@ -5155,6 +5158,8 @@ Brace insertion is only done if point is in a math 
construct and
   "Call the function specified by the variable `TeX-newline-function'."
   (interactive) (call-interactively TeX-newline-function))
 
+(put #'TeX-newline 'delete-selection t)
+
 (progn
   (let ((map TeX-mode-map))
 ;; Standard
@@ -6149,18 +6154,14 @@ See `TeX-math-input-meth

master 3b0becf0 1/3: Split out the electric version of `LaTeX-insert-left-brace'

2024-05-16 Thread Ikumi Keita
branch: master
commit 3b0becf00535f77d47db8e39e17a726504254f53
Author: Artem Yurchenko 
Commit: Ikumi Keita 

Split out the electric version of `LaTeX-insert-left-brace'

Set the proper `delete-selection` property.

The backstory.

When a function bound to SYMBOL has optional «electric»
behavior, it might interfere with other «electric» modes,
e.g. `electric-pair-mode', `smartparens-mode'; see bug#47936.

As a way to «override» those modes, we use raw `insert' instead
of `self-insert-command'.  That prevents those electric modes
from running their hooks tied to `self-insert-command'.

However, when /our/ electric behavior is disabled (ELECTRICP is
nil), we want other electric modes to operate freely.  That
means, on the non-electric path, we should use
`self-insert-command' instead of `insert'.

Now, there arises an issue of `delete-selection'.  The electric
path usually doesn't want to delete selection, it wants to
operate some electricity on it; see bug#36385, bug#23177.  Now,
we could think that `delete-selection' for the non-electric path
should be t.  That would disable other electric modes from
working, as they also need to operate on selection.  The decision
is to inherit `delete-selection' from `self-insert-command',
which queries hooks from other electric modes to determine
whether deletion is necessary.

The changelog.

* tex.el (TeX--put-electric-delete-selection): New function, sets
the appropriate `delete-selection' property for electric functions.

* latex.el (LaTeX-insert-left-brace): Split out electric logic
into a few function `LaTeX-insert-left-brace-electric'
Set appropriate `delete-selection'.
---
 latex.el | 123 ---
 tex.el   |  42 ++
 2 files changed, 96 insertions(+), 69 deletions(-)

diff --git a/latex.el b/latex.el
index e66f4116..67680cee 100644
--- a/latex.el
+++ b/latex.el
@@ -3285,80 +3285,65 @@ supply the corresponding macro such as \\right before 
the right brace macro."
 (LaTeX-insert-corresponding-right-macro-and-brace
  left-macro left-brace optional)
 
+(defun LaTeX-insert-left-brace-electric (brace)
+  "Insert typed left BRACE and a corresponding right brace.
+
+BRACE should be a character.  See `LaTeX-insert-left-brace' for
+allowed BRACE values."
+  (when (and (TeX-active-mark) (> (point) (mark)))
+(exchange-point-and-mark))
+  (let ((lbrace (char-to-string brace)) lmacro skip-p)
+;; Use `insert' rather than `self-insert-command' so that
+;; unexpected side effects from `post-self-insert-hook',
+;; e.g. `electric-pair-mode', won't mess up the following
+;; outcomes. (bug#47936)
+(insert brace)
+(save-excursion
+  (backward-char)
+  ;; The brace "{" is exceptional in two aspects.
+  ;; 1. "\{" should be considered as a single brace
+  ;;like "(" and "[".
+  ;; 2. "\left{" is nonsense while "\left\{" and
+  ;;"\left(" are not.
+  (if (string= lbrace TeX-grop)
+  ;; If "{" follows "\", set lbrace to "\{".
+  (if (TeX-escaped-p)
+  (progn
+(backward-char)
+(setq lbrace (concat TeX-esc TeX-grop)))
+;; Otherwise, don't search for left macros.
+(setq skip-p t)))
+  (unless skip-p
+;; Obtain the name of preceding left macro, if any,
+;; such as "left", "bigl" etc.
+(setq lmacro (LaTeX--find-preceding-left-macro-name
+(let ((TeX-arg-right-insert-p t)
+  ;; "{" and "}" are paired temporally so that typing
+  ;; a single "{" should insert a pair "{}".
+  (TeX-braces-association
+   (cons (cons TeX-grop TeX-grcl) TeX-braces-association)))
+  (save-excursion
+(if (TeX-active-mark)
+(goto-char (mark)))
+(LaTeX-insert-corresponding-right-macro-and-brace
+ lmacro lbrace)
+
 (defun LaTeX-insert-left-brace (arg)
-  "Insert typed left brace ARG times and possibly a correspondig right brace.
+  "Insert typed left brace ARG times and possibly a corresponding right brace.
 Automatic right brace insertion is done only if no prefix ARG is given and
 `LaTeX-electric-left-right-brace' is non-nil.
 Normally bound to keys \(, { and [."
   (interactive "*P")
-  ;; If you change the condition for `auto-p', adjust the condition in
-  ;; the `delete-selection' property, just below this defun, accordingly.
-  (let ((auto-p (and LaTeX-electric-left-right-brace (not arg
-(if (and auto-p
- (TeX-active-mark)
- (> (point) (mark)))
-(exchange-point-and-mark))
-(i

bug#70503: [PATCH] Add function "TeX-master-output-file"

2024-05-14 Thread Ikumi Keita
>>>>> Arash Esbati  writes:
> Ok, thanks.  I think we'll wait until the patch for bug#70811 is
> installed and then we can start the release process.  Unless I'm missing
> something?

Now bug#70811 is resolved. I think we can go now.

Bye,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#70811: ConTeXt-mode-cleanup clobbers my paragraph-start

2024-05-14 Thread Ikumi Keita
Hi Jim,

>>>>> Jim  writes:
> In the interest of getting you an answer quickly, I only tested it for
> about 5 minutes, but in all of those tests, I can happily say that it did
> what I wanted it to do.

Thanks for testing. I pushed the fix to the git repository.

>> You can use
>> (add-hook 'LaTeX-mode-hook
>> (lambda ()
>> (add-hook 'find-file-hook
>> (lambda ()
>> (setq paragraph-start "abc")) <-- Set whatever you like
>> nil t)))
>> in your init file if you really need, but I'd like you to try the patch
>> below first.

> Thanks for that emacs-fu.  (Although I wonder if I want 'ConTeXt-mode-hook'
> intead of 'LaTeX-mode-hook'.)

You are right. That's `ConTeXt-mode-hook'. 

> Regardless of what hook I should use, this version of your patch seems to
> work very nicely.  Thank you for all the time you have put into this.

You're welcome. I'll close this bug.

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


master 970787f9: Improve paragraph commands management for ConTeXt mode (bug#70811)

2024-05-14 Thread Ikumi Keita
branch: master
commit 970787f92d21447296c474bee954ac1ac3e0b8de
Author: Ikumi Keita 
Commit: Ikumi Keita 

Improve paragraph commands management for ConTeXt mode (bug#70811)

* context.el (ConTeXt-paragraph-commands): New customize option similar
to LaTeX counterpart.
(ConTeXt-extra-paragraph-commands): Provide proper defvar.
(ConTeXt-paragraph-commands-regexp-make): Rename from
`ConTeXt-paragraph-commands-regexp' for consistency with latex.el.
Include `ConTeXt-paragraph-commands' to generate the regexp.
(ConTeXt-paragraph-commands-regexp): Add alias for backward
compatibility.
(ConTeXt-set-paragraph-start): Factor out following latex.el.
(ConTeXt-paragraph-commands-add-locally): New convinience function
similar to LaTeX counterpart.
(ConTeXt-mode-cleanup): Use new functions.
---
 context.el | 63 +++---
 1 file changed, 48 insertions(+), 15 deletions(-)

diff --git a/context.el b/context.el
index 0d5b9adb..8b0c88ee 100644
--- a/context.el
+++ b/context.el
@@ -53,9 +53,6 @@
 (require 'latex) ; for functions like `TeX-look-at' and `LaTeX-split-long-menu'
 (require 'plain-tex) ; for `plain-TeX-common-initialization'
 
-;; Silence the compiler:
-(defvar ConTeXt-extra-paragraph-commands)
-
 (defgroup ConTeXt-macro nil
   "Special support for ConTeXt macros in AUCTeX."
   :prefix "TeX-"
@@ -1121,18 +1118,59 @@ If OPTIONAL, only insert it if not empty, and then use 
square brackets."
 (defvar ConTeXt-item-list ()
   "List of macro's considered items.")
 
-(defun ConTeXt-paragraph-commands-regexp ()
-  "Return a regexp matching macros that should have their own line."
+(defvar ConTeXt-extra-paragraph-commands nil
+  "List of default ConTeXt macros that should begin their own line.
+Unlike `ConTeXt-paragraph-commands', each entry should be a regular
+expression without leading backslash.
+Updated in language-specific initialization.")
+
+(defcustom ConTeXt-paragraph-commands nil
+  "List of user ConTeXt macros that should begin their own line.
+The list should contain macro names without the leading backslash.
+
+If you change this variable, its value is reflected to only new buffers
+created afterwards; existing ConTeXt mode buffers aren't affected."
+  :group 'ConTeXt-macro
+  :type '(repeat (string)))
+
+(defun ConTeXt-paragraph-commands-regexp-make ()
+  "Return a regexp matching macros that should begin their own line."
   (concat
-   (regexp-quote TeX-esc) "\\("
+   (regexp-quote TeX-esc) "\\(?:"
"[][]\\|"  ; display math delimitors (is this applicable to ConTeXt??)
(ConTeXt-environment-start-name) "\\|"
(ConTeXt-environment-stop-name) "\\|"
(mapconcat #'car ConTeXt-numbered-section-list "\\b\\|") "\\b\\|"
(mapconcat #'car ConTeXt-unnumbered-section-list "\\b\\|") "\\b\\|"
+   (mapconcat #'identity ConTeXt-paragraph-commands "\\b\\|") "\\b\\|"
(mapconcat #'identity ConTeXt-extra-paragraph-commands "\\b\\|")
"\\b\\|"
(mapconcat #'identity ConTeXt-item-list "\\b\\|") "\\b\\)"))
+;; Backward compatibility.
+(defalias 'ConTeXt-paragraph-commands-regexp
+  #'ConTeXt-paragraph-commands-regexp-make)
+
+(defun ConTeXt-set-paragraph-start ()
+  "Set `paragraph-start'."
+  (setq paragraph-start
+(concat
+ "[ \t]*\\(?:"
+ LaTeX-paragraph-commands-regexp "\\|"
+ "\\$\\$\\|" ; Plain TeX display math
+ "$\\)")))
+
+(defun ConTeXt-paragraph-commands-add-locally (commands)
+  "Make COMMANDS be recognized as paragraph commands.
+COMMANDS can be a single string or a list of strings which will be added
+to `ConTeXt-extra-paragraph-commands'.  Additionally
+`LaTeX-paragraph-commands-regexp' will be updated.
+This is mainly a convenience function which can be used in style files."
+  (unless (listp commands) (setq commands (list commands)))
+  (dolist (elt commands)
+(add-to-list 'ConTeXt-extra-paragraph-commands elt))
+  (setq-local LaTeX-paragraph-commands-regexp
+  (ConTeXt-paragraph-commands-regexp-make))
+  (ConTeXt-set-paragraph-start))
 
 
 ;; Outline support
@@ -1908,16 +1946,11 @@ Run after mode hooks and file local variables 
application."
(mapconcat #'identity ConTeXt-item-list "\\|")
"\\)\\>")))
 
-  ;; Don't do locally-bound test for `LaTeX-paragraph-commands-regexp'
-  ;; and `paragraph-start'.  See comments in similar part in latex.el.
   (setq-local LaTeX-paragraph-commands-regexp
-  (ConTeXt-paragraph-commands-regexp))
-  (setq paragraph-start
-(concat
- "[ \t]*\\("
- (ConTeXt-paragraph-commands-regexp) "\\|"

bug#70817: 14.0.3.2024-03-17; max-lisp-eval-depth exceeded with XeTeX option

2024-05-13 Thread Ikumi Keita
Hi Landis,

>>>>> "Landis Florian (ladi)"  writes:
> Am 09.05.2024 um 15:01 schrieb Ikumi Keita:
>> I think this must be the issue bug#69373[1]. Landis, can you try the
>> patch given in [2]? If not, either
>> A. Update your emacs to 29.3 or

> I can confirm that the problem goes away if I use emacs 29.3.

> Thanks,

Thank you for confirmation. I'll close this bug.

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#70811: ConTeXt-mode-cleanup clobbers my paragraph-start

2024-05-13 Thread Ikumi Keita
Hi Jim,

>>>>> Jim  writes:
> Thank you very much for spending some time on this.  I tried it on this
> section of code

> \startitemize[yadda]
> \item sslkdslkd lskdlskdls slkd slkdslk
> sldk sldkl
> lkslks d sldsldk s sldksldk slkdsldksd sldsldk s sldksldk slkdsldksd
> sldsldk s sldksldk slkdsldksd
> \item sldsldk s sldksldk slkdsldksd
> \item fill this paragraph right here
> fill this paragraph right here fill this paragraph right here
> fill this paragraph right here
> \stopitemize

> and if I run fill-paragraph on the last item, I get

> ...
> \item fill this paragraph right here fill this paragraph right here fill
>   this paragraph right here fill this paragraph right here \stopitemize

> (i.e., the \stopitemize has become "part of" the "\item" paragraph).  I
> won't try to imagine what other ConTeXt users want, but I don't like this.

Thanks for your report. I'm sorry, I was wrong at altering regexp
generation code. Can you try the attached patch? (Undo the last patch
and apply the attached patch to the fresh source, please.)

> I wonder if the default definition should (could?) somehow capture all
> of them.

I expect the revised patch fills that bill.

> Given that the (interactive) customization doesn't want the leading
> '\',

Do you mean that `ConTeXt-paragraph-commands' doesn't include the
leading backslash? Then it isn't specific to interactive customization.
It is desgined after LaTeX counterpart, which also doesn't include the
leading backslash.

> is there any way to add that to paragraph-start with the code you
> recently added?

You can use
(add-hook 'LaTeX-mode-hook
  (lambda ()
 (add-hook 'find-file-hook
(lambda ()
   (setq paragraph-start "abc")) <-- Set whatever you like
    nil t)))
in your init file if you really need, but I'd like you to try the patch
below first.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

>From edc178926f57eca69c1676715657486f2e6ac952 Mon Sep 17 00:00:00 2001
From: Ikumi Keita 
Date: Thu, 9 May 2024 14:47:06 +0900
Subject: [PATCH] Improve paragraph commands management for ConTeXt mode
 (bug#70811)

* context.el (ConTeXt-paragraph-commands): New customize option similar
to LaTeX counterpart.
(ConTeXt-extra-paragraph-commands): Provide proper defvar.
(ConTeXt-paragraph-commands-regexp-make): Rename from
`ConTeXt-paragraph-commands-regexp' for consistency with latex.el.
Include `ConTeXt-paragraph-commands' to generate the regexp.
(ConTeXt-paragraph-commands-regexp): Add alias for backward
compatibility.
(ConTeXt-set-paragraph-start): Factor out following latex.el.
(ConTeXt-paragraph-commands-add-locally): New convinience function
similar to LaTeX counterpart.
(ConTeXt-mode-cleanup): Use new functions.
---
 context.el | 63 +-
 1 file changed, 48 insertions(+), 15 deletions(-)

diff --git a/context.el b/context.el
index 0d5b9adb..8b0c88ee 100644
--- a/context.el
+++ b/context.el
@@ -53,9 +53,6 @@
 (require 'latex) ; for functions like `TeX-look-at' and `LaTeX-split-long-menu'
 (require 'plain-tex) ; for `plain-TeX-common-initialization'
 
-;; Silence the compiler:
-(defvar ConTeXt-extra-paragraph-commands)
-
 (defgroup ConTeXt-macro nil
   "Special support for ConTeXt macros in AUCTeX."
   :prefix "TeX-"
@@ -1121,18 +1118,59 @@ If OPTIONAL, only insert it if not empty, and then use square brackets."
 (defvar ConTeXt-item-list ()
   "List of macro's considered items.")
 
-(defun ConTeXt-paragraph-commands-regexp ()
-  "Return a regexp matching macros that should have their own line."
+(defvar ConTeXt-extra-paragraph-commands nil
+  "List of default ConTeXt macros that should begin their own line.
+Unlike `ConTeXt-paragraph-commands', each entry should be a regular
+expression without leading backslash.
+Updated in language-specific initialization.")
+
+(defcustom ConTeXt-paragraph-commands nil
+  "List of user ConTeXt macros that should begin their own line.
+The list should contain macro names without the leading backslash.
+
+If you change this variable, its value is reflected to only new buffers
+created afterwards; existing ConTeXt mode buffers aren't affected."
+  :group 'ConTeXt-macro
+  :type '(repeat (string)))
+
+(defun ConTeXt-paragraph-commands-regexp-make ()
+  "Return a regexp matching macros that should begin their own line."
   (concat
-   (regexp-quote TeX-esc) "\\("
+   (regexp-quote TeX-esc) "\\(?:"
"[][]\\|"  ; display math delimitors (is this applicable to ConTeXt??)
(ConTeXt-environment-start-name) "\\|"
(ConTeXt-environment-stop-name) "\\|"
(mapconcat #'car ConTeXt-numbered-section-list "\\b\\|") "\\b\\|"
(mapconcat #

Re: [PATCH] fix delete-property handling

2024-05-10 Thread Ikumi Keita
Hi Artem,

>>>>> Artem Yurchenko  writes:
>> I moved the call to `TeX-math-input-method-off' out of the `if' form in
>> my local repository so that it's called always when
>> `TeX-insert-dollar-electric' runs, because this is the current behavior
>> of `TeX-insert-dollar'.

> While it is indeed the current behaviour, it didn't seem right. When
> we call electric math on a region, we end up /outside/ of math
> mode. For example:

>   point bla-bla mark → press $ → $bla-bla$ point.

> So, if we're outside of math, why turn off the input methods?

Indeed! I'll revert it and let it be as you proposed again. Thank you.

>> Now I think AUCTeX can incorporate your patches. Did your copyright
>> assignment process finish? If not, I'll push the change to the git repo
>> after you notify us the completion of the process.

> It's been more than a month since I've sent my signed papers, and
> still no progress :( I have signed them though, I can send them here
> too. It's just the FSF signature that is missing.

Hmm, that's a pity. Arash, Tassilo, Mosè and David, what do you think
about it?

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



bug#70817: 14.0.3.2024-03-17; max-lisp-eval-depth exceeded with XeTeX option

2024-05-09 Thread Ikumi Keita
Hi Landis and all,

>>>>> "Landis Florian (ladi)"  writes:
>   latex-mode()

>   #(mode LaTeX)
>   apply(# (mode LaTeX))
>   hack-one-local-variable(mode LaTeX)

I think this must be the issue bug#69373[1]. Landis, can you try the
patch given in [2]? If not, either
A. Update your emacs to 29.3 or
B. Put the following code block into somewhere in your init file
(~/.emacs.d/init.el)

--
(defun hack-one-local-variable (var val)
  "Set local variable VAR with value VAL.
If VAR is `mode', call `VAL-mode' as a function unless it's
already the major mode."
  (pcase var
('mode
 (let ((mode (intern (concat (downcase (symbol-name val))
  "-mode"
   (set-auto-mode-0 mode t)))
('eval
 (pcase val
   (`(add-hook ',hook . ,_) (hack-one-local-variable--obsolete hook)))
 (save-excursion (eval val t)))
(_
 (hack-one-local-variable--obsolete var)
 ;; Make sure the string has no text properties.
 ;; Some text properties can get evaluated in various ways,
 ;; so it is risky to put them on with a local variable list.
 (if (stringp val)
 (set-text-properties 0 (length val) nil val))
 (set (make-local-variable var) val
--

Sorry for inconvenience.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69373
[2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69373#14

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


master 77497418: Fix compilation on Emacs 27

2024-05-09 Thread Ikumi Keita
branch: master
commit 774974185a1a49db4ff0d48121c33b77e0546a04
Author: Ikumi Keita 
Commit: Ikumi Keita 

Fix compilation on Emacs 27

* tex.el (require): Require subr-x for `if-let' introduced in
`TeX-master-output-file'.
---
 tex.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tex.el b/tex.el
index e13c02ce..749037b5 100644
--- a/tex.el
+++ b/tex.el
@@ -34,7 +34,8 @@
 (require 'custom)
 (require 'tex-site)
 (eval-when-compile
-  (require 'cl-lib))
+  (require 'cl-lib)
+  (require 'subr-x))
 (require 'texmathp)
 ;; seq.el is preloaded in Emacs 29, so the next form can be removed
 ;; once 29 is the minimum required Emacs version



bug#70811: ConTeXt-mode-cleanup clobbers my paragraph-start

2024-05-09 Thread Ikumi Keita
Hi Jim,

>>>>> Jim  writes:
>> I think I can implement `ConTeXt-paragraph-commands' like LaTeX mode and
>> then you can set it instead of `paragraph-start'. What do you think
>> about this idea?

> I spent a few minutes looking at the code; I now have a glimmer of
> understanding, thanks.

> I still am unclear about why the setting of paragraph-start is done in
> the after-hook, rather than before the user's hook is called. However,
> it may well be that I don't need to understand this.

Suppose that there is a file local variable entry for
`LaTeX-paragraph-commands'. LaTeX mode uses after-hook so that its value
is reflected to `paragraph-start'. In addition, AUCTeX style files
casually overwrite `paragraph-start' to support various paragraph
commands; in that procedure, they never care what the user set to
`paragraph-start' in the mode hook and just overwrite. In other words,
AUCTeX doesn't consider `paragraph-start' as a variable which is to be
customized in the mode hook. The users are expected to use other
variables to control `paragraph-start'.

> I think your solution would work for me. My current paragraph-start
> does not have "[ \t]*" and yet does what I want, but perhaps having "[
> \t]*" won't hurt. Maybe it will make things better in some way I don't
> see now. Time will tell.

> In summary, thanks very much for the response, and if you are able to
> implement that for ConTeXt-mode I would very much appreciate it.

Thanks. Can you try the attached patch? If you customize the new option
`ConTeXt-paragraph-commands', its value will be reflected to
`paragraph-start' (for new buffers created after the customization).

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

>From b6bbde5c5678f23fdf6031d7f5dd29e811a792cd Mon Sep 17 00:00:00 2001
From: Ikumi Keita 
Date: Thu, 9 May 2024 14:47:06 +0900
Subject: [PATCH] Improve paragraph commands management for ConTeXt mode
 (bug#70811)

* context.el (ConTeXt-paragraph-commands): New customize option similar
to LaTeX counterpart.
(ConTeXt-extra-paragraph-commands): Provide proper defvar.
(ConTeXt-paragraph-commands-regexp-make): Rename from
`ConTeXt-paragraph-commands-regexp' for consistency with latex.el.
Make efficient regexp using `regexp-opt'.
(ConTeXt-paragraph-commands-regexp): Add alias for backward
compatibility.
(ConTeXt-set-paragraph-start): Factor out following latex.el.
(ConTeXt-paragraph-commands-add-locally): New convinience function
similar to LaTeX counterpart.
(ConTeXt-mode-cleanup): Use `ConTeXt-set-paragraph-start' so that the
value of `ConTeXt-paragraph-commands' is refected to `paragraph-start'.
---
 context.el | 79 +++---
 1 file changed, 57 insertions(+), 22 deletions(-)

diff --git a/context.el b/context.el
index 0d5b9adb..3ccd0637 100644
--- a/context.el
+++ b/context.el
@@ -53,9 +53,6 @@
 (require 'latex) ; for functions like `TeX-look-at' and `LaTeX-split-long-menu'
 (require 'plain-tex) ; for `plain-TeX-common-initialization'
 
-;; Silence the compiler:
-(defvar ConTeXt-extra-paragraph-commands)
-
 (defgroup ConTeXt-macro nil
   "Special support for ConTeXt macros in AUCTeX."
   :prefix "TeX-"
@@ -1121,18 +1118,61 @@ If OPTIONAL, only insert it if not empty, and then use square brackets."
 (defvar ConTeXt-item-list ()
   "List of macro's considered items.")
 
-(defun ConTeXt-paragraph-commands-regexp ()
-  "Return a regexp matching macros that should have their own line."
+(defvar ConTeXt-extra-paragraph-commands nil
+  "List of default ConTeXt macros that should begin their own line.
+Updated in language-specific initialization.")
+
+(defcustom ConTeXt-paragraph-commands nil
+  "List of user ConTeXt macros that should begin their own line.
+The list should contain macro names without the leading backslash.
+
+If you change this variable, its value is reflected to only new buffers
+created afterwards; existing ConTeXt mode buffers aren't affected."
+  :group 'ConTeXt-macro
+  :type '(repeat (string)))
+
+(defun ConTeXt-paragraph-commands-regexp-make ()
+  "Return a regexp matching macros that should begin their own line."
   (concat
-   (regexp-quote TeX-esc) "\\("
+   (regexp-quote TeX-esc) "\\(?:"
"[][]\\|"  ; display math delimitors (is this applicable to ConTeXt??)
-   (ConTeXt-environment-start-name) "\\|"
-   (ConTeXt-environment-stop-name) "\\|"
-   (mapconcat #'car ConTeXt-numbered-section-list "\\b\\|") "\\b\\|"
-   (mapconcat #'car ConTeXt-unnumbered-section-list "\\b\\|") "\\b\\|"
-   (mapconcat #'identity ConTeXt-extra-paragraph-commands "\\b\\|")
-   "\\b\\|"
-   (mapconcat #'identity ConTeXt-item-list "\\b\\|") "\\b\\)"))
+ 

bug#70811: ConTeXt-mode-cleanup clobbers my paragraph-start

2024-05-06 Thread Ikumi Keita
Hi Jim,

>>>>> Jim  writes:
> ConTeXt mode has the defun ConTeXt-mode-cleanup which is the :after-hook
> of ConTeXt-mode.  In this cleanup defun, paragraph-start is re-set.
> Unfortunately, this over-writes my choice of paragraph-start which I set
> in my ConTeXt-mode hook.  Unless there is some ":after-after-hook" or
> ":really-after-hook" or ":my-after-hook" or some other (unknown to me)
> way of doing something after ConTeXt-mode-cleanup, I have to
> handraulically (re-)setq paragraph-start after loading my file.

> This is not a good thing.

> The comment in context.el mentions doing this for reasons similar to the
> same part of latex.el,
>   ;; Don't do locally-bound test for `LaTeX-paragraph-commands-regexp'
>   ;; and `paragraph-start'.  See comments in similar part in latex.el.
> but not being a latex user I don't understand why this is desired for latex
> users, and so I can't transmogrify that to why context users might want
> this.

> In any case,
> (a) do we really need the paragraph-start setting code in context.el, and
> (b) if so, could there be some user option which tells ConTeXt-mode-cleanup
> to *not* setq paragraph-start ?

> (Or perhaps there is already a way which I don't have enough emacs-fu to
> know.  I am happy to be enlightened.)

Thank you for the report. The reason for LaTeX mode is that this
treatment enables AUCTeX to add flexibly new commands afterwards as
paragraph starters through sub files supporting various LaTeX packages
("style files" in AUCTeX terminology). AUCTeX style files overwrites
`paragraph-start' casually in LaTeX mode, so users who want to customize
it in the LaTeX mode hook should actually set `LaTeX-paragraph-commands'
instead.

In principle, ConTeXt mode should have similar framework, although the
current AUCTeX style files have no support for ConTeXt modules except
TikZ.

I think I can implement `ConTeXt-paragraph-commands' like LaTeX mode and
then you can set it instead of `paragraph-start'. What do you think
about this idea?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#70779: [PATCH] Emacs 30 and warning about missing lexical-binding declaration

2024-05-06 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> Thanks for your response; we don't really need them, it was driven by my
> habit of having prop-lines justified right.  A simple

>   ;; -*- lexical-binding: t;

> looked odd to me.

Hmm, it doesn't to me. :-)

> What do you think is appropriate?

I think these auto files are generally not intended for human eyes. So
we wouldn't have to care much about the justtification of the prop line.
I vote for simpler form.

Best,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#70779: [PATCH] Emacs 30 and warning about missing lexical-binding declaration

2024-05-06 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:

> That change in Emacs in reverted (d51de0c5d9), but still, I think we can
> turn lexical-binding on in auto-parsed style files as well.  I will
> install this in a day or two if there are no other comments.

I'm not actually against your proposal, but why do we need 40 spaces here?

>> +  (insert ";;" (make-string 40 ?\s) "-*- lexical-binding: t; 
>> -*-\n\n")
       

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#58005: 13.1.4; Can't work with indirect buffers

2024-05-04 Thread Ikumi Keita
Hi all,

>>>>> Arash Esbati  writes:
> Paul Nelson  writes:
>> Somewhere between when I tried Vangelis's patch (earlier in this
>> thread) and when it was installed, it seems that a further change was
>> made to preview-region that breaks previews in indirect buffers.
>> Specifically, the substitution buffer-file-name ->
>> (TeX-buffer-file-name) was applied where it shouldn't be.
>> 
>> The issue is as explained in my earlier email in this thread -- we
>> actually want "" to be the filename when doing previews for
>> indirect buffers, so that preview-parse-messages ultimately places
>> them according to the command buffer rather than according to the
>> filename.  (It might clarify here to note that AFAIK, the "original"
>> argument to TeX-region-create is relevant only when doing
>> preview-document, which is irrelevant for indirect buffers.)
>> 
>> I've attached a patch reverting this particular substitution, so that
>> previews once again work in indirect buffers.

> @Keita and Vangelis: Any comments on Paul's proposal?

Hmm, sorry. Contrary to what I said before, the current master puts the
preview images in the base buffer for both document preview (C-c C-p
C-d) and region preview (C-c C-p C-r etc.). Maybe I was doing something
wrong. :-(

It seems to me that Paul's approach makes sense. I'd like to hear
Vangelis'es opinion.

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: [PATCH] fix delete-property handling

2024-05-02 Thread Ikumi Keita
Hi Artem,

>>>>> Artem Yurchenko  writes:
> I haven't seen any objections, so I moved on with restoring the old
> behaviour.

Thank you for your cooperation.

>>> +(define-obsolete-variable-alias 'TeX-refuse-unmatched-dollar
>>> + 'TeX-refuse-nested-math "13.4"

>> The next AUCTeX version would be 14. (The ELPA releases already reached
>> 14.) So the version should be "14" or "14.1".

> Since I've restored the old behaviour, it makes sense to preserve the
> old variable name.

OK.

>> In general, an elisp function whose name ends with "-mode" is a major or
>> minor mode function, or is expected to do something related to major or
>> minor modes, at least within AUCTeX source. Thus I'd like you to change
>> this name `TeX-insert-dollar-mode' to `TeX-insert-dollar-action' or
>> something like that for coherency. (Since it can be considered as a
>> private helper function, you might as well assign it a name
>> "TeX--insert-..."; but that isn't much important.)

> Done. However, I don't want to make it private, since the helper could
> be useful to other electric modes, which can enable or disable
> features based on the operation mode.

OK.

>> In addition, I'd request to provide appropriate patches for
>> doc/auctex.texi and doc/changes.texi, too. :-)

> Done.

Thanks. I'll add one minor modification, in addition to some trivial
adjustments:
--
(defun TeX-insert-dollar-electric ()
  "Perform electric math symbol insertion.
See `TeX-electric-math'."
  (if (and (TeX-active-mark) (/= (point) (mark)))
  (TeX-insert-dollar-electric-region)
(insert (car TeX-electric-math))
(save-excursion (insert (cdr TeX-electric-math
  (TeX-math-input-method-off))   <-- CHANGED
--
I moved the call to `TeX-math-input-method-off' out of the `if' form in
my local repository so that it's called always when
`TeX-insert-dollar-electric' runs, because this is the current behavior
of `TeX-insert-dollar'.

Now I think AUCTeX can incorporate your patches. Did your copyright
assignment process finish? If not, I'll push the change to the git repo
after you notify us the completion of the process.

Best regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



bug#70503: [PATCH] Add function "TeX-master-output-file"

2024-04-27 Thread Ikumi Keita
>>>>> Arash Esbati  writes:
> Thanks Keita.  Can you in future also add/amend the bug number to the
> commit message, please?  It makes it easier to search for a bug inside
> Git.

Oh, sorry. I forgot to fix up the commit messages to include the bug
number for recent commits. :-(

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


main 56b5dab1: Recover compatibility with non-GNU sed

2024-04-27 Thread Ikumi Keita
branch: main
commit 56b5dab16630ea31dbcec239f10b04a3748c5408
Author: Ikumi Keita 
Commit: Ikumi Keita 

Recover compatibility with non-GNU sed

* GNUmakefile (LASTVERSION): Avoid syntax invalid for non-GNU sed.
---
 GNUmakefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/GNUmakefile b/GNUmakefile
index 507d69fd..4f90cd07 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -101,7 +101,8 @@ AUCTEXDATE:=$(shell (git log -n1 --pretty=tformat:"%ci" 
2>/dev/null \
 THISVERSION:=$(shell git show HEAD -- auctex.el 2>/dev/null \
| sed -nre 's/[+];; Version: ([0-9]+.[0-9]+.[0-9]+)/\1/p')
 # Extract the last released version number from `auctex.el`.
-LASTVERSION:=$(shell sed -nre '/Version:/{s/;; Version: 
([0-9]+.[0-9]+.[0-9]+)/\1/p;q}' auctex.el)
+LASTVERSION:=$(shell grep "^;; Version:" auctex.el \
+ | sed -nre 's/;; Version: ([0-9]+.[0-9]+.[0-9]+)/\1/p;q')
 AUCTEXVERSION:=$(if $(THISVERSION),$(THISVERSION),$(LASTVERSION).$(AUCTEXDATE))
 
 tex-site.el: tex-site.el.in



bug#70503: [PATCH] Add function "TeX-master-output-file"

2024-04-26 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> Thanks for looking at this.  The new workflow (for the time being) is
> actually the old one: Push all changes to the master branch, and we can
> merge that onto main when needed.  The only minor change is probably to
> add noteworthy changes to NEWS.org and not to changes.texi.

Thanks, I committed to the master branch and pushed. I'll close this
bug.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


master 255da611: Add function TeX-master-output-file

2024-04-26 Thread Ikumi Keita
branch: master
commit 255da61131a20b1f72ce656bec5d4cf8ccf0f0ac
Author: Paul Nelson 
Commit: Ikumi Keita 

Add function TeX-master-output-file

* tex.el (TeX-master-output-file): New function.
---
 tex.el | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/tex.el b/tex.el
index 9fb533ff..d2864b5f 100644
--- a/tex.el
+++ b/tex.el
@@ -2608,6 +2608,16 @@ ARGNAME is prepended to the quoted output directory.  If
 (concat argname "\"" out-dir "\"")
   "")))
 
+(defun TeX-master-output-file (extension)
+  "Return the output file with given EXTENSION.
+If `TeX-output-dir' is nil, then defer to `TeX-master-file'.  Otherwise,
+return the file of the same name, but in the build directory specified by
+`TeX-output-dir'."
+  (let ((master (TeX-master-file extension)))
+(if-let ((output-dir (TeX--master-output-dir (TeX-master-directory) t)))
+(concat output-dir (file-name-nondirectory master))
+  master)))
+
 (defcustom TeX-style-local "style"
   "Directory containing hand generated TeX information.
 



bug#70503: [PATCH] Add function "TeX-master-output-file"

2024-04-26 Thread Ikumi Keita
Hi Paul,

>>>>> Paul Nelson  writes:
> I think that a function as in the attached patch, which wraps the
> function TeX--master-output-dir introduced along with TeX-output-dir,
> would be a useful addition to the public-facing API.  For example, I
> would use it in both of the packages that I recently shared on the
> devel list (these would otherwise refer to the internal function
> TeX--master-output-dir).  Any other suggestions are welcome, of
> course.

The proposed function seems reasonable enough and I think AUCTeX can
accept it.

To Tassilo & Arash: I'm not sure the new workflow after the inclusion of
the main branch. Should I commit new changeset to main branch instead of
master branch now? And should I add an entry for NEWS.org, in addition
to commit message?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: [can't compile the main branch]

2024-04-25 Thread Ikumi Keita
Hi all,

>>>>> Stefan Monnier  writes:
>> And I like the way the manual is formatted.  Compare this:
>> https://www.gnu.org/software/auctex/manual/auctex.html
>> with this:
>> https://elpa.gnu.org/devel/doc/auctex.html

> Hmm... nice.  FWIW, the elpa rendering is the same as that of

> https://www.gnu.org/software/emacs/manual/html_node/emacs/index.html

> not sure why https://www.gnu.org/software/auctex/manual/auctex.html is
> not as nice.

The reason must be that the traditional AUCTeX html manuals are
generated with texi2html, not makeinfo.

A while ago, I noticed that the preview-latex html manual lacks its
contents in the FAQ section[1] and am preparing to propose the attached
change to use makeinfo rather than texi2html, so that others can test
it. But it seems it's no longer necessary :-)

[1] all nodes below 
https://www.gnu.org/software/auctex/manual/preview-latex/Frequently-Asked-Questions.html

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

>From 37a225843d9995b308a36942f3d38fdfbaec9a46 Mon Sep 17 00:00:00 2001
From: Ikumi Keita 
Date: Thu, 18 Apr 2024 22:18:24 +0900
Subject: [PATCH] Immigrate from texi2html to makeinfo

* gendocs.sh.patch: New file. Copy from gendocspatch branch and arrange
for use with makeinfo.
* Makefile.in (www-doc): Arrange options for gendocs.sh for makeinfo.
Change URL to retrieve gendocs.sh.patch from master branch.
---
 Makefile.in  | 12 -
 gendocs.sh.patch | 67 
 2 files changed, 73 insertions(+), 6 deletions(-)
 create mode 100644 gendocs.sh.patch

diff --git a/Makefile.in b/Makefile.in
index bc2ea951..c2c8bf83 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -605,17 +605,17 @@ www-doc: check-tag
 	$(CP) auctex-$(TAG)/doc/*.texi $(WWWDIR)/manual
 	cd $(WWWDIR)/manual \
 	&& wget -O gendocs.sh 'https://cvs.savannah.gnu.org/viewvc/%2acheckout%2a/texinfo/texinfo/util/gendocs.sh' \
-	&& wget -O gendocs.sh.patch 'https://git.savannah.gnu.org/gitweb/?p=auctex.git;a=blob_plain;f=gendocs.sh.patch;hb=gendocspatch' \
+	&& wget -O gendocs.sh.patch 'https://git.savannah.gnu.org/gitweb/?p=auctex.git;a=blob_plain;f=gendocs.sh.patch;hb=master' \
 	&& patch https://cvs.savannah.gnu.org/viewvc/%2acheckout%2a/texinfo/texinfo/util/gendocs_template' \
 	&& sed -i -e 's/html_node\/index\.html/%%PACKAGE%%\/index.html/' gendocs_template \
 	&& mkdir .texinfo \
-	&& echo -e "emacs split https://www.gnu.org/software/emacs/manual/html_node/emacs/\nemacs mono https://www.gnu.org/software/emacs/manual/html_mono/emacs.html\nreftex split https://www.gnu.org/software/auctex/manual/reftex/\nreftex mono https://www.gnu.org/software/auctex/manual/reftex.html\n; > .texinfo/htmlxref.cnf \
-	&& ./gendocs.sh --email bug-auc...@gnu.org --texi2html \
-	  --html --use-nodes auctex "AUCTeX Manual" \
-	&& ./gendocs.sh --email bug-auc...@gnu.org --texi2html \
-	  --html --use-nodes preview-latex "preview-latex Manual"
+	&& echo -e "emacs node https://www.gnu.org/software/emacs/manual/html_node/emacs/\nemacs mono https://www.gnu.org/software/emacs/manual/html_mono/emacs.html\nreftex node https://www.gnu.org/software/auctex/manual/reftex/\nreftex mono https://www.gnu.org/software/auctex/manual/reftex.html\n; > .texinfo/htmlxref.cnf \
+	&& ./gendocs.sh --email bug-auc...@gnu.org \
+	  auctex "AUCTeX Manual" \
+	&& ./gendocs.sh --email bug-auc...@gnu.org \
+	  preview-latex "preview-latex Manual"
 
 preview-ball: check-tag
 	test ! -d $(PREVIEW_BUILD_DIR) || rm -r $(PREVIEW_BUILD_DIR)
diff --git a/gendocs.sh.patch b/gendocs.sh.patch
new file mode 100644
index ..3c3967ce
--- /dev/null
+++ b/gendocs.sh.patch
@@ -0,0 +1,67 @@
+--- gendocs.sh.orig	2014-10-29 14:25:47.404620794 +0100
 gendocs.sh	2014-10-29 14:35:45.812600075 +0100
+@@ -320,9 +320,9 @@
+ tar -czf "$abs_outdir/${PACKAGE}.html_$1.tar.gz" -- *.html
+   )
+   eval html_$1_tgz_size=`calcsize "$outdir/${PACKAGE}.html_$1.tar.gz"`
+-  rm -f "$outdir"/html_$1/*.html
+-  mkdir -p "$outdir/html_$1/"
+-  mv ${split_html_dir}/*.html "$outdir/html_$1/"
++  rm -f "$outdir"/${PACKAGE}/*.html
++  mkdir -p "$outdir/${PACKAGE}/"
++  mv ${split_html_dir}/*.html "$outdir/${PACKAGE}/"
+   rmdir ${split_html_dir}
+ }
+ 
+@@ -351,9 +351,9 @@
+   )
+   eval \
+ html_${split}_tgz_size=`calcsize "$outdir/$PACKAGE.html_$split.tar.gz"`
+-  rm -rf "$outdir/html_$split/"
+-  mv $split_html_dir "$outdir/html_$split/"
+-  du -s "$outdir/html_$split/"
++  rm -rf "$outdir/${PACKAGE}/"
++  mv $split_html_dir "$outdir/${PACKAGE}/"
++  du -s "$outdir/${PACKAGE}/"
+   ls -l "$outdir/$PACKAGE.html_$

bug#58005: 13.1.4; Can't work with indirect buffers

2024-04-25 Thread Ikumi Keita
[ To phil...@haselwarter.org: I'm sorry, the thread began to fail to
include you in Cc:; It seems to reach a reasonable solution. ]

>>>>> Vangelis Evangelou  writes:
> OK. I attach the diff.
> On Wed, 24 Apr 2024 at 10:57, Ikumi Keita  wrote:

Thanks, I added small adaptaion and a paragraph explaining the
preview-document behavior, and pushed to the git repo. I'll close this
bug.

>> To AUCTeX admins: Do you think Vangelis'es patch needs copyright
>> assignment? In my opinion, it doesn't because definition of
>> `TeX-buffer-file-name' is straightforward and other changes are trivial
>> (replacements of `buffer-file-name' -> `TeX-buffer-file-name' or
>> additions of `(with-current-buffer (or (buffer-base-buffer)
>> (current-buffer))...')

I committed with "Copyright-paperwork-exempt: yes".
 
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


master 0e315c7f: Support indirect buffer

2024-04-25 Thread Ikumi Keita
branch: master
commit 0e315c7fbeed081addf369fd42e7206d83580bc5
Author: Vangelis Evangelou 
Commit: Ikumi Keita 

Support indirect buffer

* tex.el (TeX-buffer-file-name): New wrapper function for
`buffer-file-name'.  It returns base buffer's file name in indirect
buffer.
(TeX-master-file, TeX-normal-mode): Wrap the body in
`with-current-buffer' in case called in indirect buffer.
Omit an unused return value in `save-excursion' form.
(TeX-master-directory): Omit redundant optional argument for
`expand-file-name'.
* bib-cite.el:
* latex.el:
* preview.el.in:
* style/catchfilebetweentags.el:
* style/pdfsync.el:
* tex-info.el:
* tex.el:
* toolbar-x.el:
Replace call to `buffer-file-name' and reference to `buffer-file-name'
with call to `TeX-buffer-file-name' (or equivalent form).

Copyright-paperwork-exempt: yes
---
 bib-cite.el   |   2 +-
 doc/changes.texi  |  12 +++
 latex.el  |   4 +-
 preview.el.in |   8 +-
 style/catchfilebetweentags.el |   2 +-
 style/pdfsync.el  |   2 +-
 tex-info.el   |   2 +-
 tex.el| 223 ++
 toolbar-x.el  |   6 +-
 9 files changed, 142 insertions(+), 119 deletions(-)

diff --git a/bib-cite.el b/bib-cite.el
index 5a7de98f..7b425cac 100644
--- a/bib-cite.el
+++ b/bib-cite.el
@@ -1903,7 +1903,7 @@ If no master file, then return current default."
 ;; rather than\input file
 (re-search-forward "^[ \t]*\\(include\\|input\\){"
nil t
-   (buffer-file-name))
+   (TeX-buffer-file-name))
   (t
nil
 (cond
diff --git a/doc/changes.texi b/doc/changes.texi
index cae91aa2..0d57a654 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -11,6 +11,18 @@
 @heading News in 14.1
 
 @itemize @bullet
+@item
+@AUCTeX{} can be used with indirect buffers cloned from buffers visiting a
+file.  This feature allows having different perspectives of the same
+buffer (narrowing, folding, previewing, etc).  The indirect buffer has the
+same master file as its base buffer.
+
+In indirect buffer, @previewlatex{} works naturally for region preview
+such as @code{preview-region} (@kbd{C-c C-p C-r}), but document preview
+@code{preview-document} (@kbd{C-c C-p C-d}) puts preview images in the
+base buffer, not in the indirect buffer itself.  We expect this behavior
+doesn't matter because of the users' intent.
+
 @item
 @AUCTeX{} changes major mode names.  Its primary purpose is to avoid
 conflicts with Emacs built-in @TeX{} major modes.  It also improves
diff --git a/latex.el b/latex.el
index c5965b05..9e769e97 100644
--- a/latex.el
+++ b/latex.el
@@ -2569,7 +2569,7 @@ string."
 Initial input is the name of the file being visited in the
 current buffer, with extension.  If OPTIONAL is non-nil, insert
 it as an optional argument.  Use PROMPT as the prompt string."
-  (let ((name (file-name-nondirectory buffer-file-name)))
+  (let ((name (file-name-nondirectory (TeX-buffer-file-name
 (TeX-argument-insert
  (TeX-read-string
   (TeX-argument-prompt optional
@@ -2590,7 +2590,7 @@ current buffer, without extension.  If OPTIONAL is 
non-nil,
 insert it as an optional argument.  Use PROMPT as the prompt
 string."
   (let ((name (file-name-sans-extension
-   (file-name-nondirectory buffer-file-name
+   (file-name-nondirectory (TeX-buffer-file-name)
 (TeX-argument-insert
  (TeX-read-string
   (TeX-argument-prompt optional
diff --git a/preview.el.in b/preview.el.in
index 12500011..7b59a3de 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -3079,8 +3079,8 @@ pp")
#'desktop-buffer-preview-misc-data)
   (add-hook 'pre-command-hook #'preview-mark-point nil t)
   (add-hook 'post-command-hook #'preview-move-point nil t)
-  (when buffer-file-name
-(let* ((filename (expand-file-name buffer-file-name))
+  (when (TeX-buffer-file-name)
+(let* ((filename (expand-file-name (TeX-buffer-file-name)))
format-cons)
   (when (string-match (concat "\\." TeX-default-extension "\\'")
   filename)
@@ -4128,8 +4128,8 @@ The function bound to this variable will be called inside
  (if preview-preprocess-function
  (funcall preview-preprocess-function str)
str))
-   (if buffer-file-name
-   (file-name-nondirectory buffer-file-name)
+   (if (TeX-buffer-file-name)
+   (file-name-nondirectory (TeX-buffer-file-name))
  "")
(TeX-current-offset begin)))
   (setq TeX-current-proce

bug#70501: [PATCH] Fix preview bug involving long common suffixes

2024-04-24 Thread Ikumi Keita
Hi Paul,

>>>>> Paul Nelson  writes:
> These positions are recovered by Emacs using calls to search-forward
> that always start at the beginning of line.  The strings that should
> identify the end of overlay2 also match the end of overlay1, hence the
> bug.  The fix is to bump the point forward, before searching, by just
> enough so that the search must go beyond any previous position
> identified on the same line.

Thanks, pushed to the git repo. I'll close this bug.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


master 36590b04: Fix preview bug involving long common suffixes

2024-04-24 Thread Ikumi Keita
branch: master
commit 36590b044f86a546b1a0b21e89e301ed29408be4
Author: Paul Nelson 
Commit: Ikumi Keita 

Fix preview bug involving long common suffixes

* preview.el.in (preview-parse-messages): Fix it.
---
 preview.el.in | 8 
 1 file changed, 8 insertions(+)

diff --git a/preview.el.in b/preview.el.in
index a2c0235d..12500011 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -3340,6 +3340,7 @@ call, and in its CDR the final stuff for the placement 
hook."
 (let (TeX-error-file TeX-error-offset snippet box counters
   file line
   (lsnippet 0) lstart (lfile "") lline lbuffer lpoint
+  lpos
   lcounters
   string after-string
   offset
@@ -3610,6 +3611,12 @@ name(\\([^)]+\\))\\)\\|\
   (car preview-current-region))
(goto-char (car preview-current-region)))
 
+  ;; Make sure that we don't accidentally match
+  ;; something earlier in the search that follows.
+  (and (eq (current-buffer) lbuffer)
+   (= lline line)
+   (goto-char (max (point) (- (1+ lpos) (length 
string)
+
   (cond
((search-forward (concat string after-string)
 (line-end-position) t)
@@ -3645,6 +3652,7 @@ name(\\([^)]+\\))\\)\\|\
string
(line-end-position) t
 (setq lline line
+  lpos (point)
   lbuffer (current-buffer))
 (if box
 (progn



Re: [can't compile the main branch]

2024-04-24 Thread Ikumi Keita
>>>>> Uwe Brauer  writes:
> So I am confused now, shall I try out to make a symbolic link or not? 

You can try either way. Try one of the symblic link or this patch:
diff --git a/build-aux/gitlog-to-auctexlog b/build-aux/gitlog-to-auctexlog
index 808597d5..944d90ff 100755
--- a/build-aux/gitlog-to-auctexlog
+++ b/build-aux/gitlog-to-auctexlog
@@ -60,6 +60,12 @@ fi
 gen_origin=$2
 }
 
+# If this is not a Git repository, just generate an empty ChangeLog.
+test -d .git || {
+  >"$output"
+  exit
+}
+
 # Get the new value for gen_origin from the latest version in the repository.
 new_origin=`git log --pretty=format:%H 'HEAD^!'` || exit
 
@@ -68,12 +74,6 @@ if [ -f "$output" ]; then
 rm -f "$output" || exit 1
 fi
 
-# If this is not a Git repository, just generate an empty ChangeLog.
-test -d .git || {
-  >"$output"
-  exit
-}
-
 # Use Gnulib's packaged ChangeLog generator.
 # Maybe we should skip all "Merge branch 'master'" messages.
 ./build-aux/gitlog-to-changelog \


Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: [can't compile the main branch]

2024-04-24 Thread Ikumi Keita
Hi all,

Hmm, build-aux/gitlog-to-auctexlog is not a perl script, actually is a
Bourne shell script. I was looking at gitlog-to-changelog 

>>>>> Arash Esbati  writes:
> Hmm, build-aux/gitlog-to-auctexlog contains[1]:
> # If this is not a Git repository, just generate an empty ChangeLog.
> test -d .git || {
>> "$output"
>   exit
> }
> Maybe Uwe has a .git directory in his setup, but it isn't a real .git
> directory as Git would expect?

It seems that the script bails out before reaching that line, here:
new_origin=`git log --pretty=format:%H 'HEAD^!'` || exit
         ^^^

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: [can't compile the main branch]

2024-04-24 Thread Ikumi Keita
>>>>> Uwe Brauer  writes:
>>>> "SM" == Stefan Monnier  writes:
>>> Hence either
>>> 1) Uwe installs git

>> He does have Git installed.  He's just working in a directory that's not
>> under Git's control.

> That is correct. I prefer to clone the auctex devel repo with mercurial,
> since I am much more acquainted with mercurial, and therefore it is
> easier for me to make a new branch for testing, than it is with git.

I'm sorry, I was wrong about it. Uwe uses hg-git and the local repository
doesn't contain .git directory. I don't remember well what hg-git does,
but isn't there the "real" .git direcotry in the .hg directory? In other
words, I suspect the directory structure is

repo-dir -+- .hg -+- .git
  |   |
  +- bib-cite.el  +- FILES_FOR_MERCURIAL_REPO
  +- ...  +- ...

If this is correct, making symbolic link by
ln -s .hg/.git .
might be another mean to make gitlog-to-auctexlog work.

> I tried out also the repository that I cloned with git and encounter
> other problems, since my Emacs-repository-version  is 

> "7bf17ceee8c2d347917541e143ce25609e90ebbb"

> Even though emacs-version tells me 29.0.50

> And therefore too old.

This is another problem. I suggest to use master branch and stay away
from main branch until Uwe can use emacs 29.1 or newer.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: [can't compile the main branch]

2024-04-24 Thread Ikumi Keita
Hi Uwe,

>>>>> Uwe Brauer  writes:
> Thanks I applied the patch and run make EMACSBIN=/opt/emacs29/bin/emacs

> Result:
> fatal: not a git repository (or any of the parent directories): .git
> sed -e 's|@lisppackagelispdir@|(file-name-directory load-file-name)|'\
> -e 's|@lisppackagedatadir@|(file-name-directory load-file-name)|'\
> -e 's|@lispautodir@|(if (file-writable-p "/usr/local/var/auctex") 
> "/usr/local/var/auctex" "~/.emacs.d/auctex")|'\
> -e 's|@AUCTEXVERSION@|14.0.4.2024-04-24_08:10:19|'\
> -e 's|@AUCTEXDATE@|2024-04-24_08:10:19|'\
> tex-site.el.in >tex-site.el
> make: *** No rule to make target 'ChangeLog', needed by 'doc/version.texi'.  
> Stop.
> Sorry, still does not work

The GNUmakefile uses perl script build-aux/gitlog-to-auctexlog to
generate Changelog, and that script calls git internally. Thus Changelog
isn't generated without running git binary.

Hence either
1) Uwe installs git
2) AUCTeX implements fallback in build-aux/gitlog-to-auctexlog
is necessary to have Changelog.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



bug#58005: 13.1.4; Can't work with indirect buffers

2024-04-24 Thread Ikumi Keita
Hi Vangelis,

>>>>> Vangelis Evangelou  writes:
> Hi all.
> I'm not sure what the ideal outcome is. It depends on each user's case. In
> principle, indirect buffers have identical text content as their base
> buffer, but different view properties, so the previews not showing in the
> indirect buffer agrees with this principle. I therefore, agree with Paul's
> comment.

Thank you. Then I think AUCTeX can incorporate your proposal. Can you
make an entry for doc/changes.texi and send the diff? 

To AUCTeX admins: Do you think Vangelis'es patch needs copyright
assignment? In my opinion, it doesn't because definition of
`TeX-buffer-file-name' is straightforward and other changes are trivial
(replacements of `buffer-file-name' -> `TeX-buffer-file-name' or
additions of `(with-current-buffer (or (buffer-base-buffer)
(current-buffer))...')

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#58005: 13.1.4; Can't work with indirect buffers

2024-04-23 Thread Ikumi Keita
Hi Paul and Vangelis,

>>>>> Paul Nelson  writes:
>> Ah, I see. Thanks for confirmation. I didn't try region preview. The
>> previews do appear in the indirect buffer if I type C-c C-p C-b etc.
>> 
>> I expect you see what I described if you type C-c C-p C-d in the
>> indirect buffer.

> OK, good -- we're on the same page then.

> For whatever it's worth, in my opinion, this is the correct behavior:
> preview-document should not be responsible for indirect buffers, a bit
> like how it is not responsible for buffers having the given TeX-master
> that do not appear \include'd in that TeX-master's source.

OK. Vangelis, what do you think about it? The same opinion?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


master 195bceed: Supplement documentation

2024-04-23 Thread Ikumi Keita
branch: master
commit 195bceed828c7a16bed9c63a2db08ec1667a8264
Author: Ikumi Keita 
Commit: Ikumi Keita 

Supplement documentation

* doc/preview-latex.texi (The Emacs interface):
* preview.el.in (preview-leave-open-previews-visible):
Adjust and enhance the explanation of the new customize option.
---
 doc/preview-latex.texi | 7 ++-
 preview.el.in  | 8 +++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/doc/preview-latex.texi b/doc/preview-latex.texi
index 0c1fb730..0bce9747 100644
--- a/doc/preview-latex.texi
+++ b/doc/preview-latex.texi
@@ -674,7 +674,12 @@ current point should be temporarily opened.  Default value 
is @code{nil}.
 
 @item preview-leave-open-previews-visible
 This boolean variable determines whether to leave preview images visible
-(above their generating TeX code) when they are opened.
+when they are opened.
+
+There is a side effect in enabling this option.  The preview image doesn't
+turn into construction sign temporarily when you edit the underlying
+@LaTeX{} code and regenerate the preview; it is just replaced by updated
+image when ready.  This behavior suppresses flicker in the appearance.
 
 @end vtable
 
diff --git a/preview.el.in b/preview.el.in
index 1f65f728..a2c0235d 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -1213,7 +1213,13 @@ is located."
 (defcustom preview-leave-open-previews-visible nil
   "Whether to leave previews visible when they are opened.
 If nil, then the TeX preview icon is used when the preview is opened.
-If non-nil, then the preview image is moved above the text."
+If non-nil, then the preview image remains visible.  In either case, the
+TeX code appears either below or to the right of the displayed graphic.
+
+If you enable this option, the preview image doesn't turn into
+construction sign temporarily when you edit the underlying LaTeX code
+and regenerate the preview; it is just replaced by updated image when
+ready.  This behavior suppresses flicker in the appearance."
   :group 'preview-appearance
   :type 'boolean)
 



bug#58005: 13.1.4; Can't work with indirect buffers

2024-04-23 Thread Ikumi Keita
Hi Paul,

>>>>> Paul Nelson  writes:
> For me, previews work fine in indirect buffers with this patch (based
> on 20 mins of usage).  I don't see anything like what you described
> (previews appearing in the base buffer).

Ah, I see. Thanks for confirmation. I didn't try region preview. The
previews do appear in the indirect buffer if I type C-c C-p C-b etc.

I expect you see what I described if you type C-c C-p C-d in the
indirect buffer.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#70455: [PATCH] Add new user option `preview-leave-open-previews-visible'

2024-04-23 Thread Ikumi Keita
Hi Paul,

>>>>> Paul Nelson  writes:
> Please see attached.  Thanks, best,  Paul

Thanks, but it is half of what I wanted :-)

I added a paragraph to your propsal as the attached patch. Can you
confirm it?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

>From 195bceed828c7a16bed9c63a2db08ec1667a8264 Mon Sep 17 00:00:00 2001
From: Ikumi Keita 
Date: Tue, 23 Apr 2024 23:45:42 +0900
Subject: [PATCH] Supplement documentation

* doc/preview-latex.texi (The Emacs interface):
* preview.el.in (preview-leave-open-previews-visible):
Adjust and enhance the explanation of the new customize option.
---
 doc/preview-latex.texi | 7 ++-
 preview.el.in  | 8 +++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/doc/preview-latex.texi b/doc/preview-latex.texi
index 0c1fb730..0bce9747 100644
--- a/doc/preview-latex.texi
+++ b/doc/preview-latex.texi
@@ -674,7 +674,12 @@ current point should be temporarily opened.  Default value is @code{nil}.
 
 @item preview-leave-open-previews-visible
 This boolean variable determines whether to leave preview images visible
-(above their generating TeX code) when they are opened.
+when they are opened.
+
+There is a side effect in enabling this option.  The preview image doesn't
+turn into construction sign temporarily when you edit the underlying
+@LaTeX{} code and regenerate the preview; it is just replaced by updated
+image when ready.  This behavior suppresses flicker in the appearance.
 
 @end vtable
 
diff --git a/preview.el.in b/preview.el.in
index 1f65f728..a2c0235d 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -1213,7 +1213,13 @@ is located."
 (defcustom preview-leave-open-previews-visible nil
   "Whether to leave previews visible when they are opened.
 If nil, then the TeX preview icon is used when the preview is opened.
-If non-nil, then the preview image is moved above the text."
+If non-nil, then the preview image remains visible.  In either case, the
+TeX code appears either below or to the right of the displayed graphic.
+
+If you enable this option, the preview image doesn't turn into
+construction sign temporarily when you edit the underlying LaTeX code
+and regenerate the preview; it is just replaced by updated image when
+ready.  This behavior suppresses flicker in the appearance."
   :group 'preview-appearance
   :type 'boolean)
 
-- 
2.44.0

___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#58005: 13.1.4; Can't work with indirect buffers

2024-04-23 Thread Ikumi Keita
Hi,

>>>>> Paul Nelson  writes:
>> Can you try the following command on terminal? Replace auctex-dir below with 
>> our auctex directory.
>> patch -ruN -d auctex-dir < indirect2.patch

> I'm trying this from the latest origin/master, but happy to try
> something else if you think that'd be a good idea.

> auctex % patch -ruN -d . < indirect2.patch

Vangelis'es patch doesn't apply straight to the current master. It
begins with
...
--- auctex-13.3/bib-cite.el  ...
+++ auctex-13.3-modified/bib-cite.el ...
...
, which means that he is playing with AUCTeX 13.3 source (probably,
installation from ELPA).

I used
patch -p1 < indirect2.patch
in the top directory of the local git repo and took care of the rejected
hunks manually.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#58005: 13.1.4; Can't work with indirect buffers

2024-04-23 Thread Ikumi Keita
[ Please keep Cc: 58...@debbugs.gnu.org when you reply so that the record 
remains in the bug tracker. ]

>>>>> Vangelis Evangelou  writes:

> Regarding `TeX-master-file', I don't know what is the correct order that
> the various conditions need to be checked. There might be a situation where
> the file is shared between two master files. As far as I can tell, auctex
> allows for this by setting TeX-master to 'shared as a local variable. In
> that case you might want to have the main buffer set to one of the master
> files and the indirect buffer set to the other master file. Is that a
> desirable functionality? I personally don't use that options.

It isn't clear for me, too :-) In theory, base buffer and cloned buffer
can have different master file as you say and the user can make use of
that duality. However, the user must remember which buffer has which
master file in that case, between buffers with identical contents. That
doesn't seem a useful feature to me.

> I think there is a simpler way to approach this. We should have the
> function check at the beginning if the buffer is indirect, and switch
> temporarily to the base buffer before doing the rest of the operations.

This can be a solution, indeed.

> This is perhaps simpler, but does not allow for the situation I mentioned
> above with the two masters. The way to do that is with
>   (with-current-buffer
>  (or (buffer-base-buffer) (current-buffer)))
> at the beginning of the function. There is also another function that is
> affected: `TeX-normal-mode' which calls `normal-mode'. In the documentation
> is says:
> If invoked in a buffer that doesn’t visit a file, this function
> processes only the major mode specification in the -*- line and
> the local variables spec.
> I found that it doesn't correctly set the local variables if
> TeX-normal-mode is run on the indirect buffer.

OK.

> I attach the updated patch. I have tested this, and it works for me. Please
> let me know what you think.

A brief testing didn't show fatal behavior. Here are two notes I noticed:
1. In indirect buffer, preview-latex doesn't work. All preview images
   appear in the base buffer.
2. TeX Fold mode works independently in indirect and base buffers.

I suppose there will be dissatisfied users about item 1. Do you have any
good idea about it?
Item 2 can be a useful feature rather than a shortcoming, whereas some
users want to inherit the folded appearance when they clone a buffer.

Maybe we should regard these points as feature and announce them as
"known limitations".

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#70455: [PATCH] Add new user option `preview-leave-open-previews-visible'

2024-04-23 Thread Ikumi Keita
Hi Paul,

>>>>> Paul Nelson  writes:
> Yes, that's right.  This behavior could just as well be its own
> customization option, perhaps "preview-indicate-regeneration"
> (default: t), independent of the option
> "preview-leave-open-previews-visible" just added; let me know if you'd
> prefer that.  I'll also be happy to update the doc/texi if that's what
> you intend

I'd like to have updates in the documentation. New customize option is
probably overkilling.

>  (presumably by sending a patch on top of the current one, to this
> thread?)

Yes, please.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#70455: [PATCH] Add new user option `preview-leave-open-previews-visible'

2024-04-22 Thread Ikumi Keita
Hi Paul,

>>>>> Paul Nelson  writes:
> I think there is no such debris, and have attempted to check this, but
> would be happy to learn that I missed something.  The EXCEPTION
> argument is used only in preview-place-preview, where it is the
> overlay being generated -- not something we want to clearout.  The
> changes to preview-place-preview have the effect of keeping the old
> overlays around long enough for the call to preview-gs-place (via
> preview-call-hook) to be able to use the image from the old overlay in
> place of the construction symbol, eliminating the flicker that would
> otherwise occur when regenerating a preview.  The subsequent call to
> preview-clearout should in fact delete that old image, but it stays in
> the cache long enough to serve its fleeting purpose.  Happy to discuss
> further if that'd clarify.

Thanks for clarification. If I understand correctly, "use the image from
the old overlay in place of the construction symbol" means that the user
can't tell whether a particular preview image is to be updated
afterwards or has already been updated, by its appearance only, during
the regeneration process is running. Right? Though I don't object to
that behavior, I think that difference should be mentioned somewhere in
the documentation as a feature (side effect) of non-nil value of the new
customize option.

>> The TeX code appears _to right of_ the preview for inline math
>> expression for me. Is this a misbehavior? Or does your above sentence
>> miss this case?

> You're right, for inlined math, it appears to the right (and for
> displayed math, it's like in my summary).  This is the intended
> behavior, the idea being that someone watching your screen (in person
> or remotely) can stay focused on the equation.

Thanks. Then I'd like to request to update the doc string and
preview-latex.texi accordingly.

To Arash:
It seems that the reason you saw the preview image above the TeX code is
that your inline math is at the beginning of line; in that situation, my
example indeed behaves as you described, too.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#70455: [PATCH] Add new user option `preview-leave-open-previews-visible'

2024-04-22 Thread Ikumi Keita
Hi Arash and Paul,

>>>>> Arash Esbati  writes:
> I don't have a suggestion for a better name, but another comment.  Your
> patch uses `cl-find-if' which is a function.  Until now, we used only
> macros from the cl-lib inside AUCTeX in order to have no other runtime
> dependencies.  In general, I have no problem if we lift this limitation
> and use cl-lib functions as well -- the library is part of Emacs and why
> not use it.  But before we do this, I'd like to hear from Keita and
> Tassilo what they think about this.

I don't mind. It doesn't matter to use emacs built-in library to write
code simply.

I'd like to ask Paul some questions:

> Paul Nelson  writes:

>> With the new user option disabled, behavior is instead:
>> 
>> - When you enter a preview, it remains visible.  The tex code appears
>> below the preview.

The TeX code appears _to right of_ the preview for inline math
expression for me. Is this a misbehavior? Or does your above sentence
miss this case?

I don't understand the change as a whole, but it seems that this change
extends cases which doesn't touch the preview images through EXCEPTION
argument of `preview-clearout' function. Doesn't this lead to leave some
kind of "debris" which needs additional clean-up facility after usage of
preview-latex?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#70399: ConTeXT options need updating

2024-04-21 Thread Ikumi Keita
Hi Jim,

>>>>> Jim  writes:
>> Do you think AUCTeX should do smart action to avoid "--nonstopmode" when
>> "--synctex" is requested by the user, so that
>> (setq ConTeXt-texexec-option-nonstop "")
>> isn't necessary on the user side?  It isn't difficult to have
>> "--nonstopmode" only when `TeX-source-correlate-mode' and
>> `TeX-interactive-mode' are nil.

> I think that would be an even nicer solution!  I will point out that the
> Head Honcho of ConTeXT said (on the ConTeXT users mailing list)
> - running context in nonstop mode makes little sense

> He did not elaborate on that comment.  However, I note that when context
> finds an error in an input file, even without -nonstopmode, the process
> terminates (in a few tests I did) , unlike (e.g.,) pdftex, which as you
> know waits for user input.

> I spent a few minutes trying various command line options and commands
> inside the source file, and I can't get context to stop on error and wait
> for input.  This doesn't mean that there is no way to do it, and poking
> through the code I see a lot of code related to 'nonstopmode' and
> 'errorstopmode', but I don't know how to make context stop on an error and
> wait for input.

Thanks, I pushed the fix including the change to omit --nonstop option
when --synctex option is present.

> I could ask for clarification about this on the context users' list if you
> would like to hear a more authoritative opinion before making changes.  Let
> me know.

Thanks, I don't think that's necessary. I'll close this bug.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


master 44879847: Adjust ConTeXt options (bug#70399)

2024-04-21 Thread Ikumi Keita
branch: master
commit 44879847609f0ac14a18841a363012e5e979b8ca
Author: Ikumi Keita 
Commit: Ikumi Keita 

Adjust ConTeXt options (bug#70399)

* tex.el (TeX-command-list): Remove obsolete option "--texutil".
* context.el (ConTeXt-expand-options): Use "repeat" for synctex option
for the latest ConTeXt.
Don't add nonstop option when synctex option exists.
* doc/changes.texi: Mention the above changes.
---
 context.el   |  9 +++--
 doc/changes.texi | 14 ++
 tex.el   |  2 +-
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/context.el b/context.el
index 29bbccd6..0d5b9adb 100644
--- a/context.el
+++ b/context.el
@@ -1747,8 +1747,13 @@ Use `ConTeXt-Mark-version' to choose the command."
((string= ConTeXt-Mark-version "IV")
 (concat
  (if TeX-source-correlate-mode
- "--synctex=1 ")
- (unless TeX-interactive-mode
+ "--synctex=repeat ")
+ ;; Omit nonstop option when we set synctex option.  According to
+ ;; Jim  in bug#70399 report,
+ ;; "if context is called with "--nonstopmode" (or "--nonstop")
+ ;;  the "--synctex=..." request to create a synctex file is
+ ;;  over-ridden."
+ (unless (or TeX-interactive-mode TeX-source-correlate-mode)
ConTeXt-texexec-option-nonstop)))
;; In any other case fall back on Mark II.
(t
diff --git a/doc/changes.texi b/doc/changes.texi
index 098195ac..cae91aa2 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -187,6 +187,20 @@ In Fold mode, the original source text is revealed when 
you click the
 folded portion by mouse.  You can customize the detailed behavior by
 new customize option @code{TeX-fold-auto-reveal}.
 
+@item
+@AUCTeX{} adjusts @ConTeXt{} option.
+@itemize @minus
+@item
+Obsolete option @option{--texutil} was removed.
+@item
+Now synctex option is @option{--synctex=repeat} instead of
+@option{--synctex=1} for @ConTeXt{}.
+@item
+@AUCTeX{} omits @option{--nonstop} option when
+@code{TeX-source-correlate-mode} is enabled because @command{context}
+ignores @option{--synctex} option if @option{--nonstop} is present.
+@end itemize
+
 @item
 @AUCTeX{} now requires GNU Emacs 27.1 or higher.
 @end itemize
diff --git a/tex.el b/tex.el
index 2ab35875..985cb71e 100644
--- a/tex.el
+++ b/tex.el
@@ -211,7 +211,7 @@ If nil, none is specified."
  TeX-run-TeX nil (AmSTeX-mode) :help "Run AMSTeX")
 ;; support for ConTeXt  --pg
 ;; first version of ConTeXt to support nonstopmode: 2003.2.10
-("ConTeXt" "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t"
+("ConTeXt" "%(cntxcom) --once %(extraopts) %(execopts)%t"
  TeX-run-TeX nil (ConTeXt-mode) :help "Run ConTeXt once")
 ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t"
  TeX-run-TeX nil



bug#70399: ConTeXT options need updating

2024-04-20 Thread Ikumi Keita
Hi Jim,

>>>>> Jim  writes:
>> It is easy to remove "--texutil", but I'd like to ask whether it is safe
>> for older (before 2023) TeX distribution to do so. What was this option
>> "--texutil" for? Unfortunately, "context --help" of TeX Live 2024
>> doesn't give me useful information.

> I am a relatively recent ConTeXt convert, so I have never used it.
> However, the documentation I can find indicates that texutil was used for
> ConTeXt Mk II, which has (long since) been deprecated (as I understand it).

> I guess since it doesn't hurt anything, it could stay, but I think that it
> has no use in ConTeXt Mk IV.

I see, thanks. I guess this option is necessary for only rather old
context binaries and expect it can be removed safely for now.

>>> (b) but if context is called with "--nonstopmode" (or "--nonstop")
>>> the "--synctex=..." request to create a synctex file is over-ridden.
>>> It is easy for a user who knows what is going on to use
>>> (setq ConTeXt-texexec-option-nonstop "")

Do you think AUCTeX should do smart action to avoid "--nonstopmode" when
"--synctex" is requested by the user, so that
(setq ConTeXt-texexec-option-nonstop "")
isn't necessary on the user side? It isn't difficult to have
"--nonstopmode" only when `TeX-source-correlate-mode' and
`TeX-interactive-mode' are nil.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: [PATCH] fix delete-property handling

2024-04-19 Thread Ikumi Keita
Hi Artem,

>>>>> Artem Yurchenko  writes:
> I'm attaching two patches for the current master. I've tried to fix
> all of the regressions you've pointed out and apply all of the
> suggestions you've made.

Thank you!

>>> 2. Suppose that TeX-electric-math is a pair of dollars. Then typing $ 
>>> at 
>>> $E = mc^2-!- 
>>> inserts two dollars, not one dollar.

> I am personally still not a fan for special casing of dollars in a
> situation like that.

> While it can happen in some situations as you've pointed out, we're
> supporting this «insert the matching sign» behaviour only for the
> dollar sign. All other electric math options do not get this benefit.
> Furthermore, it's easily amended by typing C-d.

> Furthemore, if we had 
> $E = mc^2-!- bar-bar $ foo-foo
> and typed $, we would get 
> $E = mc^2$-!- bar-bar $ foo-foo
> which moves previously math-mode «bar-bar» into text-mode and
> previously text-mode «foo-foo» into (an unclosed) math-mode.

> With the new behaviour from my previous pacthes, it would turn into 
> $E = mc^2$-!-$ bar-bar $ foo-foo,
> preserving the modes.

> All in all, given that neither solution is without flaws, I lean in
> favour of the consistent one.

Your argument makes sense, so I think AUCTeX can accept that suggestion.
Are there anyone who object to this new behavior? (It is only relevant
for users who customized `TeX-refuse-unmatched-dollar' to non-nil.)

I'll comment on other minor matters.

> +(define-obsolete-variable-alias 'TeX-refuse-unmatched-dollar
> +  'TeX-refuse-nested-math "13.4"

The next AUCTeX version would be 14. (The ELPA releases already reached
14.) So the version should be "14" or "14.1".

> +(defun TeX-insert-dollar-mode (arg)

In general, an elisp function whose name ends with "-mode" is a major or
minor mode function, or is expected to do something related to major or
minor modes, at least within AUCTeX source. Thus I'd like you to change
this name `TeX-insert-dollar-mode' to `TeX-insert-dollar-action' or
something like that for coherency. (Since it can be considered as a
private helper function, you might as well assign it a name
"TeX--insert-..."; but that isn't much important.)

In addition, I'd request to provide appropriate patches for
doc/auctex.texi and doc/changes.texi, too. :-)

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: Supporting LatexMK in AUCTeX OOTB

2024-04-18 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> This doesn't feel right.  AUCTeX has some options to control the output,
> and I think we should support them.  I mean, the only issue is currently
> with dvipdfmx as discussed above, and I don't think we should throw the
> baby out with the bathwater because of this one glitch.  And I think we
> should also get close to what auctex-latexmk offers, and we're not far
> away.  WDYT?

I think most Latexmk users have their own .latexmkrc because the stock
Latexmk just runs latex enough times and generate .dvi file. (no pdflatex
and no .pdf output) So I guess they are accustomed to have full control
over the options with their .latexmkrc.
However, I don't object to your idea, so please proceed.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



bug#70399: ConTeXT options need updating

2024-04-18 Thread Ikumi Keita
Hi Jim,

Thank you for your report. None of the AUCTeX maintainer uses ConTeXt,
so inputs from ConTeXt user are valuable.

>>>>> Jim  writes:
> (1) TeX-command-list contains the following
> ("ConTeXt" "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t"
> and --texutil isn't in texlive 2023's context, texlive 2024's context,
> or the context in the ConTeXt distribution.

It is easy to remove "--texutil", but I'd like to ask whether it is safe
for older (before 2023) TeX distribution to do so. What was this option
"--texutil" for? Unfortunately, "context --help" of TeX Live 2024
doesn't give me useful information.

> (2) A recent change (early April 2024?) to context has changed how
> synctex is done.
> On the good side, with the right option context will produce a
> synctex file that epdfinfo knows how to parse.
> On the bad side,
> (a) rather than calling with "--synctex=1" (as done in
> ConTeXt-expand-options in context.el) the correct option is now
> "--synctex=repeat";
> (b) but if context is called with "--nonstopmode" (or "--nonstop")
> the "--synctex=..." request to create a synctex file is over-ridden.
> It is easy for a user who knows what is going on to use
> (setq ConTeXt-texexec-option-nonstop "")
> but changing --synctex=1 to --synctex=repeat seems to require
> a redefinition of the function.

> The --synctex=repeat version may not have reached texlive 2024 yet, but
> using --synctex=repeat with the version of context in TL2024 creates the
> same synctex file as --synctex=1, so there seems to be no harm in
> changing this.

OK, then I'll change "--synctex=1" to "--synctex=repeat", expecting that
the situation about compatibility is the same for older ConTeXt.

> Bonus "bug": TeX-submit-bug-report suggests upgrading to the version from
> https://www.gnu.org/software/auctex, but as of today that would be a
> downgrade, since it says the current auctex version is 13.3.

The message is followed by "if your installation is older than the one
available from the web site.", isn't it? 

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#58005: 13.1.4; Can't work with indirect buffers

2024-04-17 Thread Ikumi Keita
as the first argument in the above (1) because it is indeed irrelevant.
On the other hand, I'm not sure the necessity of the above (1) itself;
It seems to me that both (1a) and (1b) are to have been established when
emacs opens the base buffer first time and ready by the time
`TeX-master-file' is called in indirect buffer under usual
circumstances.

> I don't get the error that you mentioned. Can you please send me a
> traceback?

Sorry, my bad. It turned out that I was examining with code without your
patch. I confirmed that it actually runs without error. I apologize you.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: [PATCH] fix delete-property handling

2024-04-16 Thread Ikumi Keita
Hi Artem,

>>>>> Artem Yurchenko  writes:
> Suppose that TeX-electric-math is set to dollar and
> TeX-refuse-unmatched-dollar is set to true. I am thinking, when is the
> «refuse the dollar» behaviour going to happen? It's not going to
> happen in inline math or display math — the user uses dollars for math
> and we never «refuse the dollar» when enclosed by dollars. It's /only/
> going to apply in some environments that don't explicitly use dollars,
> such as «equation», «align», «cases*» and so on. However, in some of
> those environments this behaviour is going to be /incorrect/, as noted
> in bug#57626, for example.

> So, the only environment (sorry for the pun) where we «refuse the
> dollar» is also the environment where that feature breaks
> occasionally.

Thanks, now I see what you mean. I naively imagine that users (if exist
at all) who like such customization would happily type C-q $ when they
encounter such refusal. Anyway, I think this topic isn't much important.

>> I think other occurrence of single quotes in

>>> you need exactly one $, you can use `C-1 $'.

> I think I should use `C-1 \\[TeX-insert-dollar]' according to the help
> entry on «Keys in Documentation»?

I'm talking about single quotes surrounding the key sequence. ...Hm, I
was thinking that elisp reference discourages to surround key sequence
by single quotes, but it seems that's my hasty conclusion. Sorry, forget
about this.

>>> Otherwise, when in a verbatim construct or escaped with `\\',
> >should also fixed according to the elisp reference direction.
> Oh, yes, missed that.

By the same argument, I withdraw this remark as well.

> I had an impression that it should blink to the closing paren when
> applied to a region in the electric mode, but per docs it's not
> required. However, it doesn't respect the behaviour of
> blink-matching-paren, which allows the user to choose between jumping
> onscreen, jumping offscreen or just blinking.

Thanks for clarification. I don't think blinking is needed when there is
an active region because the starting position is obvious without
blinking. On the other hand, I realize that `TeX-insert-dollar' falls
much behind at emulating emacs built-in paren-matching behavior.
Well, it seems to me that poor blinking feature isn't a serious issue,
so my opinion is to postpone it for now. :-)

>> I noticed two incompatibilities with the current behavior.
> Okay, I guess it is more difficult than I felt initially :D

:-)

>> 2. Suppose that TeX-electric-math is a pair of dollars. Then typing $
>> at
>> $E = mc^2-!-
>> inserts two dollars, not one dollar.

> That is indeed a regression, however, I feel that it might be not very
> serious. An electric user will almost always have balanced dollars.

Unbalanced dollar often occurs during editing drafts and revising
existing documents even for an electric user. Thus I think this behavior
must be fixed.

>> (This is optional) The revised patch increases calls to `texmathp'. It
>> doesn't make much difference anyway, it is preferable if you can reduce
>> them.

> Will consider the best approach to this. My first idea is actually to
> «cache» texmathp. That is, when we see that the buffer is unmodified
> since the last call, we just don't do anything.

I think it's enough to cache in one command execution. When the user
types "$", `texmathp' is called once in `TeX-insert-dollar-refuse-p' and
again at
--
   ((and (texmathp)
 (or (string= (car texmathp-why) "\$")
 (string= (car texmathp-why) "\$\$")))
--
in the body of `TeX-insert-dollar', in your last patch. I'm not sure
whether you plan to keep the basic logic structure of electricity, but
if it is kept, the first result of `texmathp' can be used for the
second. (There is another call in `delete-selection' property which
calls `TeX-insert-dollar-refuse-p', but it seems difficult to me to make
use of cache in a simple and robust way.)

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: Supporting LatexMK in AUCTeX OOTB

2024-04-15 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> This is my next approximation:
> diff --git a/tex.el b/tex.el
> index c4e4104e..a0649c73 100644
> --- a/tex.el
> +++ b/tex.el
> @@ -250,6 +250,9 @@ If nil, none is specified."
>  ("Ps2pdf" "ps2pdf %f %(O?pdf)" TeX-run-ps2pdf nil
>   (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode)
>   :help "Convert PostScript file to PDF")
> +("LaTeXMK" "latexmk -recorder %(latexmk-out) %(file-line-error) \

I think we can omit "-recorder" option. It seems that Latexmk adds
"-recorder" option to latex command by default. The reason why I put
"-recorder-" in my proposal was to suppress that option; when %l
expansion includes "\input", Latexmk puts "-recorder" between "\input"
and .tex file name when it invokes latex, which leads to error.
(I forgot to mention this in my previous message, sorry.)

> Reg. this part:

> +;; FIXME: This might be inaccurate:
> +((and TeX-PDF-mode
> +  (string=3D (TeX-PDF-from-DVI) "Dvipdfmx"))
> + " -pdfdvi")

> I think users have to control the behavior of $dvipdf inside their
> latexmk config file; I have no idea how this should work (and don't want
> to investigate further).  WDYT?

Yes, I think so, too. Without changing $dvipdf value, Latexmk calls
dvipdf, not dvipdfmx, in response to "-pdfdvi" option. Thus this
treatment is half-cooked. :-(

Maybe we should minimize the command option like
("LaTeXMK" "latexmk %(extraopts) %t"
 TeX-run-format nil (LaTeX-mode docTeX-mode) :help "Run LaTeXMK")
and let the user to do all control over the option through .latexmkrc?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



bug#58005: 13.1.4; Can't work with indirect buffers

2024-04-14 Thread Ikumi Keita
>>>>> Ikumi Keita  writes:
> . Why is the first argument always nil? The original function receives
> the second argument as `extension'. Aren't there cases that we should
  ^^
> provide the same argument `extension' here?

Sorry, I meant "first" here actually, rather than "second".

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#58005: 13.1.4; Can't work with indirect buffers

2024-04-14 Thread Ikumi Keita
Hi Vangelis,

>>>>> Vangelis Evangelou  writes:
> I am using indirect buffers with auctex and I am affected by this. My use
> is to have an indirect buffer narrowed to the preamble of my file.
> Typically, if I want to define a new command, I switch to the narrowed
> buffer instead of jumping at the top of the buffer to type the command and
> then go back to where I was later. I implemented a patch (attached) where,
> essentially, I replace instances of `buffer-file-name' with a new function
> `TeX-buffer-file-name' defined as

> (defun TeX-buffer-file-name ( BUFFER)
>   (buffer-file-name (or (buffer-base-buffer BUFFER) BUFFER)))

Thank you for your proposal. I'd like to comment on it. Please bear with
me if I'm saying something stupid since I don't know indirect buffer well.

Current AUCTeX source has some references to the variable
`buffer-file-name', as well as call to the function of the same name. It
seems that the variable is nil in indirect buffers. Is it safe to leave
those references unchanged?

> I also added a condition in TeX-master-file to check for indirect
> buffer.

The major portion of the addition is
(cond
[...]
 ;; Indirect buffer
 (my-buffer
  (with-current-buffer my-buffer
(TeX-master-file nil nondirectory ask)))
 ^^^
. Why is the first argument always nil? The original function receives
the second argument as `extension'. Aren't there cases that we should
provide the same argument `extension' here?

There are still some calls to the function `buffer-file-name' which
weren't replaced by `TeX-buffer-file-name' in the source. You can see
them with
git grep -E "[^-]buffer-file-name"
on the repo directory. (This lists references to the variable
`buffer-file-name' as well.)

It seems that the proposed change doesn't work in indirect buffer if
`TeX-output-dir' is specified. To try:
1. Open the following file.
2. Type C-x 4 c
3. Type C-c C-c RET
4. Then AUCTeX signals error with "LaTeX errors in ‘*~/test-tex/ 
output*’. Use C-c ` to display."
Can you resolve this problem?
--
\documentclass{article}
\begin{document}

dummy

\end{document}

%%% Local Variables:
%%% mode: LaTeX
%%% TeX-master: t
%%% TeX-output-dir: "build"
%%% End:
------

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: Supporting LatexMK in AUCTeX OOTB

2024-04-14 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> So lets call it a preliminary solution ;-)  I plan to install this
> change as a starter:

[...]

> + ;; This is essentially (eq TeX-engine 'default) since we
> + ;; ignore 'omega completely:

This isn't quite correct because this clause covers cases for Japanese
LaTeX engines (`TeX-engine' being ptex or uptex※) as well.

※ `jtex' engine became obsolete and isn't maintained anymore as far as
I know.

> + (t
> +  (cond ((and TeX-PDF-mode
> +  (not (TeX-PDF-from-DVI)))
> + " -pdf")
> +((and TeX-PDF-mode
> +  (TeX-PDF-from-DVI))
> + " -pdfdvi")
> +;; FIXME: Which LaTeXMK options cover this:
> +;; ((and TeX-PDF-mode
> +;;   (string= (TeX-PDF-from-DVI) "Dvipdfmx"))
> +;;  " ???")
> +((and TeX-PDF-mode
> +  (string= (TeX-PDF-from-DVI) "Dvips"))
> + " -pdfps")

This clause is always ignored because of the above
> +((and TeX-PDF-mode
> +  (TeX-PDF-from-DVI))
conditional, isn't it?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: [PATCH] fix delete-property handling

2024-04-13 Thread Ikumi Keita
Hi Artem,

>>>>> Artem Yurchenko  writes:
> However, if we apply it when electricity is on, this option seems
> somewhat misleadingly named and documented and doesn't make sense IMO.

I agree that the situation is not totally consistent, because of the
historical reason[1]. :-)

> First, the name (and the doc) say that the option controls the insert
> of a /dollar/ sign. Thus, if the TeX-electric-math is not a dollar, then
> technically, this option shouldn't apply? That seems somewhat
> inconsistent, because the reasoning behind the option is the same for
> any math delimiter: «nested» math mode is invalid.

I haven't considered the discrepancy seriously before. :-) But I think
you speak right.

> Now, suppose that the user sets TeX-electric-math to dollars. Then,
> that option is not going to be applicable in many cases, as the user
> is likely using «$» and «$$» as math delimiters. There are however
> other environments, «equation», «align» etc where this option works.
> There are also environments where this option breaks, which is why
> this behaviour was made optional in the first place.

Sorry, I can't follow. Can you elaborate?

> Suppose that the user sets TeX-electric-math to non-nil, and not
> dollars. Then, this option is not going to be applicable at all, as
> the dollar key never inserts a dollar. In fact, the very name
> «unmatched-dollar» no longer makes sense, because we are automatically
> inserting two matching delimiters which are not dollars.

If we follow the name «unmatched-dollar» rigorously, your argument makes
sense.

> So, the options I see are:

> 1. Extend semantics of TeX-refuse-unmatched-dollar to other
> delimiters, change the documentation, possibly change the name, create
> the deprecated alias with the old name.

> 2. Keep semantics and docs of TeX-refuse-unmatched-dollar, but confine
> to when electricity is off.

I don't have strong opinion about it. If you want to sort out the
confusion and provide a consistent solution, I'm fine with either way.

>>> +When ARG is given, insert a literal `$' ARG times. E.g., if you
>> The elisp reference node "(elisp) Documentation Tips" directs not to use
>> single quotes in the doc string in that way:
>> ,
>> | • In documentation strings, do not quote expressions that are not
>> | Lisp symbols, as these expressions can stand for themselves. For
>> | example, write ‘Return the list (NAME TYPE RANGE) ...’ instead of
>> | ‘Return the list `(NAME TYPE RANGE)' ...’ or ‘Return the list
>> | \\='(NAME TYPE RANGE) ...’.
>> `

> Fixed.

I think other occurrence of single quotes in
> you need exactly one $, you can use `C-1 $'.
and
> Otherwise, when in a verbatim construct or escaped with `\\',
should also fixed according to the elisp reference direction.

> The blinking probably should also be removed due to being very
> inconsistent. Or fixed, if worth it.

I wasn't aware of that inconsistency. Could you explain it?

By the way...
> It is not extremely difficult to keep that feature, and I have already
> written a patch to do it. 

I noticed two incompatibilities with the current behavior.
1. In math environment (including \[...\]), it no longer allows to
   insert a escaped dollar sign (in other words, users cannot write
   "\$" by typing backslash followed by dollar.)
   Similarly, it no longer allows to insert dollar sign inside
   \verb|...| in math environment.
   This was introduced anew in the revised patch.
2. Suppose that TeX-electric-math is a pair of dollars. Then typing $
   at
$E = mc^2-!-
   inserts two dollars, not one dollar.
   This behavior existed prior to the revised patch.

(This is optional) The revised patch increases calls to `texmathp'. It
doesn't make much difference anyway, it is preferable if you can reduce
them.
 
Regards, 
Ikumi Keita 
#StandWithUkraine #StopWarInUkraine 
#Gaza #StopMassiveKilling #CeasefireNOW

[1] The option `TeX-electric-math' was added afterwards; the behavior
when $ is typed in situation discussed now varied from time to time:

https://lists.gnu.org/archive/html/auctex-devel/2005-12/msg0.html
https://git.savannah.gnu.org/cgit/auctex.git/commit/?id=05c78e15cf89ee3cc5828a8decc21a0420729714

https://lists.gnu.org/archive/html/auctex-devel/2020-01/msg2.html
https://git.savannah.gnu.org/cgit/auctex.git/commit/?id=13e6746758abcaf28bc61c2cbafcd52a8c9a6dd1

bug#57626
https://git.savannah.gnu.org/cgit/auctex.git/commit/?id=42150568f1d8ef9a556ecdc3f107e7f4cb02e7a9



bug#70307: [PATCH] Allow preview to work in non-file buffers

2024-04-11 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> @David and Keita: WDYT, any comments?

This makes difference only when the file name is "", so it
wouldn't affect almost all regular usage. Thus I'm fine with applying
this change.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: Supporting LatexMK in AUCTeX OOTB

2024-04-10 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
>> AUCTeX users can deginate latex binary file names through
>> `TeX-engine-alist' and `LaTeX-command', which can be different from
>> standard "latex", "xelatex" and "lualatex".  If we are to support such
>> non-standard binary names, we need %l.  (However, maybe this isn't much
>> meaningful because fixed binary names of "latexmk" and "dvipdfmx" after
>> all in my patch. :-))

> So the question is: What is the best course of action?  I have no
> problems with %l, but breaking Windows compatibility is bad.

I realized that %l played an important role for Japanese LaTeX document,
too; it gave latex binary name such as "platex" as well as its
supplementary option such as "-kanji=xxx".
However, I haven't come up with a good solution which is compatible for
both windows and non-windows with respect to quoting. :-(

I concluded that AUCTeX should incorporate your simple proposal and
users who need other non-default options, e.g. Japanese latex binary
names, should prepare their own config file such as .latexmkrc.

It isn't a literal "OOB" solution, but I think it is the most practical
approach and is user-friendly enough. :-)

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: [PATCH] fix delete-property handling

2024-04-10 Thread Ikumi Keita
Hi Artem,

> This is my first time contributing and I expect to have made mistakes. I am 
> willing to react to comments and fix any deficiencies.

Commentaries on the second patch follow.

I think the two incompatibilities discussed there are permissible:
(1) The special case where
> If [[`TeX-electric-math']] non-nil and point is inside math ...
(2) We've changed `C-u $' to insert four dollars as opposed to one.

They are reasonable and we can announce work arounds for them.

On the other hand, I'm afraid another incompatibility, due to refactoring
of the electric logic of `TeX-insert-dollar', can be bad. Suppose that
`TeX-electric-math' is "$...$" or "\(...\)" and
`TeX-refuse-unmatched-dollar' is t. Then the current `TeX-insert-dollar'
refuses to insert anything if the point is in math-mode which doesn't
begin with "$" nor "$$".
However, after your patch is applied, it just shows ordinary electric
behavior; it inserts pair of "$...$" or "\(...\)".
I'm not sure how this feature is important; maybe very few users concern
about it. But I ask you to try to keep the compatibility first. If it is
extremely difficult, let's discuss what to do.

> +(TeX--put-electric-delete-selection
> + #'TeX-newline (lambda () nil))
Is it right to inherit `delete-selection' property from
`self-insert-command' for the command associated with RET key? I'm not
familiar with delete selection mode, so I cannot tell.
(By the way, (lambda () nil) can just be #'ignore .)

> +(defun TeX-insert-dollar-electric-p ()
> +  "Non-nil if `TeX-insert-dollar' should use the electric behaviour."
This doc string looks like to explain a variable because it starts with
"Non-nil if...". A doc string for a function should tell what this
function does.

> +(defun TeX-insert-dollar-electric-p ()
> +  "Non-nil if `TeX-insert-dollar' should use the electric behaviour."
> +  (and (not current-prefix-arg)
> +   (not (TeX-escaped-p))
> +   (not (TeX-verbatim-p))
> +   TeX-electric-math))
It would be slightly efficient if it refers to `TeX-electric-math'
before evaluation of `TeX-escaped-p' and `TeX-verbatim-p'.

> +When ARG is given, insert a literal `$' ARG times.  E.g., if you
The elisp reference node "(elisp) Documentation Tips" directs not to use
single quotes in the doc string in that way:
,
|• In documentation strings, do not quote expressions that are not
|  Lisp symbols, as these expressions can stand for themselves.  For
|  example, write ‘Return the list (NAME TYPE RANGE) ...’ instead of
|  ‘Return the list `(NAME TYPE RANGE)' ...’ or ‘Return the list
|  \\='(NAME TYPE RANGE) ...’.
`
In addition, the same node discourages to use "e.g." in the doc string:
,
|• Try to avoid using abbreviations such as “e.g.” (for “for
|  example”), “i.e.” (for “that is”), “no.” (for “number”), “cf.” (for
|  “compare”/“see also”) and “w.r.t.” (for “with respect to”) as much
|  as possible.  It is almost always clearer and easier to read the
|  expanded version.(1)
`

> +Otherwise, when in a verbatim or an escaped (with `\\')
> +environment, insert one literal `$'.
The term "environment" is ambiguous in this context because it's
difficult to distinguish from "LaTeX environment". How about
Otherwise, when in a verbatim construct or escaped with \"\\\",...
instead?

> +(TeX--put-electric-delete-selection
> + #'TeX-insert-dollar TeX-insert-dollar-electric-p)
The second argument must be quoted.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: [PATCH] fix delete-property handling

2024-04-09 Thread Ikumi Keita
Hi Artem,

>>>>> Artem Yurchenko  writes:
> Hello,
> I am sending two patches that fix delete-property handling. They improve 
> interaction of auctex with other «electric» modes.

Thanks for your proposals. I'm now reading through the proposed codes.
They basically look good to me. I think that AUCTeX can accept them and
it requires copyright assignment. I assume that you haven't signed FSF
copyright assignment form before, so please follow this instruction if
you want to have your proposal incorporated into AUCTeX:
https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.future

> This is my first time contributing and I expect to have made mistakes. I am 
> willing to react to comments and fix any deficiencies.

I'd like to comment on the first patch now; I haven't read the second
patch in detail yet. Commentary on the second would follow on another
day.

> +(defun TeX--put-electric-delete-selection (symbol electricp)
> +  "Set appropriate `delete-selection' property for electric functions.
> +
> +When the function bound to SYMBOL has «electric» behaviour, as
> +determined by ELECTRICP, `delete-selection' is set to nil.  In

I think it should explicitly state that ELECTRICP is actually a
predicate (function).

> +However, when /our/ electric behaviour is disabled (ELECTRICP is
> +nil), we want other electric modes to operate freely.

Shouldn't it be "ELECTRICP returns nil" instead of "ELECTRICP is nil"?
It seems as if ELECTRICP was just an boolean flag rather than a
predicate.

(This isn't a suggestion, just an impression.)
> +  (put symbol 'delete-selection
> +   (lambda ()
> + (unless (funcall electricp)
> +   (get #'self-insert-command 'delete-selection)

Good simple solution. I wasn't aware that `delete-selection' property
can return a function because of the commentary of delsel.el:
;;  FUNCTION
;;  For commands which need to dynamically determine this behavior.
;;  FUNCTION should take no argument and return one of the above
;;  values, or nil.  In the latter case, FUNCTION should itself
;;  do with the active region whatever is appropriate."
I took that "one of the above values" doesn't include FUCTTION itself.
However, `delete-selection-helper' is actually written to operate
recursively, which I didn't realize.
(That was the reason I wrote the current `delete-selection' property of
`LaTeX-insert-left-brace' to discriminate the cases between '(yank
supersede kill t nil) and a function.)

(This is optional.)
> +(defun LaTeX-insert-left-brace-electric ()
[...]
> +  (let ((lbrace (char-to-string last-command-event)) lmacro skip-p)
[...]
> +(insert last-command-event)

Since `LaTeX-insert-left-brace-electric' is no longer a command bound to
a key, I'm inclined to writing it to receive `last-command-event' as an
argument of the function rather than to refer to the variable directly.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



bug#70251: 14.0.4 install from gnu/elpa hangs

2024-04-07 Thread Ikumi Keita
Hi Peter,

>>>>> Peter Mao  writes:
> I'm running emacs 29.3 on GNU/Linux and OSX.  When I updated auctex from v
> 13.2.1 to v. 14.0.4, I see "Checking /elpa/auctex-14.0.4..."
> seemingly forever (until I give up and C-g it).

> Any guidance on what's going on here?  Auctex seems to be ok still (I just
> opened a .tex file and looked at it, but didn't push it any further), but
> my package-selected-packages list is all screwed up now.

Sorry for inconvenience. It is known that upgrading to AUCTeX 14 from 13
in running emacs session can lead to unsuccessful installation,
including infinite loop as you experienced.

The first thing which is worth trying is:
  1. Terminate the current running Emacs session and restart Emacs.
  2. Type ‘M-x package-recompile  auctex ’.
  3. Restart your Emacs again.

If you are lucky enough, this will basically resolve the issue. There is
still old ‘auctex-X.Y.Z’ directory left behind under
‘~/.emacs.d/elpa/’, so delete it manually to avoid future trouble.

If the above prescription doesn't work, then try:
  1. Uninstall AUCTeX once.
  2. Restart your Emacs and (before doing anything else) reinstall
 AUCTeX.

In theory, this recipe will circumvent all caveats in ELPA upgrade of
AUCTeX. Find and delete old ‘auctex-X.Y.Z’ directory remaining under
‘~/.emacs.d/elpa/’.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#70128: Issue after upgrading ELPA-auctex 14.0.4

2024-04-03 Thread Ikumi Keita
Hi Angelo,

>>>>> Angelo Graziosi  writes:
>> ,
>> | − If your Emacs is 29 or newer and you use ‘desktop.el’ to save
>> |   and restore Emacs sessions, be careful before you update
>> |   AUCTeX; You should attempt to update only after
>> | 1. you kill all buffer under former AUCTeX modes which have
>> |overlapped name with Emacs built-in TeX modes, and
>> | 2. you terminate the current Emacs session.
>> |   The modes with such overlapped name are ‘plain-tex-mode’,
>> |   ‘latex-mode’, ‘doctex-mode’ and ‘texinfo-mode’.  (The above
>> |   prescription ensures no buffer of such modes is recorded in
>> |   the desktop file.  Otherwise those buffers would be restored
>> |   in the built-in modes, not AUCTeX modes, after the update of
>> |   AUCTeX.)
>> `

> It is the first time I hear this. I used my builds of AUCTeX for a
> long time when Emacs was 22 or 23 and never saw this kind of issues..

AUCTeX changed its major mode names at version 14. The above entry warns
about incompatibility caused by that change.

> If things are so, maybe it is better do not use AUCTeX at all... or not?

I think you don't have to worry about that. In general, the major mode
names are unlikely to change easily. This update to version 14 is very
exceptional.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: Supporting LatexMK in AUCTeX OOTB

2024-04-03 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
>> 2. After C-c C-c LaTeXMK, in dvi+dvips case, C-c C-c View offers xdvi,
>> not postscript viewer, as default candidate. Similarly, in
>> dvi+dvipdfmx case, C-c C-c offers Dvipdfmx, not View, as default
>> candidate.

> Yes, I can confirm this.  I also tried it with my approach with the same
> result: C-c C-c View doesn't work.  I didn't try to find out why,
> though.

It would need to write a new sentinel for latexmk if we are going to
provide the most suitable candidate in all cases.

> I have a question: Is putting the "progname='%`%l%(mode)%''" in each
> entry necessary?

AUCTeX users can deginate latex binary file names through
`TeX-engine-alist' and `LaTeX-command', which can be different from
standard "latex", "xelatex" and "lualatex".  If we are to support such
non-standard binary names, we need %l.  (However, maybe this isn't much
meaningful because fixed binary names of "latexmk" and "dvipdfmx" after
all in my patch. :-))

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: Supporting LatexMK in AUCTeX OOTB

2024-04-02 Thread Ikumi Keita
>>>>> Ikumi Keita  writes:
> Hi Arash,
>>>>> Arash Esbati  writes:
>> I knew you would understand me ;-) Can you do me a favor please and have
>> a look at the code I posted?  I'm not sure how (XeLaTeX/)Dvipdfmx works
>> in .dvi mode, I think you have more experience in that area.  I'd
>> appreciate if you can give a me hint where to put that stuff.  I took
>> the conditional from our style/graphicx.el.

> I don't use latexmk either, but I expect that an article[1] posted in
> Japanese TeX users community would provide some insights about dvipdfmx
> usage for us. I'll take a look tomorrow.

> [1] https://texwiki.texjp.org/?AUCTeX

I expect the attached patch basically works. It still has shortcomings:
1. It uses single quote to prevent variable expansion of '$dvipdf' in
   the shell command line. However, it doesn't work for windows.
2. After C-c C-c LaTeXMK, in dvi+dvips case, C-c C-c View offers xdvi,
   not postscript viewer, as default candidate. Similarly, in
   dvi+dvipdfmx case, C-c C-c offers Dvipdfmx, not View, as default
   candidate.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

diff --git a/tex.el b/tex.el
index 053a0ade..6386ff24 100644
--- a/tex.el
+++ b/tex.el
@@ -250,6 +250,10 @@ If nil, none is specified."
 ("Ps2pdf" "ps2pdf %f %(O?pdf)" TeX-run-ps2pdf nil
  (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode)
  :help "Convert PostScript file to PDF")
+;; Suppress "-recorder" option because %l expantion can include
+;; "\input", after which latexmk inserts "-recorder".
+("LaTeXMK" "latexmk -recorder- %(latexmk-opt) %t"
+ TeX-run-format nil (LaTeX-mode docTeX-mode) :help "Run LaTeXMK")
 ("Glossaries" "makeglossaries %(d-dir) %s" TeX-run-command nil
  (plain-TeX-mode LaTeX-mode docTeX-mode AmSTeX-mode Texinfo-mode)
  :help "Run makeglossaries to create glossary file")
@@ -672,7 +676,35 @@ string."
 ;; Okular forward PDF search requires absolute path.
 ("%a" (lambda nil (prin1-to-string (expand-file-name (buffer-file-name)
 ;; the following is for preview-latex.
-("%m" preview-create-subdirectory))
+("%m" preview-create-subdirectory)
+;; LaTeXMK support
+("%(latexmk-opt)"
+ (lambda ()
+   (cond ((eq TeX-engine 'luatex) ; Running lualatex:
+  (if TeX-PDF-mode
+  " -pdflua -pdflualatex='%`%l%(mode)%''"
+" -dvilua -ps -dvilualatex='%`%l%(mode)%''"))
+ ((eq TeX-engine 'xetex) ; Running xetex in any mode:
+  ;; FIXME: What to do when TeX-PDF-mode is nill?
+  " -pdfxe -pdfxelatex='%`%l%(mode)%''")
+ (t ; For anything else; we don't care Omega:
+  (cond ((and TeX-PDF-mode
+  ;; We want to produce a pdf
+  ;; Return t if default compiler produces PDF,
+  ;; nil for "Dvips" or "Dvipdfmx"
+  (not (TeX-PDF-from-DVI)))
+ ;; We're using pdflatex in pdf-mode
+ " -pdf -pdflatex='%`%l%(mode)%''")
+;; We're generating a .dvi to process with dvips or
+;; dvipdfmx.
+((and TeX-PDF-mode
+  (equal (TeX-PDF-from-DVI) "Dvipdfmx"))
+ " -pdfdvi -latex='%`%l%(mode)%'' -e '$dvipdf=q/dvipdfmx %%O -o %%D %%S/'")
+((and TeX-PDF-mode
+  (equal (TeX-PDF-from-DVI) "Dvips"))
+ " -pdfps -latex='%`%l%(mode)%''")
+(t
+ " -dvi -ps -latex='%`%l%(mode)%''")))
   "List of built-in expansion strings for TeX command names.
 
 This should not be changed by the user who can use
@@ -2200,7 +2232,8 @@ Must be the car of an entry in `TeX-command-list'."
 "\\.glo" "\\.gls" "\\.idx" "\\.ilg" "\\.ind"
 "\\.lof" "\\.log" "\\.lot" "\\.nav" "\\.out"
 "\\.snm" "\\.toc" "\\.url" "\\.synctex\\.gz"
-"\\.bcf" "\\.run\\.xml" "\\.fls" "-blx\\.bib")
+"\\.bcf" "\\.run\\.xml" "\\.fls" "-blx\\.bib"
+"\\.fdb_latexmk")
   "List of regexps matching suffixes of files to be cleaned.
 Used as a default in TeX, LaTeX and docTeX mode.")
 


bug#70128: Issue after upgrading ELPA-auctex 14.0.4

2024-04-02 Thread Ikumi Keita
Hi Angelo,

>>>>> Angelo Graziosi via bug-auctex via Bug reporting list for AUCTeX 
>>>>>  writes:
> The following happens on Windows 10 64 and Emacs 29.3-1 installed from
> MSYS2/UCRT64 (mingw-w64-ucrt-x86_64-emacs 29.3-1, released/built with
> native compilation )

> When one starts Emacs it prints in Messages and minibuffer:

> imenu-default-create-index-function: Invalid (or missing) doc string
> ("c:/Users/utente/AppData/Roaming/.emacs.d/elpa/auctex-14.0.4/tex.elc"
> . 301409)

I don't understand why this error occurred, but this entry in CHANGES
entry may be related:
,
| − If your Emacs is 29 or newer and you use ‘desktop.el’ to save
|   and restore Emacs sessions, be careful before you update
|   AUCTeX; You should attempt to update only after
| 1. you kill all buffer under former AUCTeX modes which have
|overlapped name with Emacs built-in TeX modes, and
| 2. you terminate the current Emacs session.
|   The modes with such overlapped name are ‘plain-tex-mode’,
|   ‘latex-mode’, ‘doctex-mode’ and ‘texinfo-mode’.  (The above
|   prescription ensures no buffer of such modes is recorded in
|   the desktop file.  Otherwise those buffers would be restored
|   in the built-in modes, not AUCTeX modes, after the update of
|   AUCTeX.)
`
If emacs tried to restore the buffer in the built-in latex-mode,
something inconsistent which led to the reported error could happen...?

> After this the desktop file is "emptied": restarting Emacs all buffers
> of the desktop file are lost (I have lost about 50 of them :-( )

Sorry for that. 

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: Supporting LatexMK in AUCTeX OOTB

2024-03-31 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> I knew you would understand me ;-) Can you do me a favor please and have
> a look at the code I posted?  I'm not sure how (XeLaTeX/)Dvipdfmx works
> in .dvi mode, I think you have more experience in that area.  I'd
> appreciate if you can give a me hint where to put that stuff.  I took
> the conditional from our style/graphicx.el.

I don't use latexmk either, but I expect that an article[1] posted in
Japanese TeX users community would provide some insights about dvipdfmx
usage for us. I'll take a look tomorrow.

[1] https://texwiki.texjp.org/?AUCTeX

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: Supporting LatexMK in AUCTeX OOTB

2024-03-29 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> Hi all,
> I was looking through our old bugs and I saw bug#48144[1] which was
> about LatexMK and the issue is resolved.  Looking at auctex-latexmk
> package[2], it seems dormant.  Acc. to this message[3], the fix in
> #48144 was helpful and adding LatexMK support to AUCTeX isn't hard.  I
> don't use LatexMK and don't have any idea how it works, but adding two
> entries to `TeX-expand-list' and `TeX-command-list' should be doable.

> What do others think?  Is there a market for this addition?

I'm fine with your idea. AUCTeX already has plenty of supplementary
entries in `TeX-command-list', so it would be good to have another one
:-)

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



master ec4e27ec: * doc/changes.texi: Add an entry for `TeX-fold-auto-reveal'.

2024-03-27 Thread Ikumi Keita
branch: master
commit ec4e27ec215a7023da2de13ac534b9cdbda8ab20
Author: Ikumi Keita 
Commit: Ikumi Keita 

* doc/changes.texi: Add an entry for `TeX-fold-auto-reveal'.
---
 doc/changes.texi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/doc/changes.texi b/doc/changes.texi
index 2ac2ee05..098195ac 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -182,6 +182,11 @@ The boolean custom variable 
@code{TeX-kill-process-without-query} can be
 used to disable the user query before aborting a running process for a
 @TeX{} document.  Default is @code{nil}.
 
+@item
+In Fold mode, the original source text is revealed when you click the
+folded portion by mouse.  You can customize the detailed behavior by
+new customize option @code{TeX-fold-auto-reveal}.
+
 @item
 @AUCTeX{} now requires GNU Emacs 27.1 or higher.
 @end itemize



master 0fcc1523: Document the new customize option

2024-03-26 Thread Ikumi Keita
branch: master
commit 0fcc152333c411670230e6c8203da54f170c1362
Author: Ikumi Keita 
Commit: Ikumi Keita 

Document the new customize option

* doc/auctex.texi (Folding): Add description about
`TeX-fold-auto-reveal' to follow up the last commit (bug#69954).
---
 doc/auctex.texi | 24 
 1 file changed, 24 insertions(+)

diff --git a/doc/auctex.texi b/doc/auctex.texi
index b499c63b..6e9d33c3 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -2826,6 +2826,30 @@ Maximum length of original text displayed in a tooltip 
or the echo area
 for folded content.  Set it to zero in order to disable this feature.
 @end defopt
 
+@defopt TeX-fold-auto-reveal
+This option determines the auto-reveal behavior when the point enters the
+folded portion of the buffer.  Possible values and the corresponding
+behaviors are:
+@itemize
+@item
+@code{t}: @AUCTeX{} always opens the folded expression and reveal the
+original source text.
+@item
+@code{nil}: @AUCTeX{} never reveals.
+@item
+@var{SYMBOL}: The value of @var{SYMBOL} is used as a boolean flag.  If
+@var{SYMBOL} isn't bound as a variable, it is treated as @code{nil}.
+@item
+Cons cell @code{(@var{FUNCTION} . @var{ARGUMENTS})}: @AUCTeX{} calls the
+@var{FUNCTION} with arbitrary number of @var{ARGUMENTS}.  The return value
+is regarded as a boolean flag.
+@end itemize
+
+It has a reasonable default value to reveal when the point enters the
+folded portion with @kbd{@key{left}}, @kbd{@key{right}}, @kbd{C-b},
+@kbd{C-f} or mouse click under standard key binding.
+@end defopt
+
 
 @node Outline
 @section Outlining the Document



bug#69954: 13.3; allow TeX-fold auto-reveal customization

2024-03-25 Thread Ikumi Keita
Hi, Arash

>>>>> Arash Esbati  writes:
> Arrgh, my bad; I was looking at the other commit c290376d5d provided by
> Paul and installed by you -- sorry for the noise :-(

Don't worry, I don't mind. :-)

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#69954: 13.3; allow TeX-fold auto-reveal customization

2024-03-25 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> @Keita: We loosely try to follow the guidelines of Emacs which says[1]:

>   - Commit messages should not contain the "Signed-off-by:" lines that
> are used in some other projects.

Yes, I comitted without "Signed-off-by:" line, with me being the author.
Did you actually mean to mention another paragraph in CONTRIBUTE?
(By the way, I should have included the bug number in the commit
message. )

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#69954: 13.3; allow TeX-fold auto-reveal customization

2024-03-25 Thread Ikumi Keita
>>>>> Paul Nelson  writes:
> Hi Ikumi,
> Looks good to me!

Thank you, pushed to the git repo. I'll close this bug.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


master c008bb60: Make auto reveal feature configurable in folding

2024-03-25 Thread Ikumi Keita
branch: master
commit c008bb60b2fbd6e8e0220439109070d600080724
Author: Ikumi Keita 
Commit: Ikumi Keita 

Make auto reveal feature configurable in folding

* tex-fold.el (TeX-fold-auto-reveal): New customize option following
`preview-auto-reveal'.
(TeX-fold-auto-reveal-p, TeX-fold-arrived-via): New function following
`preview-auto-reveal-p' and `preview-arrived-via'.
(TeX-fold-post-command): Use it.
---
 tex-fold.el | 50 +-
 1 file changed, 45 insertions(+), 5 deletions(-)

diff --git a/tex-fold.el b/tex-fold.el
index 92304fb2..d786ff62 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -254,6 +254,34 @@ After that, changing the prefix key requires manipulating 
keymaps."
 (define-key map "i"#'TeX-fold-clearout-item)
 map))
 
+(defcustom TeX-fold-auto-reveal
+  '(eval (TeX-fold-arrived-via (key-binding [left]) (key-binding [right])
+   #'backward-char #'forward-char
+   #'mouse-set-point))
+  "Predicate to open a fold when entered.
+Possibilities are:
+t autoopens,
+nil doesn't,
+a symbol will have its value consulted if it exists,
+defaulting to nil if it doesn't.
+A CONS-cell means to call a function for determining the value.
+The CAR of the cell is the function to call which receives
+the CDR of the CONS-cell in the rest of the arguments, while
+point and current buffer point to the position in question.
+All of the options show reasonable defaults."
+  :group 'TeX-fold
+  :type '(choice (const :tag "Off" nil)
+ (const :tag "On" t)
+ (symbol :tag "Indirect variable" :value reveal-mode)
+ (cons :tag "Function call"
+   :value (eval (TeX-fold-arrived-via
+ (key-binding [left])
+ (key-binding [right])
+ #'backward-char #'forward-char
+ #'mouse-set-point))
+   function (list :tag "Argument list"
+  (repeat :inline t sexp)
+
 
 ;;; Folding
 
@@ -833,6 +861,22 @@ Remove the respective properties from the overlay OV."
   (when font-lock-mode
 (overlay-put ov 'face TeX-fold-unfolded-face)))
 
+(defun TeX-fold-auto-reveal-p (mode)
+  "Decide whether to auto-reveal.
+Return non-nil if folded region should be auto-opened.
+See `TeX-fold-auto-reveal' for definitions of MODE."
+  (cond ((symbolp mode)
+ (and (boundp mode)
+  (symbol-value mode)))
+((consp mode)
+ (apply (car mode) (cdr mode)))
+(t mode)))
+
+(defun TeX-fold-arrived-via ( list)
+  "Indicate auto-opening.
+Return non-nil if called by one of the commands in LIST."
+  (memq this-command list))
+
 ;; Copy and adaption of `reveal-post-command' from reveal.el in GNU
 ;; Emacs on 2004-07-04.
 (defun TeX-fold-post-command ()
@@ -855,11 +899,7 @@ Remove the respective properties from the overlay OV."
   (setq TeX-fold-open-spots (cdr spots))
   (when (or disable-point-adjustment
 global-disable-point-adjustment
-;; See preview.el on how to make this configurable.
-(memq this-command
-  (list (key-binding [left]) (key-binding [right])
-#'backward-char #'forward-char
-#'mouse-set-point)))
+(TeX-fold-auto-reveal-p TeX-fold-auto-reveal))
 ;; Open new overlays.
 (dolist (ol (nconc (when (and TeX-fold-unfold-around-mark
   mark-active)



bug#69954: 13.3; allow TeX-fold auto-reveal customization

2024-03-24 Thread Ikumi Keita
Hi Paul,

>>>>> Paul Nelson  writes:
> It would be useful to be able to customize when TeX-fold-mode
> auto-reveals.  I attach a patch with my best attempt at this,
> imitating what is done in preview.el.

Thanks for your proposal. I'm considering to apply slightly modified
patch as attached. I intend to have all `defcustom's in the early
block of the file and to improve similarity with preview.el.

What do you think about this idea?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW

diff --git a/tex-fold.el b/tex-fold.el
index 92304fb2..d786ff62 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -254,6 +254,34 @@ After that, changing the prefix key requires manipulating keymaps."
 (define-key map "i"#'TeX-fold-clearout-item)
 map))
 
+(defcustom TeX-fold-auto-reveal
+  '(eval (TeX-fold-arrived-via (key-binding [left]) (key-binding [right])
+   #'backward-char #'forward-char
+   #'mouse-set-point))
+  "Predicate to open a fold when entered.
+Possibilities are:
+t autoopens,
+nil doesn't,
+a symbol will have its value consulted if it exists,
+defaulting to nil if it doesn't.
+A CONS-cell means to call a function for determining the value.
+The CAR of the cell is the function to call which receives
+the CDR of the CONS-cell in the rest of the arguments, while
+point and current buffer point to the position in question.
+All of the options show reasonable defaults."
+  :group 'TeX-fold
+  :type '(choice (const :tag "Off" nil)
+ (const :tag "On" t)
+ (symbol :tag "Indirect variable" :value reveal-mode)
+ (cons :tag "Function call"
+   :value (eval (TeX-fold-arrived-via
+ (key-binding [left])
+ (key-binding [right])
+ #'backward-char #'forward-char
+ #'mouse-set-point))
+   function (list :tag "Argument list"
+  (repeat :inline t sexp)
+
 
 ;;; Folding
 
@@ -833,6 +861,22 @@ Remove the respective properties from the overlay OV."
   (when font-lock-mode
 (overlay-put ov 'face TeX-fold-unfolded-face)))
 
+(defun TeX-fold-auto-reveal-p (mode)
+  "Decide whether to auto-reveal.
+Return non-nil if folded region should be auto-opened.
+See `TeX-fold-auto-reveal' for definitions of MODE."
+  (cond ((symbolp mode)
+ (and (boundp mode)
+  (symbol-value mode)))
+((consp mode)
+ (apply (car mode) (cdr mode)))
+(t mode)))
+
+(defun TeX-fold-arrived-via ( list)
+  "Indicate auto-opening.
+Return non-nil if called by one of the commands in LIST."
+  (memq this-command list))
+
 ;; Copy and adaption of `reveal-post-command' from reveal.el in GNU
 ;; Emacs on 2004-07-04.
 (defun TeX-fold-post-command ()
@@ -855,11 +899,7 @@ Remove the respective properties from the overlay OV."
   (setq TeX-fold-open-spots (cdr spots))
   (when (or disable-point-adjustment
 global-disable-point-adjustment
-;; See preview.el on how to make this configurable.
-(memq this-command
-  (list (key-binding [left]) (key-binding [right])
-#'backward-char #'forward-char
-#'mouse-set-point)))
+(TeX-fold-auto-reveal-p TeX-fold-auto-reveal))
 ;; Open new overlays.
 (dolist (ol (nconc (when (and TeX-fold-unfold-around-mark
   mark-active)
___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


Re: Emacs 27 problem with :local keyword in defcustom

2024-03-17 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> I pushed a change 509a71b436 which should fix this issue. Can you please
> give it a new try with 27.1?  If the result is Ok, I'll ask Tassilo to
> make a new ELPA release.

It works for emacs 27.1.

By the way, this chunk should be reverted :-)

modified   latex.el
@@ -1,6 +1,6 @@
 ;;; latex.el --- Support for LaTeX documents.  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 1991, 1993-2024 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1993-2023 Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Keywords: tex

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Emacs 27 problem with :local keyword in defcustom

2024-03-15 Thread Ikumi Keita
Hi Arash,

I noticed that emacs 27.1 fails with the current AUCTeX master. When I
open circ.tex with emacs 27.1, it signals error with
"(wrong-type-argument number-or-marker-p nil)" in `TeX-auto-parse'. The
local values of `TeX-auto-parse-length' and `TeX-auto-x-parse-length'
are both nil in the circ.tex buffer.

It seems that it is due to introduction of :local keyword in defcustom:
,
| 77a02f837a0d32e2f7b47764d6e7f64ad76001ba
| Author: Arash Esbati 
| AuthorDate: Thu Jan 18 22:55:12 2024 +0100
| Commit: Arash Esbati 
| CommitDate: Thu Jan 18 22:55:12 2024 +0100
| 
| Mark options as buffer-local with the :local keyword
`
As far as I can see, it is a bug of emacs 27.1. The function
`custom-declare-variable', which is the essential part of `defcustom',
puts the `make-variable-buffer-local' declaration _before_ the actual
`defvar', thus ending up with inconsistent local values.

Hence we have to refrain from using :local in `defcustom' until we drop
support for emacs 27 :-(

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



Re: Deleting compat code from commit 087b030001

2024-03-15 Thread Ikumi Keita
>>>>> Arash Esbati  writes:
> Hi Keita,
> can I delete this code in tex.el:
> (if (< emacs-major-version 27)
> (or (assq 'compilation-in-progress minor-mode-alist)
> (setq minor-mode-alist (cons '(compilation-in-progress " Compiling")
>  minor-mode-alist
> It was introduced with commit 087b030001:

>   Simplify mode line for emacs 27

>   * tex-buf.el: Don't add an entry in `minor-mode-alist' for
>   `compilation-in-progress'. In emacs 27, compile.el adds a similar
>   entry in `mode-line-modes'.

> We require Emacs=E2=89=A527 now, I think we can delete it.  WDYT?

Yes, I think so. Please go ahead.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




bug#54200: 13.0.14; Preview incorrectly folds math environments with TeX-engine LuaTeX

2024-03-06 Thread Ikumi Keita
>>>>> Arash Esbati  writes:
> Ikumi Keita  writes:
>> Hi David and Liam,
>> 
>>>>>>> Ikumi Keita  writes:
>>>> Error context is produced by the TeX engine itself, so in this case it
>>>> would be the fault of LuaTeX and should likely be reported to its
>>>> developer list at dev-lua...@ntg.nl .
>> 
>> I reported the issue in LuaTeX developer list[1], but it doesn't seem
>> promissing.
>> 
>> The core developers don't regard it as a bug basically, thus working
>> with low priority on it. This issue, if it is ever resolved, will be a
>> long way off unfortunately.
>> 
>> [1] Thread beginning with
>> https://mailman.ntg.nl/pipermail/dev-luatex/2022-March/006601.html

> Hi Keita,

> can we assume that this is a "wontfix"?  The way I see it we rely on
> LuaTeX here.

Yes, I think so. Thank you for enthusiatic work on unresolved bugs these
days!

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#69398: `LaTeX-fill-paragraph` behavior within indented environments

2024-03-06 Thread Ikumi Keita
Hi Ruiyang,

>>>>> Ruiyang Wu  writes:
> Hi Ikumi,
> Thanks for the reply and please take your time.

I figured out the reason but haven't come up with a satisfactory
solution.

[Basis]
The elisp function `save-excursion' uses marker internally to keep track
of the original position.

[Analysis]
,
| \documentclass{article}
| 
| \begin{document}
| \begin{itemize}
| \item In indented environments, when the point is at the first letter
| of a line, running ``LaTeX-fill-paragraph'' will move the point to
|   the beginning of the line. Ideally, it should stay with the letter.
| \end{itemize}
| \end{document}
`

During the course of the filling, in `LaTeX-indent-outer-do', the line
in question once loses its indent:
,
| \item In indented environments, when the point is at the first letter
| of a line, running ``LaTeX-fill-paragraph'' will move the point to the 
beginning of the line. Ideally, it should stay with the letter.
| \end{itemize}
`
At this time, the marker locates at the "correct" position, namely at
the first "o" in the line immediately after "item". In other words, it
is at the beginning of the line immediately after "item".

Then `LaTeX-indent-outer-do' calls `indent-to', which inserts
whitespaces, to give the correct indentation. However, this insertion is
done at the position of the marker that the `save-excursion' uses. This
means that emacs doesn't send the marker after the inserted whitespaces
because that's the default behavior of emacs. Therefore, the marker
stays at the beginning of the line and the point is moved to that
marker position after M-q finishes, rather than the position after the
indentation.

[Solution?]
We can work around this particular example by replacing
  (save-excursion
...)
in `LaTeX-fill-paragraph' with
  (let ((m (point-marker)))
(set-marker-insertion-type m t) ; Send marker after the inserted text.
...
(goto-char m)
(set-marker m nil))
, but I'm not sure this is the right thing to do:
1. This wouldn't match with behavior with other filling functions.
2. Even if we tweak all such occurences of `save-excursion', it isn't
   clear whether it is right that the position always "sticks" to the
   letter where before M-q is typed.

Does anyone find a good solution?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#69398: `LaTeX-fill-paragraph` behavior within indented environments

2024-03-03 Thread Ikumi Keita
Hi Ruiyang,

>>>>> Ruiyang Wu  writes:
> Hi there,
> When the point is on the first letter of a line inside an indented 
> environment (e.g., itemize, proof, etc.), running `LaTeX-fill-paragraph` will 
> move the point to the beginning of the line. Here is a MWE:

> \documentclass{article}

> \begin{document}
> \begin{itemize}
> \item In indented environments, when the point is at the first letter
> of a line, running ``LaTeX-fill-paragraph'' will move the point to
>   the beginning of the line. Ideally, it should stay with the letter.
> \end{itemize}
> \end{document}

> 1. If the point is on the first “o” in the line immediately after “\item”, 
> running `LaTeX-fill-paragraph` moves the point to column 0, while “o” is 
> moved to column 2 because of the filling operation.
> 2. If the point is on the first “f” in the same line as above, the point 
> stays on “f” after running `LaTeX-fill-paragraph` (both moved to column 3).

> I think it is better to have consistent point behavior as in scenario 2, 
> because users probably want to continue editing after running `M-q’, and it 
> is much more efficient if the point stays on the same letter before and after 
> filling.

Sorry for late response. I confirmed what you reported (with fill-column
being 70) and had brief look at the relevant code. Unfortunately, the
code uses `save-excursion' to preserve the point, so it seems that
something very exceptional is happening. I'll try to figure out the
origin and fix it, but it can take a non trivial span of time. :-(

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#65750: 12.2; LaTeX-mark-section and LaTeX-section-list

2024-02-23 Thread Ikumi Keita
Hi Janet,

>>>>> Janet Chen  writes:
> Dear Ikumi,
> Thanks very much!

>> I installed a fix in the git repo, so you won't need the workaround
>> under the next AUCTeX release.
>> 
>> I'll close this bug.

I'm sorry to deliver you a bad news. In response to bug#69254[1], we
decided to revert the fix of bug#65750. This is in favor of being able
to turn on outline minor mode in `LaTeX-mode-hook'. See the thread of
[1] for detail.

Therefore, you again need the code block
(add-hook 'LaTeX-mode-hook
  (lambda ()
(add-hook 'hack-local-variables-hook
  (lambda ()
(setq-local outline-regexp (LaTeX-outline-regexp t))
(setq outline-heading-alist
  (mapcar (lambda (x)
(cons (concat "\\" (nth 0 x)) (nth 1 
x)))
  LaTeX-section-list)))
  nil t)))
in your init file to make `LaTeX-mark-section' recognize your customize
to `LaTeX-section-list' as the file local variable after the next AUCTeX
release.

Sorry for inconvenience.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69254

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#69254: 14.0.2; outline-hide-body doesn't work when called in LaTeX-mode-hook

2024-02-23 Thread Ikumi Keita
Hi Arash,

>>>>> Arash Esbati  writes:
> Ikumi Keita  writes:
>> Do you think that we should also revert the similar changes for
>> paragraph related variables?

> I'm not sure if that part is really relevant for users.  I suggest we
> keep that as is and touch it if we get feedback from the users.  Does it
> make sense?

OK, then I'll install the current patch.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW




___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


master 0f8901dc: Set up outline mode variables early (bug#69254)

2024-02-23 Thread Ikumi Keita
branch: master
commit 0f8901dc5dff4687def1250983ff1a66d2322db5
Author: Ikumi Keita 
Commit: Ikumi Keita 

Set up outline mode variables early (bug#69254)

* latex.el (LaTeX-mode-cleanup):
(LaTeX-common-initialization):
Revert the fix for bug#65750 partially so that call to outline mode in
`LaTeX-mode-hook' works.
* context.el (ConTeXt-mode-common-initialization):
(ConTeXt-mode-cleanup):
* tex-info.el: (Texinfo-mode):
(Texinfo-mode-cleanup):
Follow the above change for LaTeX mode.
---
 context.el  | 10 +++---
 latex.el| 23 ++-
 tex-info.el | 26 ++
 3 files changed, 15 insertions(+), 44 deletions(-)

diff --git a/context.el b/context.el
index 5ee0217d..86991ccf 100644
--- a/context.el
+++ b/context.el
@@ -1875,9 +1875,8 @@ that is, you do _not_ have to cater for this yourself by 
adding \\=' or $."
   ;; Outline support
   (require 'outline)
   (set (make-local-variable 'outline-level) #'ConTeXt-outline-level)
-  ;; Moved after `run-mode-hooks'. (bug#65750)
-  ;; (set (make-local-variable 'outline-regexp) (ConTeXt-outline-regexp t))
-  ;;(make-local-variable 'outline-heading-end-regexp)
+  (set (make-local-variable 'outline-regexp) (ConTeXt-outline-regexp t))
+  (make-local-variable 'outline-heading-end-regexp)
   (setq TeX-header-end (ConTeXt-header-end)
 TeX-trailer-start (ConTeXt-trailer-start))
 
@@ -1913,10 +1912,7 @@ Run after mode hooks and file local variables 
application."
  "[ \t]*\\("
  (ConTeXt-paragraph-commands-regexp) "\\|"
  "\\$\\$\\|" ; Plain TeX display math
- "$\\)"))
-
-  (or (local-variable-p 'outline-regexp)
-  (setq-local outline-regexp (ConTeXt-outline-regexp t
+ "$\\)")))
 
 (defun context-guess-current-interface ()
   "Guess what ConTeXt interface the current buffer is using."
diff --git a/latex.el b/latex.el
index 83de0e84..de70c7f5 100644
--- a/latex.el
+++ b/latex.el
@@ -8268,16 +8268,6 @@ Run after mode hooks and file local variables 
application."
   (if (bound-and-true-p filladapt-mode)
   (turn-off-filladapt-mode))
 
-  ;; Don't overwrite the value the user set by hooks or file
-  ;; (directory) local variables.
-  (or (local-variable-p 'outline-regexp)
-  (setq-local outline-regexp (LaTeX-outline-regexp t)))
-  (or (local-variable-p 'outline-heading-alist)
-  (setq outline-heading-alist
-(mapcar (lambda (x)
-  (cons (concat "\\" (nth 0 x)) (nth 1 x)))
-LaTeX-section-list)))
-
   ;; Keep `LaTeX-paragraph-commands-regexp' in sync with
   ;; `LaTeX-paragraph-commands' in case the latter is updated by
   ;; hooks or file (directory) local variables.
@@ -8441,13 +8431,12 @@ function would return non-nil and `(match-string 1)' 
would return
 
   (require 'outline)
   (set (make-local-variable 'outline-level) #'LaTeX-outline-level)
-  ;; Moved after `run-mode-hooks'. (bug#65750)
-  ;; (set (make-local-variable 'outline-regexp) (LaTeX-outline-regexp t))
-  ;; (when (boundp 'outline-heading-alist)
-  ;;   (setq outline-heading-alist
-  ;; (mapcar (lambda (x)
-  ;;   (cons (concat "\\" (nth 0 x)) (nth 1 x)))
-  ;; LaTeX-section-list)))
+  (set (make-local-variable 'outline-regexp) (LaTeX-outline-regexp t))
+  (when (boundp 'outline-heading-alist)
+(setq outline-heading-alist
+  (mapcar (lambda (x)
+(cons (concat "\\" (nth 0 x)) (nth 1 x)))
+  LaTeX-section-list)))
 
   (setq-local TeX-auto-full-regexp-list
   (delete-dups (append LaTeX-auto-regexp-list
diff --git a/tex-info.el b/tex-info.el
index fc10f018..9f919ee3 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -31,9 +31,6 @@
 
 (require 'texinfo)
 
-;; Silence the compiler for variables:
-(defvar outline-heading-alist)
-
 ;;; Environments:
 (defvar Texinfo-environment-list
   '(("cartouche") ("command") ("copying") ("defcv") ("deffn") ("defivar")
@@ -672,13 +669,12 @@ value of `Texinfo-mode-hook'."
   (set (make-local-variable 'syntax-propertize-function)
texinfo-syntax-propertize-function)
 
-  ;; Moved after `run-mode-hooks'. (bug#65750)
-  ;; (setq-local outline-heading-alist
-  ;; (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x)))
-  ;; texinfo-section-list))
-  ;; (setq-local outline-regexp
-  ;; (concat (regexp-opt (mapcar #'car outline-heading-alist) t)
-  ;; "\\>"))
+  (setq-local outline-heading-alist
+  (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x)))
+ texinfo-section-list))
+  (setq-local outline-regexp
+  (concat (regexp-opt (mapcar #'car outline-heading-alist) t)
+ 

  1   2   3   4   5   6   7   8   9   10   >