commit 53e18401e5c3fbbeef952f75b153d240921c1a4d (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Fri May 17 11:01:20 2019 +0300 Fix a recent commit in select.el * lisp/select.el (gui-get-selection): Revert a recent incorrect change. Add a comment explaining what we are trying to do with C_STRING and why. (xselect--encode-string): Add a comment explaining what we are trying to do with C_STRING and why. diff --git a/lisp/select.el b/lisp/select.el index 3ea741d383..af6bf467e4 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -308,15 +308,12 @@ the formats available in the clipboard if TYPE is `CLIPBOARD'." ('STRING 'iso-8859-1) (_ (error "Unknown selection data type: %S" type)))))) - (setq data (cond - (coding - (decode-coding-string data coding)) - ;; The last two cases are only possible in the - ;; C_STRING case. - ((multibyte-string-p data) - data) - (t - (encode-coding-string data 'eight-bit))))) + (setq data (if coding (decode-coding-string data coding) + ;; This is for C_STRING case. + ;; We want to convert each non-ASCII byte to the + ;; corresponding eight-bit character, which has + ;; a codepoint >= #x3FFF00. + (string-to-multibyte data)))) (setq next-selection-coding-system nil) (put-text-property 0 (length data) 'foreign-selection data-type data)) data)) @@ -479,6 +476,9 @@ two markers or an overlay. Otherwise, it is nil." (setq str (encode-coding-string str coding))) ((eq type 'C_STRING) + ;; If STR is unibyte (the normal case), use it; otherwise + ;; we assume some of the characters are eight-bit, and + ;; take their lower 8 bits. (setq str (string-make-unibyte str))) (t commit e0ea878a89f6944d8949d3df1f5d83b5ca5f48e3 Author: Lars Ingebrigtsen Date: Fri May 17 06:53:58 2019 +0200 Remove obsolete example functions from imenu.el * lisp/imenu.el (imenu-example--create-c-index) (imenu-example--function-name-regexp-c) (imenu-example--create-lisp-index) (imenu-example--lisp-extract-index-name): Remove functions (and internal variables used by those functions) declared obsolete in Emacs 23.2. The functions gave compilation warnings. diff --git a/lisp/imenu.el b/lisp/imenu.el index df39ff3c07..5084fe61ef 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -348,98 +348,6 @@ Don't move point." (signal 'imenu-unavailable (list (apply #'format-message format args)))) -(defun imenu-example--lisp-extract-index-name () - ;; Example of a candidate for `imenu-extract-index-name-function'. - ;; This will generate a flat index of definitions in a lisp file. - (declare (obsolete nil "23.2")) - (save-match-data - (and (looking-at "(def") - (condition-case nil - (progn - (down-list 1) - (forward-sexp 2) - (let ((beg (point)) - (end (progn (forward-sexp -1) (point)))) - (buffer-substring beg end))) - (error nil))))) - -(defun imenu-example--create-lisp-index () - ;; Example of a candidate for `imenu-create-index-function'. - ;; It will generate a nested index of definitions. - (declare (obsolete nil "23.2")) - (let ((index-alist '()) - (index-var-alist '()) - (index-type-alist '()) - (index-unknown-alist '())) - (goto-char (point-max)) - ;; Search for the function - (while (beginning-of-defun) - (save-match-data - (and (looking-at "(def") - (save-excursion - (down-list 1) - (cond - ((looking-at "def\\(var\\|const\\)") - (forward-sexp 2) - (push (imenu-example--name-and-position) - index-var-alist)) - ((looking-at "def\\(un\\|subst\\|macro\\|advice\\)") - (forward-sexp 2) - (push (imenu-example--name-and-position) - index-alist)) - ((looking-at "def\\(type\\|struct\\|class\\|ine-condition\\)") - (forward-sexp 2) - (if (= (char-after (1- (point))) ?\)) - (progn - (forward-sexp -1) - (down-list 1) - (forward-sexp 1))) - (push (imenu-example--name-and-position) - index-type-alist)) - (t - (forward-sexp 2) - (push (imenu-example--name-and-position) - index-unknown-alist))))))) - (and index-var-alist - (push (cons "Variables" index-var-alist) - index-alist)) - (and index-type-alist - (push (cons "Types" index-type-alist) - index-alist)) - (and index-unknown-alist - (push (cons "Syntax-unknown" index-unknown-alist) - index-alist)) - index-alist)) - -;; Regular expression to find C functions -(defvar imenu-example--function-name-regexp-c - (concat - "^[a-zA-Z0-9]+[ \t]?" ; Type specs; there can be no - "\\([a-zA-Z0-9_*]+[ \t]+\\)?" ; more than 3 tokens, right? - "\\([a-zA-Z0-9_*]+[ \t]+\\)?" - "\\([*&]+[ \t]*\\)?" ; Pointer. - "\\([a-zA-Z0-9_*]+\\)[ \t]*(" ; Name. - )) - -(defun imenu-example--create-c-index (&optional regexp) - (declare (obsolete nil "23.2")) - (let ((index-alist '()) - char) - (goto-char (point-min)) - ;; Search for the function - (save-match-data - (while (re-search-forward - (or regexp imenu-example--function-name-regexp-c) - nil t) - (backward-up-list 1) - (save-excursion - (goto-char (scan-sexps (point) 1)) - (setq char (following-char))) - ;; Skip this function name if it is a prototype declaration. - (if (not (eq char ?\;)) - (push (imenu-example--name-and-position) index-alist)))) - (nreverse index-alist))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Internal variables commit 670c5126a094f6c7d7043db62db36ed30fef84af Author: Lars Ingebrigtsen Date: Fri May 17 06:21:37 2019 +0200 Remove unused internal function completion-pcm--optimize-pattern * lisp/minibuffer.el (completion-pcm--optimize-pattern): Remove unused internal function (that signalled a compilation warning). diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index d11a5cf574..ed610c16ee 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2971,28 +2971,6 @@ or a symbol, see `completion-pcm--merge-completions'." ;; It should be avoided properly, but it's so easy to remove it here. (delete "" (nreverse pattern))))) -(defun completion-pcm--optimize-pattern (p) - ;; Remove empty strings in a separate phase since otherwise a "" - ;; might prevent some other optimization, as in '(any "" any). - (setq p (delete "" p)) - (let ((n '())) - (while p - (pcase p - (`(,(and s1 (pred stringp)) ,(and s2 (pred stringp)) . ,rest) - (setq p (cons (concat s1 s2) rest))) - (`(,(and p1 (pred symbolp)) ,(and p2 (guard (eq p1 p2))) . ,_) - ;; Unused lexical variable warning due to body not using p1, p2. - ;; https://debbugs.gnu.org/16771 - (setq p (cdr p))) - (`(star ,(pred symbolp) . ,rest) (setq p `(star . ,rest))) - (`(,(pred symbolp) star . ,rest) (setq p `(star . ,rest))) - (`(point ,(or 'any 'any-delim) . ,rest) (setq p `(point . ,rest))) - (`(,(or 'any 'any-delim) point . ,rest) (setq p `(point . ,rest))) - (`(any ,(or 'any 'any-delim) . ,rest) (setq p `(any . ,rest))) - (`(,(pred symbolp)) (setq p nil)) ;Implicit terminating `any'. - (_ (push (pop p) n)))) - (nreverse n))) - (defun completion-pcm--pattern->regex (pattern &optional group) (let ((re (concat "\\`" commit a93e672e279adc45782254a66520471c336ed4ac Author: Stefan Monnier Date: Fri May 17 00:09:16 2019 -0400 * lisp/gnus: Remove assumptions about mail-header being a vector Use `mail-header-p` and `make-full-mail-header` instead of `vectorp` and `vector`, respectively. * lisp/gnus/message.el (message-cite-original-1, message-reply) (message-followup): * lisp/gnus/gnus-sum.el (gnus-get-newsgroup-headers): Use make-full-mail-header instead of `vector`. (gnus--dummy-mail-header): New const, using make-full-mail-header. (gnus-update-summary-mark-positions): Use it instead of an immediate vector. (gnus-set-mode-line, gnus-summary-article-pseudo-p) (gnus-summary-article-subject, gnus-summary-insert-subject) (gnus-summary-find-subject, gnus-summary-goto-subject) (gnus-summary-limit-to-age, gnus-summary-find-matching) (gnus-summary-mark-article-as-unread, gnus-summary-mark-article) (gnus-summary-save-article): * lisp/gnus/gnus.el (gnus-news-group-p): Use mail-header-p instead of vectorp. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 00f0de61d7..f761fdb794 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -3267,7 +3267,7 @@ The following commands are available: (defun gnus-summary-article-pseudo-p (article) "Say whether this article is a pseudo article or not." - (not (vectorp (gnus-data-header (gnus-data-find article))))) + (not (mail-header-p (gnus-data-header (gnus-data-find article))))) (defmacro gnus-summary-article-sparse-p (article) "Say whether this article is a sparse article or not." @@ -3343,7 +3343,7 @@ article number." '(gnus-data-header (assq (gnus-summary-article-number) gnus-newsgroup-data))))) (and headers - (vectorp headers) + (mail-header-p headers) (mail-header-subject headers)))) (defmacro gnus-summary-article-score (&optional number) @@ -3600,6 +3600,9 @@ buffer that was in action when the last article was fetched." t (not (cdr (gnus-data-find-list article))))) +(defconst gnus--dummy-mail-header + (make-full-mail-header 0 "" "" "05 Apr 2001 23:33:09 +0400" "" "" 0 0 "" nil)) + (defun gnus-make-thread-indent-array (&optional n) (when (or n (progn (setq n 200) nil) @@ -3628,10 +3631,9 @@ buffer that was in action when the last article was fetched." (gnus-undownloaded-mark ?Z) (gnus-summary-line-format-spec spec) (gnus-newsgroup-downloadable '(0)) - (header [0 "" "" "05 Apr 2001 23:33:09 +0400" "" "" 0 0 "" nil]) case-fold-search ignores) ;; Here, all marks are bound to Z. - (gnus-summary-insert-line header + (gnus-summary-insert-line gnus--dummy-mail-header 0 nil t gnus-tmp-unread t nil "" nil 1) (goto-char (point-min)) ;; Memorize the positions of the same characters as dummy marks. @@ -3645,7 +3647,7 @@ buffer that was in action when the last article was fetched." gnus-score-below-mark ?C gnus-score-over-mark ?C gnus-undownloaded-mark ?D) - (gnus-summary-insert-line header + (gnus-summary-insert-line gnus--dummy-mail-header 0 nil t gnus-tmp-unread t nil "" nil 1) ;; Ignore characters which aren't dummy marks. (dolist (p ignores) @@ -6219,7 +6221,7 @@ If WHERE is `summary', the summary mode line format will be used." gnus-tmp-unselected)))) (gnus-tmp-subject (if (and gnus-current-headers - (vectorp gnus-current-headers)) + (mail-header-p gnus-current-headers)) (gnus-mode-string-quote (mail-header-subject gnus-current-headers)) "")) @@ -6436,7 +6438,7 @@ The resulting hash table is returned, or nil if no Xrefs were found." ;; doesn't always go hand in hand. (setq header - (vector + (make-full-mail-header ;; Number. (prog1 (setq number (read cur)) @@ -6649,7 +6651,7 @@ If USE-OLD-HEADER is non-nil, then OLD-HEADER should be a header, and OLD-HEADER will be used when the summary line is inserted, too, instead of trying to fetch new headers." (let* ((line (and (numberp old-header) old-header)) - (old-header (and (vectorp old-header) old-header)) + (old-header (and (mail-header-p old-header) old-header)) (header (cond ((and old-header use-old-header) old-header) ((and (numberp id) @@ -6887,7 +6889,7 @@ If EXCLUDE-GROUP, do not go to this group." (while arts (and (or (not unread) (gnus-data-unread-p (car arts))) - (vectorp (gnus-data-header (car arts))) + (mail-header-p (gnus-data-header (car arts))) (gnus-subject-equal simp-subject (mail-header-subject (gnus-data-header (car arts))) t) (setq result (car arts) @@ -7724,7 +7726,7 @@ If FORCE, also allow jumping to articles not currently shown." force (gnus-summary-insert-subject article - (if (or (numberp force) (vectorp force)) force) + (if (or (numberp force) (mail-header-p force)) force) t) (setq data (gnus-data-find article))) (goto-char b) @@ -8469,7 +8471,7 @@ articles that are younger than AGE days." (cutoff (days-to-time age)) articles d date is-younger) (while (setq d (pop data)) - (when (and (vectorp (gnus-data-header d)) + (when (and (mail-header-p (gnus-data-header d)) (setq date (mail-header-date (gnus-data-header d)))) (setq is-younger (time-less-p (time-since (gnus-date-get-time date)) @@ -9614,7 +9616,7 @@ not match REGEXP on HEADER." (gnus-data-list backward)))) (when (and (or (not unread) ; We want all articles... (gnus-data-unread-p d)) ; Or just unreads. - (vectorp (gnus-data-header d)) ; It's not a pseudo. + (mail-header-p (gnus-data-header d)) ; It's not a pseudo. (if not-matching (not (string-match regexp @@ -11151,7 +11153,7 @@ If NO-EXPIRE, auto-expiry will be inhibited." ;; See whether the article is to be put in the cache. (and gnus-use-cache - (vectorp (gnus-summary-article-header article)) + (mail-header-p (gnus-summary-article-header article)) (save-excursion (gnus-cache-possibly-enter-article gnus-newsgroup-name article @@ -11198,7 +11200,7 @@ If NO-EXPIRE, auto-expiry will be inhibited." ;; See whether the article is to be put in the cache. (and gnus-use-cache (not (= mark gnus-canceled-mark)) - (vectorp (gnus-summary-article-header article)) + (mail-header-p (gnus-summary-article-header article)) (save-excursion (gnus-cache-possibly-enter-article gnus-newsgroup-name article @@ -12147,7 +12149,7 @@ performed." header file) (dolist (article articles) (setq header (gnus-summary-article-header article)) - (if (not (vectorp header)) + (if (not (mail-header-p header)) ;; This is a pseudo-article. (if (assq 'name header) (gnus-copy-file (cdr (assq 'name header))) diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 3d7c37eac8..7538274e15 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -3143,7 +3143,7 @@ that that variable is buffer-local to the summary buffers." t) ;is news of course. ((not (gnus-member-of-valid 'post-mail group)) ;Non-combined. nil) ;must be mail then. - ((vectorp article) ;Has header info. + ((mail-header-p article) ;Has header info. (eq (gnus-request-type group (mail-header-id article)) 'news)) ((null article) ;Hasn't header info (eq (gnus-request-type group) 'news)) ;(unknown ==> mail) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index edfe1a39f3..8b72ef88ab 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -3819,13 +3819,14 @@ This function uses `mail-citation-hook' if that is non-nil." (narrow-to-region start end) (message-narrow-to-head-1) (setq x-no-archive (message-fetch-field "x-no-archive")) - (vector 0 - (or (message-fetch-field "subject") "none") - (or (message-fetch-field "from") "nobody") - (message-fetch-field "date") - (message-fetch-field "message-id" t) - (message-fetch-field "references") - 0 0 "")))) + (make-full-mail-header + 0 + (or (message-fetch-field "subject") "none") + (or (message-fetch-field "from") "nobody") + (message-fetch-field "date") + (message-fetch-field "message-id" t) + (message-fetch-field "references") + 0 0 "")))) (mml-quote-region start end) (when strip-signature ;; Allow undoing. @@ -6977,8 +6978,8 @@ specified by FUNCTIONS, if non-nil, or by the variable (if wide to-address nil)) switch-function)) (setq message-reply-headers - (vector 0 (cdr (assq 'Subject headers)) - from date message-id references 0 0 "")) + (make-full-mail-header 0 (cdr (assq 'Subject headers)) + from date message-id references 0 0 "")) (message-setup headers cur)))) ;;;###autoload @@ -7035,7 +7036,8 @@ If TO-NEWSGROUPS, use that as the new Newsgroups line." (message-pop-to-buffer (message-buffer-name "followup" from newsgroups)) (setq message-reply-headers - (vector 0 subject from date message-id references 0 0 "")) + (make-full-mail-header + 0 subject from date message-id references 0 0 "")) (message-setup `((Subject . ,subject) diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index e138f141c6..d30a739949 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -136,6 +136,7 @@ on your system, you could say something like: ;; (That next-to-last entry is defined as "misc" in the NOV format, ;; but Gnus uses it for xrefs.) +(defalias 'mail-header-p #'vectorp) ;For lack of tag, it's all we have. (cl-defstruct (mail-header (:type vector) (:constructor nil) diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el index c80bbf6187..25f3413fcd 100644 --- a/lisp/gnus/nnvirtual.el +++ b/lisp/gnus/nnvirtual.el @@ -491,9 +491,9 @@ If UPDATE-P is not nil, call gnus-group-update-group on the components." -;;; This is currently O(kn^2) to merge n lists of length k. -;;; You could do it in O(knlogn), but we have a small n, and the -;;; overhead of the other approach is probably greater. +;; This is currently O(kn^2) to merge n lists of length k. +;; You could do it in O(knlogn), but we have a small n, and the +;; overhead of the other approach is probably greater. (defun nnvirtual-merge-sorted-lists (&rest lists) "Merge many sorted lists of numbers." (if (null (cdr lists)) @@ -501,68 +501,68 @@ If UPDATE-P is not nil, call gnus-group-update-group on the components." (sort (apply 'nconc lists) '<))) -;;; We map between virtual articles and real articles in a manner -;;; which keeps the size of the virtual active list the same as the -;;; sum of the component active lists. - -;;; To achieve fair mixing of the groups, the last article in each of -;;; N component groups will be in the last N articles in the virtual -;;; group. - -;;; If you have 3 components A, B and C, with articles 1-8, 1-5, and -;;; 6-7 respectively, then the virtual article numbers look like: -;;; -;;; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -;;; A1 A2 A3 A4 B1 A5 B2 A6 B3 A7 B4 C6 A8 B5 C7 - -;;; To compute these mappings we generate a couple tables and then -;;; do some fast operations on them. Tables for the example above: -;;; -;;; Offsets - [(A 0) (B -3) (C -1)] -;;; -;;; a b c d e -;;; Mapping - ([ 3 0 1 3 0 ] -;;; [ 6 3 2 9 3 ] -;;; [ 8 6 3 15 9 ]) -;;; -;;; (note column 'e' is different in real algorithm, which is slightly -;;; different than described here, but this gives you the methodology.) -;;; -;;; The basic idea is this, when going from component->virtual, apply -;;; the appropriate offset to the article number. Then search the first -;;; column of the table for a row where 'a' is less than or equal to the -;;; modified number. You can see that only group A can therefore go to -;;; the first row, groups A and B to the second, and all to the last. -;;; The third column of the table is telling us the number of groups -;;; which might be able to reach that row (it might increase by more than -;;; 1 if several groups have the same size). -;;; Then column 'b' provides an additional offset you apply when you have -;;; found the correct row. You then multiply by 'c' and add on the groups -;;; _position_ in the offset table. The basic idea here is that on -;;; any given row we are going to map back and forth using X'=X*c+Y and -;;; X=(X'/c), Y=(X' mod c). Then once you've done this transformation, -;;; you apply a final offset from column 'e' to give the virtual article. -;;; -;;; Going the other direction, you instead search on column 'd' instead -;;; of 'a', and apply everything in reverse order. - -;;; Convert component -> virtual: -;;; set num = num - Offset(group) -;;; find first row in Mapping where num <= 'a' -;;; num = (num-'b')*c + Position(group) + 'e' - -;;; Convert virtual -> component: -;;; find first row in Mapping where num <= 'd' -;;; num = num - 'e' -;;; group_pos = num mod 'c' -;;; num = (num / 'c') + 'b' + Offset(group_pos) - -;;; Easy no? :) -;;; -;;; Well actually, you need to keep column e offset smaller by the 'c' -;;; column for that line, and always add 1 more when going from -;;; component -> virtual. Otherwise you run into a problem with -;;; unique reverse mapping. +;; We map between virtual articles and real articles in a manner +;; which keeps the size of the virtual active list the same as the +;; sum of the component active lists. + +;; To achieve fair mixing of the groups, the last article in each of +;; N component groups will be in the last N articles in the virtual +;; group. + +;; If you have 3 components A, B and C, with articles 1-8, 1-5, and +;; 6-7 respectively, then the virtual article numbers look like: +;; +;; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 +;; A1 A2 A3 A4 B1 A5 B2 A6 B3 A7 B4 C6 A8 B5 C7 + +;; To compute these mappings we generate a couple tables and then +;; do some fast operations on them. Tables for the example above: +;; +;; Offsets - [(A 0) (B -3) (C -1)] +;; +;; a b c d e +;; Mapping - ([ 3 0 1 3 0 ] +;; [ 6 3 2 9 3 ] +;; [ 8 6 3 15 9 ]) +;; +;; (note column 'e' is different in real algorithm, which is slightly +;; different than described here, but this gives you the methodology.) +;; +;; The basic idea is this, when going from component->virtual, apply +;; the appropriate offset to the article number. Then search the first +;; column of the table for a row where 'a' is less than or equal to the +;; modified number. You can see that only group A can therefore go to +;; the first row, groups A and B to the second, and all to the last. +;; The third column of the table is telling us the number of groups +;; which might be able to reach that row (it might increase by more than +;; 1 if several groups have the same size). +;; Then column 'b' provides an additional offset you apply when you have +;; found the correct row. You then multiply by 'c' and add on the groups +;; _position_ in the offset table. The basic idea here is that on +;; any given row we are going to map back and forth using X'=X*c+Y and +;; X=(X'/c), Y=(X' mod c). Then once you've done this transformation, +;; you apply a final offset from column 'e' to give the virtual article. +;; +;; Going the other direction, you instead search on column 'd' instead +;; of 'a', and apply everything in reverse order. + +;; Convert component -> virtual: +;; set num = num - Offset(group) +;; find first row in Mapping where num <= 'a' +;; num = (num-'b')*c + Position(group) + 'e' + +;; Convert virtual -> component: +;; find first row in Mapping where num <= 'd' +;; num = num - 'e' +;; group_pos = num mod 'c' +;; num = (num / 'c') + 'b' + Offset(group_pos) + +;; Easy no? :) +;; +;; Well actually, you need to keep column e offset smaller by the 'c' +;; column for that line, and always add 1 more when going from +;; component -> virtual. Otherwise you run into a problem with +;; unique reverse mapping. (defun nnvirtual-map-article (article) "Return a cons of the component group and article corresponding to the given virtual ARTICLE." commit 9843e7b6b159d66feaaa2c5f67e3d7fd0c63af1d Author: Lars Ingebrigtsen Date: Fri May 17 06:07:00 2019 +0200 Declare fileloop-continue in dired-aux to avoid warning * lisp/dired-aux.el (fileloop-continue): Declare to avoid compilation warning. `fileloop-initialize-search' (used before -continue) will load fileloop.el. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 0cf9e6e2e9..aae521287e 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2849,6 +2849,8 @@ is part of a file name (i.e., has the text property `dired-filename')." (multi-isearch-files-regexp (dired-get-marked-files nil nil 'dired-nondirectory-p nil t))) +(declare-function fileloop-continue "fileloop" ()) + ;;;###autoload (defun dired-do-search (regexp) "Search through all marked files for a match for REGEXP. commit 6a2968b9e7b5ee604751d430879844b5298135e4 Author: Lars Ingebrigtsen Date: Fri May 17 06:00:22 2019 +0200 Avoind string-as-multibyte in ps-output-string-prim * lisp/ps-print.el (ps-output-string-prim): Avoid `string-as-multibyte', and encode as utf-8 instead if multibyte. diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 647597cefa..881d6a8f4b 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -4612,7 +4612,9 @@ page-height == ((floor print-height ((th + ls) * zh)) * ((th + ls) * zh)) - th (defsubst ps-output-string-prim (string) (insert "(") ;insert start-string delimiter (save-excursion ;insert string - (insert (string-as-unibyte string))) + (insert (if (multibyte-string-p string) + (encode-coding-string string 'utf-8) + string))) ;; Find and quote special characters as necessary for PS ;; This skips everything except control chars, non-ASCII chars, (, ) and \. (while (progn (skip-chars-forward " -'*-[]-~") (not (eobp))) commit ab263a798076c028812b9a747d6c4206b8090faf Author: Lars Ingebrigtsen Date: Fri May 17 05:42:12 2019 +0200 (gui-get-selection): Avoid using `string-to-multibyte' * lisp/select.el (gui-get-selection): Avoid using `string-to-multibyte' -- instead encode as `eight-bit' if the string is unibyte. diff --git a/lisp/select.el b/lisp/select.el index c79e923b74..3ea741d383 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -308,8 +308,15 @@ the formats available in the clipboard if TYPE is `CLIPBOARD'." ('STRING 'iso-8859-1) (_ (error "Unknown selection data type: %S" type)))))) - (setq data (if coding (decode-coding-string data coding) - (string-to-multibyte data)))) + (setq data (cond + (coding + (decode-coding-string data coding)) + ;; The last two cases are only possible in the + ;; C_STRING case. + ((multibyte-string-p data) + data) + (t + (encode-coding-string data 'eight-bit))))) (setq next-selection-coding-system nil) (put-text-property 0 (length data) 'foreign-selection data-type data)) data)) commit 54f5d678dccdf7b6a60579c6048e8cf87c81c4ae Author: Lars Ingebrigtsen Date: Fri May 17 05:18:12 2019 +0200 Declare two w32 functions to avoid byte compilation warnings * lisp/w32-fns.el (w32-version, w32-read-registry): Declare these functions to avoid byte compilation warnings. The functions should be loaded when `w32--os-description' is called, as far as I can tell. diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index 8762fe772b..2b6464ab98 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el @@ -305,7 +305,10 @@ names." ;;;; System name and version for emacsbug.el -(defun w32--os-description () +(declare-function w32-version "w32-win" ()) +(declare-function w32-read-registry "w32fns" (root key name)) + +(defun w32--os-descriptiono () "Return a string describing the underlying OS and its version." (let* ((w32ver (car (w32-version))) (w9x-p (< w32ver 5)) commit 92b1edb1f8232785c25cc9484a5dfb78b51da414 Author: Lars Ingebrigtsen Date: Fri May 17 04:47:31 2019 +0200 Remove obsolete epg functions * lisp/epg.el (epg-start-sign-keys, epg-sign-keys): Remove functions declared obsolete since Emacs 23.1. diff --git a/lisp/epa.el b/lisp/epa.el index c8abff4753..59c11ab541 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -1282,29 +1282,6 @@ If no one is selected, default public key is exported. "))) (epa-display-error context) (signal (car error) (cdr error)))))) -;; (defun epa-sign-keys (keys &optional local) -;; "Sign selected KEYS. -;; If a prefix-arg is specified, the signature is marked as non exportable. - -;; Don't use this command in Lisp programs!" -;; (declare (interactive-only t)) -;; (interactive -;; (let ((keys (epa--marked-keys))) -;; (unless keys -;; (error "No keys selected")) -;; (list keys current-prefix-arg))) -;; (let ((context (epg-make-context epa-protocol))) -;; (epg-context-set-passphrase-callback context -;; #'epa-passphrase-callback-function) -;; (epg-context-set-progress-callback context -;; (cons -;; #'epa-progress-callback-function -;; "Signing keys...")) -;; (message "Signing keys...") -;; (epg-sign-keys context keys local) -;; (message "Signing keys...done"))) -;; (make-obsolete 'epa-sign-keys "Do not use.") - (provide 'epa) ;;; epa.el ends here diff --git a/lisp/epg.el b/lisp/epg.el index e06cc06a7d..0400716845 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -1936,40 +1936,6 @@ If you are unsure, use synchronous version of this function (epg-errors-to-string errors)))))) (epg-reset context))) -(defun epg-start-sign-keys (context keys &optional local) - "Initiate a sign keys operation. - -If you use this function, you will need to wait for the completion of -`epg-gpg-program' by using `epg-wait-for-completion' and call -`epg-reset' to clear a temporary output file. -If you are unsure, use synchronous version of this function -`epg-sign-keys' instead." - (declare (obsolete nil "23.1")) - (setf (epg-context-operation context) 'sign-keys) - (setf (epg-context-result context) nil) - (epg--start context (cons (if local - "--lsign-key" - "--sign-key") - (mapcar - (lambda (key) - (epg-sub-key-id - (car (epg-key-sub-key-list key)))) - keys)))) - -(defun epg-sign-keys (context keys &optional local) - "Sign KEYS from the key ring." - (declare (obsolete nil "23.1")) - (unwind-protect - (progn - (epg-start-sign-keys context keys local) - (epg-wait-for-completion context) - (let ((errors (epg-context-result-for context 'error))) - (if errors - (signal 'epg-error - (list "Sign keys failed" - (epg-errors-to-string errors)))))) - (epg-reset context))) - (defun epg-start-generate-key (context parameters) "Initiate a key generation. PARAMETERS is a string which specifies parameters of the generated key. commit cad2bbbe25fda36f7eb5a81c34070e26743f4ccf Author: Lars Ingebrigtsen Date: Fri May 17 04:22:08 2019 +0200 Declare rectangle functions in mouse.el to avoid warnings * lisp/mouse.el (rectangle-dimensions) (rectangle-position-as-coordinates, rectangle-intersect-p): Declare these functions from rect.el to avoid compilation warnings. diff --git a/lisp/mouse.el b/lisp/mouse.el index 835eaa32c6..8428c1e013 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -2402,6 +2402,10 @@ highlight the original region when `mouse-drag-and-drop-region-show-cursor' is non-nil." :version "26.1") +(declare-function rectangle-dimensions "rect" (start end)) +(declare-function rectangle-position-as-coordinates "rect" (position)) +(declare-function rectangle-intersect-p "rect" (pos1 size1 pos2 size2)) + (defun mouse-drag-and-drop-region (event) "Move text in the region to point where mouse is dragged to. The transportation of text is also referred as `drag and drop'. commit 2e8f6ad287acfd4d09f1952d7c45ce7ee68a2474 Author: Stefan Monnier Date: Thu May 16 22:00:57 2019 -0400 * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Fix docstring of accessors. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 23c4351c7c..c4a1dcb8ba 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2903,7 +2903,7 @@ non-nil value, that slot cannot be set via `setf'. ;; and pred-check, so changing it is not straightforward. (push `(,defsym ,accessor (cl-x) ,(format "Access slot \"%s\" of `%s' struct CL-X." - slot struct) + slot name) (declare (side-effect-free t)) ,@(and pred-check (list `(or ,pred-check commit 5f6c08ef2c52c7fe526cbe4f9a684438f6a72007 Author: Stefan Monnier Date: Thu May 16 21:50:16 2019 -0400 * lisp/gnus/nnheader.el (mail-header-*): Define via cl-defstruct This also has the side effect that the accessors are now defined as proper functions rather than as macros, so they can be passed to `mapcar` etc.. * lisp/gnus/nnheader.el (mail-header-number, mail-header-subject) (mail-header-from, mail-header-date, mail-header-id) (mail-header-references, mail-header-chars, mail-header-lines) (mail-header-xref, mail-header-extra): Define via cl-defstruct. (mail-header-set-number, mail-header-set-subject) (mail-header-set-from, mail-header-set-date, mail-header-set-id) (mail-header-set-message-id, mail-header-set-references) (mail-header-set-chars, mail-header-set-lines, mail-header-set-xref) (mail-header-set-extra): Remove, use `setf` instead. All callers adjusted. * lisp/gnus/gnus-sum.el (gnus-select-newsgroup) (gnus-summary-pop-limit, gnus-summary-limit-mark-excluded-as-read) (gnus-summary-find-matching, gnus-find-matching-articles): * lisp/gnus/gnus-kill.el (gnus-apply-kill-file-internal, gnus-execute): * lisp/gnus/gnus-score.el (gnus-score-adaptive): Eta-reduce, now that mail-header-FIELD are functions. diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index d6d2457dd9..bed480f554 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -3929,7 +3929,7 @@ If REREAD is not nil, downloaded articles are marked as unread." (nnheader-insert-file-contents file) (nnheader-remove-body) (setq header (nnheader-parse-naked-head))) - (mail-header-set-number header (car downloaded)) + (setf (mail-header-number header) (car downloaded)) (if nov-arts (let ((key (concat "^" (int-to-string (car nov-arts)) "\t"))) diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el index 5e6483d105..afe8a8a416 100644 --- a/lisp/gnus/gnus-cache.el +++ b/lisp/gnus/gnus-cache.el @@ -187,9 +187,9 @@ it's not cached." (setq lines-chars (nnheader-get-lines-and-char)) (nnheader-remove-body) (setq headers (nnheader-parse-naked-head)) - (mail-header-set-number headers number) - (mail-header-set-lines headers (car lines-chars)) - (mail-header-set-chars headers (cadr lines-chars)) + (setf (mail-header-number headers) number) + (setf (mail-header-lines headers) (car lines-chars)) + (setf (mail-header-chars headers) (cadr lines-chars)) (gnus-cache-change-buffer group) (set-buffer (cdr gnus-cache-buffer)) (goto-char (point-max)) diff --git a/lisp/gnus/gnus-kill.el b/lisp/gnus/gnus-kill.el index a7ded39303..442d26cf4f 100644 --- a/lisp/gnus/gnus-kill.el +++ b/lisp/gnus/gnus-kill.el @@ -350,8 +350,7 @@ Returns the number of articles marked as read." (let ((headers gnus-newsgroup-headers)) (if gnus-kill-killed (setq gnus-newsgroup-kill-headers - (mapcar (lambda (header) (mail-header-number header)) - headers)) + (mapcar #'mail-header-number headers)) (while headers (unless (gnus-member-of-range (mail-header-number (car headers)) @@ -600,8 +599,7 @@ marked as read or ticked are ignored." ((cond ((fboundp (setq function (intern-soft - (concat "mail-header-" (downcase field))))) - (setq function `(lambda (h) (,function h)))) + (concat "mail-header-" (downcase field)))))) ((when (setq extras (member (downcase field) (mapcar (lambda (header) diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el index 58c05e0716..529cd8a337 100644 --- a/lisp/gnus/gnus-salt.el +++ b/lisp/gnus/gnus-salt.el @@ -573,9 +573,9 @@ Two predefined functions are available: (header (if (vectorp header) header (progn (setq header (make-mail-header "*****")) - (mail-header-set-number header 0) - (mail-header-set-lines header 0) - (mail-header-set-chars header 0) + (setf (mail-header-number header) 0) + (setf (mail-header-lines header) 0) + (setf (mail-header-chars header) 0) header))) (gnus-tmp-from (mail-header-from header)) (gnus-tmp-subject (mail-header-subject header)) diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 2faf0f951d..476c36023e 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -2341,9 +2341,7 @@ score in `gnus-newsgroup-scored' by SCORE." "references" (symbol-name (caar elem))) (cdar elem))) - (setcar (car elem) - `(lambda (h) - (,func h)))) + (setcar (car elem) func)) (setq elem (cdr elem))) (setq malist (cdr malist))) ;; Then we score away. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 9431b06b4f..00f0de61d7 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -1014,10 +1014,9 @@ following hook: (add-hook gnus-select-group-hook (lambda () (mapcar (lambda (header) - (mail-header-set-subject - header - (gnus-simplify-subject - (mail-header-subject header) \\='re-only))) + (setf (mail-header-subject header) + (gnus-simplify-subject + (mail-header-subject header) \\='re-only))) gnus-newsgroup-headers)))" :group 'gnus-group-select :type 'hook) @@ -4401,7 +4400,7 @@ Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." (setq id-dep (puthash (setq id (nnmail-message-id)) (list header) dependencies)) - (mail-header-set-id header id)) + (setf (mail-header-id header) id)) ;; The last case ignores an existing entry, except it adds any ;; additional Xrefs (in case the two articles came from different @@ -4409,11 +4408,10 @@ Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." ;; Also sets `header' to nil meaning that the `dependencies' ;; table was *not* modified. (t - (mail-header-set-xref - (car id-dep) - (concat (or (mail-header-xref (car id-dep)) - "") - (or (mail-header-xref header) ""))) + (setf (mail-header-xref (car id-dep)) + (concat (or (mail-header-xref (car id-dep)) + "") + (or (mail-header-xref header) ""))) (setq header nil))) (when (and header (not replaced)) @@ -4427,7 +4425,7 @@ Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." ;; Yuk! This is a reference loop. Make the article be a ;; root article. (progn - (mail-header-set-references (car id-dep) "none") + (setf (mail-header-references (car id-dep)) "none") (setq ref nil) (setq parent-id nil)) (setq ref (gnus-parent-id (mail-header-references ref-header))))) @@ -4565,8 +4563,8 @@ Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." (when (and (string= references "") (setq in-reply-to (mail-header-extra header)) (setq in-reply-to (cdr (assq 'In-Reply-To in-reply-to)))) - (mail-header-set-references - header (gnus-extract-message-id-from-in-reply-to in-reply-to))) + (setf (mail-header-references header) + (gnus-extract-message-id-from-in-reply-to in-reply-to))) (when gnus-alter-header-function (funcall gnus-alter-header-function header)) @@ -5619,7 +5617,7 @@ or a straight list of headers." (setq subject (concat (substring subject 0 (match-beginning 1)) (substring subject (match-end 1))))) - (mail-header-set-subject header subject)))))) + (setf (mail-header-subject header) subject)))))) (defun gnus-fetch-headers (articles &optional limit force-new dependencies) "Fetch headers of ARTICLES." @@ -5775,8 +5773,7 @@ If SELECT-ARTICLES, only select those articles from GROUP." (setq gnus-newsgroup-limit (copy-sequence articles)) ;; Remove canceled articles from the list of unread articles. (setq fetched-articles - (mapcar (lambda (headers) (mail-header-number headers)) - gnus-newsgroup-headers)) + (mapcar #'mail-header-number gnus-newsgroup-headers)) (setq gnus-newsgroup-articles fetched-articles) (setq gnus-newsgroup-unreads (gnus-sorted-nintersection @@ -6642,7 +6639,7 @@ This is meant to be called in `gnus-article-internal-prepare-hook'." (search-forward "\nXref:" nil t)) (goto-char (1+ (match-end 0))) (setq xref (buffer-substring (point) (point-at-eol))) - (mail-header-set-xref headers xref))))))) + (setf (mail-header-xref headers) xref))))))) (defun gnus-summary-insert-subject (id &optional old-header use-old-header) "Find article ID and insert the summary line for that article. @@ -6680,7 +6677,7 @@ too, instead of trying to fetch new headers." (let ((gnus-newsgroup-headers (list header))) (gnus-summary-remove-list-identifiers)) (when old-header - (mail-header-set-number header (mail-header-number old-header))) + (setf (mail-header-number header) (mail-header-number old-header))) (setq gnus-newsgroup-sparse (delq (setq number (mail-header-number header)) gnus-newsgroup-sparse)) @@ -8281,8 +8278,7 @@ If given a prefix, remove all limits." (interactive "P") (when total (setq gnus-newsgroup-limits - (list (mapcar (lambda (h) (mail-header-number h)) - gnus-newsgroup-headers)))) + (list (mapcar #'mail-header-number gnus-newsgroup-headers)))) (unless gnus-newsgroup-limits (error "No limit to pop")) (prog1 @@ -8790,8 +8786,7 @@ If ALL, mark even excluded ticked and dormants as read." (setq gnus-newsgroup-limit (sort gnus-newsgroup-limit #'<)) (let ((articles (gnus-sorted-ndifference (sort - (mapcar (lambda (h) (mail-header-number h)) - gnus-newsgroup-headers) + (mapcar #'mail-header-number gnus-newsgroup-headers) #'<) gnus-newsgroup-limit)) article) @@ -9580,8 +9575,7 @@ Optional argument BACKWARD means do search for backward. This search includes all articles in the current group that Gnus has fetched headers for, whether they are displayed or not." (let ((articles nil) - ;; FIXME: Can't η-reduce because it's a macro (make it define-inline) - (func `(lambda (h) (,(intern (concat "mail-header-" header)) h))) + (func (intern (concat "mail-header-" header))) (case-fold-search t)) (dolist (header gnus-newsgroup-headers) ;; FIXME: when called from gnus-summary-limit-include-thread via @@ -9612,8 +9606,7 @@ not match REGEXP on HEADER." (error "%s is an invalid header" header)) (unless (fboundp (intern (concat "mail-header-" header))) (error "%s is not a valid header" header)) - ;; FIXME: eta-reduce! - (setq func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))) + (setq func (intern (concat "mail-header-" header)))) (dolist (d (if (eq backward 'all) gnus-newsgroup-data (gnus-data-find-list @@ -12650,7 +12643,7 @@ If REVERSE, save parts that do not match TYPE." ;; If we fetched by Message-ID and the article came from ;; a different group (or server), we fudge some bogus ;; article numbers for this article. - (mail-header-set-number header gnus-reffed-article-number)) + (setf (mail-header-number header) gnus-reffed-article-number)) (with-current-buffer gnus-summary-buffer (cl-decf gnus-reffed-article-number) (gnus-remove-header (mail-header-number header)) diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index c8b7eed987..aca29fea57 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -979,7 +979,7 @@ all. This may very well take some time.") "Add a nov line for the GROUP base." (with-current-buffer (nndiary-open-nov group) (goto-char (point-max)) - (mail-header-set-number headers article) + (setf (mail-header-number headers) article) (nnheader-insert-nov headers))) (defsubst nndiary-header-value () @@ -994,8 +994,8 @@ all. This may very well take some time.") (goto-char (point-min)) (if (search-forward "\n\n" nil t) (1- (point)) (point-max)))) (let ((headers (nnheader-parse-naked-head))) - (mail-header-set-chars headers chars) - (mail-header-set-number headers number) + (setf (mail-header-chars headers) chars) + (setf (mail-header-number headers) number) headers)))) (defun nndiary-open-nov (group) diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el index 1c83045e45..41963f32ef 100644 --- a/lisp/gnus/nnfolder.el +++ b/lisp/gnus/nnfolder.el @@ -1162,15 +1162,15 @@ This command does not work if you use short group names." (with-temp-buffer (insert-buffer-substring buf b e) (let ((headers (nnheader-parse-naked-head))) - (mail-header-set-chars headers chars) - (mail-header-set-number headers number) + (setf (mail-header-chars headers) chars) + (setf (mail-header-number headers) number) headers))))) (defun nnfolder-add-nov (group article headers) "Add a nov line for the GROUP base." (with-current-buffer (nnfolder-open-nov group) (goto-char (point-max)) - (mail-header-set-number headers article) + (setf (mail-header-number headers) article) (nnheader-insert-nov headers))) (provide 'nnfolder) diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index 090b842084..e138f141c6 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -136,97 +136,30 @@ on your system, you could say something like: ;; (That next-to-last entry is defined as "misc" in the NOV format, ;; but Gnus uses it for xrefs.) -(defmacro mail-header-number (header) - "Return article number in HEADER." - `(aref ,header 0)) - -(defmacro mail-header-set-number (header number) - "Set article number of HEADER to NUMBER." - `(aset ,header 0 ,number)) - -(defmacro mail-header-subject (header) - "Return subject string in HEADER." - `(aref ,header 1)) - -(defmacro mail-header-set-subject (header subject) - "Set article subject of HEADER to SUBJECT." - `(aset ,header 1 ,subject)) - -(defmacro mail-header-from (header) - "Return author string in HEADER." - `(aref ,header 2)) - -(defmacro mail-header-set-from (header from) - "Set article author of HEADER to FROM." - `(aset ,header 2 ,from)) - -(defmacro mail-header-date (header) - "Return date in HEADER." - `(aref ,header 3)) - -(defmacro mail-header-set-date (header date) - "Set article date of HEADER to DATE." - `(aset ,header 3 ,date)) - -(defalias 'mail-header-message-id 'mail-header-id) -(defmacro mail-header-id (header) - "Return Id in HEADER." - `(aref ,header 4)) - -(defalias 'mail-header-set-message-id 'mail-header-set-id) -(defmacro mail-header-set-id (header id) - "Set article Id of HEADER to ID." - `(aset ,header 4 ,id)) - -(defmacro mail-header-references (header) - "Return references in HEADER." - `(aref ,header 5)) - -(defmacro mail-header-set-references (header ref) - "Set article references of HEADER to REF." - `(aset ,header 5 ,ref)) - -(defmacro mail-header-chars (header) - "Return number of chars of article in HEADER." - `(aref ,header 6)) - -(defmacro mail-header-set-chars (header chars) - "Set number of chars in article of HEADER to CHARS." - `(aset ,header 6 ,chars)) - -(defmacro mail-header-lines (header) - "Return lines in HEADER." - `(aref ,header 7)) - -(defmacro mail-header-set-lines (header lines) - "Set article lines of HEADER to LINES." - `(aset ,header 7 ,lines)) - -(defmacro mail-header-xref (header) - "Return xref string in HEADER." - `(aref ,header 8)) - -(defmacro mail-header-set-xref (header xref) - "Set article XREF of HEADER to xref." - `(aset ,header 8 ,xref)) - -(defmacro mail-header-extra (header) - "Return the extra headers in HEADER." - `(aref ,header 9)) - -(defun mail-header-set-extra (header extra) - "Set the extra headers in HEADER to EXTRA." - (aset header 9 extra)) +(cl-defstruct (mail-header + (:type vector) + (:constructor nil) + (:constructor make-full-mail-header + (&optional number subject from date id + references chars lines xref + extra))) + number + subject + from + date + id + references + chars + lines + xref + extra) + +(defalias 'mail-header-message-id #'mail-header-id) (defsubst make-mail-header (&optional init) "Create a new mail header structure initialized with INIT." - (make-vector 10 init)) - -(defsubst make-full-mail-header (&optional number subject from date id - references chars lines xref - extra) - "Create a new mail header structure initialized with the parameters given." - (vector number subject from date id references chars lines xref extra)) + (make-full-mail-header init init init init init + init init init init init)) ;; fake message-ids: generation and detection diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 37a38a58d4..9d59a4db0d 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -723,7 +723,7 @@ skips all prompting." (mail-header-number novitem))) (art (car (rassq artno articleids)))) (when art - (mail-header-set-number novitem art) + (setf (mail-header-number novitem) art) (push novitem headers)) (forward-line 1))))) (setq headers diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el index 501ea1d390..1b42d3b505 100644 --- a/lisp/gnus/nnmairix.el +++ b/lisp/gnus/nnmairix.el @@ -1419,12 +1419,12 @@ TYPE is either 'nov or 'headers." (setq cur (nnheader-parse-nov)) (when corr (setq article (+ (mail-header-number cur) numc)) - (mail-header-set-number cur article)) + (setf (mail-header-number cur) article)) (setq xref (mail-header-xref cur)) (when (and (stringp xref) (string-match (format "[ \t]%s:[0-9]+" backendgroup) xref)) (setq xref (replace-match (format " %s:%d" mairixgroup article) t nil xref)) - (mail-header-set-xref cur xref)) + (setf (mail-header-xref cur) xref)) (set-buffer buf) (nnheader-insert-nov cur) (set-buffer nntp-server-buffer) diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el index 205e9e4803..1d9d166dba 100644 --- a/lisp/gnus/nnml.el +++ b/lisp/gnus/nnml.el @@ -792,14 +792,14 @@ article number. This function is called narrowed to an article." "Add a nov line for the GROUP nov headers, incrementally." (with-current-buffer (nnml-open-incremental-nov group) (goto-char (point-max)) - (mail-header-set-number headers article) + (setf (mail-header-number headers) article) (nnheader-insert-nov headers))) (defun nnml-add-nov (group article headers) "Add a nov line for the GROUP base." (with-current-buffer (nnml-open-nov group) (goto-char (point-max)) - (mail-header-set-number headers article) + (setf (mail-header-number headers) article) (nnheader-insert-nov headers))) (defsubst nnml-header-value () @@ -816,8 +816,8 @@ article number. This function is called narrowed to an article." (1- (point)) (point-max)))) (let ((headers (nnheader-parse-naked-head))) - (mail-header-set-chars headers chars) - (mail-header-set-number headers number) + (setf (mail-header-chars headers) chars) + (setf (mail-header-number headers) number) headers)))) (defun nnml-get-nov-buffer (group &optional incrementalp) diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index 7b87502d0e..b08b27dd1e 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el @@ -461,22 +461,21 @@ Valid types include `google', `dejanews', and `gmane'.") (subject (mail-header-subject header)) (rfc2047-encoding-type 'mime)) (when (string-match " \\([^:]+\\)[:/]\\([0-9]+\\)" xref) - (mail-header-set-xref - header - (format "http://article.gmane.org/%s/%s/raw" - (match-string 1 xref) - (match-string 2 xref)))) + (setf (mail-header-xref header) + (format "http://article.gmane.org/%s/%s/raw" + (match-string 1 xref) + (match-string 2 xref)))) ;; Add host part to gmane-encrypted addresses (when (string-match "@$" from) - (mail-header-set-from header - (concat from "public.gmane.org"))) + (setf (mail-header-from header) + (concat from "public.gmane.org"))) - (mail-header-set-subject header - (rfc2047-encode-string subject)) + (setf (mail-header-subject header) + (rfc2047-encode-string subject)) (unless (nnweb-get-hashtb (mail-header-xref header)) - (mail-header-set-number header (cl-incf (cdr active))) + (setf (mail-header-number header) (cl-incf (cdr active))) (push (list (mail-header-number header) header) map) (nnweb-set-hashtb (cadar map) (car map)))))) (forward-line 1))) commit ca3c59146bd5c0effdc7602718b91f1ee41f866a Author: Katsumi Yamaoka Date: Fri May 17 01:34:47 2019 +0000 Fix ffap behavior in the Gnus group buffer (bug#35693) * lisp/ffap.el (ffap-file-exists-string, ffap-file-at-point): Don't recognize "" as a path or a file name (bug#35693). diff --git a/lisp/ffap.el b/lisp/ffap.el index bcb5efef54..08f7208945 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -513,7 +513,9 @@ When using jka-compr (a.k.a. `auto-compression-mode'), the returned name may have a suffix added from `ffap-compression-suffixes'. The optional NOMODIFY argument suppresses the extra search." (cond - ((not file) nil) ; quietly reject nil + ((or (not file) ; quietly reject nil + (zerop (length file))) ; and also "" + nil) ((file-exists-p file) file) ; try unmodified first ;; three reasons to suppress search: (nomodify nil) @@ -1326,6 +1328,7 @@ which may actually result in an URL rather than a filename." ;; If it contains a colon, get rid of it (and return if exists) ((and (string-match path-separator name) (setq name (ffap-string-at-point 'nocolon)) + (> (length name) 0) (ffap-file-exists-string name))) ;; File does not exist, try the alist: ((let ((alist ffap-alist) tem try case-fold-search) commit 802dcafb5ebc3588e26a7f83e6144b73d99f2e13 Author: Stefan Monnier Date: Thu May 16 20:49:06 2019 -0400 * mule.el (set-buffer-file-coding-system): Don't burp on iso-2022-7bit diff --git a/lisp/international/mule.el b/lisp/international/mule.el index ba30fee496..b5414de0db 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1345,8 +1345,11 @@ just set the variable `buffer-file-coding-system' directly." (setq coding-system (merge-coding-systems coding-system buffer-file-coding-system))) (when (and (called-interactively-p 'interactive) - (not (memq 'emacs (coding-system-get coding-system - :charset-list)))) + ;; FIXME: For some reason + ;; (coding-system-get 'iso-2022-7bit :charset-list) + ;; returns `iso-2022' rather than returning a list! + (let ((css (coding-system-get coding-system :charset-list))) + (not (and (listp css) (memq 'emacs css))))) ;; Check whether save would succeed, and jump to the offending char(s) ;; if not. (let ((css (find-coding-systems-region (point-min) (point-max)))) commit 8d3fff6bd68198b1a76dce559b0b8a5f87cd5103 Author: Paul Pogonyshev Date: Thu Jan 10 20:39:54 2019 +0100 Make `package' not "uninhibit" messages (Bug#34037) * lisp/emacs-lisp/package.el: Don't let-bind inhibit-message to a different value if it was non-nil. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 949ad711ae..7b779b5ae5 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1625,7 +1625,7 @@ downloads in the background." (make-directory package-user-dir t)) (let ((default-keyring (expand-file-name "package-keyring.gpg" data-directory)) - (inhibit-message async)) + (inhibit-message (or inhibit-message async))) (when (and package-check-signature (file-exists-p default-keyring)) (condition-case-unless-debug error (package-import-keyring default-keyring) @@ -3261,7 +3261,7 @@ objects removed." (redisplay 'force) (dolist (elt (package--sort-by-dependence delete-list)) (condition-case-unless-debug err - (let ((inhibit-message package-menu-async)) + (let ((inhibit-message (or inhibit-message package-menu-async))) (package-delete elt nil 'nosave)) (error (message "Error trying to delete `%s': %S" (package-desc-full-name elt) commit 9408e36b84b8e81dd9f4d1465c4f20f125d4bd06 Author: Basil L. Contovounesios Date: Tue May 7 13:46:22 2019 +0100 Fix gnus-summary-expand-window placement of point * lisp/gnus/gnus-win.el (gnus-configure-frame): Replace switch-to-buffer with pop-to-buffer-same-window to avoid messing with point. (bug#35613) diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index a992fe731c..40c5b42d45 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -285,7 +285,7 @@ See the Gnus manual for an explanation of the syntax used.") ;; from a hard-dedicated frame, it creates (and ;; configures) a new frame, leaving the dedicated frame alone. (pop-to-buffer buf)) - (t (switch-to-buffer buf))))) + (t (pop-to-buffer-same-window buf))))) (when (memq 'frame-focus split) (setq gnus-window-frame-focus window)) ;; We return the window if it has the `point' spec. commit b2c0eb63dd1f0d68de9bf7f14cc337df51617dcc Author: Basil L. Contovounesios Date: Thu May 16 23:26:27 2019 +0100 Add docstring to project--read-file-cpd-relative For discussion, see thread starting at: https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00460.html * lisp/progmodes/project.el (project--read-file-cpd-relative): Describe arglist as promised by user option project-read-file-name-function. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index eab508af3a..cc45a71f57 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -477,6 +477,10 @@ For the arguments list, see `project--read-file-cpd-relative'." (defun project--read-file-cpd-relative (prompt all-files &optional predicate hist default) + "Read a file name, prompting with PROMPT. +ALL-FILES is a list of possible file name completions. +PREDICATE, HIST, and DEFAULT have the same meaning as in +`completing-read'." (let* ((common-parent-directory (let ((common-prefix (try-completion "" all-files))) (if (> (length common-prefix) 0) commit 9ed0b55848ce8a3049fd82e42cd9ea274410d426 Author: Stefan Monnier Date: Thu May 16 17:16:36 2019 -0400 * cl-macs-tests.el (cl-macs-test--symbol-macrolet): New test diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el index 989553bd7b..09ce660a2f 100644 --- a/test/lisp/emacs-lisp/cl-macs-tests.el +++ b/test/lisp/emacs-lisp/cl-macs-tests.el @@ -513,4 +513,21 @@ collection clause." (macroexpand '(cl-defstruct (hash-table (:predicate hash-table-p)))) :type 'wrong-type-argument)) +(ert-deftest cl-macs-test--symbol-macrolet () + ;; A `setq' shouldn't be converted to a `setf' just because it occurs within + ;; a symbol-macrolet! + (should-error + ;; Use `eval' so the error is signaled when running the test rather than + ;; when macroexpanding it. + (eval '(let ((l (list 1))) (cl-symbol-macrolet ((x 1)) (setq (car l) 0))))) + ;; Make sure `gv-synthetic-place' isn't macro-expanded before `setf' gets to + ;; see its `gv-expander'. + (should (equal (let ((l '(0))) + (let ((cl (car l))) + (cl-symbol-macrolet + ((p (gv-synthetic-place cl (lambda (v) `(setcar l ,v))))) + (cl-incf p))) + l) + '(1)))) + ;;; cl-macs-tests.el ends here commit c89b0add51305e83c822c08f1026e7d1278eec74 Author: Eric Abrahamsen Date: Thu May 16 12:47:18 2019 -0700 Fix stray call to make-vector * lisp/gnus/gnus-agent.el (gnus-agent-fetch-group-1): This is meant to be a hash table. diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 9f7d2c9df7..d6d2457dd9 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -2439,7 +2439,7 @@ modified) original contents, they are first saved to their own file." ;; Parse them and see which articles we want to fetch. (setq gnus-newsgroup-dependencies (or gnus-newsgroup-dependencies - (make-vector (length articles) 0))) + (gnus-make-hashtable (length articles)))) (setq gnus-newsgroup-headers (or gnus-newsgroup-headers (gnus-get-newsgroup-headers-xover articles nil nil commit 37c41c6ef01de5bf16948eb67c4a9da6c7158b34 Author: Stefan Monnier Date: Thu May 16 15:29:36 2019 -0400 * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand) : Rewrite The previous code had 2 problems: - It converted `setq` to `setf` in unrelated cases such as (cl-symbol-macrolet ((x 1)) (setq (car foo) bar)) - It macroexpanded places before `setf` had a chance to see if they have a gv-expander. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 16e9bd6a75..23c4351c7c 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2145,16 +2145,26 @@ of `cl-symbol-macrolet' to additionally expand symbol macros." (let ((symval (assq exp venv))) (when symval (setq exp (cadr symval))))) - (`(setq . ,_) + (`(setq . ,args) ;; Convert setq to setf if required by symbol-macro expansion. - (let* ((args (mapcar (lambda (f) (macroexpand f env)) - (cdr exp))) - (p args)) - (while (and p (symbolp (car p))) (setq p (cddr p))) - (if p (setq exp (cons 'setf args)) - (setq exp (cons 'setq args)) - ;; Don't loop further. - nil))) + (let ((convert nil) + (rargs nil)) + (while args + (let ((place (pop args))) + ;; Here, we know `place' should be a symbol. + (while + (let ((symval (assq place venv))) + (when symval + (setq place (cadr symval)) + (if (symbolp place) + t ;Repeat. + (setq convert t) + nil)))) + (push place rargs) + (push (pop args) rargs))) + (setq exp (cons (if convert 'setf 'setq) + (nreverse rargs))) + convert)) ;; CL's symbol-macrolet used to treat re-bindings as candidates for ;; expansion (turning the let into a letf if needed), contrary to ;; Common-Lisp where such re-bindings hide the symbol-macro. commit 4ac234ad576cf9068419805ef338701024265afb Author: Paul Eggert Date: Thu May 16 10:42:27 2019 -0700 Distribute test cases in tarballs by default * INSTALL, INSTALL.REPO, admin/make-tarball.txt: Mention ‘make check’. * configure.ac: Update comment. * etc/NEWS: Say that tarballs have a test directory. * make-dist (with_tests): Default to "yes". Add an option --no-tests to make it "no". diff --git a/INSTALL b/INSTALL index b2a06b3d15..6934022c4e 100644 --- a/INSTALL +++ b/INSTALL @@ -82,6 +82,10 @@ sections if you need to. src/emacs -Q + To test Emacs further (intended mostly to help developers): + + make check + 6. Assuming that the program 'src/emacs' starts and displays its opening screen, you can install the program and its auxiliary files into their installation directories: diff --git a/INSTALL.REPO b/INSTALL.REPO index 6dca9dd714..b7433856c6 100644 --- a/INSTALL.REPO +++ b/INSTALL.REPO @@ -32,8 +32,8 @@ can invoke './configure -C'. After configuring, build Emacs as follows: $ make -If you want to install Emacs, type 'make install' instead of 'make' in -the last command. +You can also type 'make check' to test and 'make install' to install +Emacs. Occasionally the file 'lisp/loaddefs.el' (and similar automatically generated files, such as 'esh-groups.el', and '*-loaddefs.el' in some diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 47b60173f8..43992a0bb2 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -115,7 +115,7 @@ General steps (for each step, check for possible errors): results against the new tar contents. 7. tar -xf emacs-NEW.tar; cd emacs-NEW - ./configure --prefix=/tmp/emacs && make && make install + ./configure --prefix=/tmp/emacs && make check && make install Use 'script' or M-x compile to save the compilation log in compile-NEW.log and compare it against an old one. The easiest way to do that is to visit the old log in Emacs, change the version diff --git a/configure.ac b/configure.ac index d13dddfd9a..0f1fd5d26e 100644 --- a/configure.ac +++ b/configure.ac @@ -5726,9 +5726,8 @@ m4_define([subdir_makefiles], SUBDIR_MAKEFILES="subdir_makefiles" AC_CONFIG_FILES(subdir_makefiles) -dnl test/ is not present in release tarfiles. +dnl The test/ directory is missing if './make-dist --no-tests' was used. opt_makefile=test/Makefile - if test -f "$srcdir/$opt_makefile.in"; then SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile" dnl Again, it's best not to use a variable. Though you can add diff --git a/etc/NEWS b/etc/NEWS index ce637a7679..8c059157ba 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -101,6 +101,10 @@ option was useful with modern debugging tools such as AddressSanitizer. (See etc/DEBUG for the details of using the modern replacements of the removed configure options.) ++++ +** The distribution tarball now has test cases; 'make check' runs them. +This is intended mostly to help developers. + --- ** Emacs now requires GTK 2.24 and GTK 3.10 for the GTK 2 and GTK 3 builds respectively. diff --git a/make-dist b/make-dist index 74660032e9..e4e6d40d98 100755 --- a/make-dist +++ b/make-dist @@ -52,7 +52,7 @@ make_tar=no default_gzip=gzip newer="" with_info=yes -with_tests=no +with_tests=yes changelog=yes verbose=no @@ -110,11 +110,16 @@ while [ $# -gt 0 ]; do ;; ## Include the test/ directory. - ## This option is mainly for the hydra build server. + ## This is for backward compability to when --no-tests was the default. "--tests") with_tests=yes ;; + ## Exclude the test/ directory. + "--no-tests") + with_tests=no + ;; + "--verbose") verbose=yes ;; @@ -131,9 +136,9 @@ while [ $# -gt 0 ]; do echo " --no-update don't recompile or do analogous things" echo " --no-changelog don't generate the top-level ChangeLog" echo " --no-info don't include info files" + echo " --no-tests don't include the test/ directory" echo " --snapshot same as --clean-up --no-update --tar --no-check" echo " --tar make a tar file" - echo " --tests include the test/ directory" echo " --verbose noisier output" echo "" exit 0 commit bc0adf112d82a9b89f858f80e04f1ee2f401fa05 Author: Lars Ingebrigtsen Date: Thu May 16 13:38:11 2019 +0200 Make shr-rescale-image respect get-buffer-window again * lisp/net/shr.el (shr-rescale-image): Partially revert previous change -- ressurrect the check for `get-buffer-window'. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 3ff0c24778..c1e9fdd30d 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1101,36 +1101,38 @@ WIDTH and HEIGHT are the sizes given in the HTML data, if any. The size of the displayed image will not exceed MAX-WIDTH/MAX-HEIGHT. If not given, use the current window width/height instead." - (let* ((edges (window-inside-pixel-edges - (get-buffer-window (current-buffer)))) - (max-width (truncate (* shr-max-image-proportion - (or max-width - (- (nth 2 edges) (nth 0 edges)))))) - (max-height (truncate (* shr-max-image-proportion - (or max-height - (- (nth 3 edges) (nth 1 edges)))))) - (scaling (image-compute-scaling-factor image-scaling-factor))) - (when (or (and width - (> width max-width)) - (and height - (> height max-height))) - (setq width nil - height nil)) - (if (and width height - (< (* width scaling) max-width) - (< (* height scaling) max-height)) + (if (not (get-buffer-window (current-buffer))) + (create-image data nil t :ascent 100) + (let* ((edges (window-inside-pixel-edges + (get-buffer-window (current-buffer)))) + (max-width (truncate (* shr-max-image-proportion + (or max-width + (- (nth 2 edges) (nth 0 edges)))))) + (max-height (truncate (* shr-max-image-proportion + (or max-height + (- (nth 3 edges) (nth 1 edges)))))) + (scaling (image-compute-scaling-factor image-scaling-factor))) + (when (or (and width + (> width max-width)) + (and height + (> height max-height))) + (setq width nil + height nil)) + (if (and width height + (< (* width scaling) max-width) + (< (* height scaling) max-height)) + (create-image + data nil t + :ascent 100 + :width width + :height height + :format content-type) (create-image data nil t :ascent 100 - :width width - :height height - :format content-type) - (create-image - data nil t - :ascent 100 - :max-width max-width - :max-height max-height - :format content-type)))) + :max-width max-width + :max-height max-height + :format content-type))))) ;; url-cache-extract autoloads url-cache. (declare-function url-cache-create-filename "url-cache" (url)) commit 63a71535a8998ac6e8cadb9db44cf1dca650d4cb Author: Ivan Shmakov Date: Fri Sep 14 19:05:12 2018 +0000 Improve user convenience of the rcirc debug buffer * lisp/net/rcirc.el (rcirc-debug): Ignore rcirc-debug-buffer read-only status. Restore point after insertion unless it was at the end. Ensure a newline before each [lead]. Replace %Y-%m-%d with the equivalent %F in format-time-string; remove useless concat. (Bug#32470) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index b1a6c1ce8d..e8710becd0 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -679,16 +679,24 @@ last ping." "If non-nil, write information to `rcirc-debug-buffer'.") (defun rcirc-debug (process text) "Add an entry to the debug log including PROCESS and TEXT. -Debug text is written to `rcirc-debug-buffer' if `rcirc-debug-flag' -is non-nil." +Debug text is appended to `rcirc-debug-buffer' if `rcirc-debug-flag' +is non-nil. + +For convenience, the read-only state of the debug buffer is ignored. +When the point is at the end of the visible portion of the buffer, it +is moved to after the text inserted. Otherwise the point is not moved." (when rcirc-debug-flag (with-current-buffer (get-buffer-create rcirc-debug-buffer) - (goto-char (point-max)) - (insert (concat - "[" - (format-time-string "%Y-%m-%dT%T ") (process-name process) - "] " - text))))) + (let ((old (point-marker))) + (set-marker-insertion-type old t) + (goto-char (point-max)) + (let ((inhibit-read-only t)) + (terpri (current-buffer) t) + (insert "[" + (format-time-string "%FT%T ") (process-name process) + "] " + text)) + (goto-char old))))) (define-obsolete-variable-alias 'rcirc-sentinel-hooks 'rcirc-sentinel-functions "24.3") commit 04e9938350d3820648d28d7cf4aa1885a08fd9b7 Author: Noam Postavsky Date: Tue May 7 18:15:35 2019 -0400 Accept NO-PROPERTIES in thing-at-point aliases (Bug#35491) * lisp/thingatpt.el (word-at-point, sentence-at-point): Accept and pass NO-PROPERTIES to thing-at-point. * etc/NEWS: Announce change. diff --git a/etc/NEWS b/etc/NEWS index 699a04b524..ce637a7679 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1283,11 +1283,18 @@ automatically updates. In the buffer, you can use 's q' or 's e' to signal a thread with quit or error respectively, or get a snapshot backtrace with 'b'. + +** thingatpt.el + --- -** thingatpt.el supports a new "thing" called 'uuid'. +*** 'thing-at-point' supports a new "thing" called 'uuid'. A symbol 'uuid' can be passed to 'thing-at-point' and it returns the UUID at point. +--- +*** 'word-at-point' and 'sentence-at-point' accept NO-PROPERTIES. +Just like 'thing-at-point' itself. + ** Interactive automatic highlighting +++ diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 26e084320b..60a20e2d18 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -585,13 +585,13 @@ See RFC 4122 for the description of the format.") ;; Aliases -(defun word-at-point () +(defun word-at-point (&optional no-properties) "Return the word at point. See `thing-at-point'." - (thing-at-point 'word)) + (thing-at-point 'word no-properties)) -(defun sentence-at-point () +(defun sentence-at-point (&optional no-properties) "Return the sentence at point. See `thing-at-point'." - (thing-at-point 'sentence)) + (thing-at-point 'sentence no-properties)) (defun thing-at-point--read-from-whole-string (str) "Read a Lisp expression from STR.