aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorGlenn Morris2021-10-04 08:13:11 -0700
committerGlenn Morris2021-10-04 08:13:11 -0700
commite0fdb68f8ccb1c870bfb8c3cd2bf786a0bb312b6 (patch)
treec196f5f691ae5ad5d732f49af358768eaf9141ef /lisp/textmodes
parentf0e6b47ef0a5ee15568e0b3992352d00d1055f46 (diff)
parent3b8dda6c903e8e103a26ce812fc9400b301a09ae (diff)
downloademacs-e0fdb68f8ccb1c870bfb8c3cd2bf786a0bb312b6.tar.gz
emacs-e0fdb68f8ccb1c870bfb8c3cd2bf786a0bb312b6.zip
Merge from origin/emacs-28
3b8dda6c90 Add safety check in x_menu_show e1fb731393 Tweak x_connection_closed when I/O error 595e506c82 * lisp/erc/erc.el (erc-user-mode): Set "+i" by default. d00f3d4c05 Port unused decls to C2x 317eb2d5b5 Improve structure of TODO c0793cd9de Don't use some obsolete names in documentation 87153cc915 Tweak x_hide_tip for consistency 7e871dcd27 Remove encode_terminal_code UNINITs 2a00634880 Port pdumper.c maybe_unused to C2x 6d9b3c0eaa Port systhreads.h to C2x fd274d7d24 Pacify -Wanalyzer-null-argument in lisp_malloc cc3fc94f09 Pacify gcc 11.2.1 -Wanalyzer-null-argument d3a832a61a Simplify hack-read-symbol-shorthands again (bug#50946) 4831426158 Fix recipe for 'native-lisp' directory 0bb42ef803 ; * lisp/time-stamp.el (time-stamp-format): Doc string. 732c70a0d9 Simplify socket symlink-attack checking fc32a3bd95 ; * doc/lispref/files.texi (Reading from Files): Fix wording. 3cc77aa976 Clarify (elisp) insert-file-contents with BEG or END not o... 5deeb0947d * src/Makefile.in: Simplify conditionals. 121a5abeae Move context-menu selection items Defun/List/Symbol to pro... 0c341e6e84 * lisp/tab-bar.el (tab-bar-detach-tab): Handle frame selec... 931a7276c0 * lisp/tab-line.el (tab-line-format): Add face-modified to... 3863919a00 Fix unmounting in Tramp 7a6d34cd1f * etc/themes/light-blue-theme.el: Add "Maintainer: emacs-d... c1b1e1f545 Define HAVE_NATIVE_COMP in src/Makefile.in 137fa2d716 Rename elisp-shorthands to read-symbol-shorthands e6fbc45b7b Font-lock shorthands in elisp-mode for quick visual recogn... 17e6f3bee5 ; Fix last change in tramp-sshfs.el 3dae1e33d1 Suppress superfluous error messages in Tramp b228ec9fab Fix reading the tail of a file in shorthands.el 7fb2789509 Fix substitution of pretty quotes in code in easy-mmode b47d7ce1b8 Fix agent directory deletion b1a8a66fb0 ; * etc/TODO: Fix previous commit; delete the right thing. 6c01a21365 Clarify the purpose of internal--format-docstring-line 55dadbc57e * lisp/net/dictionary.el (context-menu-dictionary): Move m... bb209cd5ab Update to Org 9.5-30-g10dc9d 4341e79a5f Remove bogus ":safe t" custom properties b6f6b593c6 Fix 'apropos-compact-layout' 62d6cecfcd Remove bogus ":safe nil" custom properties f9111d8784 The safe-local-variable property is a function (bug#50944) 3dc094abee ; Some minor tweaks to TODO a5b4356d37 Revert "; * etc/TODO: Move elpa.gnu.org items to the end." 7bc0cee115 Revert "* etc/TODO: Rearrange to start with "Simple tasks"." 3489471417 Fix selection of fonts for Arabic on Posix platforms 13e5943386 ; Fix a typo in a doc string bd60fca2fa Fix ox-koma-letter compilation warnings 340e527bed Preload paren.el a9052248da Improve documentation of 'shift-select-mode' d505971894 ; Standardize some license headers 9307889d68 Simplify shorthand injection (bug#50946) 5c77cc9584 ; * admin/release-branch.txt: Tweak previous. # Conflicts: # etc/NEWS # test/lisp/subr-tests.el
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/etc-authors-mode.el8
-rw-r--r--lisp/textmodes/fill.el2
-rw-r--r--lisp/textmodes/reftex-cite.el4
-rw-r--r--lisp/textmodes/reftex-ref.el4
-rw-r--r--lisp/textmodes/text-mode.el25
-rw-r--r--lisp/textmodes/tildify.el4
6 files changed, 36 insertions, 11 deletions
diff --git a/lisp/textmodes/etc-authors-mode.el b/lisp/textmodes/etc-authors-mode.el
index a591b2db978..8b5fefd3b7d 100644
--- a/lisp/textmodes/etc-authors-mode.el
+++ b/lisp/textmodes/etc-authors-mode.el
@@ -5,18 +5,20 @@
5;; Author: Stefan Kangas <stefan@marxist.se> 5;; Author: Stefan Kangas <stefan@marxist.se>
6;; Keywords: internal 6;; Keywords: internal
7 7
8;; This program is free software; you can redistribute it and/or modify 8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by 11;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation, either version 3 of the License, or 12;; the Free Software Foundation, either version 3 of the License, or
11;; (at your option) any later version. 13;; (at your option) any later version.
12 14
13;; This program is distributed in the hope that it will be useful, 15;; GNU Emacs is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of 16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details. 18;; GNU General Public License for more details.
17 19
18;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
19;; along with this program. If not, see <https://www.gnu.org/licenses/>. 21;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
20 22
21;;; Commentary: 23;;; Commentary:
22 24
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 81d908c95e7..decce88573b 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -768,7 +768,7 @@ space does not end a sentence, so don't break a line there."
768 (setq first nil 768 (setq first nil
769 linebeg (+ (point) (length actual-fill-prefix)))) 769 linebeg (+ (point) (length actual-fill-prefix))))
770 (move-to-column (current-fill-column)) 770 (move-to-column (current-fill-column))
771 (if (when (< (point) to) 771 (if (when (and (< (point) to) (< linebeg to))
772 ;; Find the position where we'll break the line. 772 ;; Find the position where we'll break the line.
773 ;; Use an immediately following space, if any. 773 ;; Use an immediately following space, if any.
774 ;; However, note that `move-to-column' may overshoot 774 ;; However, note that `move-to-column' may overshoot
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 8a54b1a301f..e1475934ddb 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -814,7 +814,7 @@ in order to only add another reference in the same cite command."
814 (interactive) 814 (interactive)
815 (reftex-citation nil ?t)) 815 (reftex-citation nil ?t))
816 816
817(defvar reftex-select-bib-map) 817(defvar reftex-select-bib-mode-map)
818(defvar reftex--found-list) 818(defvar reftex--found-list)
819(defun reftex-offer-bib-menu () 819(defun reftex-offer-bib-menu ()
820 "Offer bib menu and return list of selected items." 820 "Offer bib menu and return list of selected items."
@@ -870,7 +870,7 @@ in order to only add another reference in the same cite command."
870 (reftex-select-item 870 (reftex-select-item
871 reftex-citation-prompt 871 reftex-citation-prompt
872 reftex-citation-help 872 reftex-citation-help
873 reftex-select-bib-map 873 reftex-select-bib-mode-map
874 nil 874 nil
875 'reftex-bibtex-selection-callback nil)) 875 'reftex-bibtex-selection-callback nil))
876 (setq key (car rtn) 876 (setq key (car rtn)
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index 9d5bc5a8f0f..a5d83c34d67 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -533,7 +533,7 @@ When called with 2 \\[universal-argument] prefix args, disable magic word recogn
533 (cons (cdr cell) (- (match-end 0) (match-end 1))) 533 (cons (cdr cell) (- (match-end 0) (match-end 1)))
534 nil))) 534 nil)))
535 535
536(defvar reftex-select-label-map) 536(defvar reftex-select-label-mode-map)
537(defun reftex-offer-label-menu (typekey) 537(defun reftex-offer-label-menu (typekey)
538 ;; Offer a menu with the appropriate labels. 538 ;; Offer a menu with the appropriate labels.
539 (let* ((buf (current-buffer)) 539 (let* ((buf (current-buffer))
@@ -605,7 +605,7 @@ When called with 2 \\[universal-argument] prefix args, disable magic word recogn
605 (reftex-select-item 605 (reftex-select-item
606 reftex-select-label-prompt 606 reftex-select-label-prompt
607 reftex-select-label-help 607 reftex-select-label-help
608 reftex-select-label-map 608 reftex-select-label-mode-map
609 offset 609 offset
610 'reftex-show-label-location follow)) 610 'reftex-show-label-location follow))
611 (setq key (car rtn) 611 (setq key (car rtn)
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index 74c6d412a65..3243bd31c4c 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -95,6 +95,28 @@ inherit all the commands defined in this map.")
95 :style toggle 95 :style toggle
96 :selected (memq 'turn-on-auto-fill text-mode-hook)])) 96 :selected (memq 'turn-on-auto-fill text-mode-hook)]))
97 97
98(defun text-mode-menu (menu click)
99 "Populate MENU with text selection commands at CLICK."
100
101 (when (thing-at-mouse click 'word)
102 (define-key-after menu [select-region mark-word]
103 `(menu-item "Word"
104 ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'word))
105 :help "Mark the word at click for a subsequent cut/copy")
106 'mark-whole-buffer))
107 (define-key-after menu [select-region mark-sentence]
108 `(menu-item "Sentence"
109 ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'sentence))
110 :help "Mark the sentence at click for a subsequent cut/copy")
111 'mark-whole-buffer)
112 (define-key-after menu [select-region mark-paragraph]
113 `(menu-item "Paragraph"
114 ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'paragraph))
115 :help "Mark the paragraph at click for a subsequent cut/copy")
116 'mark-whole-buffer)
117
118 menu)
119
98 120
99(define-derived-mode text-mode nil "Text" 121(define-derived-mode text-mode nil "Text"
100 "Major mode for editing text written for humans to read. 122 "Major mode for editing text written for humans to read.
@@ -104,7 +126,8 @@ You can thus get the full benefit of adaptive filling
104\\{text-mode-map} 126\\{text-mode-map}
105Turning on Text mode runs the normal hook `text-mode-hook'." 127Turning on Text mode runs the normal hook `text-mode-hook'."
106 (setq-local text-mode-variant t) 128 (setq-local text-mode-variant t)
107 (setq-local require-final-newline mode-require-final-newline)) 129 (setq-local require-final-newline mode-require-final-newline)
130 (add-hook 'context-menu-functions 'text-mode-menu 10 t))
108 131
109(define-derived-mode paragraph-indent-text-mode text-mode "Parindent" 132(define-derived-mode paragraph-indent-text-mode text-mode "Parindent"
110 "Major mode for editing text, with leading spaces starting a paragraph. 133 "Major mode for editing text, with leading spaces starting a paragraph.
diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el
index 01e2ad72d88..2a4c8cff8f0 100644
--- a/lisp/textmodes/tildify.el
+++ b/lisp/textmodes/tildify.el
@@ -67,7 +67,7 @@ matching the white space). The pattern is matched case-sensitive regardless of
67the value of `case-fold-search' setting." 67the value of `case-fold-search' setting."
68 :version "25.1" 68 :version "25.1"
69 :type 'regexp 69 :type 'regexp
70 :safe t) 70 :safe #'stringp)
71 71
72(defcustom tildify-pattern-alist () 72(defcustom tildify-pattern-alist ()
73 "Alist specifying where to insert hard spaces. 73 "Alist specifying where to insert hard spaces.
@@ -112,7 +112,7 @@ If nil, current major mode has no way to represent a hard space."
112 " ") 112 " ")
113 (const :tag "No-break space (U+00A0)" "\u00A0") 113 (const :tag "No-break space (U+00A0)" "\u00A0")
114 (string :tag "Custom string")) 114 (string :tag "Custom string"))
115 :safe t) 115 :safe #'string-or-null-p)
116 116
117(defcustom tildify-string-alist () 117(defcustom tildify-string-alist ()
118 "Alist specifying what is a hard space in the current major mode. 118 "Alist specifying what is a hard space in the current major mode.