[elpa] externals/auctex 94af6a0 04/30: ; Silence the compiler
branch: externals/auctex commit 94af6a0b597445818be6aaf7e6187d2bb3a35272 Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * style/dinbrief.el (LaTeX-dinbrief-style): Adjust indentation. Consolidate the name of style hooks to run in one `TeX-run-style-hooks' call. (LaTeX-dinbrief-sender): Use `forward-line' instead of `previous-line'. * style/tikz.el: Move definition of variables to the beginning of the library. --- style/dinbrief.el | 28 +- style/tikz.el | 86 +++ 2 files changed, 56 insertions(+), 58 deletions(-) diff --git a/style/dinbrief.el b/style/dinbrief.el index 8c08b66..4707654 100644 --- a/style/dinbrief.el +++ b/style/dinbrief.el @@ -1,6 +1,6 @@ ;;; dinbrief.el --- Special code for LaTeX-Style dinbrief. -;; Copyright (C) 1994, 2013, 2014, 2018 Free Software Foundation, Inc. +;; Copyright (C) 1994, 2013, 2014, 2018, 2020 Free Software Foundation, Inc. ;; Author: Werner Fink ;; Maintainer: auctex-de...@gnu.org @@ -78,19 +78,17 @@ (beginning-of-line 1)) (open-line 2) (indent-relative-maybe) - (LaTeX-dinbrief-insert TeX-esc "usepackage" - LaTeX-optop "latin1,utf8" LaTeX-optcl - TeX-grop "inputenc" TeX-grcl) - (newline-and-indent) - (LaTeX-dinbrief-insert TeX-esc "usepackage" - LaTeX-optop "T1" LaTeX-optcl - TeX-grop "fontenc" TeX-grcl) - (newline-and-indent) - (LaTeX-dinbrief-insert TeX-esc "usepackage" - TeX-grop "ngerman" TeX-grcl) - (TeX-run-style-hooks "inputenc") - (TeX-run-style-hooks "fontenc") - (TeX-run-style-hooks "ngerman"))) +(LaTeX-dinbrief-insert TeX-esc "usepackage" + LaTeX-optop "latin1,utf8" LaTeX-optcl + TeX-grop "inputenc" TeX-grcl) +(newline-and-indent) +(LaTeX-dinbrief-insert TeX-esc "usepackage" + LaTeX-optop "T1" LaTeX-optcl + TeX-grop "fontenc" TeX-grcl) +(newline-and-indent) +(LaTeX-dinbrief-insert TeX-esc "usepackage" + TeX-grop "ngerman" TeX-grcl) +(TeX-run-style-hooks "inputenc" "fontenc" "ngerman"))) (defun LaTeX-dinbrief-env-recipient (environment) "Insert ENVIRONMENT and prompt for recipient and address." @@ -216,7 +214,7 @@ (goto-char (point-min)) ; insert before \end{document} (if (re-search-forward ".end.document." (point-max) t) (beginning-of-line 1)) - (previous-line 1) ;FIXME: Use forward-line! + (forward-line -1) (LaTeX-dinbrief-insert TeX-esc "address" TeX-grop name) (if (not (zerop (length str))) (progn diff --git a/style/tikz.el b/style/tikz.el index 4a2fc03..ded4d25 100644 --- a/style/tikz.el +++ b/style/tikz.el @@ -1,6 +1,6 @@ ;;; tikz.el --- AUCTeX style for `tikz.sty' -;; Copyright (C) 2016 Free Software Foundation, Inc. +;; Copyright (C) 2016, 2020 Free Software Foundation, Inc. ;; Author: Matthew Leach ;; Maintainer: auctex-de...@gnu.org @@ -30,6 +30,48 @@ ;;; Code: +(defcustom TeX-TikZ-point-name-regexp + "(\\([A-Za-z0-9]+\\))" + "A regexp that matches TikZ names." + :type 'regexp + :group 'auctex-tikz) + +(defconst TeX-TikZ-point-function-map + '(("Rect Point" TeX-TikZ-arg-rect-point) +("Polar Point" TeX-TikZ-arg-polar-point) +("Named Point" TeX-TikZ-arg-named-point)) + "An alist of point specification types and their functions.") + +(defconst TeX-TikZ-relative-point-function-map + (apply #'append (mapcar + (lambda (point-map) +(let ((key (car point-map)) + (value (cadr point-map))) + `((,(concat "+" key) ,value "+") +(,(concat "++" key) ,value "++" + TeX-TikZ-point-function-map)) + "`TeX-TikZ-point-function-map' with \"+\" and \"++\" as a +prefix.") + +(defconst TeX-TikZ-path-connector-function-map + '(("--" identity) +("|-" identity) +( "-|" identity) +("sin" identity) +("cos" identity)) + "An alist of path connectors.") + +(defconst TeX-TikZ-draw-arg-function-map + `(,@TeX-TikZ-point-function-map +,@TeX-TikZ-relative-point-function-map +,@TeX-TikZ-path-connector-function-map +("Node" TeX-TikZ-arg-node) +("Circle" TeX-TikZ-arg-circle) +("Arc" TeX-TikZ-arg-arc) +("Parabola" TeX-TikZ-arg-parabola) +("Grid" TeX-TikZ-arg-grid)) + "An alist of argument names and functoins for TikZ's \draw.") + (defun TeX-TikZ-get-opt-arg-string (arg &optional open close) "Return a string for optional arguments. If ARG is nil or \"\", return \"\". Otherwise return \"OPEN ARG @@ -150,12 +192,6 @@ is finished." ;; Finish the macro. (insert ";"))) -(defcustom TeX-TikZ-point-name-regexp - "(\\([A-Za-z0-9]+\\))" - "A regexp that matches TikZ names."
[elpa] externals/auctex updated (b6366ef -> 1bc7a21)
tsdh pushed a change to branch externals/auctex. from b6366ef * tex-site.el (AUCTeX-version): Add comment new 601e6a3 Get rid of gabage in generated texi file new 2e798ee Support \newblock macro new bdf96e8 Ajust document new 94af6a0 ; Silence the compiler new 1b71eb6 Add short verb characters to `ispell-tex-skip-alist' new 243961c ; Silence the compiler new e293844 ; Silence the compiler new 840973c ; Silence the compiler new 4d58d7d Don't extend font lock region too eagerly (bug#42267) new a27850f Fix previous commit and add new test new 255e768 Cater for case where fontification match goes over limit new dd7f844 Add support of \tag for texmathp new 2e448e3 ; Silence the compiler new 971bece Update style/csquotes.el to package version 5.2j new 55e8842 Treat \choice like \item new a17fee2 ; Silence the compiler new 59b7942 ; Silence the compiler new 67ecb0b ; Silence the compiler new b21889e Merge prv-emacs.el into preview.el.in new 3ef28a5 Add an extra check for tex-buf.el in some style hooks new d7cba92 Prepare for pdf output for PSTricks documents new f04a508 Restore all math environments in texmathp.el new 0692e51 ; Silence the compiler new 07b79fc ; Silence the compiler new b06ca0a Fix document new be4a912 ; Silence the compiler new ef1f670 ; Partially revert silencing the compiler new 087b030 Simplify mode line for emacs 27 new 92aa02b Merge remote-tracking branch 'origin/master' into externals/auctex new 1bc7a21 ; Regenerate docs Summary of changes: Makefile.in| 2 +- auctex.info| 227 bib-cite.el| 19 +- configure.ac | 3 - context.el | 21 +- doc/auctex.texi| 7 +- doc/changes.texi | 18 +- doc/preview-dtxdoc.pl | 6 +- doc/preview-latex.texi | 4 +- font-latex.el | 82 -- latex.el | 40 ++- preview-latex.info | 92 +++ preview.el | 515 +++- prv-emacs.el | 587 - style/amsmath.el | 19 -- style/arabxetex.el | 2 + style/bidi.el | 4 +- style/breqn.el | 16 -- style/csquotes.el | 470 + style/dinbrief.el | 142 +- style/empheq.el| 20 -- style/exam.el | 6 +- style/fontspec.el | 4 +- style/ifluatex.el | 2 +- style/kpfonts.el | 7 +- style/letter.el| 23 +- style/mathtools.el | 8 - style/polyglossia.el | 2 + style/pstricks.el | 9 +- style/shortvrb.el | 9 + style/tikz.el | 86 +++--- tests/latex/font-latex-test.el | 40 +++ tex-bar.el | 100 +++ tex-buf.el | 8 +- tex-font.el| 3 +- tex-info.el| 1 + tex-site.el| 10 +- tex.el | 74 +- texmathp.el| 40 ++- 39 files changed, 1478 insertions(+), 1250 deletions(-) delete mode 100644 prv-emacs.el
[elpa] externals/auctex 4d58d7d 09/30: Don't extend font lock region too eagerly (bug#42267)
branch: externals/auctex commit 4d58d7d1abd84feb7d975da3c9571a884756ff37 Author: Ikumi Keita Commit: Ikumi Keita Don't extend font lock region too eagerly (bug#42267) * font-latex.el (font-latex-extend-region-backwards-quotation): If there is no matching open quote, don't extend the font lock region. --- font-latex.el | 40 +++- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/font-latex.el b/font-latex.el index d7d26fa..09a6feb 100644 --- a/font-latex.el +++ b/font-latex.el @@ -2066,19 +2066,33 @@ set to french, and >>german<< (and 8-bit) are used if set to german." (setq opening-quote (car elt)) (throw 'found nil ;; Find opening quote taking nested quotes into account. - (while (progn - (re-search-backward (concat opening-quote "\\|" - closing-quote) - point-of-surrender 'move) - (when (and (> (point) point-of-surrender) - (not (bobp))) -(if (string= (match-string 0) closing-quote) -(setq nest-count (1+ nest-count)) - (when (/= nest-count 0) -(setq nest-count (1- nest-count))) - (when (< (point) font-lock-beg) -(setq font-lock-beg (point)) - (throw 'extend t) + (while (and (re-search-backward (concat opening-quote "\\|" + closing-quote) + point-of-surrender t) + ;; Found quotes before point-of-surrender. + (cond ((string= (match-string 0) closing-quote) +;; Encountered another closing quote. +;; Increase nest-count and continue +;; the inner loop. +(setq nest-count (1+ nest-count))) + ;; Found an opening quote. + ((/= nest-count 0) +;; If in nest, decrease nest-count +;; and continue the inner loop. +(setq nest-count (1- nest-count))) + ;; Else we arrived at the opening quote + ;; matching with the closing quote found + ;; in the outer loop. + ((< (point) font-lock-beg) +;; If that opening quote locates +;; before `font-lock-beg', break the +;; outer loop and extend the region. +(setq font-lock-beg (point)) +(throw 'extend t)) + (t +;; Else terminate the inner loop and +;; continue the outer loop. +nil))) (defun font-latex-match-script (limit) "Match subscript and superscript patterns up to LIMIT."
[elpa] externals/auctex 601e6a3 01/30: Get rid of gabage in generated texi file
branch: externals/auctex commit 601e6a332b070286988facdc5a56eafd09960147 Author: Ikumi Keita Commit: Ikumi Keita Get rid of gabage in generated texi file * doc/preview-dtxdoc.pl (MAIN): Add rule to delete dtx comment ^^A. (): Add coding tag. Update copyright year. --- doc/preview-dtxdoc.pl | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/preview-dtxdoc.pl b/doc/preview-dtxdoc.pl index 62d215d..52d28cb 100755 --- a/doc/preview-dtxdoc.pl +++ b/doc/preview-dtxdoc.pl @@ -1,11 +1,12 @@ #!/usr/bin/perl +# -*- coding: iso-latin-1-unix; -*- # Autoconverter from preview.dtx to preview-dtxdoc.texi # Author: Jan-�ke Larsson # Maintainer: auctex-de...@gnu.org -# Copyright (C) 2002, 2005 Free Software Foundation, Inc. +# Copyright (C) 2002, 2005, 2020 Free Software Foundation, Inc. # This file is part of AUCTeX. @@ -53,6 +54,9 @@ MAIN: while () { s/^%//; s/\\%/%/g; +# Comment +s/\^\^A.*\n//; + # Text-substitution macros s/\@/\@\@/g; s/\\#/#/g;
[elpa] externals/auctex ef1f670 27/30: ; Partially revert silencing the compiler
branch: externals/auctex commit ef1f6708812606f66b5a562bb2be754412baa74f Author: Arash Esbati Commit: Arash Esbati ; Partially revert silencing the compiler * context.el (ConTeXt-numbered-section-heading) (ConTeXt-unnumbered-section-heading, ConTeXt-section-title) (ConTeXt-section-section, ConTeXt-section-ref): Revert wrapping function body in `with-no-warnings'. Restore and comment out defvar'ing of dynamically scoped variables `reference', `title', `name' and `level'. * latex.el (LaTeX-section-heading, LaTeX-section-title) (LaTeX-section-toc, LaTeX-section-section, LaTeX-section-label): Revert wrapping function body in `with-no-warnings'. Restore and comment out defvar'ing of dynamically scoped variables `title', `name', `level' and `toc'. * style/exam.el (LaTeX-exam-insert-item): * style/ifluatex.el (LaTeX-ifluatex-set-exit-mark): Revert wrapping function body in `with-no-warnings'. --- context.el| 93 +-- latex.el | 76 +++-- style/exam.el | 29 + style/ifluatex.el | 3 +- 4 files changed, 103 insertions(+), 98 deletions(-) diff --git a/context.el b/context.el index 0d65249..626da22 100644 --- a/context.el +++ b/context.el @@ -1,6 +1,6 @@ ;;; context.el --- Support for ConTeXt documents. -;; Copyright (C) 2003-2006, 2008, 2010, 2012, 2014-2018 +;; Copyright (C) 2003-2006, 2008, 2010, 2012, 2014-2020 ;; Free Software Foundation, Inc. ;; Maintainer: Berend de Boer @@ -67,10 +67,20 @@ ;;; variables -;; Dynamically scoped vars used in certain macro's. `done-mark' is -;; marked special; `reference', `title', `name' and `level' are -;; pacified via `with-no-warnings' in the respective functions. -(defvar done-mark) ; Position of point afterwards, default nil (meaning end) +;; Dynamically scoped vars used in certain macro's. +;; BEWARE: We used to give them a global nil value, but this can mess up poor +;; unrelated packages using those same vars but expecting them to be +;; lexically scoped. +;; So don't give them a global value, which makes sure the effect of `defvar' +;; localized to this file! +;; N.B.: These forms are commented out since they produce a "lack of +;; prefix" warning during byte-compilation. This way they produce +;; only a "reference to free variable" one. +;; (defvar done-mark) ; Position of point afterwards, default nil (meaning end) +;; (defvar reference) ; Used by `ConTeXt-section-ref' and `ConTeXt-section-section'. +;; (defvar title) ; Used by `ConTeXt-section-title' and `ConTeXt-section-section'. +;; (defvar name) +;; (defvar level) ;; others @@ -501,53 +511,49 @@ in your .emacs file." "Hook to prompt for ConTeXt section name. Insert this hook into `ConTeXt-numbered-section-hook' to allow the user to change the name of the sectioning command inserted with `\\[ConTeXt-section]'." - (with-no-warnings -(let ((string (completing-read - (concat "Select level (default " name "): ") - ConTeXt-numbered-section-list - nil nil nil))) - ;; Update name - (if (not (zerop (length string))) - (setq name string) + (let ((string (completing-read +(concat "Select level (default " name "): ") +ConTeXt-numbered-section-list +nil nil nil))) +;; Update name +(if (not (zerop (length string))) + (setq name string (defun ConTeXt-unnumbered-section-heading () "Hook to prompt for ConTeXt section name. Insert this hook into `ConTeXt-unnumbered-section-hook' to allow the user to change the name of the sectioning command inserted with `\\[ConTeXt-section]'." - (with-no-warnings -(let ((string (completing-read - (concat "Select level (default " name "): ") - ConTeXt-unnumbered-section-list - nil nil nil))) - ;; Update name - (if (not (zerop (length string))) - (setq name string) + (let ((string (completing-read +(concat "Select level (default " name "): ") +ConTeXt-unnumbered-section-list +nil nil nil))) +;; Update name +(if (not (zerop (length string))) + (setq name string (defun ConTeXt-section-title () "Hook to prompt for ConTeXt section title. Insert this hook into `ConTeXt-(un)numbered-section-hook' to allow the user to change the title of the section inserted with `\\[ConTeXt-section]." - (with-no-warnings -(setq title (TeX-read-string "What title: " + (setq title (TeX-read-string "What title: "))) (defun ConTeXt-section-section () "Hook to insert ConTeXt section command into the file. Insert this hook into `ConTeXt-section-hook' after those hooks which sets the `name', `title', and `reference' variables, but before those hooks which assumes the s
[elpa] externals/auctex e293844 07/30: ; Silence the compiler
branch: externals/auctex commit e293844ce819557459ca3fc5cd50a0d5fd8f0585 Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * style/exam.el (LaTeX-exam-insert-item): * style/ifluatex.el (LaTeX-ifluatex-set-exit-mark): Use `with-no-warnings' around variables defined at run time. --- style/exam.el | 29 +++-- style/ifluatex.el | 5 +++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/style/exam.el b/style/exam.el index 3ecc38d..a1ce1b5 100644 --- a/style/exam.el +++ b/style/exam.el @@ -51,20 +51,21 @@ (defun LaTeX-exam-insert-item () "Insert a new item in an environment from exam class. Item inserted depends on the environment." - (TeX-insert-macro - (cond ((string= environment "questions") - "question") - ((string= environment "parts") - "part") - ((string= environment "subparts") - "subpart") - ((string= environment "subsubparts") - "subsubpart") -((member environment '("choices" "oneparchoices" - "checkboxes" "oneparcheckboxes")) - "choice") - ;; Fallback - (t "item" + (with-no-warnings +(TeX-insert-macro + (cond ((string= environment "questions") +"question") + ((string= environment "parts") +"part") + ((string= environment "subparts") +"subpart") + ((string= environment "subsubparts") +"subsubpart") + ((member environment '("choices" "oneparchoices" + "checkboxes" "oneparcheckboxes")) + "choice") + ;; Fallback + (t "item") (defun LaTeX-exam-insert-label (_optional &optional name type) "Indent the line and query/insert a label incl. the \"\\label\" macro. diff --git a/style/ifluatex.el b/style/ifluatex.el index 20d3c8d..736e5ca 100644 --- a/style/ifluatex.el +++ b/style/ifluatex.el @@ -1,6 +1,6 @@ ;;; ifluatex.el --- AUCTeX style for `ifluatex.sty' version 1.3. -;; Copyright (C) 2014, 2016, 2018 Free Software Foundation, Inc. +;; Copyright (C) 2014, 2016, 2018, 2020 Free Software Foundation, Inc. ;; Author: Davide G. M. Salvetti ;; Maintainer: auctex-de...@gnu.org @@ -36,7 +36,8 @@ (defun LaTeX-ifluatex-set-exit-mark (_optional) "Discard OPTIONAL and set exit-mark to current point." - (set-marker exit-mark (point))) + (with-no-warnings +(set-marker exit-mark (point (TeX-add-style-hook "ifluatex"
[elpa] externals/auctex 971bece 14/30: Update style/csquotes.el to package version 5.2j
branch: externals/auctex commit 971becefd27858aac2bef8306e5069ae9bfd6d94 Author: Arash Esbati Commit: Arash Esbati Update style/csquotes.el to package version 5.2j * style/csquotes.el: Track changes in package version 5.2j. Remove deprecated macros, improve query for language argument. Add keyval query of package options. (LaTeX-csquotes-insert-environment): Remove function and use `LaTeX-env-args' instead. --- style/csquotes.el | 470 +++--- 1 file changed, 304 insertions(+), 166 deletions(-) diff --git a/style/csquotes.el b/style/csquotes.el index a34a775..8f64627 100644 --- a/style/csquotes.el +++ b/style/csquotes.el @@ -1,6 +1,6 @@ -;;; csquotes.el --- AUCTeX style for `csquotes.sty' +;;; csquotes.el --- AUCTeX style for `csquotes.sty' (v5.2j) -;; Copyright (C) 2004, 2005, 2006, 2014, 2018 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005, 2006, 2014, 2018, 2020 Free Software Foundation, Inc. ;; Author: Ralf Angeli ;; Maintainer: auctex-de...@gnu.org @@ -26,7 +26,8 @@ ;;; Commentary: -;; This file adds support for `csquotes.sty', version 3.7. +;; This file adds support for `csquotes.sty', version 5.2j from +;; 2019/12/06. ;;; Code: @@ -35,109 +36,165 @@ "font-latex" (keywords class)) -;; FIXME: It would be nice to be able to dump this function in favor -;; of a generalized handling of additional arguments for environments -;; specified via `LaTeX-add-environments'. `TeX-parse-arguments' and -;; friends would be the functions to be used for that, but those -;; functions currently insert text directly into the buffer. There -;; would either have to be a way of preventing this and letting them -;; return a string, or the insertion could happen in a temporary buffer -;; and the buffer content be returned. -(defun LaTeX-csquotes-insert-environment (env &rest args) - "Insert environment ENV considering optional arguments ARGS. - -This is basically a variant of `LaTeX-environment-menu' -specialized for csquotes.el. ARGS can be made up of strings and -vectors containing single strings. Plain strings will be used as -prompts for mandatory arguments and strings in vectors as prompts -for optional arguments of the environment to be inserted. - -That means, in contrast to `LaTeX-environment-menu' it supports -the insertion of optional arguments." - (let (env-extra prompt optional user-input) -(dolist (elt args) - (if (vectorp elt) - (setq prompt (aref elt 0) - optional t) - (setq prompt elt - optional nil)) - (setq user-input (TeX-read-string (TeX-argument-prompt optional prompt nil))) - (unless (and optional (zerop (length user-input))) - (setq env-extra (concat env-extra - (if optional LaTeX-optop TeX-grop) - user-input - (if optional LaTeX-optcl TeX-grcl) -(LaTeX-insert-environment env env-extra))) +(defun LaTeX-csquotes-read-language (optional &optional prompt) + "Read and return a language for csquotes macros. +If OPTIONAL is non-nil, indicate it in minibuffer while reading +user input. PROMPT replaces the standard one \"Language\". This +function checks if the functions `LaTeX-babel-active-languages' +or `LaTeX-polyglossia-active-languages' are bound and use them to +retrieve the active languages. If none available, user is +requested to enter a language." + (cond ((and (fboundp 'LaTeX-babel-active-languages) + (LaTeX-babel-active-languages)) +(completing-read + (TeX-argument-prompt optional prompt "Language") + (LaTeX-babel-active-languages))) + ((and (fboundp 'LaTeX-polyglossia-active-languages) + (LaTeX-polyglossia-active-languages)) +(completing-read + (TeX-argument-prompt optional prompt "Language") + (LaTeX-polyglossia-active-languages))) + (t +(TeX-read-string + (TeX-argument-prompt optional prompt "Language") + +(defun LaTeX-arg-csquotes-language (optional &optional prompt) + "Insert a language for csquotes macros. +If OPTIONAL is non-nil, insert the language in square brackets. +PROMPT replaces the standard one \"Language\"." + (TeX-argument-insert + (LaTeX-csquotes-read-language optional prompt) + optional)) (TeX-add-style-hook "csquotes" (lambda () - (let ((quote-style-variant-list '(("quotes") ("guillemets") ("american") -("british") ("oldstyle") ("imprimerie") -("swiss"))) -(quote-style-name-list '(("danish") ("dutch") ("english") ("finnish") - ("french") ("german") ("italian") - ("norwegian") ("swedish" + (let ((quote-style-variant-list '(("american") ("brazilian") +("british"
[elpa] externals/auctex 255e768 11/30: Cater for case where fontification match goes over limit
branch: externals/auctex commit 255e768d2b150484b9e9b29e05ee5b5886d343d2 Author: Ikumi Keita Commit: Ikumi Keita Cater for case where fontification match goes over limit * font-latex.el (font-latex-match-quotation): Cater for case where fontification match goes over limit. Drop `string-make-multibyte'. It's no longer necessary because all supported emacsen handle multibyte strings well enough. (font-latex--updated-region-end): Adjust comments. --- font-latex.el | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/font-latex.el b/font-latex.el index 6ce901f..4736cfb 100644 --- a/font-latex.el +++ b/font-latex.el @@ -1320,11 +1320,11 @@ then call `font-latex-set-syntactic-keywords'."))) (make-obsolete 'font-latex-update-font-lock nil "12.2.4") (defvar font-latex--updated-region-end nil -;; During hilighting of math expression, matched range sometimes exceeds -;; the given end limit. So record the actual end in this variable to +;; During font lock operation, matched range sometimes exceeds the +;; given end limit. So record the actual end in this variable to ;; notify the font lock machinery. -;; Match function of math expression should do the following two if -;; the end of the actual match goes beyond the limit: +;; Match functions should do the following two if the end of the +;; actual match goes beyond the limit: ;; 1. If the value of this variable is smaller than limit, set this ;;variable to that limit. ;; 2. When the end of the actual match exceeds this variable, @@ -2018,12 +2018,9 @@ set to french, and >>german<< (and 8-bit) are used if set to german." (match-beginning 0)) (let* ((beg (match-beginning 0)) (after-beg (match-end 0)) -(opening-quote (match-string 0)) +(opening-quote (match-string-no-properties 0)) (closing-quote - (nth 1 (assoc (if (fboundp 'string-make-multibyte) - (string-make-multibyte (match-string 0)) - (match-string 0)) - font-latex-quote-list))) + (nth 1 (assoc opening-quote font-latex-quote-list))) (nest-count 0) (point-of-surrender (+ beg font-latex-multiline-boundary))) ;; Find closing quote taking nested quotes into account. @@ -2032,7 +2029,8 @@ set to french, and >>german<< (and 8-bit) are used if set to german." (concat opening-quote "\\|" closing-quote) point-of-surrender 'move) (when (and (< (point) point-of-surrender) (not (eobp))) - (if (string= (match-string 0) opening-quote) + (if (string= (match-string-no-properties 0) + opening-quote) (setq nest-count (1+ nest-count)) (when (/= nest-count 0) (setq nest-count (1- nest-count))) @@ -2043,7 +2041,14 @@ set to french, and >>german<< (and 8-bit) are used if set to german." (progn (goto-char after-beg) (store-match-data (list after-beg after-beg beg after-beg))) - (store-match-data (list beg (point) (point) (point + (let ((p (point))) + (if (< font-latex--updated-region-end limit) + (setq font-latex--updated-region-end limit)) + (when (< font-latex--updated-region-end p) + (font-lock-unfontify-region + font-latex--updated-region-end p) + (setq font-latex--updated-region-end p)) + (store-match-data (list beg p p p (throw 'match t))) (defun font-latex-extend-region-backwards-quotation ()
[elpa] externals/auctex 840973c 08/30: ; Silence the compiler
branch: externals/auctex commit 840973cc6d7736849dfb7cdca9e7e87655bd6315 Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * style/kpfonts.el (LaTeX-kpfonts-mode-map) (LaTeX-kpfonts-mode-menu): defvar the variables which are generated later in the minor mode and via easy menu. --- style/kpfonts.el | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/style/kpfonts.el b/style/kpfonts.el index 2e8ffc3..4938416 100644 --- a/style/kpfonts.el +++ b/style/kpfonts.el @@ -1,9 +1,9 @@ ;;; kpfonts.el --- AUCTeX style for `kpfonts.sty' version 3.31. -;; Copyright (C) 2013, 2018 Free Software Foundation, Inc. +;; Copyright (C) 2013, 2018, 2020 Free Software Foundation, Inc. ;; Maintainer: auctex-de...@gnu.org -;; Author: Mosè Giordano +;; Author: Mosè Giordano ;; Keywords: tex ;; This file is part of AUCTeX. @@ -33,6 +33,9 @@ (declare-function font-latex-add-keywords "font-latex" (keywords class)) +;; These are generated by the minor mode or easy menu: +(defvar LaTeX-kpfonts-mode-map) +(defvar LaTeX-kpfonts-mode-menu) ;;; Kpfonts Minor Mode (heavily based on LaTeX Math Minor Mode code)
[elpa] externals/auctex 92aa02b 29/30: Merge remote-tracking branch 'origin/master' into externals/auctex
branch: externals/auctex commit 92aa02b2d674f34a9ba5fed2da0cbdb96cd012f9 Merge: b6366ef 087b030 Author: Tassilo Horn Commit: Tassilo Horn Merge remote-tracking branch 'origin/master' into externals/auctex --- Makefile.in| 2 +- bib-cite.el| 19 +- configure.ac | 3 - context.el | 21 +- doc/auctex.texi| 7 +- doc/changes.texi | 18 +- doc/preview-dtxdoc.pl | 6 +- doc/preview-latex.texi | 4 +- font-latex.el | 82 -- latex.el | 40 ++- preview.el | 515 +++- prv-emacs.el | 587 - style/amsmath.el | 19 -- style/arabxetex.el | 2 + style/bidi.el | 4 +- style/breqn.el | 16 -- style/csquotes.el | 470 + style/dinbrief.el | 142 +- style/empheq.el| 20 -- style/exam.el | 6 +- style/fontspec.el | 4 +- style/ifluatex.el | 2 +- style/kpfonts.el | 7 +- style/letter.el| 23 +- style/mathtools.el | 8 - style/polyglossia.el | 2 + style/pstricks.el | 9 +- style/shortvrb.el | 9 + style/tikz.el | 86 +++--- tests/latex/font-latex-test.el | 40 +++ tex-bar.el | 100 +++ tex-buf.el | 8 +- tex-font.el| 3 +- tex-info.el| 1 + tex.el | 74 +- texmathp.el| 40 ++- 36 files changed, 1315 insertions(+), 1084 deletions(-) diff --git a/Makefile.in b/Makefile.in index 1037fe0..63234c1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -177,7 +177,7 @@ STYLESRC = style/prosper.el \ STYLEELC = $(STYLESRC:.el=.elc) ifeq (@preview_enabled@,yes) - PREVIEWSRC = @PLAT_LISP@ preview.el + PREVIEWSRC = preview.el PREVIEWELC = $(PREVIEWSRC:.el=.elc) PREVIEWLATEX = $(MAKE) preview-latex.el TEXMF = (cd latex ; $(MAKE) all) diff --git a/bib-cite.el b/bib-cite.el index d871cb0..8d346c3 100644 --- a/bib-cite.el +++ b/bib-cite.el @@ -592,6 +592,14 @@ (eval-when-compile (require 'cl-lib)) +;; Silence the compiler: +(declare-function dired-replace-in-string "ext:dired" + (regexp newtext string)) +(declare-function dired-split "ext:dired-aux" + (pat str &optional limit)) +(declare-function reftex-view-crossref "ext:reftex-dcr" + (&optional arg auto-how fail-quietly)) + (defgroup bib-cite nil "bib-cite, LaTeX minor-mode to display \\cite, \\ref and \\label commands." :group 'tex) @@ -973,9 +981,14 @@ documents, and the Emacs command `find-tag' doesn't allow to interactively find the next occurrence of a regexp." (interactive "P") (if (bib-master-file) ;Multi-file document - (if prev-p - (find-tag t '- t) - (find-tag t t t)) + ;; FIXME: This check for `xref-find-definitions' should be + ;; removed once AUCTeX requires Emacs >= 25.1 + (let ((func (if (fboundp 'xref-find-definitions) + 'xref-find-definitions + 'find-tag))) + (if prev-p + (funcall func t '- t) + (funcall func t t t))) (if bib-cite-search-ring ;;FIXME: Should first make sure I move off initial \ref{}. (let ((regexp (concat bib-ref-regexpc bib-cite-search-ring "}"))) diff --git a/configure.ac b/configure.ac index 566378d..a31b049 100644 --- a/configure.ac +++ b/configure.ac @@ -55,8 +55,6 @@ AC_ARG_ENABLE(preview, [preview_enabled="yes"]) AC_SUBST(preview_enabled) -PLAT_LISP=prv-emacs.el - EMACS_PATH_LISPDIR AC_MSG_CHECKING(what file to use for auctex startup) AC_ARG_WITH(auctexstartfile, @@ -92,7 +90,6 @@ texsitedir="${lispdir}" AC_SUBST(auctexstartfile) AC_SUBST(previewstartfile) -AC_SUBST(PLAT_LISP) AC_MSG_CHECKING([where the package lisp files go]) AC_ARG_WITH(packagelispdir, diff --git a/context.el b/context.el index 87bcd38..626da22 100644 --- a/context.el +++ b/context.el @@ -1,6 +1,6 @@ ;;; context.el --- Support for ConTeXt documents. -;; Copyright (C) 2003-2006, 2008, 2010, 2012, 2014-2018 +;; Copyright (C) 2003-2006, 2008, 2010, 2012, 2014-2020 ;; Free Software Foundation, Inc. ;; Maintainer: Berend de Boer @@ -55,6 +55,9 @@ (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-" @@ -70,13 +73,14 @@ ;; lexically scoped. ;; So don't give them
[elpa] externals/auctex 67ecb0b 18/30: ; Silence the compiler
branch: externals/auctex commit 67ecb0bc3be90a8be08eaf001b63538cb57f3294 Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * prv-emacs.el: Silence the compiler for unknown functions. --- prv-emacs.el | 38 ++ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/prv-emacs.el b/prv-emacs.el index 0ccce7b..2d9a6ef 100644 --- a/prv-emacs.el +++ b/prv-emacs.el @@ -30,19 +30,41 @@ (require 'tex) (require 'latex) +;; Silence the compiler for functions: +(declare-function preview-inherited-face-attribute "prv-emacs" + (face attribute &optional inherit)) +(declare-function preview-filter-specs-1 "preview" + (specs)) +(declare-function preview-format-kill "preview" + (format-cons)) +(declare-function preview-delete "preview" + (ovr &rest ignored)) +(declare-function preview-relaxed-string= "preview" + (&rest args)) +(declare-function preview-disable "preview" + (ovr)) +(declare-function preview-inactive-string "preview" + (ov)) +(declare-function preview-filter-specs "preview" + (spec-list)) +(declare-function preview-auto-reveal-p "preview" + (mode distance)) +(declare-function desktop-buffer-preview-misc-data "preview" + (&rest ignored)) + (defcustom preview-transparent-color '(highlight :background) "Color to appear transparent in previews. Set this to something unusual when using `preview-transparent-border', to the default background in most other cases." :type '(radio (const :tag "None" nil) -(const :tag "Autodetect" t) -(color :tag "By name" :value "white") -(list :tag "Take from face" - :value (default :background) - (face) - (choice :tag "What to take" - (const :tag "Background" :value :background) - (const :tag "Foreground" :value :foreground + (const :tag "Autodetect" t) + (color :tag "By name" :value "white") + (list :tag "Take from face" + :value (default :background) + (face) + (choice :tag "What to take" + (const :tag "Background" :value :background) + (const :tag "Foreground" :value :foreground :group 'preview-appearance) ;;; Note that the following default introduces a border only when
[elpa] externals/auctex be4a912 26/30: ; Silence the compiler
branch: externals/auctex commit be4a912097521709f74617b2ef9b45e1487a2830 Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * tex-font.el (tex-math-face): Add variable to tex group. * tex.el: defvar internal and external variables. --- tex-font.el | 3 ++- tex.el | 45 - 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/tex-font.el b/tex-font.el index 27c9cf2..cdedc42 100644 --- a/tex-font.el +++ b/tex-font.el @@ -148,7 +148,8 @@ (defface tex-math-face '((t :inherit font-lock-string-face)) - "Face used to highlight TeX math expressions.") + "Face used to highlight TeX math expressions." + :group 'tex) (defvar tex-math-face 'tex-math-face) ;; Use string syntax but math face for $...$. diff --git a/tex.el b/tex.el index b954eba..b2f 100644 --- a/tex.el +++ b/tex.el @@ -35,6 +35,7 @@ (require 'tex-site) (eval-when-compile (require 'cl-lib)) +(require 'texmathp) ;; Silence the compiler for functions: (declare-function dbus-ignore-errors "ext:dbus" @@ -65,6 +66,48 @@ (declare-function spell-buffer "ext:text-mode" t) +;; Silence the compiler for variables: +;; tex.el: Variables defined somewhere in this file: +(defvar TeX-PDF-from-DVI) +(defvar TeX-PDF-mode) +(defvar TeX-PDF-mode-parsed) +(defvar TeX-all-extensions) +(defvar TeX-command-default) +(defvar TeX-default-extension) +(defvar TeX-esc) +(defvar TeX-interactive-mode) +(defvar TeX-macro-global) +(defvar TeX-mode-map) +(defvar TeX-mode-p) +(defvar TeX-output-extension) +(defvar TeX-output-extension) +(defvar TeX-source-correlate-mode) +(defvar TeX-source-specials-places) +(defvar TeX-source-specials-tex-flags) +(defvar TeX-synctex-tex-flags) +;; Variables defined in other AUCTeX libraries: +;; latex.el: +(defvar BibLaTeX-global-style-files) +(defvar BibTeX-global-files) +(defvar BibTeX-global-style-files) +(defvar LaTeX-default-verb-delimiter) +(defvar LaTeX-global-class-files) +(defvar LaTeX-optcl) +(defvar LaTeX-optop) +(defvar TeX-Biber-global-files) +(defvar TeX-global-input-files) +;; tex-buf.el +(defvar TeX-current-process-region-p) +(defvar TeX-region) +(defvar TeX-region-orig-buffer) +;; tex-ispell.el +(defvar TeX-ispell-verb-delimiters) +;; graphicx.el +(defvar LaTeX-includegraphics-global-files) +;; Others: +(defvar tex--prettify-symbols-alist) ; tex-mode.el +(defvar Info-file-list-for-emacs) ; info.el + (defgroup TeX-file nil "Files used by AUCTeX." :group 'AUCTeX) @@ -1191,7 +1234,7 @@ entry in `TeX-view-program-list-builtin'." (if (and TeX-source-correlate-mode (fboundp 'pdf-sync-forward-search)) (with-current-buffer (or (when TeX-current-process-region-p -(get-file-buffer (TeX-region-file t))) +(get-file-buffer (TeX-region-file t))) (current-buffer)) (pdf-sync-forward-search)) (let ((pdf (concat file "." (TeX-output-extension
[elpa] externals/auctex 1b71eb6 05/30: Add short verb characters to `ispell-tex-skip-alist'
branch: externals/auctex commit 1b71eb6142fe5dad11f2b59d7cc7daa020bc0e1c Author: Arash Esbati Commit: Arash Esbati Add short verb characters to `ispell-tex-skip-alist' * style/shortvrb.el ("shortvrb"): Add entries in `LaTeX-shortvrb-chars to `ispell-tex-skip-alist' in order to skip verbatim content during spell checking. --- style/shortvrb.el | 9 + 1 file changed, 9 insertions(+) diff --git a/style/shortvrb.el b/style/shortvrb.el index a8cf2a1..932df29 100644 --- a/style/shortvrb.el +++ b/style/shortvrb.el @@ -49,6 +49,15 @@ (TeX-add-style-hook "shortvrb" (lambda () + + ;; Ispell: Add entries to `ispell-tex-skip-alist': + (when LaTeX-shortvrb-chars + (TeX-ispell-skip-setcar + (mapcar (lambda (char) + (let ((str (char-to-string char))) + (cons str str))) + LaTeX-shortvrb-chars))) + ;; Fontification (when (and LaTeX-shortvrb-chars (featurep 'font-latex)
[elpa] externals/auctex 55e8842 15/30: Treat \choice like \item
branch: externals/auctex commit 55e8842bcec6037ef4d294638388d736a67d14cf Author: Arash Esbati Commit: Arash Esbati Treat \choice like \item * style/exam.el ("exam"): Add "choice" to `LaTeX-item-regexp'. Simplify regexp for "subpart" and "subsubpart". --- style/exam.el | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/style/exam.el b/style/exam.el index a1ce1b5..e84203f 100644 --- a/style/exam.el +++ b/style/exam.el @@ -123,14 +123,16 @@ Arguments NAME and TYPE are the same as for the function ;; Append us only once: (unless (and (string-match "question" LaTeX-item-regexp) -(string-match "subsub" LaTeX-item-regexp)) +(string-match "sub" LaTeX-item-regexp)) (set (make-local-variable 'LaTeX-item-regexp) (concat LaTeX-item-regexp "\\|" + "choice\\b" + "\\|" "\\(titled\\)?question\\b" "\\|" - "\\(sub\\|subsub\\)?part\\b")) + "\\(sub\\)*part\\b")) (LaTeX-set-paragraph-start)) (TeX-add-symbols
[elpa] externals/auctex 243961c 06/30: ; Silence the compiler
branch: externals/auctex commit 243961c71b0dc4b62a380eba4d3017d65cd122a7 Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * style/dinbrief.el ("dinbrief"): Remove unnecessary `function' and ": " from query strings. (LaTeX-dinbrief-style, LaTeX-dinbrief-env-recipient): Check if `indent-relative-first-indent-point' is defined and use it, otherwise stick with `indent-relative-maybe' which is obsolete since 26.1. Minor indentation fixes. * style/letter.el ("letter"): Remove unnecessary ": " from query strings. (LaTeX-env-recipient): Check if `indent-relative-first-indent-point' is defined and use it, otherwise stick with `indent-relative-maybe' which is obsolete since 26.1. --- style/dinbrief.el | 144 -- style/letter.el | 23 + 2 files changed, 87 insertions(+), 80 deletions(-) diff --git a/style/dinbrief.el b/style/dinbrief.el index 4707654..6375afd 100644 --- a/style/dinbrief.el +++ b/style/dinbrief.el @@ -1,6 +1,6 @@ ;;; dinbrief.el --- Special code for LaTeX-Style dinbrief. -;; Copyright (C) 1994, 2013, 2014, 2018, 2020 Free Software Foundation, Inc. +;; Copyright (C) 1994, 2013, 2014, 2018, 2020 Free Software Foundation, Inc. ;; Author: Werner Fink ;; Maintainer: auctex-de...@gnu.org @@ -33,36 +33,36 @@ (require 'tex) -(TeX-add-style-hook "dinbrief" - (function - (lambda () -(add-hook 'LaTeX-document-style-hook - 'LaTeX-dinbrief-style) -(LaTeX-add-environments - '("letter" LaTeX-dinbrief-env-recipient) - "dinquote") -(TeX-add-symbols - '("address" "Absender: ") - '("postremark" "Postvermerk: ") - '("date" "Datum: ") - '("subject" "Betreff: ") - '("handling" "Behandlungsvermerk: ") - '("cc" "Verteiler: ") - '("place" "Heutiger Ort: ") - "makelabels" - "nowindowrules" - "windowrules" - "nowindowtics" - "windowtics" - "disabledraftstandard" - "enabledraftstandard" - "centeraddress" - "normaladdress" - '("encl" "Anlagen: ") - '("backaddress" "Retouradresse: ") - '("signature" "Unterschrift: ") - '("opening" "Anrede: ") - '("closing" "Schluss: " +(TeX-add-style-hook + "dinbrief" + (lambda () + (add-hook 'LaTeX-document-style-hook +'LaTeX-dinbrief-style) + (LaTeX-add-environments +'("letter" LaTeX-dinbrief-env-recipient) +"dinquote") + (TeX-add-symbols +'("address" "Absender") +'("postremark" "Postvermerk") +'("date" "Datum") +'("subject" "Betreff") +'("handling" "Behandlungsvermerk") +'("cc" "Verteiler") +'("place" "Heutiger Ort") +"makelabels" +"nowindowrules" +"windowrules" +"nowindowtics" +"windowtics" +"disabledraftstandard" +"enabledraftstandard" +"centeraddress" +"normaladdress" +'("encl" "Anlagen: ") +'("backaddress" "Retouradresse") +'("signature" "Unterschrift") +'("opening" "Anrede") +'("closing" "Schluss"))) LaTeX-dialect) (defmacro LaTeX-dinbrief-insert (&rest args) @@ -72,41 +72,45 @@ (defun LaTeX-dinbrief-style () "Insert some useful packages for writing german letters." - (save-excursion -(goto-char (point-min)) ; insert before \begin{document} -(if (re-search-forward ".begin.document." (point-max) t) -(beginning-of-line 1)) -(open-line 2) -(indent-relative-maybe) -(LaTeX-dinbrief-insert TeX-esc "usepackage" - LaTeX-optop "latin1,utf8" LaTeX-optcl - TeX-grop "inputenc" TeX-grcl) -(newline-and-indent) -(LaTeX-dinbrief-insert TeX-esc "usepackage" - LaTeX-optop "T1" LaTeX-optcl - TeX-grop "fontenc" TeX-grcl) -(newline-and-indent) -(LaTeX-dinbrief-insert TeX-esc "usepackage" - TeX-grop "ngerman" TeX-grcl) + (let ((func (if (fboundp 'indent-relative-first-indent-point) + 'indent-relative-first-indent-point + 'indent-relative-maybe))) +(save-excursion + (goto-char (point-min)) ; insert before \begin{document} + (if (re-search-forward ".begin.document." (point-max) t) + (beginning-of-line 1)) + (open-line 2) + (funcall func) + (LaTeX-dinbrief-insert TeX-esc "usepackage" +LaTeX-optop "latin1,utf8" LaTeX-optcl +TeX-grop "inputenc" TeX-grcl) + (newline-and-indent) + (LaTeX-dinbrief-insert TeX-esc "usepackage" +LaTeX-optop "T1" LaTeX-optcl +TeX-grop "fontenc" TeX-grcl) + (funcall func) + (LaTeX-dinbrief-insert TeX-esc "usepackage" +TeX-grop "ngerman" TeX-grcl)) (TeX-run-style-hooks "inputenc" "fontenc" "ngerman"))) (defun LaTeX-dinbrief-env-recipient (environment) "Insert ENVIRONMENT and prompt for recipient and
[elpa] externals/auctex 2e448e3 13/30: ; Silence the compiler
branch: externals/auctex commit 2e448e3015a2f4532d543afd7360910e25bc62da Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * font-latex.el (font-latex-update-font-lock): Mark the argument `syntactic-kws' as unused. --- font-latex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font-latex.el b/font-latex.el index 4736cfb..f8edf91 100644 --- a/font-latex.el +++ b/font-latex.el @@ -1297,7 +1297,7 @@ triggers Font Lock to recognize the change." ;; influencing fontification in her file-local variables section. (add-hook 'hack-local-variables-hook #'font-latex-after-hacking-local-variables t t)) -(defun font-latex-update-font-lock (&optional syntactic-kws) +(defun font-latex-update-font-lock (&optional _syntactic-kws) "Tell font-lock about updates of fontification rules. If SYNTACTIC-KWS is non-nil, also update `font-latex-syntactic-keywords'."
[elpa] externals/shell-command+ c0129cc 02/36: converted all tabs to spaced
branch: externals/shell-command+ commit c0129cc8113890ac1939168822761b4cf59cf11d Author: Philip K Commit: Philip K converted all tabs to spaced --- .dir-locals.el | 5 +++ bang.el| 122 - 2 files changed, 66 insertions(+), 61 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 000..3bcda92 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,5 @@ +;;; Directory Local Variables +;;; For more information see (info "(emacs) Directory Variables") + +((emacs-lisp-mode + (indent-tabs-mode . nil))) diff --git a/bang.el b/bang.el index 8658ab6..2c29a76 100644 --- a/bang.el +++ b/bang.el @@ -8,15 +8,15 @@ (defconst bang--command-regexp (rx bos (* space) - (or (seq (group "!" ) - (or (group (+ digit)) - (group (+ alnum - (group "<") (group ">") (group "|") "") - (? (* space) -(group (* not-newline) - (not space) - (*? not-newline))) - eos) + (or (seq (group "!" ) + (or (group (+ digit)) + (group (+ alnum + (group "<") (group ">") (group "|") "") + (? (* space) + (group (* not-newline) +(not space) +(*? not-newline))) + eos) "Regular expression to parse input to `bang'.") (defvar bang--last-commands '() @@ -28,39 +28,39 @@ (defun bang--remember-command (command) (push command bang--last-commands) (let ((overflow (- (length bang--last-commands) -bang-history-size))) - (when (> overflow 0) - (setq bang--last-commands - (nbutlast bang--last-commands overflow) + bang-history-size))) +(when (> overflow 0) + (setq bang--last-commands +(nbutlast bang--last-commands overflow) (defun bang--find-last-command (prefix) (catch 'found - (dolist (cmd bang--last-commands) - (when (string-prefix-p prefix cmd) - (throw 'found cmd))) - (error "no such command in history"))) +(dolist (cmd bang--last-commands) + (when (string-prefix-p prefix cmd) +(throw 'found cmd))) +(error "no such command in history"))) (defun bang--get-command-number (arg rest) (let* ((num (string-to-number arg)) -(pos (- (length bang--last-commands) -(1- num))) -(cmd (nth pos bang--last-commands))) - (concat cmd " " rest))) + (pos (- (length bang--last-commands) + (1- num))) + (cmd (nth pos bang--last-commands))) +(concat cmd " " rest))) (defun bang-history () "Display a buffer with overview of previous bang commands." (interactive) (let ((buf (get-buffer-create "*bang-history*")) - (i (length bang--last-commands))) - (with-current-buffer buf - (setq buffer-read-only nil) - (delete-region (goto-char (point-min)) -(point-max)) - (dolist (cmd bang--last-commands) - (insert (format "%d\t%s\n" i cmd)) - (setq i (1- i))) - (special-mode)) - (pop-to-buffer buf))) +(i (length bang--last-commands))) +(with-current-buffer buf + (setq buffer-read-only nil) + (delete-region (goto-char (point-min)) + (point-max)) + (dolist (cmd bang--last-commands) +(insert (format "%d\t%s\n" i cmd)) +(setq i (1- i))) + (special-mode)) +(pop-to-buffer buf))) (defun bang (command beg end) "Intelligently execute string COMMAND in inferior shell, like @@ -78,36 +78,36 @@ Without any argument, `bang' will behave like `shell-command'. Inside COMMAND, % is replaced with the current file name. To insert a literal % quote it using a backslash." (interactive (list (read-shell-command "Bang command: ") -(if mark-active (region-beginning) (point-min)) -(if mark-active (region-end) (point-max + (if mark-active (region-beginning) (point-min)) + (if mark-active (region-end) (point-max (save-match-data - (unless (string-match bang--command-regexp command) - (error "Invalid command")) - (let ((has-! (match-string-no-properties 1 command)) - (num-! (match-string-no-properties 2 command)) - (arg-! (match-string-no-properties 3 command)) - (has-< (match-string-no-properties 4 command)) - (has-> (match-string-no-properties 5 command)) - (has-| (match-string-no-properties 6 command)) - (rest (match-string-no-properties 7 command))) - (cond (arg-! (bang (ba
[elpa] externals/shell-command+ aecad16 13/36: added link to public inbox
branch: externals/shell-command+ commit aecad16c66e8ce9923a1d0b41f7d1f9a912171eb Author: Philip K Commit: Philip K added link to public inbox --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b49f025..978cdc9 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ this: (use-package bang :bind ("M-!" . bang)) +Bug reports and patches should be sent to my [public inbox]. + Copying --- @@ -33,4 +35,5 @@ Domain Dedication][cc0] license. [leah]: http://leahneukirchen.org/dotfiles/.emacs [MELPA]: https://melpa.org/#/bang +[public inbox]: https://lists.sr.ht/~zge/public-inbox [cc0]: https://creativecommons.org/publicdomain/zero/1.0/deed
[elpa] externals/auctex 3ef28a5 20/30: Add an extra check for tex-buf.el in some style hooks
branch: externals/auctex commit 3ef28a55e3671b078c2042d0620c45c973216684 Author: Arash Esbati Commit: Arash Esbati Add an extra check for tex-buf.el in some style hooks * style/arabxetex.el ("arabxetex"): * style/bidi.el ("bidi"): * style/fontspec.el ("fontspec"): * style/polyglossia.el ("polyglossia"): Check if "tex-buf.el" is loaded and require it otherwise. `TeX-check-engine-add-engines' is defined in "tex-buf.el" and the hook would exit too early if the library isn't loaded. --- style/arabxetex.el | 2 ++ style/bidi.el| 4 +++- style/fontspec.el| 4 +++- style/polyglossia.el | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/style/arabxetex.el b/style/arabxetex.el index fefd63e..2dd9fc2 100644 --- a/style/arabxetex.el +++ b/style/arabxetex.el @@ -44,6 +44,8 @@ (TeX-run-style-hooks "amsmath" "fontspec" "bidi") ;; We need xelatex, so check for the engine here: + (unless (featurep 'tex-buf) + (require 'tex-buf)) (TeX-check-engine-add-engines 'xetex) ;; New macros & environments: diff --git a/style/bidi.el b/style/bidi.el index c000535..0638482 100644 --- a/style/bidi.el +++ b/style/bidi.el @@ -1,6 +1,6 @@ ;;; bidi.el --- AUCTeX style for the (XeLaTeX) bidi package -;; Copyright (C) 2016--2018 Free Software Foundation, Inc. +;; Copyright (C) 2016--2020 Free Software Foundation, Inc. ;; Author: Uwe Brauer ;; Created: 2016-03-06 @@ -50,6 +50,8 @@ "bidi" (lambda () ;; bidi.sty requires xelatex, so set the engine + (unless (featurep 'tex-buf) + (require 'tex-buf)) (TeX-check-engine-add-engines 'xetex) ;; 1.4 Turning TeX--XeT features on and off diff --git a/style/fontspec.el b/style/fontspec.el index 0688e98..44bc167 100644 --- a/style/fontspec.el +++ b/style/fontspec.el @@ -1,6 +1,6 @@ ;;; fontspec.el --- AUCTeX style for `fontspec.sty' version 2.6a. -;; Copyright (C) 2013, 2017, 2018 Free Software Foundation, Inc. +;; Copyright (C) 2013, 2017, 2018, 2020 Free Software Foundation, Inc. ;; Maintainer: auctex-de...@gnu.org ;; Author: Mosè Giordano @@ -253,6 +253,8 @@ to retrieve the list of fonts." (TeX-add-style-hook "fontspec" (lambda () + (unless (featurep 'tex-buf) + (require 'tex-buf)) (TeX-check-engine-add-engines 'luatex 'xetex) (TeX-run-style-hooks "expl3" "xparse") diff --git a/style/polyglossia.el b/style/polyglossia.el index c9366d0..b9aa3d4 100644 --- a/style/polyglossia.el +++ b/style/polyglossia.el @@ -231,6 +231,8 @@ argument, otherwise as a mandatory one." (TeX-add-style-hook "polyglossia" (lambda () + (unless (featurep 'tex-buf) + (require 'tex-buf)) (TeX-check-engine-add-engines 'luatex 'xetex) (TeX-auto-add-regexp `(,LaTeX-polyglossia-lang-regexp (3 1 2) LaTeX-auto-polyglossia-lang))
[elpa] externals/auctex d7cba92 21/30: Prepare for pdf output for PSTricks documents
branch: externals/auctex commit d7cba92dbe15474dceb4c18d021ef9535da5050e Author: Ikumi Keita Commit: Ikumi Keita Prepare for pdf output for PSTricks documents * style/pstricks.el ("pstricks"): Prepare for pdf output rather than turn off PDF mode. (): Update copyright year. * doc/changes.texi: Mention above change. --- doc/changes.texi | 9 + style/pstricks.el | 9 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/changes.texi b/doc/changes.texi index bc2bfb6..5127927 100644 --- a/doc/changes.texi +++ b/doc/changes.texi @@ -12,6 +12,15 @@ @itemize @bullet @item +Support for @samp{PSTricks} is now @acronym{PDF}-oriented. @AUCTeX{} no +longer turns off PDF mode for @samp{PSTricks} documents even without +@samp{pst-pdf}. It now sets up @code{TeX-PDF-from-DVI} option so that +@acronym{PDF} output is generated when @code{TeX-PDF-mode} is enabled +(default). Users who want @acronym{DVI} output should disable PDF mode +explicitly by file local variable, or customize @code{TeX-PDF-mode} to +@code{nil}. + +@item The function @code{font-latex-update-font-lock} has been obsoleted in order to fix @samp{bug#37945}. That function was used by several style files in order to refresh fontification after adding new symbols or diff --git a/style/pstricks.el b/style/pstricks.el index 33652f9..1a24767 100644 --- a/style/pstricks.el +++ b/style/pstricks.el @@ -1,6 +1,7 @@ ;;; pstricks.el --- AUCTeX style for the `pstricks' package. -;; Copyright (C) 2007, 2009, 2013-2015, 2018 Free Software Foundation, Inc. +;; Copyright (C) 2007, 2009, 2013-2015, 2018, 2020 +;;Free Software Foundation, Inc. ;; Author: Holger Sparr ;; Maintainer: auctex-de...@gnu.org @@ -781,7 +782,11 @@ comma separated list. Point has to be within the sexp to modify." (lambda () (unless (or (member "pst-pdf" TeX-active-styles) (eq TeX-engine 'xetex)) - (TeX-PDF-mode-off)) + ;; Leave at user's choice whether to disable `TeX-PDF-mode' or + ;; not. Instead set up `TeX-PDF-from-DVI' option so that AUCTeX + ;; takes dvips+ps2pdf route when `TeX-PDF-mode' is enabled. + ;; (TeX-PDF-mode-off) + (setq TeX-PDF-from-DVI "Dvips")) (mapc 'TeX-auto-add-regexp LaTeX-auto-pstricks-regexp-list) (LaTeX-add-environments '("pspicture" LaTeX-pst-env-pspicture)
[elpa] externals/shell-command+ 0931b93 03/36: added cc0 as license
branch: externals/shell-command+ commit 0931b938d24e34f92dde3af7c2502c14bc0a1672 Author: Philip K Commit: Philip K added cc0 as license --- LICENSE | 121 1 file changed, 121 insertions(+) diff --git a/LICENSE b/LICENSE new file mode 100644 index 000..0e259d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + +CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE +LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN +ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS +INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES +REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS +PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM +THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED +HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Wa
[elpa] externals/auctex f04a508 22/30: Restore all math environments in texmathp.el
branch: externals/auctex commit f04a508f6a85642524ad1a2279f2bfe2bded1db7 Author: Ikumi Keita Commit: Ikumi Keita Restore all math environments in texmathp.el * texmathp.el (texmathp-tex-commands-default): Restore all math environments from style files. The idea to update t-t-c-d by style files afterwards fails when texmathp is used solely in external packages like org mode. * style/amsmath.el: * style/breqn.el: * style/empheq.el: * style/mathtools.el: Adjust in accord with the above change. * doc/changes.texi: Delete relevant entry. --- doc/changes.texi | 9 - style/amsmath.el | 23 --- style/breqn.el | 16 style/empheq.el| 20 style/mathtools.el | 8 texmathp.el| 40 +++- 6 files changed, 35 insertions(+), 81 deletions(-) diff --git a/doc/changes.texi b/doc/changes.texi index 5127927..942daa4 100644 --- a/doc/changes.texi +++ b/doc/changes.texi @@ -49,16 +49,7 @@ instead. @ifclear rawfile @xref{Fontification of math}. @end ifclear -@item -Support for highlighting and in-math state detection for AMS-LaTeX -specific environments, such as @samp{align}, @samp{gather} and -@samp{multline}, are refactored and put into style file -@file{amsmath.el}. So these support are available only when -@code{TeX-parse-self} option is enabled. -Support for in-math state detection for packages mathtools, empheq and -breqn is also moved into the respective style files, so available only -when @code{TeX-parse-self} option is enabled. @item @AUCTeX{} tracks changes in @LaTeX{}2e 2020-02-02 release. @AUCTeX{} supports the improvements to @LaTeX{} font selection mechanism (NFSS). diff --git a/style/amsmath.el b/style/amsmath.el index 2179d57..ebae233 100644 --- a/style/amsmath.el +++ b/style/amsmath.el @@ -29,34 +29,11 @@ ;; This will also load the amstext, amsbsy and amsopn style files. ;;; Code: -(eval-when-compile (require 'cl-lib)) ;; Fontification (declare-function font-latex-add-keywords "font-latex" (keywords class)) -(declare-function font-latex-update-math-env - "font-latex") -(require 'texmathp) -(let ((list '(("equation*" env-on) - ("align" env-on) ("align*"env-on) - ("gather"env-on) ("gather*" env-on) - ("multline" env-on) ("multline*" env-on) - ("flalign" env-on) ("flalign*" env-on) - ("alignat" env-on) ("alignat*" env-on) - ("xalignat" env-on) ("xalignat*" env-on) - ("xxalignat" env-on) ("\\boxed" arg-on) - ;; In fact, \text macro is provided separately in - ;; amstext.sty, not amsmath.sty. However, it would be - ;; reasonable enough to include support for it here. - ("\\text"arg-off) ("\\intertext" arg-off) - ("\\tag" arg-off) ("\\tag*"arg-off - (dolist (entry list) -(cl-pushnew entry texmathp-tex-commands-default :test #'equal))) -(texmathp-compile) -(if (and (featurep 'font-latex) -(eq TeX-install-font-lock 'font-latex-setup)) -(font-latex-update-math-env)) (TeX-add-style-hook "amsmath" diff --git a/style/breqn.el b/style/breqn.el index 22c45aa..cef8519 100644 --- a/style/breqn.el +++ b/style/breqn.el @@ -49,7 +49,6 @@ ;;; Code: (require 'latex) -(eval-when-compile (require 'cl-lib)) (defvar LaTeX-breqn-key-val-options '(("style" ("\\tiny" "\\scriptsize" "\\footnotesize" "\\small" @@ -96,21 +95,6 @@ Keys offered for key=val query depend on ENV. \"label\" and (add-hook 'TeX-update-style-hook #'TeX-auto-parse t) -;; Fontification -(declare-function font-latex-update-math-env "font-latex") -(require 'texmathp) -(let ((list '(("dmath" env-on) ("dmath*"env-on) - ("dseries" env-on) ("dseries*" env-on) - ("dgroup"env-on) ("dgroup*" env-on) - ("darray"env-on) ("darray*" env-on) - ("dsuspend" env-off - (dolist (entry list) -(cl-pushnew entry texmathp-tex-commands-default :test #'equal))) -(texmathp-compile) -(if (and (featurep 'font-latex) -(eq TeX-install-font-lock 'font-latex-setup)) -(font-latex-update-math-env)) - (TeX-add-style-hook "breqn" (lambda () diff --git a/style/empheq.el b/style/empheq.el index 9add6c4..749964a 100644 --- a/style/empheq.el +++ b/style/empheq.el @@ -41,8 +41,6 @@ (declare-function font-latex-add-keywords "font-latex" (keywords class)) -(declare-function font-latex-update-math-env - "font-latex") (declare-function LaTeX-item-equation-alignat "amsmath" (&optional suppress)) @@ -276,24 +274,6 @@ number of ampersands if possible." (save-excursio
[elpa] externals/auctex 087b030 28/30: Simplify mode line for emacs 27
branch: externals/auctex commit 087b0300012d14cc86dec946d6c225cdb06460a1 Author: Ikumi Keita Commit: Ikumi Keita 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'. --- tex-buf.el | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tex-buf.el b/tex-buf.el index ff6be7e..510722c 100644 --- a/tex-buf.el +++ b/tex-buf.el @@ -1883,9 +1883,11 @@ variable is nil." (defvar compilation-in-progress nil "List of compilation processes now running.") -(or (assq 'compilation-in-progress minor-mode-alist) -(setq minor-mode-alist (cons '(compilation-in-progress " Compiling") -minor-mode-alist))) +;; COMPATIBILITY for emacs < 27 +(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 (defun TeX-process-get-variable (name symbol &optional default) "Return the value in the process buffer for NAME of SYMBOL.
[elpa] branch externals/shell-command+ created (now 339931d)
monnier pushed a change to branch externals/shell-command+. at 339931d rename bang to shell-command+ This branch includes the following new commits: new 57afacb initial export new c0129cc converted all tabs to spaced new 0931b93 added cc0 as license new 5e3def9 Fixed packaging issues and mistakes new c395408 Re-added % substitution new 64c0fcf delete shell output instead of killing it new ac4ec3c added initial readme new 49f3686 fixed package-lint issues new 5c01598 fixed minor checkdoc complaints new 3eed583 fixed typo on the first line new bed12c8 minor code cleanup new 9b28c60 added melpa link new aecad16 added link to public inbox new 253d4bc removed history code new 423c2af updated README new 55f3e2a emulated insert-into-buffer feature from shell-command new ee9e3e6 added `.' command new ab6bb0e reworked `.' command new 9350393 fixed critical bug when no path was specified new 3fcab36 only execute real command, not bang modifiers new 87b5ad3 version bump new d60c01f required rx while compiling new f004dfb require at least one non-whitespace character in command new 8758933 removed trailing whitespace new 11e121a added support for bang--command-regexp to start with ~ new 77989cf renamed "Bang command" to "Shell command" new 1fb0162 bumped version new 51d6934 changed tag-line new f80c7c3 autoload bang command new f0a8a95 Don't interpret local binary execution as a path new f9e92f4 added two spaces after each period new a47986d updated commentary section new e023383 bumped version new b5398d1 use eshell handler if available new 0e0c725 simplify if-expressions where applicable new 339931d rename bang to shell-command+
[elpa] externals/shell-command+ 3eed583 10/36: fixed typo on the first line
branch: externals/shell-command+ commit 3eed5838e80bea85693c660827fed35ba163a139 Author: Philip K Commit: Philip K fixed typo on the first line --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 104ee3b..7037471 100644 --- a/bang.el +++ b/bang.el @@ -1,4 +1,4 @@ -;;; bang.el --- A more inteligent shell-command -*- lexical-binding: t -*- +;;; bang.el --- A more intelligent shell-command -*- lexical-binding: t -*- ;; Author: Philip K. ;; Version: 0.1.0
[elpa] externals/auctex b06ca0a 25/30: Fix document
branch: externals/auctex commit b06ca0a48e56b7e006be02a7a845054d600538c5 Author: Ikumi Keita Commit: Ikumi Keita Fix document * doc/auctex.texi (Fontification of math): Delete incorrect description. --- doc/auctex.texi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/auctex.texi b/doc/auctex.texi index 7eb606a..b19b60d 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -2270,9 +2270,7 @@ like @samp{\(...\)} or @samp{\[...\]} is built-in and not customizable. Support for other math macros and environments can be adapted by customizing the variables @code{font-latex-match-math-command-keywords} and @code{texmathp-tex-commands} respectively. It is no longer -recommended to customize @code{font-latex-math-environments}, which -is initialized according to @code{texmathp-tex-commands} and -@code{texmathp-tex-commands-default} by default. +recommended to customize @code{font-latex-math-environments}. To convert your customization in @code{font-latex-math-environments} into @code{texmathp-tex-commands}, please register your own math
[elpa] externals/shell-command+ ee9e3e6 17/36: added `.' command
branch: externals/shell-command+ commit ee9e3e684920004c8258d91ac2c30f3d157c34ff Author: Philip K Commit: Philip K added `.' command --- README.md | 7 +-- bang.el | 13 ++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f001a4b..7036bc5 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,7 @@ `bang` is a `shell-command` substitute that makes it easier to run commands on regions or whole buffers. This is done by potentially interpreting the first character differently, as the `bang` docstring -explains: - - When COMMAND starts with - < the output of COMMAND replaces the current selection - > COMMAND is run with the current selection as input - | the current selection is filtered through COMMAND +explains. Bang has been based on a function of the same name by [Leah Neukirchen][leah]. diff --git a/bang.el b/bang.el index 2be0b25..8907f37 100644 --- a/bang.el +++ b/bang.el @@ -39,6 +39,7 @@ When COMMAND starts with < the output of COMMAND replaces the current selection > COMMAND is run with the current selection as input | the current selection is filtered through COMMAND + . COMMAND executes in the relative path following the dot Without any argument, `bang' will behave like `shell-command'. @@ -52,7 +53,9 @@ between BEG and END. Otherwise the whole buffer is processed." (if (use-region-p) (region-end) (point-max (save-match-data (unless (string-match (rx bos (* space) - (or (group "<") (group ">") (group "|") "") + (or (group "<") (group ">") (group "|") + (group "." (* (not space))) "") + (* space) (group (* not-newline)) eos) command) @@ -60,13 +63,14 @@ between BEG and END. Otherwise the whole buffer is processed." (let ((has-< (match-string-no-properties 1 command)) (has-> (match-string-no-properties 2 command)) (has-| (match-string-no-properties 3 command)) + (has-. (match-string-no-properties 4 command)) (rest (condition-case nil (replace-regexp-in-string (rx (* ?\\ ?\\) (or ?\\ (group "%"))) buffer-file-name - (match-string-no-properties 4 command) + (match-string-no-properties 5 command) nil nil 1) - (error (match-string-no-properties 4 command) + (error (match-string-no-properties 5 command) (cond (has-< (delete-region beg end) (shell-command rest t shell-command-default-error-buffer) (exchange-point-and-mark)) @@ -76,6 +80,9 @@ between BEG and END. Otherwise the whole buffer is processed." (has-| (shell-command-on-region beg end rest t t shell-command-default-error-buffer t)) +(has-. (let ((default-directory (expand-file-name has-.))) + (shell-command rest (if current-prefix-arg t nil) +shell-command-default-error-buffer))) (t (shell-command command (if current-prefix-arg t nil) shell-command-default-error-buffer))) (when has->
[elpa] externals/auctex a27850f 10/30: Fix previous commit and add new test
branch: externals/auctex commit a27850faedf2a9c0871a558353a8f8f42597794c Author: Ikumi Keita Commit: Ikumi Keita Fix previous commit and add new test * font-latex.el (font-latex-extend-region-backwards-quotation): Move the point back to the correct position when the inner loop search fails. * tests/latex/font-latex-test.el (font-latex-extend-region-backwards-quotation): New test. --- font-latex.el | 67 -- tests/latex/font-latex-test.el | 40 + 2 files changed, 78 insertions(+), 29 deletions(-) diff --git a/font-latex.el b/font-latex.el index 09a6feb..6ce901f 100644 --- a/font-latex.el +++ b/font-latex.el @@ -2050,12 +2050,13 @@ set to french, and >>german<< (and 8-bit) are used if set to german." "Extend region backwards for quotations." (when font-latex-quotes (font-latex-update-quote-list) -(let ((regexp-end (regexp-opt (mapcar 'cadr font-latex-quote-list) t))) +(let ((regexp-end (regexp-opt (mapcar #'cadr font-latex-quote-list) t))) (save-excursion (goto-char font-lock-end) (catch 'extend (while (re-search-backward regexp-end font-lock-beg t) - (let ((closing-quote (match-string 0)) + (let ((found-end (match-beginning 0)) + (closing-quote (match-string-no-properties 0)) (nest-count 0) (point-of-surrender (- font-lock-beg font-latex-multiline-boundary)) @@ -2066,33 +2067,41 @@ set to french, and >>german<< (and 8-bit) are used if set to german." (setq opening-quote (car elt)) (throw 'found nil ;; Find opening quote taking nested quotes into account. - (while (and (re-search-backward (concat opening-quote "\\|" - closing-quote) - point-of-surrender t) - ;; Found quotes before point-of-surrender. - (cond ((string= (match-string 0) closing-quote) -;; Encountered another closing quote. -;; Increase nest-count and continue -;; the inner loop. -(setq nest-count (1+ nest-count))) - ;; Found an opening quote. - ((/= nest-count 0) -;; If in nest, decrease nest-count -;; and continue the inner loop. -(setq nest-count (1- nest-count))) - ;; Else we arrived at the opening quote - ;; matching with the closing quote found - ;; in the outer loop. - ((< (point) font-lock-beg) -;; If that opening quote locates -;; before `font-lock-beg', break the -;; outer loop and extend the region. -(setq font-lock-beg (point)) -(throw 'extend t)) - (t -;; Else terminate the inner loop and -;; continue the outer loop. -nil))) + (while (if (re-search-backward (concat opening-quote "\\|" +closing-quote) +point-of-surrender 'move) +;; Found quotes before point-of-surrender. +(cond ((string= (match-string-no-properties 0) +closing-quote) + ;; Encountered another closing quote. + ;; Increase nest-count and continue + ;; the inner loop. + (setq nest-count (1+ nest-count))) + ;; Found an opening quote. + ((/= nest-count 0) + ;; If in nest, decrease nest-count + ;; and continue the inner loop. + (setq nest-count (1- nest-count))) + ;; Else we arrived at the opening quote + ;; matching with the closing quote found + ;; in the outer loop. + ((< (point) font-lock-beg) + ;; If that opening quote locates + ;; before `font-lock-beg', break the + ;; outer loop and extend the region. + (setq
[elpa] externals/shell-command+ 9b28c60 12/36: added melpa link
branch: externals/shell-command+ commit 9b28c603910681ba0cdee7391ac1cd177dbe55a9 Author: Philip K Commit: Philip K added melpa link --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e4d591..b49f025 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Neukirchen][leah]. How to use -- -Using MELPA and `use-package`, a minimal setup might look something like +Using [MELPA] and `use-package`, a minimal setup might look something like this: (use-package bang @@ -32,4 +32,5 @@ Copying Domain Dedication][cc0] license. [leah]: http://leahneukirchen.org/dotfiles/.emacs +[MELPA]: https://melpa.org/#/bang [cc0]: https://creativecommons.org/publicdomain/zero/1.0/deed
[elpa] externals/shell-command+ 253d4bc 14/36: removed history code
branch: externals/shell-command+ commit 253d4bc87ec6beb12e5c6f5569a354907adb8679 Author: Philip K Commit: Philip K removed history code --- bang.el | 97 ++--- 1 file changed, 15 insertions(+), 82 deletions(-) diff --git a/bang.el b/bang.el index 8713526..40bcd38 100644 --- a/bang.el +++ b/bang.el @@ -1,9 +1,9 @@ ;;; bang.el --- A more intelligent shell-command -*- lexical-binding: t -*- ;; Author: Philip K. -;; Version: 0.1.0 +;; Version: 0.2.0 ;; Keywords: unix, processes, convenience -;; Package-Requires: ((emacs "24.1") (seq "2.20")) +;; Package-Requires: ((emacs "24.1")) ;; URL: https://git.sr.ht/~zge/bang ;; This file is NOT part of Emacs. @@ -29,69 +29,9 @@ ;; https://leahneukirchen.org/dotfiles/.emacs (require 'rx) -(require 'seq) ;;; Code: -(defconst bang--command-regexp - (rx bos (* space) - (or (seq (group "!" ) - (or (group (+ digit)) - (group (+ alnum - (group "<") (group ">") (group "|") "") - (? (* space) - (group (* not-newline) -(not space) -(*? not-newline))) - eos) - "Regular expression to parse input to `bang'.") - -(defvar bang--last-commands '() - "List of non-history commands last executed by `bang'.") - -(defvar bang-history-size 80 - "Number of commands to save in `bang--last-commands'.") - -(defun bang--remember-command (command) - "Helper function to save COMMAND in bang's history." - (push command bang--last-commands) - (let ((overflow (- (length bang--last-commands) - bang-history-size))) -(when (> overflow 0) - (setq bang--last-commands -(nbutlast bang--last-commands overflow) - -(defun bang--find-last-command (prefix) - "Helper function to find last command that started with PREFIX." - (or (seq-find (apply-partially #'string-prefix-p prefix) -bang--last-commands) - (error "No such command in history"))) - -(defun bang--get-command-number (arg rest) - "Helper function to find ARG'th last command. - -Second argument REST will be concatenated to what was found." - (let* ((num (string-to-number arg)) - (pos (- (length bang--last-commands) - (1- num))) - (cmd (nth pos bang--last-commands))) -(concat cmd " " rest))) - -(defun bang-history () - "Display a buffer with overview of previous bang commands." - (interactive) - (let ((buf (get-buffer-create "*bang-history*")) -(i (length bang--last-commands))) -(with-current-buffer buf - (setq buffer-read-only nil) - (delete-region (goto-char (point-min)) - (point-max)) - (dolist (cmd bang--last-commands) -(insert (format "%d\t%s\n" i cmd)) -(setq i (1- i))) - (special-mode)) -(pop-to-buffer buf))) - (defun bang (command beg end) "Intelligently execute string COMMAND in inferior shell. @@ -99,8 +39,6 @@ When COMMAND starts with < the output of COMMAND replaces the current selection > COMMAND is run with the current selection as input | the current selection is filtered through COMMAND - ! executes the last command that started with COMMAND, - or if a number, re-execute nth last command Without any argument, `bang' will behave like `shell-command'. @@ -113,26 +51,23 @@ between BEG and END. Otherwise the whole buffer is processed." (if (use-region-p) (region-beginning) (point-min)) (if (use-region-p) (region-end) (point-max (save-match-data -(unless (string-match bang--command-regexp command) +(unless (string-match (rx bos (* space) + (or (group "<") (group ">") (group "|") "") + (group (* not-newline)) + eos) + command) (error "Invalid command")) -(let ((has-! (match-string-no-properties 1 command)) - (num-! (match-string-no-properties 2 command)) - (arg-! (match-string-no-properties 3 command)) - (has-< (match-string-no-properties 4 command)) - (has-> (match-string-no-properties 5 command)) - (has-| (match-string-no-properties 6 command)) +(let ((has-< (match-string-no-properties 1 command)) + (has-> (match-string-no-properties 2 command)) + (has-| (match-string-no-properties 3 command)) (rest (condition-case nil (replace-regexp-in-string (rx (* ?\\ ?\\) (or ?\\ (group "%"))) buffer-file-name - (match-string-no-properties 7 command) + (match-string-no-properties 4 command) nil nil 1) - (error (match-string-no-properties 7 command) - (cond (arg-! (bang (bang--find-last-command arg-!) - beg end)) -(num-
[elpa] externals/shell-command+ 55f3e2a 16/36: emulated insert-into-buffer feature from shell-command
branch: externals/shell-command+ commit 55f3e2a7fc240bf7754dc3de47514095c76f89be Author: Philip K Commit: Philip K emulated insert-into-buffer feature from shell-command --- bang.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 40bcd38..2be0b25 100644 --- a/bang.el +++ b/bang.el @@ -76,7 +76,8 @@ between BEG and END. Otherwise the whole buffer is processed." (has-| (shell-command-on-region beg end rest t t shell-command-default-error-buffer t)) -(t (shell-command command nil shell-command-default-error-buffer))) +(t (shell-command command (if current-prefix-arg t nil) + shell-command-default-error-buffer))) (when has-> (with-current-buffer "*Shell Command Output*" (delete-region (point-min) (point-max)))
[elpa] externals/shell-command+ 51d6934 28/36: changed tag-line
branch: externals/shell-command+ commit 51d693492b873ee81bb7ef1b758e4b2c33e015ba Author: Philip K Commit: Philip K changed tag-line --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 64eb47f..e06ce52 100644 --- a/bang.el +++ b/bang.el @@ -1,4 +1,4 @@ -;;; bang.el --- A more intelligent shell-command -*- lexical-binding: t -*- +;;; bang.el --- A sam-like shell-command -*- lexical-binding: t -*- ;; Author: Philip K. ;; Version: 1.0.2
[elpa] externals/shell-command+ 3fcab36 20/36: only execute real command, not bang modifiers
branch: externals/shell-command+ commit 3fcab363380c39a60601077660c6a1252be3a748 Author: Philip K Commit: Philip K only execute real command, not bang modifiers --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 9160823..ff82c1c 100644 --- a/bang.el +++ b/bang.el @@ -101,7 +101,7 @@ between BEG and END. Otherwise the whole buffer is processed." (has-| (shell-command-on-region beg end rest t t shell-command-default-error-buffer t)) - (t (shell-command command (if current-prefix-arg t nil) + (t (shell-command rest (if current-prefix-arg t nil) shell-command-default-error-buffer (when has-> (with-current-buffer "*Shell Command Output*"
[elpa] externals/shell-command+ f9e92f4 31/36: added two spaces after each period
branch: externals/shell-command+ commit f9e92f42ee02e7face2f2dc65167bdd9268e4980 Author: Philip K Commit: Philip K added two spaces after each period --- bang.el | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bang.el b/bang.el index 8c25476..65eba0c 100644 --- a/bang.el +++ b/bang.el @@ -46,7 +46,7 @@ "Expand any PATH into absolute path with additional tricks. Furthermore, replace each sequence with three or more `.'s with a -proper upwards directory pointers. This means that '' becomes +proper upwards directory pointers. This means that '' becomes '../../../..', and so on." (expand-file-name (replace-regexp-in-string @@ -69,14 +69,14 @@ Without any argument, `bang' will behave like `shell-command'. Before these characters, one may also place a relative or absolute path, which will be the current working directory in -which the command will be executed. See `bang-expand-path' for +which the command will be executed. See `bang-expand-path' for more details on this expansion. -Inside COMMAND, % is replaced with the current file name. To +Inside COMMAND, % is replaced with the current file name. To insert a literal % quote it using a backslash. In case a region is active, bang will only work with the region -between BEG and END. Otherwise the whole buffer is processed." +between BEG and END. Otherwise the whole buffer is processed." (interactive (list (read-shell-command "Shell command: ") (if (use-region-p) (region-beginning) (point-min)) (if (use-region-p) (region-end) (point-max
[elpa] externals/auctex b21889e 19/30: Merge prv-emacs.el into preview.el.in
branch: externals/auctex commit b21889e0f805ddaaea25317da2c872d90907d0c2 Author: Ikumi Keita Commit: Ikumi Keita Merge prv-emacs.el into preview.el.in * preview.el.in: Merge all contents of prv-emacs.el. * prv-emacs.el: Delete. * Makefile.in: * configure.ac: Drop prv-emacs.el. --- Makefile.in | 2 +- configure.ac | 3 - preview.el.in | 512 +++- prv-emacs.el | 609 -- 4 files changed, 511 insertions(+), 615 deletions(-) diff --git a/Makefile.in b/Makefile.in index 1037fe0..63234c1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -177,7 +177,7 @@ STYLESRC = style/prosper.el \ STYLEELC = $(STYLESRC:.el=.elc) ifeq (@preview_enabled@,yes) - PREVIEWSRC = @PLAT_LISP@ preview.el + PREVIEWSRC = preview.el PREVIEWELC = $(PREVIEWSRC:.el=.elc) PREVIEWLATEX = $(MAKE) preview-latex.el TEXMF = (cd latex ; $(MAKE) all) diff --git a/configure.ac b/configure.ac index 566378d..a31b049 100644 --- a/configure.ac +++ b/configure.ac @@ -55,8 +55,6 @@ AC_ARG_ENABLE(preview, [preview_enabled="yes"]) AC_SUBST(preview_enabled) -PLAT_LISP=prv-emacs.el - EMACS_PATH_LISPDIR AC_MSG_CHECKING(what file to use for auctex startup) AC_ARG_WITH(auctexstartfile, @@ -92,7 +90,6 @@ texsitedir="${lispdir}" AC_SUBST(auctexstartfile) AC_SUBST(previewstartfile) -AC_SUBST(PLAT_LISP) AC_MSG_CHECKING([where the package lisp files go]) AC_ARG_WITH(packagelispdir, diff --git a/preview.el.in b/preview.el.in index 46fcd90..c14e490 100644 --- a/preview.el.in +++ b/preview.el.in @@ -55,8 +55,6 @@ preview-latex buffers will not survive across sessions."))) preview-latex's bug reporting commands will probably not work."))) (require 'info)) -(require 'prv-emacs) - (defgroup preview nil "Embed Preview images into LaTeX buffers." :group 'AUCTeX :prefix "preview-" @@ -887,6 +885,10 @@ Pure borderless black-on-white will return an empty string." (and border (format "--bd %d" (max 1 (round (/ (* res border) 72.0 +(defsubst preview-supports-image-type (imagetype) + "Check if IMAGETYPE is supported." + (image-type-available-p imagetype)) + (defun preview-gs-dvips-process-setup () "Set up Dvips process for conversions via gs." (unless (preview-supports-image-type preview-gs-image-type) @@ -1198,6 +1200,26 @@ is located." (push ov preview-gs-queue))) t) +(defsubst preview-icon-copy (icon) + "Prepare a later call of `preview-replace-active-icon'." + + ;; This is just a GNU Emacs specific efficiency hack because it + ;; is easy to do. When porting, don't do anything complicated + ;; here, rather deliver just the unchanged icon and make + ;; `preview-replace-active-icon' do the necessary work of replacing + ;; the icon where it actually has been stored, probably + ;; in the car of the strings property of the overlay. This string + ;; might probably serve as a begin-glyph as well, in which case + ;; modifying the string in the strings property would change that + ;; glyph automatically. + + (cons 'image (cdr icon))) + +(defsubst preview-replace-active-icon (ov replacement) + "Replace the active Icon in OV by REPLACEMENT, another icon." + (let ((img (overlay-get ov 'preview-image))) +(setcdr (car img) (cdar replacement)) +(setcdr img (cdr replacement (defun preview-gs-place (ov snippet box run-buffer tempdir ps-file _imagetype) "Generate an image placeholder rendered over by Ghostscript. @@ -1226,6 +1248,35 @@ for the file extension." (defvar view-exit-action) +(eval-and-compile + (defvar preview-button-1 [mouse-2]) + (defvar preview-button-2 [mouse-3])) + +(defmacro preview-make-clickable (&optional map glyph helpstring click1 click2) + "Generate a clickable string or keymap. +If MAP is non-nil, it specifies a keymap to add to, otherwise +a new one is created. If GLYPH is given, the result is made +to display it wrapped in a string. In that case, +HELPSTRING is a format string with one or two %s specifiers +for preview's clicks, displayed as a help-echo. CLICK1 and CLICK2 +are functions to call on preview's clicks." + `(let ((resmap ,(or map '(make-sparse-keymap + ,@(if click1 + `((define-key resmap preview-button-1 ,click1))) + ,@(if click2 + `((define-key resmap preview-button-2 ,click2))) + ,(if glyph + `(propertize + "x" + 'display ,glyph + 'mouse-face 'highlight + 'help-echo + ,(if (stringp helpstring) +(format helpstring preview-button-1 preview-button-2) + `(format ,helpstring preview-button-1 preview-button-2)) + 'keymap resmap) + 'resmap))) + (defun preview-mouse-open-error (string) "Display STRING in a new view buffer on click." (let ((buff (get-buffer-create @@ -1423,6 +1474,13 @@ recursively." (symbol-value hook)) (t hook)))
[elpa] externals/shell-command+ c395408 05/36: Re-added % substitution
branch: externals/shell-command+ commit c3954087c7858fbf496bd6bbd1b37fc9e46bef78 Author: Philip K Commit: Philip K Re-added % substitution --- bang.el | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 068fed9..070018d 100644 --- a/bang.el +++ b/bang.el @@ -119,7 +119,13 @@ insert a literal % quote it using a backslash." (has-< (match-string-no-properties 4 command)) (has-> (match-string-no-properties 5 command)) (has-| (match-string-no-properties 6 command)) - (rest (match-string-no-properties 7 command))) + (rest (condition-case nil +(replace-regexp-in-string + (rx (* ?\\ ?\\) (or ?\\ (group "%"))) + buffer-file-name + (match-string-no-properties 7 command) + nil nil 1) + (error (match-string-no-properties 7 command) (cond (arg-! (bang (bang--find-last-command arg-!) beg end)) (num-! (bang (bang--get-command-number num-! rest)
[elpa] externals/shell-command+ 423c2af 15/36: updated README
branch: externals/shell-command+ commit 423c2afcd2d09f3fdb79ef62c823ec4dbbd58936 Author: Philip K Commit: Philip K updated README --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 978cdc9..f001a4b 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ explains: < the output of COMMAND replaces the current selection > COMMAND is run with the current selection as input | the current selection is filtered through COMMAND - ! executes the last command that started with COMMAND, -or if a number, re-execute nth last command Bang has been based on a function of the same name by [Leah Neukirchen][leah].
[elpa] externals/shell-command+ 11e121a 25/36: added support for bang--command-regexp to start with ~
branch: externals/shell-command+ commit 11e121aed7f5fe90700bd3f49d987bff0a796c2d Author: Philip K Commit: Philip K added support for bang--command-regexp to start with ~ --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 0af733f..9245057 100644 --- a/bang.el +++ b/bang.el @@ -34,7 +34,7 @@ (defconst bang--command-regexp (rx bos (* space) - (? (group (or "." "/") (* (not space))) (+ space)) + (? (group (or "." "/" "~") (* (not space))) (+ space)) (or (group "<") (group ">") (group "|") "!" "") (* space) (group (+ not-newline))
[elpa] externals/shell-command+ 87b5ad3 21/36: version bump
branch: externals/shell-command+ commit 87b5ad3c81ccf0f2435e3c26ad7f9a1d6191ddb9 Author: Philip K Commit: Philip K version bump --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index ff82c1c..9e17bca 100644 --- a/bang.el +++ b/bang.el @@ -1,7 +1,7 @@ ;;; bang.el --- A more intelligent shell-command -*- lexical-binding: t -*- ;; Author: Philip K. -;; Version: 0.2.0 +;; Version: 1.0.1 ;; Keywords: unix, processes, convenience ;; Package-Requires: ((emacs "24.1")) ;; URL: https://git.sr.ht/~zge/bang
[elpa] externals/shell-command+ f80c7c3 29/36: autoload bang command
branch: externals/shell-command+ commit f80c7c394b57057499db6409f386ade9ac32f763 Author: Philip K Commit: Philip K autoload bang command --- bang.el | 1 + 1 file changed, 1 insertion(+) diff --git a/bang.el b/bang.el index e06ce52..931d7f4 100644 --- a/bang.el +++ b/bang.el @@ -53,6 +53,7 @@ proper upwards directory pointers. This means that '' becomes (mapconcat #'identity (make-list (1- (length sub)) "..") "/")) path))) +;;;###autoload (defun bang (command beg end) "Intelligently execute string COMMAND in inferior shell.
[elpa] externals/shell-command+ 64c0fcf 06/36: delete shell output instead of killing it
branch: externals/shell-command+ commit 64c0fcf4abdbd45880eac935da6db0ae911b8d6d Author: Philip K Commit: Philip K delete shell output instead of killing it --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 070018d..973d94f 100644 --- a/bang.el +++ b/bang.el @@ -142,7 +142,7 @@ insert a literal % quote it using a backslash." (t (shell-command command nil shell-command-default-error-buffer))) (when (or has-! has->) (with-current-buffer "*Shell Command Output*" - (kill-ring-save (point-min) (point-max + (delete-region (point-min) (point-max (unless (or num-! arg-!) (bang--remember-command command)
[elpa] externals/shell-command+ ac4ec3c 07/36: added initial readme
branch: externals/shell-command+ commit ac4ec3cd9c52da65292ca97e4f65c9708c877a57 Author: Philip K Commit: Philip K added initial readme --- README.md | 35 +++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md new file mode 100644 index 000..1e4d591 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +`bang.el` += + +`bang` is a `shell-command` substitute that makes it easier to run +commands on regions or whole buffers. This is done by potentially +interpreting the first character differently, as the `bang` docstring +explains: + + When COMMAND starts with + < the output of COMMAND replaces the current selection + > COMMAND is run with the current selection as input + | the current selection is filtered through COMMAND + ! executes the last command that started with COMMAND, +or if a number, re-execute nth last command + +Bang has been based on a function of the same name by [Leah +Neukirchen][leah]. + +How to use +-- + +Using MELPA and `use-package`, a minimal setup might look something like +this: + + (use-package bang + :bind ("M-!" . bang)) + +Copying +--- + +`bang.el` is distributed under the [CC0 1.0 Universal (CC0 1.0) Public +Domain Dedication][cc0] license. + +[leah]: http://leahneukirchen.org/dotfiles/.emacs +[cc0]: https://creativecommons.org/publicdomain/zero/1.0/deed
[elpa] externals/shell-command+ b5398d1 34/36: use eshell handler if available
branch: externals/shell-command+ commit b5398d1f7cb56e2a2b799b8d125afd7838bf5ce5 Author: Philip K Commit: Philip K use eshell handler if available --- bang.el | 39 +++ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/bang.el b/bang.el index 6f282b9..5fc4678 100644 --- a/bang.el +++ b/bang.el @@ -30,6 +30,15 @@ ;;; Code: +(defgroup bang nil + "An extended `shell-command'" + :group 'external + :prefix "bang-") + +(defcustom bang-use-eshell t + "Check if there is an eshell-handler for each command." + :type 'boolean) + (defconst bang--command-regexp (rx bos (* space) (? (group (or (: ?. (not (any "/"))) ?/ ?~) @@ -37,7 +46,9 @@ (+ space)) (or (group ?<) (group ?>) (group ?|) ?! "") (* space) - (group (+ not-newline)) + (group (: (group (* (any alnum ?_ ?-))) +(? space)) + (+ not-newline)) eos)) (defun bang-expand-path (path) @@ -81,17 +92,19 @@ between BEG and END. Otherwise the whole buffer is processed." (save-match-data (unless (string-match bang--command-regexp command) (error "Invalid command")) -(let ((path (match-string-no-properties 1 command)) - (has-< (match-string-no-properties 2 command)) - (has-> (match-string-no-properties 3 command)) - (has-| (match-string-no-properties 4 command)) - (rest (condition-case nil -(replace-regexp-in-string - (rx (* ?\\ ?\\) (or ?\\ (group "%"))) - buffer-file-name - (match-string-no-properties 5 command) - nil nil 1) - (error (match-string-no-properties 5 command) +(let* ((path (match-string-no-properties 1 command)) + (has-< (match-string-no-properties 2 command)) + (has-> (match-string-no-properties 3 command)) + (has-| (match-string-no-properties 4 command)) + (cmd (match-string-no-properties 6 command)) + (can-eshell (intern-soft (concat "eshell/" cmd))) + (rest (condition-case nil + (replace-regexp-in-string + (rx (* ?\\ ?\\) (or ?\\ (group "%"))) + buffer-file-name + (match-string-no-properties 5 command) + nil nil 1) + (error (match-string-no-properties 5 command) (let ((default-directory (bang-expand-path (or path "." (cond (has-< (delete-region beg end) (shell-command rest t shell-command-default-error-buffer) @@ -102,6 +115,8 @@ between BEG and END. Otherwise the whole buffer is processed." (has-| (shell-command-on-region beg end rest t t shell-command-default-error-buffer t)) + ((and bang-use-eshell can-eshell) + (eshell-command rest (if current-prefix-arg t nil))) (t (shell-command rest (if current-prefix-arg t nil) shell-command-default-error-buffer (when has->
[elpa] externals/shell-command+ 49f3686 08/36: fixed package-lint issues
branch: externals/shell-command+ commit 49f36866bfb509d7e2761bf8cbb0812278ab2c14 Author: Philip K Commit: Philip K fixed package-lint issues --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 973d94f..a109b1a 100644 --- a/bang.el +++ b/bang.el @@ -1,4 +1,4 @@ -;;; bang.el --- a more inteligent shell-command -*- lexical-binding: t -*- +;;; bang.el --- A more inteligent shell-command -*- lexical-binding: t -*- ;; Author: Philip K. ;; Version: 0.1.0
[elpa] externals/shell-command+ 1fb0162 27/36: bumped version
branch: externals/shell-command+ commit 1fb0162ffd2115080d4e1ddf65935277cf3c75db Author: Philip K Commit: Philip K bumped version --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 16efe48..64eb47f 100644 --- a/bang.el +++ b/bang.el @@ -1,7 +1,7 @@ ;;; bang.el --- A more intelligent shell-command -*- lexical-binding: t -*- ;; Author: Philip K. -;; Version: 1.0.1 +;; Version: 1.0.2 ;; Keywords: unix, processes, convenience ;; Package-Requires: ((emacs "24.1")) ;; URL: https://git.sr.ht/~zge/bang
[elpa] externals/shell-command+ 339931d 36/36: rename bang to shell-command+
branch: externals/shell-command+ commit 339931da79b02a83effd37363dde2ebb65141d9a Author: Philip K Commit: Philip K rename bang to shell-command+ --- README.md | 24 + bang.el | 128 - shell-command+.el | 153 ++ 3 files changed, 167 insertions(+), 138 deletions(-) diff --git a/README.md b/README.md index 7036bc5..1a51bf8 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,26 @@ `bang.el` = -`bang` is a `shell-command` substitute that makes it easier to run -commands on regions or whole buffers. This is done by potentially -interpreting the first character differently, as the `bang` docstring -explains. +`shell-command+` is a `shell-command` substitute that makes it easier +to run commands on regions or whole buffers, among other things. -Bang has been based on a function of the same name by [Leah +`shell-command+` has been based on a function named `bang` by [Leah Neukirchen][leah]. +Features + + + + How to use -- -Using [MELPA] and `use-package`, a minimal setup might look something like -this: +`shell-command+` is available from [ELPA]. It can be installed by +invoking + + M-x package-install RET shell-command+ RET - (use-package bang - :bind ("M-!" . bang)) +Bind the command `shell-command+` to any key, for example `M-!`. Bug reports and patches should be sent to my [public inbox]. @@ -27,6 +31,6 @@ Copying Domain Dedication][cc0] license. [leah]: http://leahneukirchen.org/dotfiles/.emacs -[MELPA]: https://melpa.org/#/bang +[ELPA]: http://elpa.gnu.org/packages/shell-command+.html [public inbox]: https://lists.sr.ht/~zge/public-inbox [cc0]: https://creativecommons.org/publicdomain/zero/1.0/deed diff --git a/bang.el b/bang.el deleted file mode 100644 index 50ec7b1..000 --- a/bang.el +++ /dev/null @@ -1,128 +0,0 @@ -;;; bang.el --- A sam-like shell-command -*- lexical-binding: t -*- - -;; Author: Philip K. -;; Version: 1.0.3 -;; Keywords: unix, processes, convenience -;; Package-Requires: ((emacs "24.1")) -;; URL: https://git.sr.ht/~zge/bang - -;; This file is NOT part of Emacs. -;; -;; This file is in the public domain, to the extent possible under law, -;; published under the CC0 1.0 Universal license. -;; -;; For a full copy of the CC0 license see -;; https://creativecommons.org/publicdomain/zero/1.0/legalcode - -;;; Commentary: -;; -;; Bang is a interactive `shell-command' substitute, that extends the -;; regular Emacs function by considering the first character as special. -;; Read `bang's docstring for more details. -;; -;; This version of Bang has been based on Leah Neukirchen's version, -;; though it has been internally rewritten. -;; -;; The original version can be found here: -;; https://leahneukirchen.org/dotfiles/.emacs - -(eval-when-compile (require 'rx)) - -;;; Code: - -(defgroup bang nil - "An extended `shell-command'" - :group 'external - :prefix "bang-") - -(defcustom bang-use-eshell t - "Check if there is an eshell-handler for each command." - :type 'boolean) - -(defconst bang--command-regexp - (rx bos (* space) - (? (group (or (: ?. (not (any "/"))) ?/ ?~) -(* (not space))) - (+ space)) - (or (group ?<) (group ?>) (group ?|) ?! "") - (* space) - (group (: (group (* (any alnum ?_ ?-))) -(? space)) - (+ not-newline)) - eos)) - -(defun bang-expand-path (path) - "Expand any PATH into absolute path with additional tricks. - -Furthermore, replace each sequence with three or more `.'s with a -proper upwards directory pointers. This means that '' becomes -'../../../..', and so on." - (expand-file-name - (replace-regexp-in-string -(rx (>= 2 ".")) -(lambda (sub) - (mapconcat #'identity (make-list (1- (length sub)) "..") "/")) -path))) - -;;;###autoload -(defun bang (command beg end) - "Intelligently execute string COMMAND in inferior shell. - -When COMMAND starts with - < the output of COMMAND replaces the current selection - > COMMAND is run with the current selection as input - | the current selection is filtered through COMMAND - ! COMMAND is simply executed (same as without any prefix) - -Without any argument, `bang' will behave like `shell-command'. - -Before these characters, one may also place a relative or -absolute path, which will be the current working directory in -which the command will be executed. See `bang-expand-path' for -more details on this expansion. - -Inside COMMAND, % is replaced with the current file name. To -insert a literal % quote it using a backslash. - -In case a region is active, bang will only work with the region -between BEG and END. Otherwise the whole buffer is processed." - (interactive (list (read-shell-command "Shell command: ") - (if (use-region-p) (region-beginning) (point-min)) - (if (use-regio
[elpa] externals/shell-command+ e023383 33/36: bumped version
branch: externals/shell-command+ commit e02338331463461a85144c0ce6b9b877bd3a7567 Author: Philip K Commit: Philip K bumped version --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index a1af1fe..6f282b9 100644 --- a/bang.el +++ b/bang.el @@ -1,7 +1,7 @@ ;;; bang.el --- A sam-like shell-command -*- lexical-binding: t -*- ;; Author: Philip K. -;; Version: 1.0.2 +;; Version: 1.0.3 ;; Keywords: unix, processes, convenience ;; Package-Requires: ((emacs "24.1")) ;; URL: https://git.sr.ht/~zge/bang
[elpa] externals/shell-command+ 0e0c725 35/36: simplify if-expressions where applicable
branch: externals/shell-command+ commit 0e0c7258f8ff2ca218211626ba8771fa3dd81ca9 Author: Philip K Commit: Philip K simplify if-expressions where applicable --- bang.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bang.el b/bang.el index 5fc4678..50ec7b1 100644 --- a/bang.el +++ b/bang.el @@ -116,8 +116,8 @@ between BEG and END. Otherwise the whole buffer is processed." beg end rest t t shell-command-default-error-buffer t)) ((and bang-use-eshell can-eshell) - (eshell-command rest (if current-prefix-arg t nil))) - (t (shell-command rest (if current-prefix-arg t nil) + (eshell-command rest (and current-prefix-arg t))) + (t (shell-command rest (and current-prefix-arg t) shell-command-default-error-buffer (when has-> (with-current-buffer "*Shell Command Output*"
[elpa] externals/auctex c5772e7: Release GNU AUCTeX 12.2.5
branch: externals/auctex commit c5772e7167b5231da61fbe9da3170a3b623cbf27 Author: Tassilo Horn Commit: Tassilo Horn Release GNU AUCTeX 12.2.5 * GNU AUCTeX Version 12.2.5 released. --- auctex.el | 2 +- auctex.info| 202 ++--- preview-latex.info | 78 ++--- tex-site.el| 2 +- 4 files changed, 142 insertions(+), 142 deletions(-) diff --git a/auctex.el b/auctex.el index fc9ef95..639167c 100644 --- a/auctex.el +++ b/auctex.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2014-2019 Free Software Foundation, Inc. -;; Version: 12.2.4 +;; Version: 12.2.5 ;; URL: http://www.gnu.org/software/auctex/ ;; Maintainer: auctex-de...@gnu.org ;; Notifications-To: auctex-di...@gnu.org diff --git a/auctex.info b/auctex.info index 443487d..191337f 100644 --- a/auctex.info +++ b/auctex.info @@ -1,6 +1,6 @@ This is auctex.info, produced by makeinfo version 6.7 from auctex.texi. -This manual is for AUCTeX (version 12.2.4.2020-09-25 from 2020-09-25), a +This manual is for AUCTeX (version 12.2.5 from 2020-09-25), a sophisticated TeX environment for Emacs. Copyright (C) 1992-1995, 2001, 2002, 2004-2020 Free Software @@ -5896,8 +5896,8 @@ A.1 Copying this Manual The copyright notice for this manual is: - This manual is for AUCTeX (version 12.2.4.2020-09-25 from -2020-09-25), a sophisticated TeX environment for Emacs. + This manual is for AUCTeX (version 12.2.5 from 2020-09-25), a +sophisticated TeX environment for Emacs. Copyright (C) 1992-1995, 2001, 2002, 2004-2020 Free Software Foundation, Inc. @@ -9046,104 +9046,104 @@ Concept Index Tag Table: -Node: Top928 -Node: Copying7342 -Node: Introduction9287 -Node: Summary9557 -Node: Installation12290 -Node: Prerequisites14056 -Node: Configure16296 -Node: Build/install and uninstall20922 -Node: Loading the package21675 -Node: Advice for package providers23351 -Node: Advice for non-privileged users26156 -Node: Installation under MS Windows30121 -Node: Customizing43859 -Node: Quick Start45442 -Ref: Quick Start-Footnote-147572 -Node: Editing Facilities47666 -Node: Processing Facilities52469 -Node: Editing57170 -Node: Quotes58500 -Node: Font Specifiers66753 -Node: Sectioning68820 -Node: Environments73140 -Node: Equations78294 -Node: Floats78885 -Node: Itemize-like80889 -Node: Tabular-like81610 -Node: Customizing Environments83383 -Node: Mathematics83623 -Node: Completion86909 -Node: Marking93931 -Node: Marking (LaTeX)94555 -Node: Marking (Texinfo)95497 -Node: Commenting97107 -Node: Indenting98432 -Node: Filling104468 -Node: Display110340 -Node: Font Locking112835 -Node: Fontification of macros114910 -Node: Fontification of quotes124429 -Node: Fontification of math125924 -Node: Verbatim content129592 -Node: Faces130366 -Node: Known problems130855 -Node: Folding131852 -Node: Outline142676 -Node: Narrowing143948 -Node: Prettifying145018 -Node: Processing146255 -Node: Commands147418 -Node: Starting a Command147974 -Node: Selecting a Command152877 -Node: Processor Options161961 -Node: Viewing172308 -Node: Starting Viewers172682 -Node: I/O Correlation179809 -Node: Debugging185007 -Node: Ignoring warnings187626 -Node: Error overview189686 -Node: Checking191597 -Node: Control193190 -Node: Cleaning193917 -Node: Documentation195210 -Node: Customization195925 -Node: Modes and Hooks196418 -Node: Multifile198238 -Node: Parsing Files203050 -Node: Internationalization207962 -Node: European209275 -Node: Japanese216085 -Node: Automatic221156 -Node: Automatic Global223647 -Node: Automatic Private224779 -Node: Automatic Local226092 -Node: Style Files227124 -Node: Simple Style227917 -Node: Adding Macros231576 -Node: Adding Environments240907 -Node: Adding Other245568 -Node: Hacking the Parser246155 -Node: Appendices250024 -Node: Copying this Manual250320 -Node: GNU Free Documentation License251214 -Node: Changes276335 -Node: Development323244 -Node: Mid-term Goals323890 -Node: Wishlist325747 -Node: Bugs331188 -Node: FAQ332291 -Node: Texinfo mode337418 -Node: Exploiting338554 -Node: Superseding339374 -Node: Mapping343578 -Node: Unbinding345407 -Node: Indices346228 -Node: Key Index346391 -Node: Function Index353007 -Node: Variable Index363890 -Node: Concept Index387168 +Node: Top917 +Node: Copying7331 +Node: Introduction9276 +Node: Summary9546 +Node: Installation12279 +Node: Prerequisites14045 +Node: Configure16285 +Node: Build/install and uninstall20911 +Node: Loading the package21664 +Node: Advice for package providers23340 +Node: Advice for non-privileged users26145 +Node: Installation under MS Windows30110 +Node: Customizing43848 +Node: Quick Start45431 +Ref: Quick Start-Footnote-147561 +Node: Editing Facilities47655 +Node: Processing Facilities52458 +Node: Editing57159 +Node: Quotes58489 +Node: Font Specifiers66742 +Node: Sectioning68809 +Node: Environments
[elpa] externals/shell-command+ f0a8a95 30/36: Don't interpret local binary execution as a path
branch: externals/shell-command+ commit f0a8a955b87ce7840fd1871875c452d904640c10 Author: Philip K Commit: Philip K Don't interpret local binary execution as a path --- bang.el | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bang.el b/bang.el index 931d7f4..8c25476 100644 --- a/bang.el +++ b/bang.el @@ -34,8 +34,10 @@ (defconst bang--command-regexp (rx bos (* space) - (? (group (or "." "/" "~") (* (not space))) (+ space)) - (or (group "<") (group ">") (group "|") "!" "") + (? (group (or (: ?. (not (any "/"))) ?/ ?~) +(* (not space))) + (+ space)) + (or (group ?<) (group ?>) (group ?|) ?! "") (* space) (group (+ not-newline)) eos))
[elpa] externals/auctex 2e798ee 02/30: Support \newblock macro
branch: externals/auctex commit 2e798eebedcdb11aaa7497ada9dc4747535fc2b6 Author: Arash Esbati Commit: Arash Esbati Support \newblock macro * latex.el (LaTeX-common-initialization): Add entry for \newblock marco. Add "bibindent" to list of known lengths. (LaTeX-paragraph-commands-internal): Add "newblock". --- latex.el | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/latex.el b/latex.el index db0af47..6ba4d84 100644 --- a/latex.el +++ b/latex.el @@ -4534,8 +4534,9 @@ value of NO-SUBSECTIONS." (defvar LaTeX-paragraph-commands-internal '("[" "]" ; display math "appendix" "begin" "caption" "chapter" "end" "include" "includeonly" -"label" "maketitle" "noindent" "par" "paragraph" "part" "section" -"subsection" "subsubsection" "tableofcontents" "newpage" "clearpage") +"label" "maketitle" "newblock" "noindent" "par" "paragraph" "part" +"section" "subsection" "subsubsection" "tableofcontents" +"newpage" "clearpage") "Internal list of LaTeX macros that should have their own line.") (defun LaTeX-paragraph-commands-regexp-make () @@ -6275,10 +6276,10 @@ function would return non-nil and `(match-string 1)' would return "enumiv" "footnote" "mpfootnote") (LaTeX-add-lengths "arraycolsep" "arrayrulewidth" "baselineskip" "baselinestretch" -"columnsep" "columnwidth" "doublerulesep" "evensidemargin" -"linewidth" "oddsidemargin" "paperwidth" "paperheight" -"parindent" "parskip" "tabcolsep" "textheight" "textwidth" -"topmargin" "unitlength") +"bibindent" "columnsep" "columnwidth" "doublerulesep" +"evensidemargin" "linewidth" "oddsidemargin" "paperwidth" +"paperheight" "parindent" "parskip" "tabcolsep" +"textheight" "textwidth" "topmargin" "unitlength") (TeX-add-symbols '("addtocounter" TeX-arg-counter "Value") @@ -6367,6 +6368,7 @@ function would return non-nil and `(match-string 1)' would return '("nocite" TeX-arg-cite) '("bibliographystyle" TeX-arg-bibstyle) '("bibliography" TeX-arg-bibliography) + '("newblock" (TeX-arg-literal " ")) '("footnote" (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil) t)
[elpa] externals/auctex bdf96e8 03/30: Ajust document
branch: externals/auctex commit bdf96e8b0fb3420209df039fcad2273ec8734862 Author: Ikumi Keita Commit: Ikumi Keita Ajust document * doc/preview-latex.texi (Key bindings and user-level lisp functions): * preview.el.in (preview-at-point): Delete mention about zmacs-regions. * doc/auctex.texi (Known problems): Delete comment which is no longer valid because the current highlighting of $...$ is search-based, not syntactic. --- doc/auctex.texi| 3 --- doc/preview-latex.texi | 4 ++-- preview.el.in | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/doc/auctex.texi b/doc/auctex.texi index 079179c..7eb606a 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -2385,9 +2385,6 @@ As a remedy you can make the verbatim construct known to @fontlatex{}, commented dollar sign (@samp{%$}) at the next suitable end of line as a quick workaround. In docTeX documents, @samp{^^A$} is also available for similar purpose. -@c As a last resort one can set `font-lock-keywords-only', but we should -@c probably not advise users to do this. - @node Folding @section Folding Macros and Environments diff --git a/doc/preview-latex.texi b/doc/preview-latex.texi index 67e6de7..b0c682a 100644 --- a/doc/preview-latex.texi +++ b/doc/preview-latex.texi @@ -154,8 +154,8 @@ it will run the surroundings through preview. The surroundings include all areas up to the next valid preview, unless invalid previews occur before, in which case the area will include the last such preview in either direction. And overriding any other -action, if a region is active (@code{transient-mark-mode} or -@code{zmacs-regions}), it is run through @code{preview-region}. +action, if a region is active (@code{transient-mark-mode}), it is run +through @code{preview-region}. @kindex @kbd{C-c C-p C-p} @findex preview-at-point diff --git a/preview.el.in b/preview.el.in index 1b3ed93..46fcd90 100644 --- a/preview.el.in +++ b/preview.el.in @@ -1702,8 +1702,7 @@ surroundings don't extend into unmodified previews or past contiguous previews invalidated by modifications. Overriding any other action, if a region is -active (`transient-mark-mode' or `zmacs-regions'), it is run -through `preview-region'." +active (`transient-mark-mode'), it is run through `preview-region'." (interactive) (if (TeX-active-mark) (preview-region (region-beginning) (region-end))
[elpa] externals/shell-command+ 5c01598 09/36: fixed minor checkdoc complaints
branch: externals/shell-command+ commit 5c0159804d9ebf6e401403b5bd861cfe9a8af12a Author: Philip K Commit: Philip K fixed minor checkdoc complaints --- bang.el | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bang.el b/bang.el index a109b1a..104ee3b 100644 --- a/bang.el +++ b/bang.el @@ -26,7 +26,7 @@ ;; Most of the internal code of `bang' has been rewritten for this sake. ;; ;; The original version can be found here: -;; http://leahneukirchen.org/dotfiles/.emacs +;; https://leahneukirchen.org/dotfiles/.emacs (require 'rx) @@ -66,7 +66,7 @@ (dolist (cmd bang--last-commands) (when (string-prefix-p prefix cmd) (throw 'found cmd))) -(error "no such command in history"))) +(error "No such command in history"))) (defun bang--get-command-number (arg rest) "Helper function to find ARG'th last command. @@ -106,7 +106,10 @@ When COMMAND starts with Without any argument, `bang' will behave like `shell-command'. Inside COMMAND, % is replaced with the current file name. To -insert a literal % quote it using a backslash." +insert a literal % quote it using a backslash. + +In case a region is active, bang will only work with the region +between BEG and END. Otherwise the whole buffer is processed." (interactive (list (read-shell-command "Bang command: ") (if mark-active (region-beginning) (point-min)) (if mark-active (region-end) (point-max
[elpa] externals/shell-command+ f004dfb 23/36: require at least one non-whitespace character in command
branch: externals/shell-command+ commit f004dfbe55624161aed297c3aa2a69db1c085023 Author: Philip K Commit: Philip K require at least one non-whitespace character in command --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index ed47b7f..8c91611 100644 --- a/bang.el +++ b/bang.el @@ -37,7 +37,7 @@ (? (group (or "." "/") (* (not space))) (+ space)) (or (group "<") (group ">") (group "|") "!" "") (* space) - (group (* not-newline)) + (group (+ not-newline)) eos)) (defun bang-expand-path (path)
[elpa] externals/shell-command+ a47986d 32/36: updated commentary section
branch: externals/shell-command+ commit a47986d4ba1100e901f3233320a6deadd4fd03b8 Author: Philip K Commit: Philip K updated commentary section --- bang.el | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bang.el b/bang.el index 65eba0c..a1af1fe 100644 --- a/bang.el +++ b/bang.el @@ -20,10 +20,8 @@ ;; regular Emacs function by considering the first character as special. ;; Read `bang's docstring for more details. ;; -;; This version of Bang has been based on Leah Neukirchen's version, and -;; has been (messily) extended to handle history commands (!32 for the -;; 32'nd last command, !xterm for the last command starting with xterm). -;; Most of the internal code of `bang' has been rewritten for this sake. +;; This version of Bang has been based on Leah Neukirchen's version, +;; though it has been internally rewritten. ;; ;; The original version can be found here: ;; https://leahneukirchen.org/dotfiles/.emacs
[elpa] externals/auctex 59b7942 17/30: ; Silence the compiler
branch: externals/auctex commit 59b79425187d0d31c186d10fb13289c81cce9d58 Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * latex.el: Silence the compiler for unknown functions. --- latex.el | 8 1 file changed, 8 insertions(+) diff --git a/latex.el b/latex.el index 6ba4d84..a092a01 100644 --- a/latex.el +++ b/latex.el @@ -37,6 +37,14 @@ (eval-when-compile (require 'cl-lib)) +;; Silence the compiler for functions: +(declare-function outline-level "ext:outline" + nil) +(declare-function outline-mark-subtree "ext:outline" + nil) +(declare-function turn-off-filladapt-mode "ext:filladapt" + nil) + ;;; Syntax (defvar LaTeX-optop "["
[elpa] externals/auctex a17fee2 16/30: ; Silence the compiler
branch: externals/auctex commit a17fee27b98dc37a1b384d7018a2c151bb0612ef Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * tex.el: Silence the compiler for functions. --- tex.el | 29 + 1 file changed, 29 insertions(+) diff --git a/tex.el b/tex.el index 9a1d1b6..b954eba 100644 --- a/tex.el +++ b/tex.el @@ -36,6 +36,35 @@ (eval-when-compile (require 'cl-lib)) +;; Silence the compiler for functions: +(declare-function dbus-ignore-errors "ext:dbus" + (&rest body)) +(declare-function dbus-get-unique-name "ext:dbusbind.c" + (bus)) +(declare-function dbus-ping "ext:dbus" + (bus service &optional timeout)) +(declare-function dbus-introspect-get-method "ext:dbus" + (bus service path interface method)) +(declare-function dbus-call-method "ext:dbus" + (bus service path interface method &rest args)) +(declare-function dbus-register-signal "ext:dbus" + (bus service path interface signal handler &rest args)) +(declare-function TeX-output-extension "tex-buf" + nil) +(declare-function TeX-command-expand "tex-buf" + (command file &optional list)) +(declare-function TeX-active-master "tex-buf" + (&optional extension nondirectory ignore)) +(declare-function TeX-pop-to-buffer "tex-buf" + (buffer &optional other-window norecord)) +(declare-function LaTeX-environment-list "latex" + nil) +(declare-function tex--prettify-symbols-compose-p "ext:tex-mode" + (start end match)) +;; spell-buffer was removed in 2008 in favor of ispell +(declare-function spell-buffer "ext:text-mode" + t) + (defgroup TeX-file nil "Files used by AUCTeX." :group 'AUCTeX)
[elpa] externals/shell-command+ 77989cf 26/36: renamed "Bang command" to "Shell command"
branch: externals/shell-command+ commit 77989cf36d58c2e41d3b3cfc5adb9bb5345a875e Author: Philip K Commit: Philip K renamed "Bang command" to "Shell command" --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 9245057..16efe48 100644 --- a/bang.el +++ b/bang.el @@ -74,7 +74,7 @@ insert a literal % quote it using a backslash. In case a region is active, bang will only work with the region between BEG and END. Otherwise the whole buffer is processed." - (interactive (list (read-shell-command "Bang command: ") + (interactive (list (read-shell-command "Shell command: ") (if (use-region-p) (region-beginning) (point-min)) (if (use-region-p) (region-end) (point-max (save-match-data
[elpa] externals/auctex dd7f844 12/30: Add support of \tag for texmathp
branch: externals/auctex commit dd7f8446ca6eb98ce0c633652e8f764c40f033e2 Author: Ikumi Keita Commit: Ikumi Keita Add support of \tag for texmathp * style/amsmath.el (): Add entries for \tag and \tag* to `texmathp-tex-commands-default'. ; Add supplementary comment. --- style/amsmath.el | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/style/amsmath.el b/style/amsmath.el index 0fd9817..2179d57 100644 --- a/style/amsmath.el +++ b/style/amsmath.el @@ -46,7 +46,11 @@ ("alignat" env-on) ("alignat*" env-on) ("xalignat" env-on) ("xalignat*" env-on) ("xxalignat" env-on) ("\\boxed" arg-on) - ("\\text"arg-off) ("\\intertext" arg-off + ;; In fact, \text macro is provided separately in + ;; amstext.sty, not amsmath.sty. However, it would be + ;; reasonable enough to include support for it here. + ("\\text"arg-off) ("\\intertext" arg-off) + ("\\tag" arg-off) ("\\tag*"arg-off (dolist (entry list) (cl-pushnew entry texmathp-tex-commands-default :test #'equal))) (texmathp-compile)
[elpa] externals/auctex 07b79fc 24/30: ; Silence the compiler
branch: externals/auctex commit 07b79fca8bf7114981605748735594d7b1eff0a5 Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * bib-cite.el: Declare external functions. (bib-find-next): Check if `xref-find-definitions' is available and use it instead of `find-tag'. * context.el: defvar `ConTeXt-extra-paragraph-commands'. (ConTeXt-numbered-section-heading) (ConTeXt-unnumbered-section-heading, ConTeXt-section-title) (ConTeXt-section-section, ConTeXt-section-ref): Wrap code in `with-no-warnings' in order to suppress warnings for dynamically scoped variables `reference', `title', `name' and `level'. * tex-bar.el (TeX-bar-TeX-buttons, TeX-bar-LaTeX-buttons): Move functions after `defcustom' forms. * tex-info.el: defvar `reftex-label-alist-builtin'. --- bib-cite.el | 19 ++-- context.el | 94 tex-bar.el | 100 ++-- tex-info.el | 1 + 4 files changed, 113 insertions(+), 101 deletions(-) diff --git a/bib-cite.el b/bib-cite.el index d871cb0..8d346c3 100644 --- a/bib-cite.el +++ b/bib-cite.el @@ -592,6 +592,14 @@ (eval-when-compile (require 'cl-lib)) +;; Silence the compiler: +(declare-function dired-replace-in-string "ext:dired" + (regexp newtext string)) +(declare-function dired-split "ext:dired-aux" + (pat str &optional limit)) +(declare-function reftex-view-crossref "ext:reftex-dcr" + (&optional arg auto-how fail-quietly)) + (defgroup bib-cite nil "bib-cite, LaTeX minor-mode to display \\cite, \\ref and \\label commands." :group 'tex) @@ -973,9 +981,14 @@ documents, and the Emacs command `find-tag' doesn't allow to interactively find the next occurrence of a regexp." (interactive "P") (if (bib-master-file) ;Multi-file document - (if prev-p - (find-tag t '- t) - (find-tag t t t)) + ;; FIXME: This check for `xref-find-definitions' should be + ;; removed once AUCTeX requires Emacs >= 25.1 + (let ((func (if (fboundp 'xref-find-definitions) + 'xref-find-definitions + 'find-tag))) + (if prev-p + (funcall func t '- t) + (funcall func t t t))) (if bib-cite-search-ring ;;FIXME: Should first make sure I move off initial \ref{}. (let ((regexp (concat bib-ref-regexpc bib-cite-search-ring "}"))) diff --git a/context.el b/context.el index 87bcd38..0d65249 100644 --- a/context.el +++ b/context.el @@ -55,6 +55,9 @@ (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-" @@ -64,19 +67,10 @@ ;;; variables -;; Dynamically scoped vars used in certain macro's. -;; BEWARE: We used to give them a global nil value, but this can mess up poor -;; unrelated packages using those same vars but expecting them to be -;; lexically scoped. -;; So don't give them a global value, which makes sure the effect of `defvar' -;; localized to this file! -(defvar done-mark) ;Position of point afterwards, default nil (meaning end) - -(defvar reference);Used by `ConTeXt-section-ref' and `ConTeXt-section-section'. - -(defvar title); Used by `ConTeXt-section-title' and `ConTeXt-section-section'. -(defvar name) -(defvar level) +;; Dynamically scoped vars used in certain macro's. `done-mark' is +;; marked special; `reference', `title', `name' and `level' are +;; pacified via `with-no-warnings' in the respective functions. +(defvar done-mark) ; Position of point afterwards, default nil (meaning end) ;; others @@ -507,49 +501,53 @@ in your .emacs file." "Hook to prompt for ConTeXt section name. Insert this hook into `ConTeXt-numbered-section-hook' to allow the user to change the name of the sectioning command inserted with `\\[ConTeXt-section]'." - (let ((string (completing-read -(concat "Select level (default " name "): ") -ConTeXt-numbered-section-list -nil nil nil))) -;; Update name -(if (not (zerop (length string))) - (setq name string + (with-no-warnings +(let ((string (completing-read + (concat "Select level (default " name "): ") + ConTeXt-numbered-section-list + nil nil nil))) + ;; Update name + (if (not (zerop (length string))) + (setq name string) (defun ConTeXt-unnumbered-section-heading () "Hook to prompt for ConTeXt section name. Insert this hook into `ConTeXt-unnumbered-section-hook' to allow the user to change the name of the sectioning command inserted with `\\[ConTeXt-section]'." - (let ((string (completi
[elpa] externals/shell-command+ 57afacb 01/36: initial export
branch: externals/shell-command+ commit 57afacb82ae40ee97da953d844e18800554909b6 Author: Philip K Commit: Philip K initial export --- bang.el | 113 1 file changed, 113 insertions(+) diff --git a/bang.el b/bang.el new file mode 100644 index 000..8658ab6 --- /dev/null +++ b/bang.el @@ -0,0 +1,113 @@ +;;; -*- lexical-binding: t -*- +;;; published under CC0 into the public domain +;;; author: philip k. [https://zge.us.to], 2019 +;;; +;;; based on bang from http://chneukirchen.org/dotfiles/.emacs + +(require 'rx) + +(defconst bang--command-regexp + (rx bos (* space) + (or (seq (group "!" ) + (or (group (+ digit)) + (group (+ alnum + (group "<") (group ">") (group "|") "") + (? (* space) +(group (* not-newline) + (not space) + (*? not-newline))) + eos) + "Regular expression to parse input to `bang'.") + +(defvar bang--last-commands '() + "List of non-history commands last executed by `bang'.") + +(defvar bang-history-size 80 + "Number of commands to save in `bang--last-commands'.") + +(defun bang--remember-command (command) + (push command bang--last-commands) + (let ((overflow (- (length bang--last-commands) +bang-history-size))) + (when (> overflow 0) + (setq bang--last-commands + (nbutlast bang--last-commands overflow) + +(defun bang--find-last-command (prefix) + (catch 'found + (dolist (cmd bang--last-commands) + (when (string-prefix-p prefix cmd) + (throw 'found cmd))) + (error "no such command in history"))) + +(defun bang--get-command-number (arg rest) + (let* ((num (string-to-number arg)) +(pos (- (length bang--last-commands) +(1- num))) +(cmd (nth pos bang--last-commands))) + (concat cmd " " rest))) + +(defun bang-history () + "Display a buffer with overview of previous bang commands." + (interactive) + (let ((buf (get-buffer-create "*bang-history*")) + (i (length bang--last-commands))) + (with-current-buffer buf + (setq buffer-read-only nil) + (delete-region (goto-char (point-min)) +(point-max)) + (dolist (cmd bang--last-commands) + (insert (format "%d\t%s\n" i cmd)) + (setq i (1- i))) + (special-mode)) + (pop-to-buffer buf))) + +(defun bang (command beg end) + "Intelligently execute string COMMAND in inferior shell, like +with `shell-command'. + +When COMMAND starts with + < the output of COMMAND replaces the current selection + > COMMAND is run with the current selection as input + | the current selection is filtered through COMMAND + ! executes the last command that started with COMMAND, + or if a number, re-execute nth last command + +Without any argument, `bang' will behave like `shell-command'. + +Inside COMMAND, % is replaced with the current file name. To +insert a literal % quote it using a backslash." + (interactive (list (read-shell-command "Bang command: ") +(if mark-active (region-beginning) (point-min)) +(if mark-active (region-end) (point-max + (save-match-data + (unless (string-match bang--command-regexp command) + (error "Invalid command")) + (let ((has-! (match-string-no-properties 1 command)) + (num-! (match-string-no-properties 2 command)) + (arg-! (match-string-no-properties 3 command)) + (has-< (match-string-no-properties 4 command)) + (has-> (match-string-no-properties 5 command)) + (has-| (match-string-no-properties 6 command)) + (rest (match-string-no-properties 7 command))) + (cond (arg-! (bang (bang--find-last-command arg-!) +beg end)) + (num-! (bang (bang--get-command-number num-! rest) +beg end)) + (has-< (delete-region beg end) + (shell-command rest t shell-command-default-error-buffer) + (exchange-point-and-mark)) + (has-> (shell-command-on-region + beg end rest nil nil + shell-command-default-error-buffer t)) + (has-| (shell-command-on-region + beg end rest t t + shell-command-default-error-buffer t)) + (t (shell-command command nil shell-command-default-error-buff
[elpa] externals/shell-command+ 9350393 19/36: fixed critical bug when no path was specified
branch: externals/shell-command+ commit 93503930c1b73b270b924314d88ddc1fba2c605e Author: Philip K Commit: Philip K fixed critical bug when no path was specified --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 57cfe4d..9160823 100644 --- a/bang.el +++ b/bang.el @@ -91,7 +91,7 @@ between BEG and END. Otherwise the whole buffer is processed." (match-string-no-properties 5 command) nil nil 1) (error (match-string-no-properties 5 command) - (let ((default-directory (bang-expand-path path))) + (let ((default-directory (bang-expand-path (or path "." (cond (has-< (delete-region beg end) (shell-command rest t shell-command-default-error-buffer) (exchange-point-and-mark))
[elpa] externals/shell-command+ 8758933 24/36: removed trailing whitespace
branch: externals/shell-command+ commit 87589331a8f0850a46964dbdbdcc3f2191b03376 Author: Philip K Commit: Philip K removed trailing whitespace --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 8c91611..0af733f 100644 --- a/bang.el +++ b/bang.el @@ -7,7 +7,7 @@ ;; URL: https://git.sr.ht/~zge/bang ;; This file is NOT part of Emacs. -;; +;; ;; This file is in the public domain, to the extent possible under law, ;; published under the CC0 1.0 Universal license. ;;
[AUCTeX-diffs] [elpa] externals/auctex 1bc7a21 30/30: ; Regenerate docs
branch: externals/auctex commit 1bc7a21b8a6dd953ba4557365bcc7efd56a8d161 Author: Tassilo Horn Commit: Tassilo Horn ; Regenerate docs --- auctex.info| 227 ++--- preview-latex.info | 92 +++--- tex-site.el| 10 +-- 3 files changed, 163 insertions(+), 166 deletions(-) diff --git a/auctex.info b/auctex.info index a07a069..443487d 100644 --- a/auctex.info +++ b/auctex.info @@ -1,6 +1,6 @@ This is auctex.info, produced by makeinfo version 6.7 from auctex.texi. -This manual is for AUCTeX (version 12.2.4 from 2020-06-29), a +This manual is for AUCTeX (version 12.2.4.2020-09-25 from 2020-09-25), a sophisticated TeX environment for Emacs. Copyright (C) 1992-1995, 2001, 2002, 2004-2020 Free Software @@ -3013,8 +3013,7 @@ built-in and not customizable. Support for other math macros and environments can be adapted by customizing the variables 'font-latex-match-math-command-keywords' and 'texmathp-tex-commands' respectively. It is no longer recommended to customize -'font-latex-math-environments', which is initialized according to -'texmathp-tex-commands' and 'texmathp-tex-commands-default' by default. +'font-latex-math-environments'. To convert your customization in 'font-latex-math-environments' into 'texmathp-tex-commands', please register your own math environments, @@ -5897,8 +5896,8 @@ A.1 Copying this Manual The copyright notice for this manual is: - This manual is for AUCTeX (version 12.2.4 from 2020-06-29), a -sophisticated TeX environment for Emacs. + This manual is for AUCTeX (version 12.2.4.2020-09-25 from +2020-09-25), a sophisticated TeX environment for Emacs. Copyright (C) 1992-1995, 2001, 2002, 2004-2020 Free Software Foundation, Inc. @@ -6407,6 +6406,13 @@ A.2 Changes and New Features News in 12.3 + * Support for 'PSTricks' is now PDF-oriented. AUCTeX no longer turns + off PDF mode for 'PSTricks' documents even without 'pst-pdf'. It + now sets up 'TeX-PDF-from-DVI' option so that PDF output is + generated when 'TeX-PDF-mode' is enabled (default). Users who want + DVI output should disable PDF mode explicitly by file local + variable, or customize 'TeX-PDF-mode' to 'nil'. + * The function 'font-latex-update-font-lock' has been obsoleted in order to fix 'bug#37945'. That function was used by several style files in order to refresh fontification after adding new symbols or @@ -6429,14 +6435,7 @@ News in 12.3 In addition, it is no longer recommended to customize 'font-latex-math-environments'. Use 'texmathp-tex-commands' instead. *Note Fontification of math::. - * Support for highlighting and in-math state detection for AMS-LaTeX - specific environments, such as 'align', 'gather' and 'multline', - are refactored and put into style file 'amsmath.el'. So these - support are available only when 'TeX-parse-self' option is enabled. - - Support for in-math state detection for packages mathtools, empheq - and breqn is also moved into the respective style files, so - available only when 'TeX-parse-self' option is enabled. + * AUCTeX tracks changes in LaTeX2e 2020-02-02 release. AUCTeX supports the improvements to LaTeX font selection mechanism (NFSS). New macros like '\textsw' or '\textulc' are added to font insertion @@ -8349,9 +8348,9 @@ Variable Index * font-latex-deactivated-keyword-classes: Fontification of macros. (line 162) * font-latex-fontify-script: Fontification of math. - (line 29) + (line 28) * font-latex-fontify-script-max-level: Fontification of math. - (line 43) + (line 42) * font-latex-fontify-sectioning: Fontification of macros. (line 95) * font-latex-match-bold-command-keywords: Fontification of macros. @@ -8399,7 +8398,7 @@ Variable Index * font-latex-quotes: Fontification of quotes. (line 15) * font-latex-script-display: Fontification of math. - (line 67) + (line 66) * font-latex-sectioning-0-face: Fontification of macros. (line 96) * font-latex-sectioning-1-face: Fontification of macros. @@ -9047,104 +9046,104 @@ Concept Index Tag Table: -Node: Top917 -Node: Copying7331 -Node: Introduction9276 -Node: Summary9546 -Node: Installation12279 -N
[elpa] externals/shell-command+ ab6bb0e 18/36: reworked `.' command
branch: externals/shell-command+ commit ab6bb0e260ba40315ff22ff9641562d29f7f9ac5 Author: Philip K Commit: Philip K reworked `.' command --- bang.el | 70 + 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/bang.el b/bang.el index 8907f37..57cfe4d 100644 --- a/bang.el +++ b/bang.el @@ -32,6 +32,27 @@ ;;; Code: +(defconst bang--command-regexp + (rx bos (* space) + (? (group (or "." "/") (* (not space))) (+ space)) + (or (group "<") (group ">") (group "|") "!" "") + (* space) + (group (* not-newline)) + eos)) + +(defun bang-expand-path (path) + "Expand any PATH into absolute path with additional tricks. + +Furthermore, replace each sequence with three or more `.'s with a +proper upwards directory pointers. This means that '' becomes +'../../../..', and so on." + (expand-file-name + (replace-regexp-in-string +(rx (>= 2 ".")) +(lambda (sub) + (mapconcat #'identity (make-list (1- (length sub)) "..") "/")) +path))) + (defun bang (command beg end) "Intelligently execute string COMMAND in inferior shell. @@ -39,10 +60,15 @@ When COMMAND starts with < the output of COMMAND replaces the current selection > COMMAND is run with the current selection as input | the current selection is filtered through COMMAND - . COMMAND executes in the relative path following the dot + ! COMMAND is simply executed (same as without any prefix) Without any argument, `bang' will behave like `shell-command'. +Before these characters, one may also place a relative or +absolute path, which will be the current working directory in +which the command will be executed. See `bang-expand-path' for +more details on this expansion. + Inside COMMAND, % is replaced with the current file name. To insert a literal % quote it using a backslash. @@ -52,18 +78,12 @@ between BEG and END. Otherwise the whole buffer is processed." (if (use-region-p) (region-beginning) (point-min)) (if (use-region-p) (region-end) (point-max (save-match-data -(unless (string-match (rx bos (* space) - (or (group "<") (group ">") (group "|") - (group "." (* (not space))) "") - (* space) - (group (* not-newline)) - eos) - command) +(unless (string-match bang--command-regexp command) (error "Invalid command")) -(let ((has-< (match-string-no-properties 1 command)) - (has-> (match-string-no-properties 2 command)) - (has-| (match-string-no-properties 3 command)) - (has-. (match-string-no-properties 4 command)) +(let ((path (match-string-no-properties 1 command)) + (has-< (match-string-no-properties 2 command)) + (has-> (match-string-no-properties 3 command)) + (has-| (match-string-no-properties 4 command)) (rest (condition-case nil (replace-regexp-in-string (rx (* ?\\ ?\\) (or ?\\ (group "%"))) @@ -71,20 +91,18 @@ between BEG and END. Otherwise the whole buffer is processed." (match-string-no-properties 5 command) nil nil 1) (error (match-string-no-properties 5 command) - (cond (has-< (delete-region beg end) - (shell-command rest t shell-command-default-error-buffer) - (exchange-point-and-mark)) -(has-> (shell-command-on-region -beg end rest nil nil -shell-command-default-error-buffer t)) -(has-| (shell-command-on-region -beg end rest t t -shell-command-default-error-buffer t)) -(has-. (let ((default-directory (expand-file-name has-.))) - (shell-command rest (if current-prefix-arg t nil) -shell-command-default-error-buffer))) -(t (shell-command command (if current-prefix-arg t nil) - shell-command-default-error-buffer))) + (let ((default-directory (bang-expand-path path))) +(cond (has-< (delete-region beg end) + (shell-command rest t shell-command-default-error-buffer) + (exchange-point-and-mark)) + (has-> (shell-command-on-region + beg end rest nil nil + shell-command-default-error-buffer t)) + (has-| (shell-command-on-region + beg end rest t t + shell-command-default-error-buffer t)) + (t (shell-command command (if current-prefix-arg t nil) +shell-command-default-error-buffer (when has-> (with-current-buffer "*Shell Comma
[elpa] externals/auctex 0692e51 23/30: ; Silence the compiler
branch: externals/auctex commit 0692e5139a1f3a2b7d341332cc02d481faa4dab2 Author: Arash Esbati Commit: Arash Esbati ; Silence the compiler * latex.el: defvar the variables `outline-heading-alist', `TeX-auto-file' and `LaTeX-section-list-changed'. (LaTeX-section-heading, LaTeX-section-title, LaTeX-section-toc) (LaTeX-section-section, LaTeX-section-label): Use `with-no-warnings' in order to silence the compiler for dynamically scoped variables `title', `name', `level' and `toc'. --- latex.el | 76 ++-- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/latex.el b/latex.el index a092a01..2e9e848 100644 --- a/latex.el +++ b/latex.el @@ -45,6 +45,11 @@ (declare-function turn-off-filladapt-mode "ext:filladapt" nil) +;; Silence the compiler for variables: +(defvar outline-heading-alist) +(defvar TeX-auto-file) +(defvar LaTeX-section-list-changed) + ;;; Syntax (defvar LaTeX-optop "[" @@ -121,12 +126,8 @@ This depends on `LaTeX-insert-into-comments'." ;;; Sections -;; Declare dynamically scoped vars. -(defvar title) -(defvar name) -(defvar level) +;; Declare dynamically scoped var. (defvar done-mark) -(defvar toc) (defun LaTeX-section (arg) "Insert a template for a LaTeX section. @@ -449,32 +450,35 @@ no label is inserted." "Hook to prompt for LaTeX section name. Insert this hook into `LaTeX-section-hook' to allow the user to change the name of the sectioning command inserted with `\\[LaTeX-section]'." - (let ((string (completing-read -(concat "Level (default " name "): ") -LaTeX-section-list -nil nil nil nil name))) -;; Update name -(if (not (zerop (length string))) - (setq name string)) -;; Update level -(setq level (LaTeX-section-level name + (with-no-warnings +(let ((string (completing-read + (concat "Level (default " name "): ") + LaTeX-section-list + nil nil nil nil name))) + ;; Update name + (if (not (zerop (length string))) + (setq name string)) + ;; Update level + (setq level (LaTeX-section-level name) (defun LaTeX-section-title () "Hook to prompt for LaTeX section title. Insert this hook into `LaTeX-section-hook' to allow the user to change the title of the section inserted with `\\[LaTeX-section]." - (setq title (TeX-read-string "Title: " title)) - (let ((region (and (TeX-active-mark) -(cons (region-beginning) (region-end) -(when region (delete-region (car region) (cdr region) + (with-no-warnings +(setq title (TeX-read-string "Title: " title)) +(let ((region (and (TeX-active-mark) + (cons (region-beginning) (region-end) + (when region (delete-region (car region) (cdr region)) (defun LaTeX-section-toc () "Hook to prompt for the LaTeX section entry in the table of content . Insert this hook into `LaTeX-section-hook' to allow the user to insert a different entry for the section in the table of content." - (setq toc (TeX-read-string "Toc Entry: ")) - (if (zerop (length toc)) - (setq toc nil))) + (with-no-warnings +(setq toc (TeX-read-string "Toc Entry: ")) +(if (zerop (length toc)) + (setq toc nil (defun LaTeX-section-section () "Hook to insert LaTeX section command into the file. @@ -491,18 +495,19 @@ assume that the section is already inserted." "begin") (line-beginning-position 0) t)) (LaTeX-newline)) - (insert TeX-esc name) - (cond ((null toc)) - ((zerop (length toc)) -(insert LaTeX-optop) -(set-marker done-mark (point)) -(insert LaTeX-optcl)) - (t -(insert LaTeX-optop toc LaTeX-optcl))) - (insert TeX-grop) - (if (zerop (length title)) - (set-marker done-mark (point))) - (insert title TeX-grcl) + (with-no-warnings +(insert TeX-esc name) +(cond ((null toc)) + ((zerop (length toc)) + (insert LaTeX-optop) + (set-marker done-mark (point)) + (insert LaTeX-optcl)) + (t + (insert LaTeX-optop toc LaTeX-optcl))) +(insert TeX-grop) +(if (zerop (length title)) + (set-marker done-mark (point))) +(insert title TeX-grcl)) (LaTeX-newline) ;; If RefTeX is available, tell it that we've just made a new section (and (fboundp 'reftex-notice-new-section) @@ -514,8 +519,9 @@ Insert this hook into `LaTeX-section-hook' to prompt for a label to be inserted after the sectioning command. The behaviour of this hook is controlled by variable `LaTeX-section-label'." - (and (LaTeX-label name 'section) - (LaTeX-newline))) + (with-no-warnings +(and (LaTeX-label name 'section) +(LaTeX-newline ;;; Environments
[elpa] externals/shell-command+ 5e3def9 04/36: Fixed packaging issues and mistakes
branch: externals/shell-command+ commit 5e3def90d56a2418767d052026f042d3220d206e Author: Philip K Commit: Philip K Fixed packaging issues and mistakes --- bang.el | 46 +++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/bang.el b/bang.el index 2c29a76..068fed9 100644 --- a/bang.el +++ b/bang.el @@ -1,11 +1,37 @@ -;;; -*- lexical-binding: t -*- -;;; published under CC0 into the public domain -;;; author: philip k. [https://zge.us.to], 2019 -;;; -;;; based on bang from http://chneukirchen.org/dotfiles/.emacs +;;; bang.el --- a more inteligent shell-command -*- lexical-binding: t -*- + +;; Author: Philip K. +;; Version: 0.1.0 +;; Keywords: unix, processes, convenience +;; Package-Requires: ((emacs "24.1") (cl-lib "0.5")) +;; URL: https://git.sr.ht/~zge/bang + +;; This file is NOT part of Emacs. +;; +;; This file is in the public domain, to the extent possible under law, +;; published under the CC0 1.0 Universal license. +;; +;; For a full copy of the CC0 license see +;; https://creativecommons.org/publicdomain/zero/1.0/legalcode + +;;; Commentary: +;; +;; Bang is a interactive `shell-command' substitute, that extends the +;; regular Emacs function by considering the first character as special. +;; Read `bang's docstring for more details. +;; +;; This version of Bang has been based on Leah Neukirchen's version, and +;; has been (messily) extended to handle history commands (!32 for the +;; 32'nd last command, !xterm for the last command starting with xterm). +;; Most of the internal code of `bang' has been rewritten for this sake. +;; +;; The original version can be found here: +;; http://leahneukirchen.org/dotfiles/.emacs (require 'rx) +;;; Code: + (defconst bang--command-regexp (rx bos (* space) (or (seq (group "!" ) @@ -26,6 +52,7 @@ "Number of commands to save in `bang--last-commands'.") (defun bang--remember-command (command) + "Helper function to save COMMAND in bang's history." (push command bang--last-commands) (let ((overflow (- (length bang--last-commands) bang-history-size))) @@ -34,6 +61,7 @@ (nbutlast bang--last-commands overflow) (defun bang--find-last-command (prefix) + "Helper function to find last command that started with PREFIX." (catch 'found (dolist (cmd bang--last-commands) (when (string-prefix-p prefix cmd) @@ -41,6 +69,9 @@ (error "no such command in history"))) (defun bang--get-command-number (arg rest) + "Helper function to find ARG'th last command. + +Second argument REST will be concatenated to what was found." (let* ((num (string-to-number arg)) (pos (- (length bang--last-commands) (1- num))) @@ -63,8 +94,7 @@ (pop-to-buffer buf))) (defun bang (command beg end) - "Intelligently execute string COMMAND in inferior shell, like -with `shell-command'. + "Intelligently execute string COMMAND in inferior shell. When COMMAND starts with < the output of COMMAND replaces the current selection @@ -111,3 +141,5 @@ insert a literal % quote it using a backslash." (bang--remember-command command) (provide 'bang) + +;;; bang.el ends here
[elpa] externals/shell-command+ bed12c8 11/36: minor code cleanup
branch: externals/shell-command+ commit bed12c8f17dc488c9ac0283e662cf57b64c0b113 Author: Philip K Commit: Philip K minor code cleanup --- bang.el | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bang.el b/bang.el index 7037471..8713526 100644 --- a/bang.el +++ b/bang.el @@ -3,7 +3,7 @@ ;; Author: Philip K. ;; Version: 0.1.0 ;; Keywords: unix, processes, convenience -;; Package-Requires: ((emacs "24.1") (cl-lib "0.5")) +;; Package-Requires: ((emacs "24.1") (seq "2.20")) ;; URL: https://git.sr.ht/~zge/bang ;; This file is NOT part of Emacs. @@ -29,6 +29,7 @@ ;; https://leahneukirchen.org/dotfiles/.emacs (require 'rx) +(require 'seq) ;;; Code: @@ -62,11 +63,9 @@ (defun bang--find-last-command (prefix) "Helper function to find last command that started with PREFIX." - (catch 'found -(dolist (cmd bang--last-commands) - (when (string-prefix-p prefix cmd) -(throw 'found cmd))) -(error "No such command in history"))) + (or (seq-find (apply-partially #'string-prefix-p prefix) +bang--last-commands) + (error "No such command in history"))) (defun bang--get-command-number (arg rest) "Helper function to find ARG'th last command. @@ -111,8 +110,8 @@ insert a literal % quote it using a backslash. In case a region is active, bang will only work with the region between BEG and END. Otherwise the whole buffer is processed." (interactive (list (read-shell-command "Bang command: ") - (if mark-active (region-beginning) (point-min)) - (if mark-active (region-end) (point-max + (if (use-region-p) (region-beginning) (point-min)) + (if (use-region-p) (region-end) (point-max (save-match-data (unless (string-match bang--command-regexp command) (error "Invalid command"))
[elpa] externals/shell-command+ d60c01f 22/36: required rx while compiling
branch: externals/shell-command+ commit d60c01f4102134fa207d833bcc47250f75e2e9bf Author: Philip K Commit: Philip K required rx while compiling --- bang.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bang.el b/bang.el index 9e17bca..ed47b7f 100644 --- a/bang.el +++ b/bang.el @@ -28,7 +28,7 @@ ;; The original version can be found here: ;; https://leahneukirchen.org/dotfiles/.emacs -(require 'rx) +(eval-when-compile (require 'rx)) ;;; Code:
[elpa] externals/shell-command+ 984dc25: * shell-command+.el: Add copyright notice and change license to GPLv3+
branch: externals/shell-command+ commit 984dc250333ee5efb6a166c0316cc498e382657e Author: Stefan Monnier Commit: Stefan Monnier * shell-command+.el: Add copyright notice and change license to GPLv3+ * .gitignore: New file. * LICENSE: Delete file. --- .gitignore| 3 ++ LICENSE | 121 -- shell-command+.el | 21 ++ 3 files changed, 17 insertions(+), 128 deletions(-) diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..f680f21 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/shell-command+-autoloads.el +/shell-command+-pkg.el +*.elc diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 0e259d4..000 --- a/LICENSE +++ /dev/null @@ -1,121 +0,0 @@ -Creative Commons Legal Code - -CC0 1.0 Universal - -CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE -LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN -ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS -INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES -REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS -PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM -THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED -HEREUNDER. - -Statement of Purpose - -The laws of most jurisdictions throughout the world automatically confer -exclusive Copyright and Related Rights (defined below) upon the creator -and subsequent owner(s) (each and all, an "owner") of an original work of -authorship and/or a database (each, a "Work"). - -Certain owners wish to permanently relinquish those rights to a Work for -the purpose of contributing to a commons of creative, cultural and -scientific works ("Commons") that the public can reliably and without fear -of later claims of infringement build upon, modify, incorporate in other -works, reuse and redistribute as freely as possible in any form whatsoever -and for any purposes, including without limitation commercial purposes. -These owners may contribute to the Commons to promote the ideal of a free -culture and the further production of creative, cultural and scientific -works, or to gain reputation or greater distribution for their Work in -part through the use and efforts of others. - -For these and/or other purposes and motivations, and without any -expectation of additional consideration or compensation, the person -associating CC0 with a Work (the "Affirmer"), to the extent that he or she -is an owner of Copyright and Related Rights in the Work, voluntarily -elects to apply CC0 to the Work and publicly distribute the Work under its -terms, with knowledge of his or her Copyright and Related Rights in the -Work and the meaning and intended legal effect of CC0 on those rights. - -1. Copyright and Related Rights. A Work made available under CC0 may be -protected by copyright and related or neighboring rights ("Copyright and -Related Rights"). Copyright and Related Rights include, but are not -limited to, the following: - - i. the right to reproduce, adapt, distribute, perform, display, - communicate, and translate a Work; - ii. moral rights retained by the original author(s) and/or performer(s); -iii. publicity and privacy rights pertaining to a person's image or - likeness depicted in a Work; - iv. rights protecting against unfair competition in regards to a Work, - subject to the limitations in paragraph 4(a), below; - v. rights protecting the extraction, dissemination, use and reuse of data - in a Work; - vi. database rights (such as those arising under Directive 96/9/EC of the - European Parliament and of the Council of 11 March 1996 on the legal - protection of databases, and under any national implementation - thereof, including any amended or successor version of such - directive); and -vii. other similar, equivalent or corresponding rights throughout the - world based on applicable law or treaty, and any national - implementations thereof. - -2. Waiver. To the greatest extent permitted by, but not in contravention -of, applicable law, Affirmer hereby overtly, fully, permanently, -irrevocably and unconditionally waives, abandons, and surrenders all of -Affirmer's Copyright and Related Rights and associated claims and causes -of action, whether now known or unknown (including existing as well as -future claims and causes of action), in the Work (i) in all territories -worldwide, (ii) for the maximum duration provided by applicable law or -treaty (including future time extensions), (iii) in any current or future -medium and for any number of copies, and (iv) for any purpose whatsoever, -including without limitation commercial, advertising or promotional -purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each -member of the public at large and to the detriment of Affirmer's heirs and -successors, fully intending that
[elpa] master 78c650b: * externals-list: New package `shell-command+`
branch: master commit 78c650b94ef6f2f64c43f64fb9c944da8d863ed6 Author: Stefan Monnier Commit: Stefan Monnier * externals-list: New package `shell-command+` --- externals-list | 1 + 1 file changed, 1 insertion(+) diff --git a/externals-list b/externals-list index 8fdbf76..5590116 100644 --- a/externals-list +++ b/externals-list @@ -150,6 +150,7 @@ ("rt-liberation" :external "https://git.savannah.nongnu.org/git/rtliber";) ("rudel" :external nil) ;; Was bzr::bzr://rudel.bzr.sourceforge.net/bzrroot/rudel/trunk ("scanner":external "https://gitlab.com/rstocker/scanner.git";) + ("shell-command+" :external "https://git.sr.ht/~zge/bang/tree/shell-command+";) ("smalltalk-mode" :external "git://git.sv.gnu.org/smalltalk") ("so-long" :core "lisp/so-long.el") ("soap-client":core ("lisp/net/soap-client.el" "lisp/net/soap-inspect.el"))
[elpa] master e43b040 5/6: Excorporate: Add timeout for synchronous operations
branch: master commit e43b0407de0e60be91ebb6bf091583919cb485a9 Author: Thomas Fitzsimmons Commit: Thomas Fitzsimmons Excorporate: Add timeout for synchronous operations * excorporate.el (exco--server-timeout): New variable. (exco-operate-synchronously): Use exco--server-timeout. (exco-organizer-smtp-email-address): Likewise. Document synchronous operation. --- packages/excorporate/excorporate.el | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/excorporate/excorporate.el b/packages/excorporate/excorporate.el index 84c404c..b068121 100644 --- a/packages/excorporate/excorporate.el +++ b/packages/excorporate/excorporate.el @@ -137,6 +137,9 @@ state machine represents a service connection.") (defvar exco--connection-identifiers nil "An ordered list of connection identifiers.") +(defvar exco--server-timeout 5 + "The timeout in seconds to wait for a synchronous server response.") + (defun exco--parse-xml-in-current-buffer () "Decode and parse the XML contents of the current buffer." (let ((mime-part (mm-dissect-buffer t t))) @@ -648,7 +651,8 @@ IDENTIFIER is the connection identifier. Execute operation NAME with ARGUMENTS then call CALLBACK with two arguments, IDENTIFIER and the server's response." (exco--with-fsm identifier -(fsm-call fsm (list name arguments +(with-timeout (exco--server-timeout (error "Timed out waiting for server")) + (fsm-call fsm (list name arguments) (defun exco-server-version (identifier) "Return the server version for connection IDENTIFIER, as a string. @@ -867,7 +871,11 @@ argument ICALENDAR-TEXT." "Return the organizer's SMTP email address as a string. IDENTIFIER is the connection identifier to use to resolve ORGANIZER-STRUCTURE to the returned value. ORGANIZER-STRUCTURE -should be treated as opaque." +should be treated as opaque. + +This function queries the server synchronously. It times out and +returns nil if the server does not respond in under +`exco--server-timeout' seconds." (let* ((wrapped (list (list organizer-structure))) (routing-type (exco-extract-value '(Organizer Mailbox RoutingType) wrapped)) @@ -883,10 +891,11 @@ should be treated as opaque." Mailbox EmailAddress) (with-timeout - (2 (progn - (message (concat "exco-organizer-smtp-email-address:" -" Server did not respond in time")) - nil)) + (exco--server-timeout + (progn + (message (concat "exco-organizer-smtp-email-address:" + " Server did not respond in time")) + nil)) (exco-operate-synchronously identifier "ResolveNames" `(((UnresolvedEntry . ,email-address))
[elpa] master updated (78c650b -> 535349a)
fitzsim pushed a change to branch master. from 78c650b * externals-list: New package `shell-command+` new 2fe5e56 Excorporate: Rewrite exco-org functions for Org 9.1 new 96b57cf Excorporate: Expand responses in API usage examples new 436b625 Excorporate: Do not explicitly require Org package new 4adac33 Excorporate: Add more API usage examples to manual new e43b040 Excorporate: Add timeout for synchronous operations new 535349a Excorporate: Rename a function Summary of changes: packages/excorporate/excorporate-org.el | 80 +++--- packages/excorporate/excorporate.el | 31 ++- packages/excorporate/excorporate.info | 414 -- packages/excorporate/excorporate.texi | 431 ++-- 4 files changed, 874 insertions(+), 82 deletions(-)
[elpa] master 2fe5e56 1/6: Excorporate: Rewrite exco-org functions for Org 9.1
branch: master commit 2fe5e5696f3e74a3fafa1af272393b134c619c27 Author: Thomas Fitzsimmons Commit: Thomas Fitzsimmons Excorporate: Rewrite exco-org functions for Org 9.1 * packages/excorporate/excorporate-org.el (exco-org--calendar-item-region-at-point): New function. (exco-org--connection-identifier-at-point): Rewrite for Org 9.1 compatibility. (exco-org--is-meeting): Likewise. (exco-org--organizer): Likewise. (exco-org--organizer-matches-connection): Likewise. (exco-org--remove-calendar-item): Likewise. (exco-org--item-identifier-at-point): Re-indent. --- packages/excorporate/excorporate-org.el | 78 + 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/packages/excorporate/excorporate-org.el b/packages/excorporate/excorporate-org.el index e4d46a8..b7c1b76 100644 --- a/packages/excorporate/excorporate-org.el +++ b/packages/excorporate/excorporate-org.el @@ -33,44 +33,51 @@ (defvar exco-org--temporary-buffers '() "A list of per-connection result buffers.") +(defun exco-org--calendar-item-region-at-point () + "A special case replacement for `org-element-at-point'. +Return a list (BEGIN END) representing the region of the element +at point, if point is at a calendar item. If point is not at a +calendar item, return nil. This works back to Emacs 24.1's +built-in Org 9.1.9 which does not have the `org-element' +feature." + (catch 'not-a-calendar-item +(save-excursion + (values + (progn (ignore-errors (org-back-to-heading)) + (unless (looking-at "^\\*\\* ") (throw 'not-a-calendar-item nil)) + (point)) + (progn (org-end-of-subtree) (forward-char 1) + (point)) + (defun exco-org--connection-identifier-at-point () "Return the connection identifier associated with point." (let* ((calendar-headline - (save-excursion (org-up-heading-safe) (org-element-at-point))) -(headline (org-element-property :raw-value calendar-headline))) -(string-match "Calendar (\\(.*\\))$" headline) -(car (read-from-string (match-string 1 headline) + (save-excursion + (org-up-heading-safe) + (org-trim (substring-no-properties (thing-at-point 'line)) +(when (string-match "\\* Calendar (\\(.*\\))$" calendar-headline) + (car (read-from-string (match-string 1 calendar-headline)) (defun exco-org--item-identifier-at-point () "Return the item identifier associated with point." - (car - (read-from-string - (org-entry-get (car (org-get-property-block)) "Identifier" + (car (read-from-string + (org-entry-get (car (org-get-property-block)) "Identifier" (defun exco-org--is-meeting () "Return t if the entry at point is a meeting, not an appointment." - (save-excursion -(org-back-to-heading) -(let ((element (org-element-at-point))) - ;; Rule out top Calendar item. - (when (equal (org-element-property :level element) 2) - (not (null - (re-search-forward -"^\+ Invitees:$" -(org-element-property :end (org-element-at-point)) t))) + (let ((region (exco-org--calendar-item-region-at-point))) +(when region + (let ((item-text (apply #'buffer-substring-no-properties region))) + (when (string-match "^\+ Invitees:$" item-text) t) (defun exco-org--organizer () "Return a string representing the item at point's organizer." - (save-excursion -(org-back-to-heading) -(let* ((element (org-element-at-point)) - (begin (org-element-property :begin element)) - (end (org-element-property :end element)) - (entry-text (buffer-substring-no-properties begin end))) - ;; Rule out top Calendar item. - (when (equal (org-element-property :level element) 2) - (string-match "^+ Organizer: \\(.*\\)$" entry-text) - (match-string 1 entry-text) + (let ((region (exco-org--calendar-item-region-at-point))) +(when region + (let ((item-text (apply #'buffer-substring-no-properties region))) + (string-match "^+ Organizer: \\(.*\\)$" item-text) + ;; FIXME: Is this a critical region? + (match-string 1 item-text) (defun exco-org--organizer-matches-connection () "Return non-nil if the entry at point is owned by the connection owner." @@ -100,16 +107,13 @@ operated on." (progn ,@forms (message "excorporate-org: Successfully %s" ,success)) (message "excorporate-org: Failed to %s: %S" ,failure ,response -(defun exco-org--remove-element () - "Remove the element at point." +(defun exco-org--remove-calendar-item () + "Remove the calendar item at point." (with-current-buffer (get-buffer-create excorporate-org-buffer-name) -(save-excursion - (org-back-to-heading) - (let* ((inhibit-read-only t) -(element (org-element-at-point)) -(begin (org-element-property :begin element)) -(e
[elpa] master 436b625 3/6: Excorporate: Do not explicitly require Org package
branch: master commit 436b625d24fd9ab59581f442abe0daf8e43b28d3 Author: Thomas Fitzsimmons Commit: Thomas Fitzsimmons Excorporate: Do not explicitly require Org package * packages/excorporate/excorporate.el (Package-Requires): Remove Org. Instead rely on Emacs-native version of Org. --- packages/excorporate/excorporate.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/excorporate/excorporate.el b/packages/excorporate/excorporate.el index f4fa38c..84c404c 100644 --- a/packages/excorporate/excorporate.el +++ b/packages/excorporate/excorporate.el @@ -8,7 +8,7 @@ ;; Version: 0.8.3 ;; Keywords: calendar ;; Homepage: https://www.fitzsim.org/blog/ -;; Package-Requires: ((emacs "24.1") (fsm "0.2.1") (soap-client "3.1.5") (url-http-ntlm "2.0.4") (nadvice "0.3") (org "9.0")) +;; Package-Requires: ((emacs "24.1") (fsm "0.2.1") (soap-client "3.1.5") (url-http-ntlm "2.0.4") (nadvice "0.3")) ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by
[elpa] master 96b57cf 2/6: Excorporate: Expand responses in API usage examples
branch: master commit 96b57cf5ac447c51db52162d5091b0d900e5af42 Author: Thomas Fitzsimmons Commit: Thomas Fitzsimmons Excorporate: Expand responses in API usage examples * packages/excorporate/excorporate.texi (API Usage): Update with full example results. --- packages/excorporate/excorporate.info | 191 -- packages/excorporate/excorporate.texi | 189 +++-- 2 files changed, 361 insertions(+), 19 deletions(-) diff --git a/packages/excorporate/excorporate.info b/packages/excorporate/excorporate.info index b99ff67..8082625 100644 --- a/packages/excorporate/excorporate.info +++ b/packages/excorporate/excorporate.info @@ -264,7 +264,18 @@ Excorporate: '("hack...@gnu.org") nil (lambda (identifier response) (message "%S: %S" identifier response))) - => ("hack...@gnu.org" . "https://mail.gnu.org/EWS/Exchange.asmx";): (((ResponseMessages (CreateItemResponseMessage (ResponseClass . "Success") (ResponseCode . "NoError") (Items (CalendarItem (ItemId (Id . "A[...]A==") (ChangeKey . "D[...]M" + => + ;; Printed in *Messages*: + ("hack...@gnu.org" . "https://mail.gnu.org/EWS/Exchange.asmx";): + (((ResponseMessages +(CreateItemResponseMessage + (ResponseClass . "Success") + (ResponseCode . "NoError") + (Items + (CalendarItem + (ItemId +(Id . "A[...]A==") +(ChangeKey . "D[...]M" The callback is run asychronously after the server responds, so as not to block Emacs, and the result is what is printed in the '*Messages*' @@ -292,11 +303,79 @@ PROPERTIES drawer of calendar entries in the interactive Org buffer. '(((ItemShape (BaseShape . "AllProperties")) (ItemIds (ItemId (Id . "A[...]A==") (ChangeKey . "D[...]d" nil nil nil nil nil nil)) - => (((ResponseMessages (GetItemResponseMessage (ResponseClass . "Success") (ResponseCode . "NoError") (Items (CalendarItem ...)) + => + (((ResponseMessages +(GetItemResponseMessage + (ResponseClass . "Success") + (ResponseCode . "NoError") + (Items + (CalendarItem + (ItemId (Id . "A[...]A==") (ChangeKey . "D[...]M")) + (ParentFolderId (Id . "A[...]A") (ChangeKey . "A[...]A==")) + (ItemClass . "IPM.Appointment") + (Subject . "Excorporate discussion") + (Sensitivity . "Normal") + (Body (BodyType . "Text") . "Hi Hacker Two, + + Let's discuss Excorporate. + + Hacker One") + (DateTimeReceived . "2020-09-24T20:07:26Z") + (Size . 13709) + (Importance . "Normal") + (IsSubmitted) + (IsDraft) + (IsFromMe) + (IsResend) + (IsUnmodified) + (DateTimeSent . "2020-09-24T20:07:26Z") + (DateTimeCreated . "2020-09-24T20:07:26Z") + (ResponseObjects +(ForwardItem) +(CancelCalendarItem)) + (ReminderDueBy . "2020-09-25T14:30:00Z") + (ReminderIsSet . t) + (ReminderMinutesBeforeStart . 15) + (DisplayCc) + (DisplayTo . "Hacker Two") + (HasAttachments) + (Culture . "en-US") + (Start . "2020-09-25T14:30:00Z") + (End . "2020-09-25T15:30:00Z") + (IsAllDayEvent) + (LegacyFreeBusyStatus . "Busy") + (Location . "Online") + (IsMeeting . t) + (IsCancelled) + (IsRecurring) + (MeetingRequestWasSent . t) + (IsResponseRequested . t) + (CalendarItemType . "Single") + (MyResponseType . "Organizer") + (Organizer +(Mailbox + (Name . "Hacker One") + (EmailAddress . "hack...@gnu.org") + (RoutingType . "SMTP"))) + (RequiredAttendees +(Attendee + (Mailbox + (Name . "Hacker Two") + (EmailAddress . "hack...@gnu.org") + (RoutingType . "SMTP") + (MailboxType . "Mailbox")) + (ResponseType . "Accept") + (LastResponseTime . "2020-09-24T21:08:54Z"))) + (Duration . "PT1H") + (TimeZone . "(UTC+00:00) Monrovia, Reykjavik") + (AppointmentSequenceNumber . 0) + (AppointmentState . 1) + (IsOnlineMeeting))) Note that this function is synchronous. This is nice for experimenting -with, for example, in an IELM REPL, but published code should mostly use -the asynchronous calls to avoid blocking Emacs during server operations. +with, for example, in an '*ielm*' REPL, but published code should mostly +use the asynchronous calls to avoid blocking Emacs during server +operations. Here is a more complicated example that asynchronously queries the server for availability overlap for hack...@gnu.org and hack...@gnu.org, @@ -339,12 +418,104 @@ in
[elpa] master 535349a 6/6: Excorporate: Rename a function
branch: master commit 535349a93df8eede61c666bebb0041f20fec541f Author: Thomas Fitzsimmons Commit: Thomas Fitzsimmons Excorporate: Rename a function * packages/excorporate/excorporate.el (exco-resolve-organizer-email-address-synchronously): Rename from exco-organizer-smtp-email-address. * packages/excorporate/excorporate-org.el (exco-org-insert-meetings): Use exco-resolve-organizer-email-address-synchronously. --- packages/excorporate/excorporate-org.el | 2 +- packages/excorporate/excorporate.el | 18 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/excorporate/excorporate-org.el b/packages/excorporate/excorporate-org.el index b7c1b76..6499dc8 100644 --- a/packages/excorporate/excorporate-org.el +++ b/packages/excorporate/excorporate-org.el @@ -311,7 +311,7 @@ meeting organizer." (org-mode) (let ((new-arguments arguments)) (setf (nth 7 new-arguments) - (exco-organizer-smtp-email-address + (exco-resolve-organizer-email-address-synchronously identifier organizer-structure)) (apply #'exco-org-insert-meeting new-arguments subject start-internal end-internal diff --git a/packages/excorporate/excorporate.el b/packages/excorporate/excorporate.el index b068121..b9d1748 100644 --- a/packages/excorporate/excorporate.el +++ b/packages/excorporate/excorporate.el @@ -865,17 +865,19 @@ argument ICALENDAR-TEXT." mime-path response))) coding-system)) -;; The organizer email is in the server's internal "EX" format. -;; Resolve it synchronously, for simplicity. -(defun exco-organizer-smtp-email-address (identifier organizer-structure) +;; The organizer email address is in some cases returned in the +;; server's internal "EX" format which is very long and unfamiliar. +;; If necessary resolve it to the "SMTP" format. This is done +;; synchronously, for simplicity. +(defun exco-resolve-organizer-email-address-synchronously (identifier + organizer-structure) "Return the organizer's SMTP email address as a string. IDENTIFIER is the connection identifier to use to resolve ORGANIZER-STRUCTURE to the returned value. ORGANIZER-STRUCTURE -should be treated as opaque. - -This function queries the server synchronously. It times out and -returns nil if the server does not respond in under -`exco--server-timeout' seconds." +should be treated as opaque. If the address is not already an +SMTP address, then this function queries the server synchronously +to resolve the SMTP address. It times out and returns nil if the +server does not respond in under `exco--server-timeout' seconds." (let* ((wrapped (list (list organizer-structure))) (routing-type (exco-extract-value '(Organizer Mailbox RoutingType) wrapped))
[elpa] master 4adac33 4/6: Excorporate: Add more API usage examples to manual
branch: master commit 4adac336d1ef438fe516a0373f2d8dcc9e940343 Author: Thomas Fitzsimmons Commit: Thomas Fitzsimmons Excorporate: Add more API usage examples to manual * packages/excorporate/excorporate.texi (API Usage): Add more examples. --- packages/excorporate/excorporate.info | 231 +-- packages/excorporate/excorporate.texi | 250 -- 2 files changed, 458 insertions(+), 23 deletions(-) diff --git a/packages/excorporate/excorporate.info b/packages/excorporate/excorporate.info index 8082625..a12efdd 100644 --- a/packages/excorporate/excorporate.info +++ b/packages/excorporate/excorporate.info @@ -261,7 +261,8 @@ Excorporate: (encode-time 0 15 14 23 09 2020) (encode-time 0 0 15 23 09 2020) "Online only" - '("hack...@gnu.org") nil + '("hack...@gnu.org") + nil (lambda (identifier response) (message "%S: %S" identifier response))) => @@ -298,11 +299,15 @@ accepted, unknown). You can find ItemId forms to experiment with in the PROPERTIES drawer of calendar entries in the interactive Org buffer. (exco-operate-synchronously - (car exco--connection-identifiers) - "GetItem" - '(((ItemShape (BaseShape . "AllProperties")) - (ItemIds (ItemId (Id . "A[...]A==") (ChangeKey . "D[...]d" - nil nil nil nil nil nil)) + (car exco--connection-identifiers) + "GetItem" + '(((ItemShape + (BaseShape . "AllProperties")) + (ItemIds + (ItemId + (Id . "A[...]A==") + (ChangeKey . "D[...]d" +nil nil nil nil nil nil)) => (((ResponseMessages (GetItemResponseMessage @@ -372,14 +377,14 @@ PROPERTIES drawer of calendar entries in the interactive Org buffer. (AppointmentState . 1) (IsOnlineMeeting))) -Note that this function is synchronous. This is nice for experimenting -with, for example, in an '*ielm*' REPL, but published code should mostly -use the asynchronous calls to avoid blocking Emacs during server -operations. +Note that this function queries the server synchronously. In other +words, it waits for, and evaluates to, the server's reply. This is nice +when experimenting with the API, but published code should mostly use +the asynchronous calls to avoid blocking Emacs during server operations. Here is a more complicated example that asynchronously queries the server for availability overlap for hack...@gnu.org and hack...@gnu.org, -in the Eastern Time Zone. +in the Eastern Time time zone. (exco-operate (car exco--connection-identifiers) @@ -509,6 +514,210 @@ in the Eastern Time Zone. (StartTimeInMinutes . 480) (EndTimeInMinutes . 1020) +This example shows how to create a recurrence in the "Eastern Standard +Time" time zone. The spliced-in code fragment shows how to query how +many 'nil' arguments should be specified for the 'CreateItem' operation. +Arguments other than the first ("request") argument may be needed in the +future to use more complicated server functionality, but for now they +can all be left 'nil'. + + (exco-operate + (car exco--connection-identifiers) + "CreateItem" + `(((SendMeetingInvitations . "SendToAllAndSaveCopy") + (Items + (CalendarItem + (Subject . "Test recurrence 1") + (Body (BodyType . "Text") "Testing recurrence creation.") + (Start . "2020-09-25T17:00:00-04:00") + (End . "2020-09-25T18:00:00-04:00") + (StartTimeZone (Id . "Eastern Standard Time")) + (EndTimeZone (Id . "Eastern Standard Time")) + (Location . "Online") + (RequiredAttendees +(Attendee (Mailbox (EmailAddress . "hack...@gnu.org" + (Recurrence +(WeeklyRecurrence + (Interval . 1) + (DaysOfWeek "Friday")) +(NumberedRecurrence + (StartDate . "2020-09-25-04:00") + (NumberOfOccurrences . 4)) +;; Empty arguments. +,@(let* ((wsdl (exco--with-fsm (car exco--connection-identifiers) + (plist-get (fsm-get-state-data fsm) :service-wsdl))) + (arity (soap-operation-arity wsdl + "ExchangeServicePort" + "CreateItem"))) +(make-list (- arity 1) nil))) + (lambda (identifier response) +(message "%S: %S" identifier response))) + => + ;; Printed in *Messages*: + ("hack...@gnu.org" . "https://mail.gnu.org/EWS/Exchange.asmx";): + (((ResponseMessages +(CreateItemResponseMessage + (ResponseClass . "Success") + (ResponseCode . "NoError") + (Items + (CalendarItem + (ItemId +(Id . "A[...]A==") +(ChangeKey . "D[...]k" + +N