commit 8f784a27667fbebdf320388ef2ec46ae67f69230 (HEAD, refs/remotes/origin/master) Merge: ed9adafc0b a4078fa628 Author: Stefan Kangas Date: Wed Aug 17 06:30:25 2022 +0200 Merge from origin/emacs-28 a4078fa628 ; * lisp/vc/ediff.el: Improve wording in last change. dd077ebded Revert "; * doc/lispintro/emacs-lisp-intro.texi: Fix typo." 362c9ab879 * doc/misc/gnus.texi (Article Washing): Fix Links URL. commit ed9adafc0bdcfc2c79534282f888df3b250db329 Author: Po Lu Date: Wed Aug 17 10:20:25 2022 +0800 Avoid disabling device multiple times while handling XI attachment events * src/xterm.c (handle_one_xevent): Avoid disabling devices if we notice it has been disabled while handling XISlaveDetached or XISlaveAttached. diff --git a/src/xterm.c b/src/xterm.c index 7487450d64..a40440e0da 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -22653,13 +22653,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (info) { - if (device && info->enabled) + if (device) { device->use = info->use; device->attachment = info->attachment; } - else if (device) - disabled[n_disabled++] = hev->info[i].deviceid; + + /* device could have been disabled by now. + But instead of removing it immediately, + wait for XIDeviceDisabled, or internal + state could be left inconsistent. */ XIFreeDeviceInfo (info); } commit b24f7667ad686093c2b013bc58e2f1234d7487fd Author: Stefan Monnier Date: Tue Aug 16 17:29:26 2022 -0400 * src/buffer.c (Frename_buffer): Fix bug#56693 diff --git a/src/buffer.c b/src/buffer.c index 98066a2eb6..4fd5b2be3e 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1563,6 +1563,7 @@ This does not change the name of the visited file (if any). */) (register Lisp_Object newname, Lisp_Object unique) { register Lisp_Object tem, buf; + Lisp_Object requestedname = newname; CHECK_STRING (newname); @@ -1579,7 +1580,8 @@ This does not change the name of the visited file (if any). */) if (NILP (unique) && XBUFFER (tem) == current_buffer) return BVAR (current_buffer, name); if (!NILP (unique)) - newname = Fgenerate_new_buffer_name (newname, BVAR (current_buffer, name)); + newname = Fgenerate_new_buffer_name (newname, + BVAR (current_buffer, name)); else error ("Buffer name `%s' is in use", SDATA (newname)); } @@ -1599,7 +1601,7 @@ This does not change the name of the visited file (if any). */) run_buffer_list_update_hook (current_buffer); call2 (intern ("uniquify--rename-buffer-advice"), - BVAR (current_buffer, name), unique); + requestedname, unique); /* Refetch since that last call may have done GC. */ return BVAR (current_buffer, name); commit 8517d1e9aaf098993c5999480a301f472ba05f1d Author: Mattias Engdegård Date: Tue Aug 16 20:37:02 2022 +0200 * lisp/dired.el (dired-mark-if): Evaluate MSG once to avoid warning. diff --git a/lisp/dired.el b/lisp/dired.el index f261f9f477..10813e56df 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -775,19 +775,20 @@ of the region if `dired-mark-region' is non-nil. Otherwise, operate on the whole buffer. Return value is the number of files marked, or nil if none were marked." - `(let ((inhibit-read-only t) count + `(let ((msg ,msg) + (inhibit-read-only t) count (use-region-p (dired-mark--region-use-p)) (beg (dired-mark--region-beginning)) (end (dired-mark--region-end))) (save-excursion (setq count 0) - (when ,msg + (when msg (message "%s %ss%s%s..." (cond ((eq dired-marker-char ?\s) "Unmarking") ((eq dired-del-marker dired-marker-char) "Flagging") (t "Marking")) - ,msg + msg (if (eq dired-del-marker dired-marker-char) " for deletion" "") @@ -802,9 +803,9 @@ Return value is the number of files marked, or nil if none were marked." (insert dired-marker-char) (setq count (1+ count)))) (forward-line 1)) - (when ,msg (message "%s %s%s %s%s%s" + (when msg (message "%s %s%s %s%s%s" count - ,msg + msg (dired-plural-s count) (if (eq dired-marker-char ?\s) "un" "") (if (eq dired-marker-char dired-del-marker) commit fb98c4a4060ee756af41dee7a23472219314d37a Author: Mattias Engdegård Date: Tue Aug 16 19:03:46 2022 +0200 Improved `null` (alias `not`) optimisation Take static boolean information of the argument into account. * lisp/emacs-lisp/byte-opt.el (byte-optimize-not): New. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 74a6523cec..bbe8135f04 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1306,11 +1306,22 @@ See Info node `(elisp) Integer Basics'." condition form))) +(defun byte-optimize-not (form) + (and (= (length form) 2) + (let ((arg (nth 1 form))) + (cond ((null arg) t) + ((macroexp-const-p arg) nil) + ((byte-compile-nilconstp arg) `(progn ,arg t)) + ((byte-compile-trueconstp arg) `(progn ,arg nil)) + (t form))))) + (put 'and 'byte-optimizer #'byte-optimize-and) (put 'or 'byte-optimizer #'byte-optimize-or) (put 'cond 'byte-optimizer #'byte-optimize-cond) (put 'if 'byte-optimizer #'byte-optimize-if) (put 'while 'byte-optimizer #'byte-optimize-while) +(put 'not 'byte-optimizer #'byte-optimize-not) +(put 'null 'byte-optimizer #'byte-optimize-not) ;; byte-compile-negation-optimizer lives in bytecomp.el (put '/= 'byte-optimizer #'byte-compile-negation-optimizer) commit 621550c076b135e47cf1a377a779263e12401b8a Author: Mattias Engdegård Date: Fri Aug 12 20:12:54 2022 +0200 Improved `and` and `or` optimisation * lisp/emacs-lisp/byte-opt.el (byte-optimize-and, byte-optimize-or): Rewrite. Avoid branching on arguments statically known to be true or false, and hoist code out to an unconditional prefix when possible. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 579e2f61ae..74a6523cec 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1125,35 +1125,91 @@ See Info node `(elisp) Integer Basics'." (nth 1 form))) (defun byte-optimize-and (form) - ;; Simplify if less than 2 args. - ;; if there is a literal nil in the args to `and', throw it and following - ;; forms away, and surround the `and' with (progn ... nil). - (cond ((null (cdr form))) - ((memq nil form) - (list 'progn - (byte-optimize-and - (prog1 (setq form (copy-sequence form)) - (while (nth 1 form) - (setq form (cdr form))) - (setcdr form nil))) - nil)) - ((null (cdr (cdr form))) - (nth 1 form)) - ((byte-optimize-constant-args form)))) + (let ((seq nil) + (new-args nil) + (nil-result nil) + (args (cdr form))) + (while + (and args + (let ((arg (car args))) + (cond + (seq ; previous arg was always-true + (push arg seq) + (unless (and (cdr args) (byte-compile-trueconstp arg)) + (push `(progn . ,(nreverse seq)) new-args) + (setq seq nil)) + t) + ((and (cdr args) (byte-compile-trueconstp arg)) + ;; Always-true arg: evaluate unconditionally. + (push arg seq) + t) + ((and arg (not (byte-compile-nilconstp arg))) + (push arg new-args) + t) + (t + ;; Throw away the remaining args; this one is always false. + (setq nil-result t) + (when arg + (push arg new-args)) ; keep possible side-effects + nil)))) + (setq args (cdr args))) + + (setq new-args (nreverse new-args)) + (if (equal new-args (cdr form)) + ;; Input is unchanged: keep original form, and don't represent + ;; a nil result explicitly because that would lead to infinite + ;; growth when the optimiser is iterated. + (setq nil-result nil) + (setq form (cons (car form) new-args))) + + (let ((new-form + (pcase form + ;; (and (progn ... X) ...) -> (progn ... (and X ...)) + (`(,head (progn . ,forms) . ,rest) + `(progn ,@(butlast forms) (,head ,(car (last forms)) . ,rest))) + (`(,_) t) ; (and) -> t + (`(,_ ,arg) arg) ; (and X) -> X + (_ (byte-optimize-constant-args form))))) + (if nil-result + `(progn ,new-form nil) + new-form)))) (defun byte-optimize-or (form) - ;; Throw away nil's, and simplify if less than 2 args. - ;; If there is a literal non-nil constant in the args to `or', throw away all - ;; following forms. - (setq form (remq nil form)) - (let ((rest form)) - (while (cdr (setq rest (cdr rest))) - (if (byte-compile-trueconstp (car rest)) - (setq form (copy-sequence form) - rest (setcdr (memq (car rest) form) nil)))) - (if (cdr (cdr form)) - (byte-optimize-constant-args form) - (nth 1 form)))) + (let ((seq nil) + (new-args nil) + (args (remq nil (cdr form)))) ; Discard nil arguments. + (while + (and args + (let ((arg (car args))) + (cond + (seq ; previous arg was always-false + (push arg seq) + (unless (and (cdr args) (byte-compile-nilconstp arg)) + (push `(progn . ,(nreverse seq)) new-args) + (setq seq nil)) + t) + ((and (cdr args) (byte-compile-nilconstp arg)) + ;; Always-false arg: evaluate unconditionally. + (push arg seq) + t) + (t + (push arg new-args) + ;; If this arg is always true, throw away the remaining args. + (not (byte-compile-trueconstp arg)))))) + (setq args (cdr args))) + + (setq new-args (nreverse new-args)) + ;; Keep original form unless the arguments changed. + (unless (equal new-args (cdr form)) + (setq form (cons (car form) new-args))) + + (pcase form + ;; (or (progn ... X) ...) -> (progn ... (or X ...)) + (`(,head (progn . ,forms) . ,rest) + `(progn ,@(butlast forms) (,head ,(car (last forms)) . ,rest))) + (`(,_) nil) ; (or) -> nil + (`(,_ ,arg) arg) ; (or X) -> X + (_ (byte-optimize-constant-args form))))) (defun byte-optimize-cond (form) ;; if any clauses have a literal nil as their test, throw them away. @@ -1242,6 +1298,7 @@ See Info node `(elisp) Integer Basics'." (list 'progn condition nil))))) (defun byte-optimize-while (form) + ;; FIXME: This check does not belong here, move! (when (< (length form) 2) (byte-compile-warn-x form "too few arguments for `while'")) (let ((condition (nth 1 form))) commit e618b6faee5b81d17501fdb2e6b121062f95c021 Author: Mattias Engdegård Date: Fri Aug 12 20:12:25 2022 +0200 Improved `if` and `while` optimisation Recognise some more special cases: (if X nil t) -> (not X) (if X t) -> (not (not X)) (if X t nil) -> (not (not X)) (if VAR VAR X...) -> (or VAR (progn X...)) * lisp/emacs-lisp/byte-opt.el (byte-opt-negate): New. (byte-optimize-if): Add transformations above and refactor. (byte-optimize-while): Better static nil-detection. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 062f5bf0a2..579e2f61ae 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1190,49 +1190,64 @@ See Info node `(elisp) Integer Basics'." (and clauses form))) form)) +(defsubst byte-opt--negate (form) + "Negate FORM, avoiding double negation if already negated." + (if (and (consp form) (memq (car form) '(not null))) + (cadr form) + `(not ,form))) + (defun byte-optimize-if (form) - ;; (if (progn ) ) ==> (progn (if )) - ;; (if ) ==> - ;; (if ) ==> (progn ) - ;; (if nil ) ==> (if (not ) (progn )) - ;; (if nil) ==> (if ) - (let ((clause (nth 1 form))) - (cond ((and (eq (car-safe clause) 'progn) - (proper-list-p clause)) - (if (null (cddr clause)) - ;; A trivial `progn'. - (byte-optimize-if `(,(car form) ,(cadr clause) ,@(nthcdr 2 form))) - (nconc (butlast clause) - (list - (byte-optimize-if - `(,(car form) ,(car (last clause)) ,@(nthcdr 2 form))))))) - ((byte-compile-trueconstp clause) - `(progn ,clause ,(nth 2 form))) - ((byte-compile-nilconstp clause) - `(progn ,clause ,@(nthcdr 3 form))) - ((nth 2 form) - (if (equal '(nil) (nthcdr 3 form)) - (list (car form) clause (nth 2 form)) - form)) - ((or (nth 3 form) (nthcdr 4 form)) - (list (car form) - ;; Don't make a double negative; - ;; instead, take away the one that is there. - (if (and (consp clause) (memq (car clause) '(not null)) - (= (length clause) 2)) ; (not xxxx) or (not (xxxx)) - (nth 1 clause) - (list 'not clause)) - (if (nthcdr 4 form) - (cons 'progn (nthcdr 3 form)) - (nth 3 form)))) - (t - (list 'progn clause nil))))) + (let ((condition (nth 1 form)) + (then (nth 2 form)) + (else (nthcdr 3 form))) + (cond + ;; (if (progn ... X) ...) -> (progn ... (if X ...)) + ((eq (car-safe condition) 'progn) + (nconc (butlast condition) + (list + (byte-optimize-if + `(,(car form) ,(car (last condition)) ,@(nthcdr 2 form)))))) + ;; (if TRUE THEN ...) -> (progn TRUE THEN) + ((byte-compile-trueconstp condition) + `(progn ,condition ,then)) + ;; (if FALSE THEN ELSE...) -> (progn FALSE ELSE...) + ((byte-compile-nilconstp condition) + (if else + `(progn ,condition ,@else) + condition)) + ;; (if X nil t) -> (not X) + ((and (eq then nil) (eq else '(t))) + `(not ,condition)) + ;; (if X t [nil]) -> (not (not X)) + ((and (eq then t) (or (null else) (eq else '(nil)))) + `(not ,(byte-opt--negate condition))) + ;; (if VAR VAR X...) -> (or VAR (progn X...)) + ((and (symbolp condition) (eq condition then)) + `(or ,then ,(if (cdr else) + `(progn . ,else) + (car else)))) + ;; (if X THEN nil) -> (if X THEN) + (then + (if (equal else '(nil)) + (list (car form) condition then) + form)) + ;; (if X nil ELSE...) -> (if (not X) (progn ELSE...)) + ((or (car else) (cdr else)) + (list (car form) (byte-opt--negate condition) + (if (cdr else) + `(progn . ,else) + (car else)))) + ;; (if X nil nil) -> (progn X nil) + (t + (list 'progn condition nil))))) (defun byte-optimize-while (form) (when (< (length form) 2) (byte-compile-warn-x form "too few arguments for `while'")) - (if (nth 1 form) - form)) + (let ((condition (nth 1 form))) + (if (byte-compile-nilconstp condition) + condition + form))) (put 'and 'byte-optimizer #'byte-optimize-and) (put 'or 'byte-optimizer #'byte-optimize-or) commit 869db699ee276349b5de17b54daa4e75433075b9 Author: Mattias Engdegård Date: Fri Aug 12 20:11:52 2022 +0200 Improved static detection of nil and non-nil expressions * lisp/emacs-lisp/byte-opt.el (byte-opt--bool-value-form): New. (byte-compile-trueconstp, byte-compile-nilconstp): Determine a static nil or non-nil result in more cases. These functions have grown and are no longer defsubst. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 52e0095284..062f5bf0a2 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -722,35 +722,83 @@ for speeding up processing.") ;; something not EQ to its argument if and ONLY if it has made a change. ;; This implies that you cannot simply destructively modify the list; ;; you must return something not EQ to it if you make an optimization. -;; -;; It is now safe to optimize code such that it introduces new bindings. -(defsubst byte-compile-trueconstp (form) +(defsubst byte-opt--bool-value-form (form) + "The form in FORM that yields its boolean value, possibly FORM itself." + (while (let ((head (car-safe form))) + (cond ((memq head '( progn inline save-excursion save-restriction + save-current-buffer)) + (setq form (car (last form))) + t) + ((memq head '(let let* setq setcar setcdr)) + (setq form (car (last (cddr form)))) + t) + ((memq head '( prog1 unwind-protect copy-sequence identity + reverse nreverse sort)) + (setq form (nth 1 form)) + t) + ((eq head 'mapc) + (setq form (nth 2 form)) + t)))) + form) + +(defun byte-compile-trueconstp (form) "Return non-nil if FORM always evaluates to a non-nil value." - (while (eq (car-safe form) 'progn) - (setq form (car (last (cdr form))))) + (setq form (byte-opt--bool-value-form form)) (cond ((consp form) - (pcase (car form) - ('quote (cadr form)) - ;; Can't use recursion in a defsubst. - ;; (`progn (byte-compile-trueconstp (car (last (cdr form))))) - )) + (let ((head (car form))) + ;; FIXME: Lots of other expressions are statically non-nil. + (cond ((memq head '(quote function)) (cadr form)) + ((eq head 'list) (cdr form)) + ((memq head + ;; FIXME: Replace this list with a function property? + '( length safe-length cons lambda + string make-string format concat + substring substring-no-properties string-replace + replace-regexp-in-string symbol-name make-symbol + mapconcat + vector make-vector vconcat make-record record + regexp-quote regexp-opt + buffer-string buffer-substring + buffer-substring-no-properties + current-buffer buffer-size + point point-min point-max + following-char preceding-char max-char + + - * / % 1+ 1- min max abs + logand logior lorxor lognot ash + number-to-string string-to-number + int-to-string char-to-string prin1-to-string + byte-to-string string-to-vector string-to-char + always)) + t) + ((eq head 'if) + (and (byte-compile-trueconstp (nth 2 form)) + (byte-compile-trueconstp (car (last (cdddr form)))))) + ((memq head '(not null)) + (byte-compile-nilconstp (cadr form))) + ((eq head 'or) + (and (cdr form) + (byte-compile-trueconstp (car (last (cdr form))))))))) ((not (symbolp form))) ((eq form t)) ((keywordp form)))) -(defsubst byte-compile-nilconstp (form) +(defun byte-compile-nilconstp (form) "Return non-nil if FORM always evaluates to a nil value." - (while (eq (car-safe form) 'progn) - (setq form (car (last (cdr form))))) - (cond ((consp form) - (pcase (car form) - ('quote (null (cadr form))) - ;; Can't use recursion in a defsubst. - ;; (`progn (byte-compile-nilconstp (car (last (cdr form))))) - )) - ((not (symbolp form)) nil) - ((null form)))) + (setq form (byte-opt--bool-value-form form)) + (or (not form) ; assume (quote nil) always being normalised to nil + (and (consp form) + (let ((head (car form))) + ;; FIXME: There are many other expressions that are statically nil. + (cond ((memq head '(while ignore)) t) + ((eq head 'if) + (and (byte-compile-nilconstp (nth 2 form)) + (byte-compile-nilconstp (car (last (cdddr form)))))) + ((memq head '(not null)) + (byte-compile-trueconstp (cadr form))) + ((eq head 'and) + (and (cdr form) + (byte-compile-nilconstp (car (last (cdr form))))))))))) ;; If the function is being called with constant integer args, ;; evaluate as much as possible at compile-time. This optimizer commit 4b1ab183917b12a8ae13d6c78dd034e84429ca40 Author: Michael Albinus Date: Tue Aug 16 20:32:58 2022 +0200 Fix autoload in tramp.el diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 046d814547..ed40245e8a 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1055,6 +1055,7 @@ Derived from `tramp-postfix-host-format'.") (defconst tramp-unknown-id-integer -1 "Integer used to denote an unknown user or group.") +;;;###tramp-autoload (defconst tramp-root-id-string "root" "String used to denote the root user or group.") commit 12c3461b455bf06551060ed6061f7df84967ae97 Author: Michael Albinus Date: Tue Aug 16 19:41:00 2022 +0200 Handle root permissions on remote files * lisp/net/tramp.el (tramp-check-cached-permissions): Check also for remote uid/gid being 0. (Bug#57238) * lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls): Convert numeric uid/gid strings into real strings. (tramp-sh-get-signal-strings): Use `zerop'. * lisp/net/tramp.el (tramp-root-id-string, tramp-root-id-integer): New defconsts. (tramp-handle-find-backup-file-name, tramp-handle-lock-file) (tramp-local-host-p, tramp-handle-make-auto-save-file-name) * lisp/net/tramp-sh.el (tramp-default-method-alist) (ramp-default-user-alist, tramp-find-shell): * lisp/net/tramp-sudoedit.el (tramp-default-user-alist): Use them. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index f2e3c48235..4a9cf2e699 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -410,11 +410,12 @@ The string is used in `tramp-methods'.") (tramp-copy-keep-date t))) (add-to-list 'tramp-default-method-alist - `(,tramp-local-host-regexp "\\`root\\'" "su")) + `(,tramp-local-host-regexp + ,(format "\\`%s\\'" tramp-root-id-string) "su")) (add-to-list 'tramp-default-user-alist `(,(concat "\\`" (regexp-opt '("su" "sudo" "doas" "ksu")) "\\'") - nil "root")) + nil ,tramp-root-id-string)) ;; Do not add "ssh" based methods, otherwise ~/.ssh/config would be ignored. ;; Do not add "plink" based methods, they ask interactively for the user. (add-to-list 'tramp-default-user-alist @@ -1314,8 +1315,12 @@ component is used as the target of the symlink." ;; ... uid and gid (setq res-uid-string (read (current-buffer))) (setq res-gid-string (read (current-buffer))) + (when (natnump res-uid-string) + (setq res-uid-string (number-to-string res-uid-string))) (unless (stringp res-uid-string) (setq res-uid-string (symbol-name res-uid-string))) + (when (natnump res-gid-string) + (setq res-gid-string (number-to-string res-gid-string))) (unless (stringp res-gid-string) (setq res-gid-string (symbol-name res-gid-string))) ;; ... size @@ -3096,7 +3101,7 @@ implementation will be used." (cond ;; Some predefined values, which aren't reported sometimes, ;; or would raise problems (all Stopped signals). - ((= i 0) 0) + ((zerop i) 0) ((string-equal (nth i signals) "HUP") "Hangup") ((string-equal (nth i signals) "INT") "Interrupt") ((string-equal (nth i signals) "QUIT") "Quit") @@ -4272,8 +4277,10 @@ file exists and nonzero exit status otherwise." (with-tramp-connection-property vec "remote-shell" ;; CCC: "root" does not exist always, see my QNAP ;; TS-459. Which check could we apply instead? - (tramp-send-command vec "echo ~root" t) - (if (or (string-match-p "^~root$" (buffer-string)) + (tramp-send-command + vec (format "echo ~%s" tramp-root-id-string) t) + (if (or (string-match-p + (format "^~%s$" tramp-root-id-string) (buffer-string)) ;; The default shell (ksh93) of OpenSolaris ;; and Solaris is buggy. We've got reports ;; for "SunOS 5.10" and "SunOS 5.11" so far. diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 3564a1b7b4..0de2e0ef69 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el @@ -48,7 +48,8 @@ ("-p" "Password:") ("--"))) (tramp-password-previous-hop t))) - (add-to-list 'tramp-default-user-alist '("\\`sudoedit\\'" nil "root")) + (add-to-list 'tramp-default-user-alist + `("\\`sudoedit\\'" nil ,tramp-root-id-string)) (tramp-set-completion-function tramp-sudoedit-method tramp-completion-function-alist-su)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5ffc4f1b88..046d814547 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1055,6 +1055,12 @@ Derived from `tramp-postfix-host-format'.") (defconst tramp-unknown-id-integer -1 "Integer used to denote an unknown user or group.") +(defconst tramp-root-id-string "root" + "String used to denote the root user or group.") + +(defconst tramp-root-id-integer 0 + "Integer used to denote the root user or group.") + ;;; File name format: (defun tramp-build-remote-file-name-spec-regexp () @@ -4097,9 +4103,10 @@ Let-bind it when necessary.") (when (and (not tramp-allow-unsafe-temporary-files) (not backup-inhibited) (file-in-directory-p (car result) temporary-file-directory) - (zerop (or (file-attribute-user-id - (file-attributes filename 'integer)) - tramp-unknown-id-integer)) + (= (or (file-attribute-user-id + (file-attributes filename 'integer)) + tramp-unknown-id-integer) + tramp-root-id-integer) (not (with-tramp-connection-property (tramp-get-process v) "unsafe-temporary-file" (yes-or-no-p @@ -4482,9 +4489,10 @@ Do not set it manually, it is used buffer-local in `tramp-get-lock-pid'.") (when (and (not tramp-allow-unsafe-temporary-files) create-lockfiles (file-in-directory-p lockname temporary-file-directory) - (zerop (or (file-attribute-user-id - (file-attributes file 'integer)) - tramp-unknown-id-integer)) + (= (or (file-attribute-user-id + (file-attributes file 'integer)) + tramp-unknown-id-integer) + tramp-root-id-integer) (not (with-tramp-connection-property (tramp-get-process v) "unsafe-temporary-file" (yes-or-no-p @@ -5840,14 +5848,16 @@ be granted." ;; User accessible and owned by user. (and (eq access (aref (file-attribute-modes file-attr) offset)) - (or (equal remote-uid tramp-unknown-id-integer) + (or (equal remote-uid tramp-root-id-integer) + (equal remote-uid tramp-unknown-id-integer) (equal remote-uid (file-attribute-user-id file-attr)) (equal tramp-unknown-id-integer (file-attribute-user-id file-attr)))) ;; Group accessible and owned by user's principal group. (and (eq access (aref (file-attribute-modes file-attr) (+ offset 3))) - (or (equal remote-gid tramp-unknown-id-integer) + (or (equal remote-gid tramp-root-id-integer) + (equal remote-gid tramp-unknown-id-integer) (equal remote-gid (file-attribute-group-id file-attr)) (equal tramp-unknown-id-integer (file-attribute-group-id file-attr))))))) @@ -6007,7 +6017,7 @@ This handles also chrooted environments, which are not regarded as local." (tramp-make-tramp-file-name vec tramp-compat-temporary-file-directory)) ;; On some systems, chown runs only for root. (or (zerop (user-uid)) - (zerop (tramp-get-remote-uid vec 'integer)))))) + (= (tramp-get-remote-uid vec 'integer) tramp-root-id-integer))))) (defun tramp-get-remote-tmpdir (vec) "Return directory for temporary files on the remote host identified by VEC." @@ -6093,9 +6103,10 @@ this file, if that variable is non-nil." (when (and (not tramp-allow-unsafe-temporary-files) auto-save-default (file-in-directory-p result temporary-file-directory) - (zerop (or (file-attribute-user-id - (file-attributes filename 'integer)) - tramp-unknown-id-integer)) + (= (or (file-attribute-user-id + (file-attributes filename 'integer)) + tramp-unknown-id-integer) + tramp-root-id-integer) (not (with-tramp-connection-property (tramp-get-process v) "unsafe-temporary-file" (yes-or-no-p commit 3ea6cb40e62701dfd7eb47a5d465a67e1f56469a Author: Lars Ingebrigtsen Date: Tue Aug 16 19:20:49 2022 +0200 dired-do-shell-command doc string clarification * lisp/dired-aux.el (dired-do-shell-command): Clarify doc string (bug#57228). diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index c8de2669ea..7ff3e33351 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -882,7 +882,7 @@ In a noninteractive call (from Lisp code), you must specify the list of file names explicitly with the FILE-LIST argument, which can be produced by `dired-get-marked-files', for example. -`dired-guess-shell-alist-default' and +If `dired-x' is loaded, `dired-guess-shell-alist-default' and `dired-guess-shell-alist-user' are consulted when the user is prompted for the shell command to use interactively. commit a4078fa62847f34d65c8facbdf705c567f08b36b (refs/remotes/origin/emacs-28) Author: Stefan Kangas Date: Tue Aug 16 16:38:33 2022 +0200 ; * lisp/vc/ediff.el: Improve wording in last change. diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index 63369462e8..46ad94c182 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el @@ -89,11 +89,11 @@ ;; underlining. However, if the region is already underlined by some other ;; overlays, there is no simple way to temporarily remove that residual ;; underlining. This problem occurs when a buffer is highlighted with -;; font-lock.el packages. If this residual highlighting gets in the way, you -;; can do the following. font-lock.el provides commands for unhighlighting -;; buffers. You can either place these commands in `ediff-prepare-buffer-hook' -;; (which will unhighlight every buffer used by Ediff) or you can execute -;; them interactively, at any time and in any buffer. +;; font-lock.el. If this residual highlighting gets in the way, you +;; can use the font-lock.el commands for unhighlighting buffers. +;; Either place these commands in `ediff-prepare-buffer-hook' (which will +;; unhighlight every buffer used by Ediff) or execute them +;; interactively, which you can do at any time and in any buffer. ;;; Acknowledgments: commit 1f31c39b595aac884cf876fcc54b2ff1bc39732c Author: Eli Zaretskii Date: Tue Aug 16 16:40:49 2022 +0300 ; * lisp/bookmark.el (fringe): Require. (Bug#57241) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 7466be32b4..db2063f4ea 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -35,6 +35,7 @@ (require 'pp) (require 'tabulated-list) (require 'text-property-search) +(require 'fringe) ; for builds --without-x (eval-when-compile (require 'cl-lib)) ;;; Misc comments: commit 1097c0d1e4d0e2106f2b63396897e8bc1a5fa808 Author: Stefan Kangas Date: Tue Aug 16 15:29:30 2022 +0200 Advertise obsolete library pgg.el less * doc/misc/gnus-faq.texi (FAQ 8-2): * doc/misc/gnus.texi (Security): * doc/misc/message.texi (Using OpenPGP, PGP Compatibility): * doc/misc/mh-e.texi (Reading PGP, Sending PGP): * lisp/gnus/mml2015.el (mml2015-use): * lisp/info-look.el (mapc): * lisp/mh-e/mh-e.el (mh-mml-method-default): Advertise obsolete library pgg.el less. * lisp/mh-e/mh-identity.el (mh-identity-pgg-default-user-id): Rename from 'mh-identity-gpg-default-user-id', and make the old name into obsolete variable alias. Update all uses. diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index c442ca1bac..6d09fd4ec9 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -1920,10 +1920,9 @@ I can't find anything in the Gnus manual about X @subsubheading Answer There's not only the Gnus manual but also the manuals for message, -emacs-mime, sieve, EasyPG Assistant, and pgg. Those packages are -distributed with Gnus and used by Gnus but aren't really part of core -Gnus, so they are documented in different info files, you should have -a look in those manuals, too. +emacs-mime, sieve, and EasyPG Assistant. Those packages are +distributed with Emacs and used by Gnus. They are documented in +separate info files, so you should have a look in those manuals, too. @node FAQ 8-3 @subsubheading Question 8.3 diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 2b0ee6c114..acc70a260f 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -11560,8 +11560,8 @@ things to work: To handle @acronym{PGP} and @acronym{PGP/MIME} messages, you have to install an OpenPGP implementation such as GnuPG@. The Lisp interface to GnuPG included with Emacs is called EasyPG (@pxref{Top, ,EasyPG, -epa, EasyPG Assistant user's manual}), but PGG (@pxref{Top, ,PGG, pgg, -PGG Manual}), and Mailcrypt are also supported. +epa, EasyPG Assistant user's manual}), but Mailcrypt is also +supported. @item To handle @acronym{S/MIME} message, you need to install OpenSSL@. OpenSSL 0.9.6 @@ -11599,18 +11599,16 @@ public-key matching the @samp{From:} header as the recipient; @item mml1991-use @vindex mml1991-use Symbol indicating elisp interface to OpenPGP implementation for -@acronym{PGP} messages. The default is @code{epg}, but @code{pgg}, -and @code{mailcrypt} are also supported although -deprecated. By default, Gnus uses the first available interface in -this order. +@acronym{PGP} messages. The default is @code{epg}, but +@code{mailcrypt} is also supported although deprecated. By default, +Gnus uses the first available interface in this order. @item mml2015-use @vindex mml2015-use Symbol indicating elisp interface to OpenPGP implementation for @acronym{PGP/MIME} messages. The default is @code{epg}, but -@code{pgg}, and @code{mailcrypt} are also supported -although deprecated. By default, Gnus uses the first available -interface in this order. +@code{mailcrypt} is also supported although deprecated. By default, +Gnus uses the first available interface in this order. @end table diff --git a/doc/misc/message.texi b/doc/misc/message.texi index 49e3faed7b..6a6beb7a1f 100644 --- a/doc/misc/message.texi +++ b/doc/misc/message.texi @@ -1249,8 +1249,8 @@ as @uref{https://www.gnupg.org/, GNU Privacy Guard}. Pre-OpenPGP implementations such as PGP 2.x and PGP 5.x are also supported. The default Emacs interface to the PGP implementation is EasyPG (@pxref{Top,,EasyPG Assistant User's Manual, epa, EasyPG Assistant -User's Manual}), but PGG (@pxref{Top, ,PGG, pgg, PGG Manual}) and -Mailcrypt are also supported. @xref{PGP Compatibility}. +User's Manual}), but Mailcrypt is also supported. @xref{PGP +Compatibility}. As stated earlier, messages encrypted with OpenPGP can be formatted according to two different standards, namely @acronym{PGP} or @@ -1339,8 +1339,7 @@ your PGP implementation, so we refer to it. If you have imported your old PGP 2.x key into GnuPG, and want to send signed and encrypted messages to your fellow PGP 2.x users, you'll discover that the receiver cannot understand what you send. One -solution is to use PGP 2.x instead (e.g., if you use @code{pgg}, set -@code{pgg-default-scheme} to @code{pgp}). You could also convince your +solution is to use PGP 2.x instead. You could also convince your fellow PGP 2.x users to convert to GnuPG@. @vindex mml-signencrypt-style-alist As a final workaround, you can make the sign and encryption work in diff --git a/doc/misc/mh-e.texi b/doc/misc/mh-e.texi index 6a948ce2ca..2106c674f3 100644 --- a/doc/misc/mh-e.texi +++ b/doc/misc/mh-e.texi @@ -2814,24 +2814,6 @@ The appearance of the buttons is controlled by the faces @code{mh-show-pgg-unknown} depending on the validity of the signature. The latter is used whether the signature is unknown or untrusted. -@cindex @samp{pgg} customization group -@cindex PGG -@cindex customization group, @samp{pgg} - -The @samp{pgg} customization group may have some settings which may -interest you. -@iftex -See @cite{The PGG Manual}. -@end iftex -@ifinfo -@xref{Top, , The PGG Manual, pgg, The PGG Manual}. -@end ifinfo -@ifhtml -See -@uref{https://www.gnu.org/software/emacs/manual/pgg.html, -@cite{The PGG Manual}}. -@end ifhtml - @node Printing @section Printing Your Mail @@ -5578,33 +5560,6 @@ variety of mail security mechanisms. The default is @samp{PGP (MIME)} if it is supported; otherwise, the default is @samp{None}. Other mechanisms include vanilla @samp{PGP} and @samp{S/MIME}. -@cindex @samp{pgg} customization group -@cindex PGG -@cindex customization group, @samp{pgg} - -The @samp{pgg} customization group may have some settings which may -interest you. -@iftex -See @cite{The PGG Manual}. -@end iftex -@ifinfo -@xref{Top, , The PGG Manual, pgg, The PGG Manual}. -@end ifinfo -@ifhtml -See -@uref{https://www.gnu.org/software/emacs/manual/pgg.html, -@cite{The PGG Manual}}. -@end ifhtml - -@cindex header field, @samp{Fcc} -@cindex @samp{Fcc} header field -@vindex pgg-encrypt-for-me - -In particular, I turn on the option @code{pgg-encrypt-for-me} so that -all messages I encrypt are encrypted with my public key as well. If -you keep a copy of all of your outgoing mail with a @samp{Fcc:} header -field, this setting is vital so that you can read the mail you write! - @node Checking Recipients @section Checking Recipients diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index a373b7999e..bf9e975f74 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -45,7 +45,7 @@ ;; could be removed. (defvar mml2015-use 'epg "The package used for PGP/MIME. -Valid packages include `epg', `pgg' and `mailcrypt'.") +Valid packages include `epg', and `mailcrypt'.") ;; Something is not RFC2015. (defvar mml2015-function-alist diff --git a/lisp/info-look.el b/lisp/info-look.el index 6c8ef091a0..7f45f976a2 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -1068,7 +1068,6 @@ Return nil if there is nothing appropriate in the buffer near point." ("newsticker" "Index") ("octave" "(octave-mode)Variable Index" "(octave-mode)Lisp Function Index") ("org" "Variable Index" "Command and Function Index") - ("pgg" "Variable Index" "Function Index") ("rcirc" "Variable Index" "Index") ("reftex" "Index") ("sasl" "Variable Index" "Function Index") diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index a61620b276..f6031df9c2 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -1790,16 +1790,7 @@ message without line wrapping." This option is used to select between a variety of mail security mechanisms. The default is \"PGP (MIME)\" if it is supported; otherwise, the default is \"None\". Other mechanisms include -vanilla \"PGP\" and \"S/MIME\". - -The `pgg' customization group may have some settings which may -interest you (see Info node `(pgg)'). - -In particular, I turn on the option `pgg-encrypt-for-me' so that -all messages I encrypt are encrypted with my public key as well. -If you keep a copy of all of your outgoing mail with a \"Fcc:\" -header field, this setting is vital so that you can read the mail -you write!" +vanilla \"PGP\" and \"S/MIME\"." :type '(choice (const :tag "PGP (MIME)" "pgpmime") (const :tag "PGP" "pgp") (const :tag "S/MIME" "smime") diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el index b7fa35a92f..bcdf91299b 100644 --- a/lisp/mh-e/mh-identity.el +++ b/lisp/mh-e/mh-identity.el @@ -39,8 +39,10 @@ (autoload 'mml-insert-tag "mml") -(defvar-local mh-identity-pgg-default-user-id nil - "Holds the GPG key ID to be used by pgg.el. +(define-obsolete-variable-alias 'mh-identity-pgg-default-user-id + 'mh-identity-gpg-default-user-id "29.1") +(defvar-local mh-identity-gpg-default-user-id nil + "Holds the GPG key ID. This is normally set as part of an Identity in `mh-identity-list'.") @@ -202,15 +204,15 @@ See `mh-identity-list'." (defun mh-identity-handler-gpg-identity (_field action &optional value) "Process header FIELD \":pgg-default-user-id\". The ACTION is one of `remove' or `add'. If `add', the VALUE is added. -The buffer-local variable `mh-identity-pgg-default-user-id' is set to +The buffer-local variable `mh-identity-gpg-default-user-id' is set to VALUE when action `add' is selected." (cond ((or (equal action 'remove) (not value) (string= value "")) - (setq mh-identity-pgg-default-user-id nil)) + (setq mh-identity-gpg-default-user-id nil)) ((equal action 'add) - (setq mh-identity-pgg-default-user-id value)))) + (setq mh-identity-gpg-default-user-id value)))) ;;;###mh-autoload (defun mh-identity-handler-signature (_field action &optional value) diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index 2f1b835de0..316463b989 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -1502,7 +1502,7 @@ a prefix argument NOCONFIRM." (after-find-file nil nil nil nil t))) ;; Shush compiler. -(defvar mh-identity-pgg-default-user-id) +(defvar mh-identity-gpg-default-user-id) ;;;###mh-autoload (defun mh-mml-secure-message-encrypt (method) @@ -1513,7 +1513,7 @@ message. Use the command \\[mh-mml-unsecure-message] to remove this tag. Use a prefix argument METHOD to be prompted for one of the possible security methods (see `mh-mml-method-default')." (interactive (list (mh-mml-query-cryptographic-method))) - (mh-secure-message method "encrypt" mh-identity-pgg-default-user-id)) + (mh-secure-message method "encrypt" mh-identity-gpg-default-user-id)) ;;;###mh-autoload (defun mh-mml-secure-message-sign (method) @@ -1524,7 +1524,7 @@ message. Use the command \\[mh-mml-unsecure-message] to remove this tag. Use a prefix argument METHOD to be prompted for one of the possible security methods (see `mh-mml-method-default')." (interactive (list (mh-mml-query-cryptographic-method))) - (mh-secure-message method "sign" mh-identity-pgg-default-user-id)) + (mh-secure-message method "sign" mh-identity-gpg-default-user-id)) ;;;###mh-autoload (defun mh-mml-secure-message-signencrypt (method) @@ -1535,7 +1535,7 @@ message. Use the command \\[mh-mml-unsecure-message] to remove this tag. Use a prefix argument METHOD to be prompted for one of the possible security methods (see `mh-mml-method-default')." (interactive (list (mh-mml-query-cryptographic-method))) - (mh-secure-message method "signencrypt" mh-identity-pgg-default-user-id)) + (mh-secure-message method "signencrypt" mh-identity-gpg-default-user-id)) (defvar mh-mml-cryptographic-method-history ()) @@ -1569,9 +1569,9 @@ IDENTITY is optionally the default-user-id to use." (save-excursion (goto-char (point-min)) (mh-goto-header-end 1) - (if mh-identity-pgg-default-user-id + (if mh-identity-gpg-default-user-id (mml-insert-tag 'secure 'method method 'mode mode - 'sender mh-identity-pgg-default-user-id) + 'sender mh-identity-gpg-default-user-id) (mml-insert-tag 'secure 'method method 'mode mode))))))) ;;;###mh-autoload commit b4879603fd8f9c8e82e30c5fbb65fa63d8166ee4 Author: Po Lu Date: Tue Aug 16 21:11:03 2022 +0800 Fix XInput hierarchy events not being delivered in daemon mode * src/xfns.c (setup_xi_event_mask): Stop selecting for device hierarchy events. * src/xterm.c (xi_select_hierarchy_events, x_term_init): Select those here instead, on the default root window. diff --git a/src/xfns.c b/src/xfns.c index 6ed93ee42c..a275e3e11a 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3773,14 +3773,11 @@ setup_xi_event_mask (struct frame *f) memset (m, 0, l); #endif - mask.deviceid = XIAllDevices; - - XISetMask (m, XI_PropertyEvent); - XISetMask (m, XI_HierarchyChanged); - XISetMask (m, XI_DeviceChanged); #ifdef HAVE_XINPUT2_2 if (FRAME_DISPLAY_INFO (f)->xi2_version >= 2) { + mask.deviceid = XIAllDevices; + XISetMask (m, XI_TouchBegin); XISetMask (m, XI_TouchUpdate); XISetMask (m, XI_TouchEnd); @@ -3792,11 +3789,12 @@ setup_xi_event_mask (struct frame *f) XISetMask (m, XI_GesturePinchEnd); } #endif + + XISelectEvents (FRAME_X_DISPLAY (f), + FRAME_X_WINDOW (f), + &mask, 1); } #endif - XISelectEvents (FRAME_X_DISPLAY (f), - FRAME_X_WINDOW (f), - &mask, 1); #ifndef HAVE_XINPUT2_1 FRAME_X_OUTPUT (f)->xi_masks = selected; diff --git a/src/xterm.c b/src/xterm.c index ee0035234b..7487450d64 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -27634,6 +27634,33 @@ my_log_handler (const gchar *log_domain, GLogLevelFlags log_level, connection established. */ static unsigned x_display_id; +#if defined HAVE_XINPUT2 && !defined HAVE_GTK3 + +/* Select for device change events on the root window of DPYINFO. + These include device change and hierarchy change notifications. */ + +static void +xi_select_hierarchy_events (struct x_display_info *dpyinfo) +{ + XIEventMask mask; + ptrdiff_t l; + unsigned char *m; + + l = XIMaskLen (XI_LASTEVENT); + mask.mask = m = alloca (l); + memset (m, 0, l); + mask.mask_len = l; + + XISetMask (m, XI_PropertyEvent); + XISetMask (m, XI_HierarchyChanged); + XISetMask (m, XI_DeviceChanged); + + XISelectEvents (dpyinfo->display, dpyinfo->root_window, + &mask, 1); +} + +#endif + /* Open a connection to X display DISPLAY_NAME, and return the structure that describes the open display. If we cannot contact the display, return null. */ @@ -28263,6 +28290,12 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) if (rc == Success) { dpyinfo->supports_xi2 = true; +#ifndef HAVE_GTK3 + /* Select for hierarchy events on the root window. GTK 3.x + does this itself. */ + xi_select_hierarchy_events (dpyinfo); +#endif + x_cache_xi_devices (dpyinfo); } } commit 81ff64d3ca8d6e43e976f209399d2a0e9b4a7dd8 Author: Lars Ingebrigtsen Date: Tue Aug 16 15:01:16 2022 +0200 Make message-delete-line obsolete * lisp/gnus/message.el (message-delete-line): Make obsolete. (message-change-subject, message-cross-post-insert-note) (message-reduce-to-to-cc, message-indent-citation) (message-send-mail-with-mh, message-generate-headers) (message-fill-field-general): Adjust callers. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index ad74d2f129..da05a768e3 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -2081,6 +2081,7 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'." (defsubst message-delete-line (&optional n) "Delete the current line (and the next N lines)." + (declare (obsolete delete-line "29.1")) (delete-region (progn (beginning-of-line) (point)) (progn (forward-line (or n 1)) (point)))) @@ -2385,7 +2386,7 @@ Leading \"Re: \" is not stripped by this function. Use the function (setq old-subject (message-strip-subject-re old-subject)) (message-goto-subject) - (message-delete-line) + (delete-line) (insert (concat "Subject: " new-subject " (was: " @@ -2500,12 +2501,12 @@ been made to before the user asked for a Crosspost." (while (re-search-backward (concat "^" (regexp-quote message-cross-post-note) ".*") head t) - (message-delete-line)) + (delete-line)) (message-goto-signature) (while (re-search-backward (concat "^" (regexp-quote message-followup-to-note) ".*") head t) - (message-delete-line)) + (delete-line)) ;; insert new note (if (message-goto-signature) (re-search-backward message-signature-separator)) @@ -2577,7 +2578,7 @@ With prefix-argument just set Follow-Up, don't cross-post." (cond (cc-content (save-excursion (message-goto-to) - (message-delete-line) + (delete-line) (insert (concat "To: " cc-content "\n")) (save-restriction (message-narrow-to-headers) @@ -3930,14 +3931,14 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line." ;; Delete blank lines at the start of the buffer. (goto-char (point-min)) (while (and (eolp) (not (eobp))) - (message-delete-line)) + (delete-line)) ;; Delete blank lines at the end of the buffer. (goto-char (point-max)) (unless (eq (preceding-char) ?\n) (insert "\n")) (while (and (zerop (forward-line -1)) (looking-at "$")) - (message-delete-line))) + (delete-line))) ;; Do the indentation. (if (null message-yank-prefix) (indent-rigidly start (or end (mark t)) message-indentation-spaces) @@ -5141,9 +5142,9 @@ to find out how to use this." (let ((headers message-mh-deletable-headers)) (while headers (goto-char (point-min)) - (and (re-search-forward - (concat "^" (symbol-name (car headers)) ": *") nil t) - (message-delete-line)) + (when (re-search-forward + (concat "^" (symbol-name (car headers)) ": *") nil t) + (delete-line)) (pop headers)))) (run-hooks 'message-send-mail-hook) ;; Pass it on to mh. @@ -6275,7 +6276,7 @@ Headers already prepared in the buffer are not modified." (and (re-search-forward (concat "^" (symbol-name (car headers)) ": *") nil t) (get-text-property (1+ (match-beginning 0)) 'message-deletable) - (message-delete-line)) + (delete-line)) (pop headers))) ;; Go through all the required headers and see if they are in the ;; articles already. If they are not, or are empty, they are @@ -6494,7 +6495,7 @@ If the current line has `message-yank-prefix', insert it on the new line." ;; Tapdance around looong Message-IDs. (forward-line -1) (when (looking-at "[ \t]*$") - (message-delete-line)) + (delete-line)) (goto-char begin) (search-forward ":" nil t) (when (looking-at "\n[ \t]+") commit 190f2db78606c3afc35d72902f52d6eec206642e Author: Lars Ingebrigtsen Date: Tue Aug 16 14:58:43 2022 +0200 Fix buffer-start cleanup in message-indent-citation * lisp/gnus/message.el (message-indent-citation): Fix thinko in loop. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 90d8a744de..ad74d2f129 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -3928,9 +3928,8 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line." (goto-char start) (forward-line 1)))) ;; Delete blank lines at the start of the buffer. - (while (and (point-min) - (eolp) - (not (eobp))) + (goto-char (point-min)) + (while (and (eolp) (not (eobp))) (message-delete-line)) ;; Delete blank lines at the end of the buffer. (goto-char (point-max)) commit ad2dba38b2347c9070700c789d5097b4bbafddf5 Author: Eli Zaretskii Date: Tue Aug 16 15:27:15 2022 +0300 Don't look for long lines beyond the narrowed region * src/xdisp.c (redisplay_window): Don't scan for newlines outside the current buffer's restriction. diff --git a/src/xdisp.c b/src/xdisp.c index 0248e8e53f..03c43be5bc 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -19589,7 +19589,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) { ptrdiff_t cur, next, found, max = 0, threshold; threshold = XFIXNUM (Vlong_line_threshold); - for (cur = BEG; cur < Z; cur = next) + for (cur = BEGV; cur < ZV; cur = next) { next = find_newline1 (cur, CHAR_TO_BYTE (cur), 0, -1, 1, &found, NULL, true); commit 5e5c56f1487c3c23476ac87d9a779cc387a0fb8a Author: Stefan Kangas Date: Tue Aug 16 13:41:08 2022 +0200 ; Normalize my email diff --git a/admin/automerge b/admin/automerge index 415d717a99..9919186736 100755 --- a/admin/automerge +++ b/admin/automerge @@ -4,7 +4,7 @@ ## Copyright (C) 2018-2022 Free Software Foundation, Inc. ## Author: Glenn Morris -## Maintainer: Stefan Kangas +## Maintainer: Stefan Kangas ## This file is part of GNU Emacs. diff --git a/admin/update_autogen b/admin/update_autogen index d02da74af9..2451367171 100755 --- a/admin/update_autogen +++ b/admin/update_autogen @@ -4,7 +4,7 @@ ## Copyright (C) 2011-2022 Free Software Foundation, Inc. ## Author: Glenn Morris -## Maintainer: Stefan Kangas +## Maintainer: Stefan Kangas ## This file is part of GNU Emacs. diff --git a/lisp/textmodes/emacs-authors-mode.el b/lisp/textmodes/emacs-authors-mode.el index af78ab605e..866822c103 100644 --- a/lisp/textmodes/emacs-authors-mode.el +++ b/lisp/textmodes/emacs-authors-mode.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2022 Free Software Foundation, Inc. -;; Author: Stefan Kangas +;; Author: Stefan Kangas ;; Keywords: internal ;; This file is part of GNU Emacs. diff --git a/test/src/image-tests.el b/test/src/image-tests.el index f710aadea7..36278f4b9f 100644 --- a/test/src/image-tests.el +++ b/test/src/image-tests.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2021-2022 Free Software Foundation, Inc. -;; Author: Stefan Kangas +;; Author: Stefan Kangas ;; This file is part of GNU Emacs. commit dd077ebded1c977a6af99d8e8c25862531fae3e9 Author: Stefan Kangas Date: Tue Aug 16 13:38:22 2022 +0200 Revert "; * doc/lispintro/emacs-lisp-intro.texi: Fix typo." This reverts commit 9d0dba44da7ac83d018fff3c26d33dac12ebd806. This was not a typo, but incorrectly matching parens in Info-mode. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 8fe4de8358..860a758e75 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -14842,7 +14842,7 @@ symbols in one function definition." (setq lengths-list (cons (count-words-in-defun) lengths-list))) (kill-buffer buffer) - lengths-list)))) + lengths-list))) @end group @end smallexample commit f25c8126cea90355701644e4e0aebfceafb5c865 Author: Stefan Kangas Date: Tue Aug 16 13:31:49 2022 +0200 ; Don't mention obsolete libraries * lisp/erc/erc-speedbar.el: * etc/TODO (https): Don't mention obsolete libraries. diff --git a/etc/TODO b/etc/TODO index da4a8c1fab..772fbf7191 100644 --- a/etc/TODO +++ b/etc/TODO @@ -796,7 +796,7 @@ artist, ansi-color, array, calculator, cdl, cmuscheme, completion, delim-col, dirtrack, double, echistory, elide-head, easymenu, expand, flow-ctrl, format [format-alist], generic/generic-x [various modes], kermit, log-edit, makesum, midnight [other than in Kill Buffer node], -mouse-copy [?], mouse-drag, mouse-sel, net-utils, rcompile, snmp-mode +mouse-copy [?], mouse-drag, mouse-sel, net-utils, snmp-mode [?], soundex [should be interactive?], strokes [start from the web page], talk, thingatpt [interactive functions?], type-break, vcursor, xscheme, zone-mode [?], mlconvert [?], iso-cvt, feedmail [?], diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el index 19113c5aad..11979a0130 100644 --- a/lisp/erc/erc-speedbar.el +++ b/lisp/erc/erc-speedbar.el @@ -31,8 +31,7 @@ ;; * Write intelligent update function: ;; update-channel, update-nick, remove-nick-from-channel, ... ;; * Use indicator-strings for op/voice -;; * Extract/convert face notes field from bbdb if available and show -;; it using sb-image.el +;; * Extract/convert face notes field from bbdb if available ;; ;;; Code: commit 780c525d11a6d3ade3b85a1a0583f241311036df Author: Stefan Kangas Date: Tue Aug 16 10:14:52 2022 +0200 Modernize spam section in Gnus manual slightly * doc/misc/gnus.texi (The problem of spam): Don't explain what spam is; there is no need for that in 2022. Don't explain limitations of obsolete software TMDA; it's website has stopped working but seems to have been updated last in 2007. (Thwarting Email Spam, Anti-Spam Basics) (Spam Package Configuration Examples): Prefer "spam" to "UCE". (The problem of spam): Use example.org in example. (SpamAssassin, Hashcash): Improve wording. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 1cd52d1ed6..2b0ee6c114 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -24193,8 +24193,7 @@ people have started putting nonsense addresses into their @code{From} lines. I think this is counterproductive---it makes it difficult for people to send you legitimate mail in response to things you write, as well as making it difficult to see who wrote what. This rewriting may -perhaps be a bigger menace than the unsolicited commercial email itself -in the end. +perhaps be a bigger menace than the spam itself in the end. The biggest problem I have with email spam is that it comes in under false pretenses. I press @kbd{g} and Gnus merrily informs me that I @@ -24220,33 +24219,13 @@ This is annoying. Here's what you can do about it. @cindex UCE @cindex unsolicited commercial email -First, some background on spam. - -If you have access to e-mail, you are familiar with spam (technically -termed @acronym{UCE}, Unsolicited Commercial E-mail). Simply put, it -exists because e-mail delivery is very cheap compared to paper mail, -so only a very small percentage of people need to respond to an UCE to -make it worthwhile to the advertiser. Ironically, one of the most -common spams is the one offering a database of e-mail addresses for -further spamming. Senders of spam are usually called @emph{spammers}, -but terms like @emph{vermin}, @emph{scum}, @emph{sociopaths}, and -@emph{morons} are in common use as well. - Spam comes from a wide variety of sources. It is simply impossible to -dispose of all spam without discarding useful messages. A good -example is the TMDA system, which requires senders -unknown to you to confirm themselves as legitimate senders before -their e-mail can reach you. Without getting into the technical side -of TMDA, a downside is clearly that e-mail from legitimate sources may -be discarded if those sources can't or won't confirm themselves -through the TMDA system. Another problem with TMDA is that it -requires its users to have a basic understanding of e-mail delivery -and processing. +dispose of all spam without discarding useful messages. The simplest approach to filtering spam is filtering, at the mail server or when you sort through incoming mail. If you get 200 spam -messages per day from @samp{random-address@@vmadmin.com}, you block -@samp{vmadmin.com}. If you get 200 messages about @samp{VIAGRA}, you +messages per day from @samp{random-address@@example.org}, you block +@samp{example.org}. If you get 200 messages about @samp{VIAGRA}, you discard all messages with @samp{VIAGRA} in the message. If you get lots of spam from Bulgaria, for example, you try to filter all mail from Bulgarian IPs. @@ -24357,7 +24336,7 @@ In my experience, this will sort virtually everything into the right group. You still have to check the @samp{spam} group from time to time to check for legitimate mail, though. If you feel like being a good net citizen, you can even send off complaints to the proper authorities on -each unsolicited commercial email---at your leisure. +each spam---at your leisure. This works for me. It allows people an easy way to contact me (they can just press @kbd{r} in the usual way), and I'm not bothered at all with @@ -24373,8 +24352,8 @@ Be careful with this approach. Spammers are wise to it. @cindex Vipul's Razor @cindex DCC -The days where the hints in the previous section were sufficient in -avoiding spam are coming to an end. There are many tools out there +The days where the hints in the previous section were sufficient to +avoid spam are over. There are many tools out there that claim to reduce the amount of spam you get. This section could easily become outdated fast, as new products replace old, but fortunately most of these tools seem to have similar interfaces. Even @@ -24455,7 +24434,7 @@ spam. And here is the nifty function: @subsection Hashcash @cindex hashcash -A novel technique to fight spam is to require senders to do something +One technique to fight spam is to require senders to do something costly and demonstrably unique for each message they send. This has the obvious drawback that you cannot rely on everyone in the world using this technique, since it is not part of the Internet standards, @@ -25112,8 +25091,8 @@ The @code{gnus-article-sort-by-chars} entry simplifies detection of false positives for me. I receive lots of worms (sweN, @dots{}), that all have a similar size. Grouping them by size (i.e., chars) makes finding other false positives easier. (Of course worms aren't @i{spam} -(@acronym{UCE}, @acronym{UBE}) strictly speaking. Anyhow, bogofilter is -an excellent tool for filtering those unwanted mails for me.) +strictly speaking. Anyhow, bogofilter is an excellent tool for +filtering those unwanted mails for me.) @item @b{Ham folders:} commit c3dedb8b853d18574c27a9d9f854c7c83757b37c Author: Stefan Kangas Date: Tue Aug 16 10:08:39 2022 +0200 ; * doc/misc/url.texi: Don't mention obsolete library url-ns. diff --git a/doc/misc/url.texi b/doc/misc/url.texi index a9d06d7f5b..5644027f95 100644 --- a/doc/misc/url.texi +++ b/doc/misc/url.texi @@ -950,7 +950,6 @@ containing the data cached for that URL. @node Proxies @section Proxies and Gatewaying -@c fixme: check/document url-ns stuff @cindex proxy servers @cindex proxies @cindex environment variables commit 362c9ab879ff44e24a0cbb05ceed6b24a45b76f3 Author: Stefan Kangas Date: Tue Aug 16 08:08:36 2022 +0200 * doc/misc/gnus.texi (Article Washing): Fix Links URL. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 9f7403ae8f..67e9b5a98b 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -9359,7 +9359,7 @@ Use @uref{http://emacs-w3m.namazu.org/, emacs-w3m}. Use @uref{http://w3m.sourceforge.net/, w3m}. @item links -Use @uref{https://almende.github.io/chap-links-library/, CHAP Links}. +Use @uref{http://links.twibright.com/, Links}. @item lynx Use @uref{https://lynx.browser.org/, Lynx}.