[elpa] master 07c2407: [el-search] Fix sanity check regarding comments
branch: master commit 07c24073ed8c3077942624efcf209ae11aa17b41 Author: Michael Heerdegen Commit: Michael Heerdegen [el-search] Fix sanity check regarding comments Also bump version to 1.11.4. * packages/el-search/el-search.el (el-search-query-replace--comments-preserved-p): Fix counting ";" occurrences in strings as comment starts by mistake. Fix equality test of comment multi sets. --- packages/el-search/el-search.el | 45 ++--- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index f798ce7..2485558 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -7,7 +7,7 @@ ;; Created: 29 Jul 2015 ;; Keywords: lisp ;; Compatibility: GNU Emacs 25 -;; Version: 1.11.3 +;; Version: 1.11.4 ;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0")) @@ -4295,21 +4295,34 @@ exactly you did? Thanks!" hook-funs) 'ediff-regions-linewise nil nil) -(defun el-search-query-replace--comments-preserved-p (from to) - (cl-flet ((get-comments - (lambda (text) - (let ((comments '())) - (with-temp-buffer - (insert text) - (goto-char (point-min)) - (emacs-lisp-mode) - (while (search-forward-regexp comment-start-skip nil t) - (let ((comment-text (buffer-substring (point) (line-end-position - (unless (string= comment-text "") - (push comment-text comments))) - (forward-line +1)) - comments) -(seq-set-equal-p (get-comments from) (get-comments to) #'string=))) +(defun el-search-query-replace--comments-preserved-p (from-text to-text) + ;; Return non-nil when strings FROM-TEXT and TO-TEXT contain the same + ;; comments. + (cl-flet* ((goto-next-comment-start-p + (lambda () +(let ((success nil) (done nil)) + (while (not (or done success)) +(if (not (search-forward-regexp comment-start-skip nil t)) +(setq done t) + (setq success (not (nth 3 (syntax-ppss)) + success))) + (get-comments + (lambda (text) +(let ((comments '())) + (with-temp-buffer +(insert text) +(goto-char (point-min)) +(emacs-lisp-mode) +(while (goto-next-comment-start-p) + (let ((comment-text (buffer-substring (point) (line-end-position +(unless (string= comment-text "") + (push comment-text comments))) + (forward-line +1)) +comments) +(cl-tree-equal + (sort (get-comments from-text) #'string-lessp) + (sort (get-comments to-text) #'string-lessp) + :test #'string=))) (defun el-search--search-and-replace-pattern (pattern replacement &optional splice to-input-string use-current-search)
[elpa] externals/bbdb 5610c9c: * bbdb-com.el, bbdb.el: Fix some warnings; plus cosmetic changes
branch: externals/bbdb commit 5610c9c566b8a1dc8fcc01081b36af59f398d691 Author: Stefan Monnier Commit: Stefan Monnier * bbdb-com.el, bbdb.el: Fix some warnings; plus cosmetic changes * bbdb-com.el, bbdb.el: Use #' to quote functions. * bbdb-com.el (bbdb-dial): Clarify backslash escaping in regexp. (bbdb-mail-aliases): η-reduce. (bbdb-mail-aliases): Use abbrev-symbol. (bbdb-dial-number): Use bbdb--dial-default. * bbdb.el: Move variable aliases before their target's definition. (bbdb-merge-records-function, bbdb-dial-function): (bbdb-canonicalize-mail-function): Use a non-nil default. (bbdb--dial-default): New function. (bbdb-init-forms): Use functions rather than "forms". (bbdb-initialize): Adjust accordingly. --- bbdb-com.el | 91 +++-- bbdb.el | 146 2 files changed, 125 insertions(+), 112 deletions(-) diff --git a/bbdb-com.el b/bbdb-com.el index 94378f1..d0e9879 100644 --- a/bbdb-com.el +++ b/bbdb-com.el @@ -1,6 +1,6 @@ ;;; bbdb-com.el --- user-level commands of BBDB -*- lexical-binding: t -*- -;; Copyright (C) 2010-2018 Free Software Foundation, Inc. +;; Copyright (C) 2010-2019 Free Software Foundation, Inc. ;; This file is part of the Insidious Big Brother Database (aka BBDB), @@ -103,7 +103,7 @@ If FULL is non-nil, the list of records includes display information." (setq bbdb-do-all-records nil) (aset bbdb-modeline-info 4 nil) (aset bbdb-modeline-info 5 nil) -(if full bbdb-records (mapcar 'car bbdb-records))) +(if full bbdb-records (mapcar #'car bbdb-records))) (list (bbdb-current-record full ;;;###autoload @@ -226,7 +226,7 @@ This usage is discouraged." (dolist (key '(:all-names :organization :mail :xfield :phone :address)) (if (setq val (pop spec)) (push (list key val) newspec))) - (setq spec (apply 'append newspec + (setq spec (apply #'append newspec (let* ((count 0) (sym-list (mapcar (lambda (_) @@ -467,7 +467,7 @@ in either the name(s), organization, address, phone, mail, or xfields." "Display all BBDB records for which xfield FIELD matches REGEXP." (interactive (let ((field (completing-read "Xfield to search (RET for all): " - (mapcar 'list bbdb-xfield-label-list) nil t))) + (mapcar #'list bbdb-xfield-label-list) nil t))) (list (if (string= field "") '* (intern field)) (bbdb-search-read (if (string= field "") "any xfield" @@ -475,7 +475,7 @@ in either the name(s), organization, address, phone, mail, or xfields." (bbdb-layout-prefix (bbdb-display-records (bbdb-search (bbdb-records) :xfield (cons field regexp)) layout)) -(define-obsolete-function-alias 'bbdb-search-notes 'bbdb-search-xfields "3.0") +(define-obsolete-function-alias 'bbdb-search-notes #'bbdb-search-xfields "3.0") ;;;###autoload (defun bbdb-search-changed (&optional layout) @@ -543,11 +543,11 @@ which is probably more suited for your needs." (if (assoc-string mail mails t) ; duplicate mail address (push mail redundant) (push mail mails))) - (let ((mail-re (delq nil (mapcar 'bbdb-mail-redundant-re mails))) + (let ((mail-re (delq nil (mapcar #'bbdb-mail-redundant-re mails))) (case-fold-search t)) (if (not (cdr mail-re)) ; at most one mail-re address to consider (setq okay (nreverse mails)) - (setq mail-re (concat "\\`\\(?:" (mapconcat 'identity mail-re "\\|") + (setq mail-re (concat "\\`\\(?:" (mapconcat #'identity mail-re "\\|") "\\)\\'")) (dolist (mail mails) (if (string-match mail-re mail) ; redundant mail address @@ -564,7 +564,7 @@ which is probably more suited for your needs." (when update (bbdb-change-record record))) (define-obsolete-function-alias 'bbdb-delete-duplicate-mails - 'bbdb-delete-redundant-mails "3.0") + #'bbdb-delete-redundant-mails "3.0") (defun bbdb-search-duplicates (&optional fields) "Search all records that have duplicate entries for FIELDS. @@ -940,7 +940,7 @@ The following keywords are supported in SPEC: (push (list key val) newspec))) (if (setq val (pop spec)) (push (list :check) newspec)) - (setq spec (apply 'append newspec + (setq spec (apply #'append newspec (let ((record (bbdb-empty-record)) (record-type (cdr bbdb-record-type)) @@ -1029,14 +1029,14 @@ A non-nil prefix arg is passed on to `bbdb-read-field' as FLAG (see there)." '(affix organization aka phone address mail))) (field "") (completion-ignore-case t) - (present (mapcar 'car (bbdb-
[elpa] master 4c16bf9: * cobol-mode.el (cobol--fixed-comment-indicators-re): Clarify regexp
branch: master commit 4c16bf97d128d894cc071bfccde3787d7cbd7db2 Author: Stefan Monnier Commit: Stefan Monnier * cobol-mode.el (cobol--fixed-comment-indicators-re): Clarify regexp --- packages/cobol-mode/cobol-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cobol-mode/cobol-mode.el b/packages/cobol-mode/cobol-mode.el index a5c8be6..27485af 100644 --- a/packages/cobol-mode/cobol-mode.el +++ b/packages/cobol-mode/cobol-mode.el @@ -1,6 +1,6 @@ ;;; cobol-mode.el --- Mode for editing COBOL code -*- lexical-binding: t; -*- -;; Copyright (C) 2013-2017 Free Software Foundation, Inc. +;; Copyright (C) 2013-2019 Free Software Foundation, Inc. ;; Author: Edward Hart ;; Maintainer: Edward Hart @@ -1959,7 +1959,7 @@ The next key typed is executed unless it is SPC." "Regexp matching a complete sequence area.") (defconst cobol--fixed-comment-indicators-re - "*/" + "\\*/" "Regexp containing COBOL fixed-form comment indicators.") (defconst cobol--fixed-form-comment-re
[elpa] externals/psgml 19d1508: * psgml-parse.el: Fix regexp, warnings, and function vars defaults
branch: externals/psgml commit 19d1508768c361f0479b79fccc3bf6a59d0f65e3 Author: Stefan Monnier Commit: Stefan Monnier * psgml-parse.el: Fix regexp, warnings, and function vars defaults (sgml-entity-function, sgml-pi-function, sgml-signal-data-function) (sgml-auto-fill-inhibit-function, sgml-data-function): Use non-nil default. (sgml--entity-function-default): New function, extracted from sgml-do-entity-ref. (sgml-do-entity-ref): Use it. (sgml-formal-pubid-regexp): Clarify&simplify regexp. (sgml--in-file): Rename from sgml-in-file-eval, and make it into a macro. (sgml-declaration): Adjust use accordingly. (sgml-update-display): Use bound-and-true-p. --- psgml-parse.el | 91 +- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/psgml-parse.el b/psgml-parse.el index 3cd762b..38dc38b 100644 --- a/psgml-parse.el +++ b/psgml-parse.el @@ -1,7 +1,7 @@ ;;; psgml-parse.el --- Parser for SGML-editing mode with parsing support -*- lexical-binding:t -*- ;; $Id: psgml-parse.el,v 2.105 2008/06/21 16:13:51 lenst Exp $ -;; Copyright (C) 1994-1998, 2016-2017 Free Software Foundation, Inc. +;; Copyright (C) 1994-1998, 2016-2019 Free Software Foundation, Inc. ;; Author: Lennart Staflin ;; Acknowledgment: @@ -43,7 +43,7 @@ Advise to do-auto-fill -(defvar sgml-auto-fill-inhibit-function nil +(defvar sgml-auto-fill-inhibit-function #'ignore "If non-nil, it should be a function of no arguments. The functions is evaluated before the standard auto-fill function, `do-auto-fill', tries to fill a line. If the function returns a true @@ -145,16 +145,16 @@ Tested by `sgml-close-element' to see if the parse should be ended.") Called with the entity as argument. The start and end of the short reference is `sgml-markup-start' and point.") -(defvar sgml-data-function nil +(defvar sgml-data-function #'ignore "Function called with parsed data.") -(defvar sgml-entity-function nil +(defvar sgml-entity-function #'sgml--entity-function-default "Function called with entity referenced at current point in parse.") -(defvar sgml-pi-function nil +(defvar sgml-pi-function #'ignore "Function called with parsed processing instruction.") -(defvar sgml-signal-data-function nil +(defvar sgml-signal-data-function #'ignore "Called when some data characters are conceptually parsed. E.g. a data entity reference.") @@ -1468,9 +1468,9 @@ in any of them." (declare (debug (sexp))) (cond ((consp delim) -(list 'skip-chars-forward - (concat "^" - (cl-loop for d in delim +`(skip-chars-forward + ,(concat "^" + (cl-loop for d in delim concat (let ((ds (member (upcase (format "%s" d)) sgml-delimiters))) (cl-assert ds) @@ -1481,9 +1481,9 @@ in any of them." (t (let ((ds (sgml-get-delim-string (upcase (format "%s" delim) (if (= 1 (length ds)) - (list 'skip-chars-forward (concat "^" ds)) + `(skip-chars-forward ,(concat "^" ds)) `(and (search-forward ,ds nil t) - (backward-char ,(length ds + (backward-char ,(length ds ;;(macroexpand '(sgml-is-delim mdo)) @@ -1591,8 +1591,8 @@ in any of them." (cond (psgml-pi (goto-char start) (sgml--pi-psgml-handler in-declaration end)) - (sgml-pi-function - (funcall sgml-pi-function + (t + (funcall (or sgml-pi-function #'ignore) (buffer-substring-no-properties start end (goto-char next (unless in-declaration @@ -1739,6 +1739,12 @@ parse the value part of a name=value pair." (sgml-set-markup-type 'entity))) t) +(defun sgml--entity-function-default (entity) + (unless (memql sgml-data-function '(nil ignore)) +(sgml-push-to-entity entity sgml-markup-start) +(funcall sgml-data-function (buffer-string)) +(sgml-pop-entity))) + (defun sgml-do-entity-ref (name) (let ((entity (sgml-lookup-entity name @@ -1751,15 +1757,9 @@ parse the value part of a name=value pair." (sgml-error "XML forbids data-entity references in data or DTD (%s)" name)) - (when sgml-signal-data-function -(funcall sgml-signal-data-function)) - (cond - (sgml-entity-function -(funcall sgml-entity-function entity)) - (sgml-data-function -(sgml-push-to-entity entity sgml-markup-start) -(funcall sgml-data-function (buffer-string)) -(sgml-pop-entity + (funcall sgml-signal-data-function) + (funcall (or sgml-entity-function #'sgml--entity-function-default) +entity)) (t (sgml-push-to-entity enti
[elpa] externals/dismal 1b5e097: * dismal.el (dis--formula-string-p): Fix regexp according to manual
branch: externals/dismal commit 1b5e0979becb3a0b936366fa76217cf4c6b41c9a Author: Stefan Monnier Commit: Stefan Monnier * dismal.el (dis--formula-string-p): Fix regexp according to manual --- dismal.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dismal.el b/dismal.el index e830717..caf9660 100644 --- a/dismal.el +++ b/dismal.el @@ -1,6 +1,6 @@ ;;; dismal.el --- Dis Mode Ain't Lotus: Spreadsheet program Emacs -;; Copyright (C) 1993-2018 Free Software Foundation, Inc. +;; Copyright (C) 1993-2019 Free Software Foundation, Inc. ;; Author: David Fox, f...@cs.nyu.edu ;; Frank E. Ritter, rit...@cs.cmu.edu @@ -6089,7 +6089,7 @@ can use." ; (setq item "(if (> 3 4) nil 4)") (defun dis--formula-string-p (item) ;;(dis--formula-string-p "(* 34 34)") (and (stringp item) ;;(dis--formula-string-p "(/ (float 3) (float 3))") - (string-match "^([a-zA-Z .0-9:$---/^\"+=<>\\]*)$" item) + (string-match "\\`(.*)\\'" item) (fboundp (car (car (read-from-string item)) ; (dismal-char-col-to-dismal-col 50)