Sorry, I forgot to reply all in my previous email. The patch is attached
here.
---- Original message ----
Hi Ikumi.
Sorry I missed preview.el.in. Yes, I can change that too.
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.
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 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.
I attach the updated patch. I have tested this, and it works for me. Please
let me know what you think.
On Wed, 17 Apr 2024 at 15:23, Ikumi Keita <[email protected]> wrote:
> Hi Vangelis,
>
> >>>>> Vangelis Evangelou <[email protected]> writes:
> > ./tex.el:2440: (and buffer-file-name
> > ./tex.el:2441: (file-name-directory buffer-file-name)))))))
>
> > In the above, I think that part of the code is in fact redundant. That's
> > because if the function's `expand-file-name' second argument is nil,
> then
> > it's taken to be the default-directory. Quoting from the help page:
>
> > Second arg DEFAULT-DIRECTORY is directory to start with if NAME is
> relative
> > (does not start with slash or tilde); both the directory name and
> > a directory’s file name are accepted. If DEFAULT-DIRECTORY is nil or
> > missing, the current buffer’s value of ‘default-directory’ is used.
> > NAME should be a string that is a valid file name for the underlying
> > filesystem.
>
> > So, with the current code, the second argument will be something like
> > /home/me/file.tex, while if nil, it is assumed to be /home/me/ which in
> the
> > end has the same effect. I can't imagine a situation where that's not the
> > case.
>
> I see. I agree with your argument.
>
> > For all other cases:
>
> > ./style/catchfilebetweentags.el:70: (buffer-file-name
> > (current-buffer)))))
> > ./style/pdfsync.el:40: (file-relative-name
> (buffer-file-name)
> > ./tex-info.el:707: (unless (file-exists-p
> > (buffer-file-name))
> > ./toolbar-x.el:1465: (buffer-file-name
> > (buffer-base-buffer))
> > ./toolbar-x.el:1469: :visible (or buffer-file-name
> > ./toolbar-x.el:1479: :visible (or buffer-file-name
> > ./latex.el:2564: (let ((name (file-name-nondirectory buffer-file-name)))
> > ./latex.el:2585: (file-name-nondirectory
> buffer-file-name))))
>
> > I believe we can change buffer-file-name to (TeX-buffer-file-name) where
> > the file "tex.el" is loaded for consistency. The function with nil
> argument
> > has the same effect as the variable. I'm happy to make the changes to
> that
> > too if that's OK with you.
>
> Thanks, no problem. But note that preview.el.in (used as template to
> generate preview.el) has other references to `buffer-file-name' as well.
> I'd like you to have look at them, too.
>
> > 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?
>
> > As far as I understand the variable TeX-master always points to the name
> of
> > the file *without* the extension. That's why the first argument is nil.
> > Otherwise, if extension is say "pdf", then the TeX-master for the
> indirect
> > buffer will be something like "foo.pdf". The extension part is added
> later
> > in the code in the function TeX-master-file.
>
> After reading the surrounding code, I came to think that I should change
> the question. The function `TeX-master-file' has the following structure:
> ----------------------------------------------------------------------
> (defun TeX-master-file (&optional extension nondirectory ask)
> [...]
> (save-excursion
> [...]
> ;; Indirect buffer
> (my-buffer
> (with-current-buffer my-buffer
> (TeX-master-file nil nondirectory ask)))
> [...]
> ;; Ask the user (but add it as a local variable).
> (ask (TeX-master-file-ask))))) <-- END OF `save-excursion'
>
> (let ((name (if (stringp TeX-master)
> [...]
> name)))) <-- END OF `let' (and `defun')
> ----------------------------------------------------------------------
> The return value of this function comes from the last `let' form;
> nothing returned in the `save-excursion' form are used. Hence
> `TeX-master-file' works as follows in indirect buffer if I understand
> correctly:
> (1) The added piece of code
> (TeX-master-file nil nondirectory ask)))
> runs in the base buffer. Its return value is just discarded, so it
> runs only for these side effects:
> (1a) Sets up `TeX-master', if not ready yet.
> (1b) Adds file local variables section when necessary.
> (2) The remaining `let' form runs in the indirect buffer to compute and
> return the file name associated with the base buffer, with possible
> extension.
> It seems that the `cond' clauses which set up `TeX-master' are skipped
> in indirect buffer except when this clause runs:
> ----------------------------------------------------------------------
> ((and TeX-transient-master
> (or (not TeX-master) (eq TeX-master 'shared)))
> (setq TeX-master TeX-transient-master))
> ----------------------------------------------------------------------
> Are all these your intention? If so, it is reasonable to have fixed nil
> 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
>
diff -ru auctex-13.3/bib-cite.el auctex-13.3-modified/bib-cite.el
--- auctex-13.3/bib-cite.el 2024-01-17 14:55:20.000000000 +0000
+++ auctex-13.3-modified/bib-cite.el 2024-04-12 11:53:09.991949346 +0100
@@ -1903,7 +1903,7 @@
;; rather than \input file
(re-search-forward "^[ \t]*\\\\\\(include\\|input\\){"
nil t))))
- (buffer-file-name))
+ (TeX-buffer-file-name))
(t
nil))))
(cond
diff -ru auctex-13.3/latex.el auctex-13.3-modified/latex.el
--- auctex-13.3/latex.el 2024-01-17 14:55:20.000000000 +0000
+++ auctex-13.3-modified/latex.el 2024-04-15 15:08:06.128458448 +0100
@@ -2561,7 +2561,7 @@
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
@@ -2582,7 +2582,7 @@
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 -ru auctex-13.3/preview.el.in auctex-13.3-modified/preview.el.in
--- auctex-13.3/preview.el.in 2024-01-17 14:55:20.000000000 +0000
+++ auctex-13.3-modified/preview.el.in 2024-04-17 21:01:20.403999401 +0100
@@ -3053,8 +3053,8 @@
#'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)
@@ -4046,8 +4046,8 @@
TeX-region-extra)))
(TeX-region-create (TeX-region-file TeX-default-extension)
(buffer-substring-no-properties begin end)
- (if buffer-file-name
- (file-name-nondirectory buffer-file-name)
+ (if (TeX-buffer-file-name)
+ (file-name-nondirectory (TeX-buffer-file-name))
"<none>")
(TeX-current-offset begin)))
(setq TeX-current-process-region-p t)
diff -ru auctex-13.3/style/catchfilebetweentags.el auctex-13.3-modified/style/catchfilebetweentags.el
--- auctex-13.3/style/catchfilebetweentags.el 2024-01-17 14:55:20.000000000 +0000
+++ auctex-13.3-modified/style/catchfilebetweentags.el 2024-04-15 15:05:27.480459053 +0100
@@ -67,7 +67,7 @@
;; several external files to a singular one.
(let* ((file (file-name-sans-extension
(file-name-nondirectory
- (buffer-file-name (current-buffer)))))
+ (TeX-buffer-file-name (current-buffer)))))
(fn (when LaTeX-catchfilebetweentags-use-numeric-label
(LaTeX-catchfilebetweentags-counter-inc)))
(tag (concat file ":"
diff -ru auctex-13.3/style/pdfsync.el auctex-13.3-modified/style/pdfsync.el
--- auctex-13.3/style/pdfsync.el 2024-01-17 14:55:20.000000000 +0000
+++ auctex-13.3-modified/style/pdfsync.el 2024-04-15 15:05:40.388459004 +0100
@@ -37,7 +37,7 @@
(let* ((line (line-number-at-pos))
(master (TeX-active-master))
(file (file-name-sans-extension
- (file-relative-name (buffer-file-name)
+ (file-relative-name (TeX-buffer-file-name)
(file-name-directory master))))
(pdfsync-file (concat master ".pdfsync"))
(buf-live-p (get-file-buffer pdfsync-file))
diff -ru auctex-13.3/tex.el auctex-13.3-modified/tex.el
--- auctex-13.3/tex.el 2024-01-17 14:55:20.000000000 +0000
+++ auctex-13.3-modified/tex.el 2024-04-21 21:48:09.240121904 +0100
@@ -655,7 +655,7 @@
;; case the file is in a different subdirectory
("%b" TeX-current-file-name-master-relative)
;; Okular forward PDF search requires absolute path.
- ("%a" (lambda nil (prin1-to-string (expand-file-name (buffer-file-name)))))
+ ("%a" (lambda nil (prin1-to-string (expand-file-name (TeX-buffer-file-name)))))
;; the following is for preview-latex.
("%m" preview-create-subdirectory))
"List of built-in expansion strings for TeX command names.
@@ -1193,7 +1193,7 @@
(format "/org/%s/%s/Window/0" de app)
(format "org.%s.%s.Window" de app)
"SyncView"
- (buffer-file-name)
+ (TeX-buffer-file-name)
(list :struct :int32 (1+ (TeX-current-offset))
;; FIXME: Using `current-column' here is dubious.
;; Most of CJK letters count as occupying 2 columns,
@@ -1762,7 +1762,7 @@
(when (re-search-forward "!offset(\\([---0-9]+\\))" nil t)
(let ((offset (string-to-number (match-string-no-properties 1))))
(when TeX-region-orig-buffer
- (list (expand-file-name (buffer-file-name TeX-region-orig-buffer))
+ (list (expand-file-name (TeX-buffer-file-name TeX-region-orig-buffer))
(+ line offset) col)))))))
(defcustom TeX-raise-frame-function #'raise-frame
@@ -1981,11 +1981,11 @@
"Return the page corresponding to the position in the current buffer.
This method assumes that the document was compiled with SyncTeX
enabled and the `synctex' binary is available."
- (let* ((file (file-relative-name (buffer-file-name)
+ (let* ((file (file-relative-name (TeX-buffer-file-name)
(file-name-directory
(TeX-active-master))))
(abs-file (concat (expand-file-name (or (file-name-directory (TeX-active-master))
- (file-name-directory (buffer-file-name))))
+ (file-name-directory (TeX-buffer-file-name))))
"./" file)))
;; It's known that depending on synctex version one of
;; /absolute/path/./foo/bar.tex, foo/bar.tex, or ./foo/bar.tex (relative to
@@ -2320,7 +2320,7 @@
(TeX-add-local-master))
((or
;; Default `read-file-name' proposes and buffer visits a file.
- (string= (expand-file-name name) (buffer-file-name))
+ (string= (expand-file-name name) (TeX-buffer-file-name))
;; Default of `read-file-name' and buffer does not visit a file.
(string= name default-directory)
;; User typed <RET> in an empty minibuffer.
@@ -2347,80 +2347,84 @@
(interactive)
(if (eq extension t)
(setq extension TeX-default-extension))
- (let ((my-name (if (buffer-file-name)
- (TeX-strip-extension nil (list TeX-default-extension) t)
- "<none>")))
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (cond
- ((and TeX-transient-master
- (or (not TeX-master) (eq TeX-master 'shared)))
- (setq TeX-master TeX-transient-master))
- ;; Special value 't means it is own master (a free file).
- ((equal TeX-master my-name)
- (setq TeX-master t))
-
- ;; For files shared between many documents.
- ((and (eq 'shared TeX-master) ask)
- (setq TeX-master
- (let* ((default (TeX-dwim-master))
- (name (read-file-name
- (format "Master file (default %s): "
- (or default "this file"))
- nil default)))
- (cond ((string= name default)
- default)
- ((or
- ;; Default `read-file-name' proposes and
- ;; buffer visits a file.
- (string= (expand-file-name name)
- (buffer-file-name))
- ;; Default of `read-file-name' and
- ;; buffer does not visit a file.
- (string= name default-directory)
- ;; User typed <RET> in an empty minibuffer.
- (string= name ""))
- t)
- (t
- (TeX-strip-extension
- name (list TeX-default-extension) 'path))))))
-
- ;; We might already know the name.
- ((or (eq TeX-master t) (stringp TeX-master)) TeX-master)
-
- ;; Ask the user (but add it as a local variable).
- (ask (TeX-master-file-ask)))))
-
- (let ((name (if (stringp TeX-master)
- TeX-master
- my-name)))
-
- (if (TeX-match-extension name)
- ;; If it already has an extension...
- (if (equal extension TeX-default-extension)
- ;; Use instead of the default extension
- (setq extension nil)
- ;; Otherwise drop it.
- (setq name (TeX-strip-extension name))))
-
- (let* ((reg (TeX--clean-extensions-regexp t))
- (is-output-ext (and reg
- (or (string-match-p reg (concat "." extension))
- (string= "prv" extension))))
- (output-dir (and is-output-ext
- (TeX--master-output-dir
- (file-name-directory name)
- nondirectory))))
- (if output-dir
- (setq name (concat output-dir (file-name-nondirectory name)))
- ;; Remove directory if needed.
- (if nondirectory
- (setq name (file-name-nondirectory name)))))
- (if extension
- (concat name "." extension)
- name))))
+ (with-current-buffer
+ ;; In case this is an indirect buffer:
+ (or (buffer-base-buffer) (current-buffer))
+ (let ((my-name (if (TeX-buffer-file-name)
+ (TeX-strip-extension nil (list TeX-default-extension) t)
+ "<none>")))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (cond
+ ((and TeX-transient-master
+ (or (not TeX-master) (eq TeX-master 'shared)))
+ (setq TeX-master TeX-transient-master))
+
+ ;; Special value 't means it is own master (a free file).
+ ((equal TeX-master my-name)
+ (setq TeX-master t))
+
+ ;; For files shared between many documents.
+ ((and (eq 'shared TeX-master) ask)
+ (setq TeX-master
+ (let* ((default (TeX-dwim-master))
+ (name (read-file-name
+ (format "Master file (default %s): "
+ (or default "this file"))
+ nil default)))
+ (cond ((string= name default)
+ default)
+ ((or
+ ;; Default `read-file-name' proposes and
+ ;; buffer visits a file.
+ (string= (expand-file-name name)
+ (TeX-buffer-file-name))
+ ;; Default of `read-file-name' and
+ ;; buffer does not visit a file.
+ (string= name default-directory)
+ ;; User typed <RET> in an empty minibuffer.
+ (string= name ""))
+ t)
+ (t
+ (TeX-strip-extension
+ name (list TeX-default-extension) 'path))))))
+
+ ;; We might already know the name.
+ ((or (eq TeX-master t) (stringp TeX-master)) TeX-master)
+
+ ;; Ask the user (but add it as a local variable).
+ (ask (TeX-master-file-ask)))))
+
+ (let ((name (if (stringp TeX-master)
+ TeX-master
+ my-name)))
+
+ (if (TeX-match-extension name)
+ ;; If it already has an extension...
+ (if (equal extension TeX-default-extension)
+ ;; Use instead of the default extension
+ (setq extension nil)
+ ;; Otherwise drop it.
+ (setq name (TeX-strip-extension name))))
+
+ (let* ((reg (TeX--clean-extensions-regexp t))
+ (is-output-ext (and reg
+ (or (string-match-p reg (concat "." extension))
+ (string= "prv" extension))))
+ (output-dir (and is-output-ext
+ (TeX--master-output-dir
+ (file-name-directory name)
+ nondirectory))))
+ (if output-dir
+ (setq name (concat output-dir (file-name-nondirectory name)))
+ ;; Remove directory if needed.
+ (if nondirectory
+ (setq name (file-name-nondirectory name)))))
+ (if extension
+ (concat name "." extension)
+ name)))))
(defun TeX-master-directory ()
"Directory of master file."
@@ -2429,17 +2433,15 @@
(substitute-in-file-name
(expand-file-name
(let ((dir (file-name-directory (TeX-master-file))))
- (if dir (directory-file-name dir) "."))
- (and buffer-file-name
- (file-name-directory buffer-file-name)))))))
+ (if dir (directory-file-name dir) ".")))))))
(defun TeX-add-local-master ()
"Add local variable for `TeX-master'.
Get `major-mode' from master file and enable it."
- (when (and (buffer-file-name)
+ (when (and (TeX-buffer-file-name)
(string-match TeX-one-master
- (file-name-nondirectory (buffer-file-name)))
+ (file-name-nondirectory (TeX-buffer-file-name)))
(not buffer-read-only))
(goto-char (point-max))
(if (re-search-backward "^\\([^\n]+\\)Local Variables:"
@@ -3028,9 +3030,9 @@
(TeX-run-style-hooks (TeX-strip-extension nil nil t))
;; Run parent style hooks if it has a single parent that isn't itself.
(if (or (not (memq TeX-master '(nil t)))
- (and (buffer-file-name)
+ (and (TeX-buffer-file-name)
(string-match TeX-one-master
- (file-name-nondirectory (buffer-file-name)))))
+ (file-name-nondirectory (TeX-buffer-file-name)))))
(TeX-run-style-hooks (TeX-master-file)))
(if (and TeX-parse-self
(null (cdr-safe (assoc (TeX-strip-extension nil nil t)
@@ -3817,7 +3819,7 @@
(add-hook 'find-file-hook
(lambda ()
;; Check if we are looking at a new or shared file.
- (when (or (not (file-exists-p (buffer-file-name)))
+ (when (or (not (file-exists-p (TeX-buffer-file-name)))
(eq TeX-master 'shared))
(TeX-master-file nil nil t))
(TeX-update-style t)) nil t))
@@ -4521,7 +4523,7 @@
EXTENSIONS defaults to `TeX-file-extensions'."
(if (null string)
- (setq string (or (buffer-file-name) "<none>")))
+ (setq string (or (TeX-buffer-file-name) "<none>")))
(if (null extensions)
(setq extensions TeX-file-extensions))
@@ -4794,7 +4796,7 @@
(defun TeX-current-file-name-master-relative ()
"Return current filename, relative to master directory."
(file-relative-name
- (buffer-file-name)
+ (TeX-buffer-file-name)
(TeX-master-directory)))
(defun TeX-near-bobp ()
@@ -6132,18 +6134,21 @@
Save buffer first including style information.
With optional argument ARG, also reload the style hooks."
(interactive "*P")
- (if arg
- (dolist (var TeX-normal-mode-reset-list)
- (set var nil)))
- (let ((gc-cons-percentage 0.5))
- (let ((TeX-auto-save t))
- (if (buffer-modified-p)
- (save-buffer)
- (TeX-auto-write)))
- (normal-mode)
- ;; See also addition to `find-file-hook' in `VirTeX-common-initialization'.
- (when (eq TeX-master 'shared) (TeX-master-file nil nil t))
- (TeX-update-style t)))
+ (with-current-buffer
+ ;; In case this is an indirect buffer:
+ (or (buffer-base-buffer) (current-buffer))
+ (if arg
+ (dolist (var TeX-normal-mode-reset-list)
+ (set var nil)))
+ (let ((gc-cons-percentage 0.5))
+ (let ((TeX-auto-save t))
+ (if (buffer-modified-p)
+ (save-buffer)
+ (TeX-auto-write)))
+ (normal-mode)
+ ;; See also addition to `find-file-hook' in `VirTeX-common-initialization'.
+ (when (eq TeX-master 'shared) (TeX-master-file nil nil t))
+ (TeX-update-style t))))
(defgroup TeX-quote nil
"Quoting in AUCTeX."
@@ -6593,7 +6598,7 @@
(buffers (buffer-list)))
(while buffers
(let* ((buffer (car buffers))
- (name (buffer-file-name buffer)))
+ (name (TeX-buffer-file-name buffer)))
(setq buffers (cdr buffers))
(when (and name (string-match regexp name))
(save-excursion (switch-to-buffer buffer) (ispell-buffer))
@@ -6950,7 +6955,7 @@
TeX-region-extra)))
(TeX-region-create (TeX-region-file TeX-default-extension)
(buffer-substring-no-properties begin end)
- (file-name-nondirectory (buffer-file-name))
+ (file-name-nondirectory (TeX-buffer-file-name))
(TeX-current-offset begin))))
(defun TeX-command-region (&optional override-confirm)
@@ -7442,14 +7447,14 @@
(setq existingoriginals (cons filepath existingoriginals)))))))
(while buffers
(let* ((buffer (car buffers))
- (name (buffer-file-name buffer)))
+ (name (TeX-buffer-file-name buffer)))
(setq buffers (cdr buffers))
(if (and name (member name existingoriginals))
(progn
(and (buffer-modified-p buffer)
(or (not TeX-save-query)
(y-or-n-p (concat "Save file "
- (buffer-file-name buffer)
+ (TeX-buffer-file-name buffer)
"? ")))
(with-current-buffer buffer (save-buffer)))))))
(dolist (eo existingoriginals)
@@ -10281,6 +10286,12 @@
#'TeX-master-file))))
(error "Unable to find what command to run")))
+(defun TeX-buffer-file-name (&optional BUFFER)
+ "Return name of file BUFFER is visiting, or nil if none.
+No argument or nil as argument means use the current buffer.
+If BUFFER is indirect, return the file that the base buffer is visiting."
+ (buffer-file-name (or (buffer-base-buffer BUFFER) BUFFER)))
+
(provide 'tex)
;; Local Variables:
diff -ru auctex-13.3/tex-info.el auctex-13.3-modified/tex-info.el
--- auctex-13.3/tex-info.el 2024-01-17 14:55:20.000000000 +0000
+++ auctex-13.3-modified/tex-info.el 2024-04-15 15:06:37.612458785 +0100
@@ -704,7 +704,7 @@
(set (make-local-variable 'TeX-style-hook-dialect) :texinfo)
(add-hook 'find-file-hook (lambda ()
- (unless (file-exists-p (buffer-file-name))
+ (unless (file-exists-p (TeX-buffer-file-name))
(TeX-master-file nil nil t)))
nil t)
diff -ru auctex-13.3/toolbar-x.el auctex-13.3-modified/toolbar-x.el
--- auctex-13.3/toolbar-x.el 2024-01-17 14:55:20.000000000 +0000
+++ auctex-13.3-modified/toolbar-x.el 2024-04-15 15:07:24.116458608 +0100
@@ -1462,11 +1462,11 @@
:command save-buffer
:enable (and
(buffer-modified-p)
- (buffer-file-name)
+ (buffer-file-name (buffer-base-buffer))
(not (window-minibuffer-p
(frame-selected-window menu-updating-frame))))
:help "Save current buffer to its file"
- :visible (or buffer-file-name
+ :visible (or (buffer-file-name (buffer-base-buffer))
(not (eq 'special
(get major-mode 'mode-class)))))
@@ -1476,7 +1476,7 @@
(window-minibuffer-p
(frame-selected-window menu-updating-frame)))
:help "Write current buffer to another file"
- :visible (or buffer-file-name
+ :visible (or (buffer-file-name (buffer-base-buffer))
(not (eq 'special (get major-mode 'mode-class)))))
(undo :image "undo"
_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex