[AUCTeX-devel] Setting `add-log-current-defun-function'
Hi all, AUCTeX doesn't have a function to set `add-log-current-defun-function'. Hence, hitting `C-x 4 a' in .tex file puts only the file name in the ChangeLog. I suggest to add something like this to tex.el: --8<---cut here---start->8--- (defun TeX-current-defun-name () "Return the name of the TeX section/paragraph/chapter at point, or nil." (save-excursion (let (s1 e1 s2 e2) ;; If we are now precisely at the beginning of a sectioning ;; command, move forward and make sure `re-search-backward' ;; finds this one rather than the previous one: (or (eobp) (progn (when (looking-at-p "") (forward-char)) (unless (eolp) (forward-sexp ;; Search backward for sectioning command. If ;; `LaTeX-section-label' is buffer-local, assume that a style ;; has changed the value and recalculate the string. Otherwise ;; take the standard one: (when (re-search-backward (if (local-variable-p 'LaTeX-section-label) (concat (regexp-opt (remove "part" (mapcar #'car LaTeX-section-label))) "\\*?") "\\(sub\\)*\\(section\\|paragraph\\|chapter\\)\\*?") nil t) ;; Skip over the backslash: (setq s1 (1+ (point))) ;; Skip over the sectioning command, incl. the *: (setq e1 (goto-char (match-end 0))) ;; Skip over the optional argument, if any: (when (looking-at-p "[ \t]*\\[") (forward-sexp)) ;; Skip over any chars until the mandatory argument: (skip-chars-forward "^{") ;; Remember the points for the mandatory argument: (setq s2 (point)) (setq e2 (progn (forward-sexp) (point))) ;; Now pick the content: For one-line title, return it ;; incl. the closing brace. For multi-line, return the first ;; line of the mandatory argument incl. ellipsis and a brace; (concat (buffer-substring-no-properties s1 e1) (buffer-substring-no-properties (goto-char s2) (min (line-end-position) e2)) (when (> e2 (line-end-position)) (concat "..." TeX-grcl))) --8<---cut here---end--->8--- And the activate it in latex.el by adding this to `LaTeX-common-initialization': (setq-local add-log-current-defun-function #'TeX-current-defun-name) Any comments welcome. Best, Arash ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
Re: [AUCTeX-devel] Setting `add-log-current-defun-function'
>>> "AE" == Arash Esbati writes: Hi Arash > Hi all, > AUCTeX doesn't have a function to set `add-log-current-defun-function'. > Hence, hitting `C-x 4 a' in .tex file puts only the file name in the > ChangeLog. I suggest to add something like this to tex.el: Very nice. I asked this question more than 10 years ago and Carsten Dominik provided a small package which seems to do very similar things to your code. At some point I asked to include the code into auctex, but that was refused, but I don't recall the reason. I attach Carsten's code so that you can judge for yourself. I use it very frequently and find it very useful. Regards Uwe addl.el Description: application/emacs-lisp smime.p7s Description: S/MIME cryptographic signature ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
[AUCTeX-commit] GNU AUCTeX branch, master, updated. cd3996645123ff65659f06acb2851b26720309af
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU AUCTeX". The branch, master has been updated via cd3996645123ff65659f06acb2851b26720309af (commit) from 686a8ed3b0cf091bb24d3db826a3f8ad1047f6c0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - commit cd3996645123ff65659f06acb2851b26720309af Author: Ikumi Keita Date: Sun Apr 7 22:43:37 2019 +0900 ; Fix typos * latex.el (LaTeX--after-math-macro-prefix-p): * preview.el.in (preview-TeX-style-cooked, preview-TeX-style-dir): Fix typos in doc strings. --- Summary of changes: latex.el | 2 +- preview.el.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- GNU AUCTeX ___ auctex-commit mailing list auctex-com...@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-commit
[AUCTeX-diffs] GNU AUCTeX branch, master, updated. cd3996645123ff65659f06acb2851b26720309af
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU AUCTeX". The branch, master has been updated via cd3996645123ff65659f06acb2851b26720309af (commit) from 686a8ed3b0cf091bb24d3db826a3f8ad1047f6c0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - commit cd3996645123ff65659f06acb2851b26720309af Author: Ikumi Keita Date: Sun Apr 7 22:43:37 2019 +0900 ; Fix typos * latex.el (LaTeX--after-math-macro-prefix-p): * preview.el.in (preview-TeX-style-cooked, preview-TeX-style-dir): Fix typos in doc strings. diff --git a/latex.el b/latex.el index 510d4bf..898eec8 100644 --- a/latex.el +++ b/latex.el @@ -6040,7 +6040,7 @@ i.e. you do _not_ have to cater for this yourself by adding ' or $." Also sets `match-data' so that group 1 is the already typed prefix. -For example, in $a + \a| - 17$ with | denoting point, the +For example, in $a + \\a| - 17$ with | denoting point, the function would return non-nil and `(match-string 1)' would return \"a\" afterwards." (and (texmathp) diff --git a/preview.el.in b/preview.el.in index e6eceeb..9dd1cef 100644 --- a/preview.el.in +++ b/preview.el.in @@ -2365,7 +2365,7 @@ filename=%s> (defun preview-TeX-style-cooked () "Return `preview-TeX-style-dir' in cooked form. -This will be fine for prepending to a `TEXINPUT' style +This will be fine for prepending to a `TEXINPUTS' style environment variable, including an initial `.' at the front." (if (or (zerop (length preview-TeX-style-dir)) (member (substring preview-TeX-style-dir -1) '(";" ":"))) @@ -2422,7 +2422,7 @@ systems, or `;' on Windows-like systems. And it should be preceded with .: or .; accordingly in order to have . first in the search path. -The `TEXINPUT' environment type variables will get this prepended +The `TEXINPUTS' environment type variables will get this prepended at load time calling \\[preview-set-texinputs] to reflect this. You can permanently install the style files using \\[preview-install-styles]. --- Summary of changes: latex.el | 2 +- preview.el.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- GNU AUCTeX ___ auctex-diffs mailing list auctex-di...@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-diffs
Re: [AUCTeX-devel] Setting `add-log-current-defun-function'
Uwe Brauer writes: "AE" == Arash Esbati writes: >> AUCTeX doesn't have a function to set `add-log-current-defun-function'. >> Hence, hitting `C-x 4 a' in .tex file puts only the file name in the >> ChangeLog. I suggest to add something like this to tex.el: > > Very nice. I asked this question more than 10 years ago and Carsten > Dominik provided a small package which seems to do very similar things > to your code. At some point I asked to include the code into auctex, but > that was refused, but I don't recall the reason. > > I attach Carsten's code so that you can judge for yourself. I use it > very frequently and find it very useful. Hi Uwe, thanks for your response. Nice piece of code, thanks for sharing it. It does (more than less) what I've posted and since it relies on RefTeX, AUCTeX isn't the right place for it. I'd like to hear if was rejected for any other reason back then. Best, Arash ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
Re: [AUCTeX-devel] Setting `add-log-current-defun-function'
> Arash Esbati writes: > Uwe Brauer writes: > "AE" == Arash Esbati writes: >>> AUCTeX doesn't have a function to set >>> `add-log-current-defun-function'. Hence, hitting `C-x 4 a' in >>> .tex file puts only the file name in the ChangeLog. I suggest >>> to add something like this to tex.el: >> >> Very nice. I asked this question more than 10 years ago and >> Carsten Dominik provided a small package which seems to do very >> similar things to your code. At some point I asked to include the >> code into auctex, but that was refused, but I don't recall the >> reason. >> >> I attach Carsten's code so that you can judge for yourself. I use >> it very frequently and find it very useful. > Hi Uwe, > thanks for your response. Nice piece of code, thanks for sharing > it. It does (more than less) what I've posted and since it relies > on RefTeX, AUCTeX isn't the right place for it. I'd like to hear > if was rejected for any other reason back then. How would your patch work when the ChangeLog is updated from a CVS log using M-x vc-update-change-log ? Best wishes, -- Colin Baxter m43...@yandex.com - The sole cause of all human misery is the inability of people to sit quietly in their rooms. Blaise Pascal, 1670 ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel