From f6ae5c5df1abb3f1aaa353c20c11c2e3c8fb0ae2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 6 Apr 2013 16:05:53 -0700 Subject: [PATCH 01/23] Backport trunk 2013-03-26T00:42:08Z!monnier@iro.umontreal.ca em-prompt fix * lisp/eshell/em-prompt.el (eshell-emit-prompt): Make sure we can't insert into the prompt either. Fixes: debbugs:13963 --- lisp/ChangeLog | 5 +++++ lisp/eshell/em-prompt.el | 1 + 2 files changed, 6 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5783761a0b4..dd209f75bf6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-06 Stefan Monnier + + * eshell/em-prompt.el (eshell-emit-prompt): Make sure we can't insert + into the prompt either (bug#13963). + 2013-03-26 Fabián Ezequiel Gallina Un-indent after "pass" and "return" statements (Bug#13888) diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el index c1c4d4730f9..c5429c59bd6 100644 --- a/lisp/eshell/em-prompt.el +++ b/lisp/eshell/em-prompt.el @@ -122,6 +122,7 @@ arriving, or after." (add-text-properties 0 (length prompt) '(read-only t face eshell-prompt + front-sticky (face read-only) rear-nonsticky (face read-only)) prompt)) (eshell-interactive-print prompt))) From 8c1f2bb0fa5eec3f052f81082ccde733e337eb40 Mon Sep 17 00:00:00 2001 From: Petr Hracek Date: Tue, 9 Apr 2013 18:39:02 -0700 Subject: [PATCH 02/23] * doc/man/emacs.1: Add some more command-line options. Fixes: debbugs:14165 --- doc/man/ChangeLog | 4 ++++ doc/man/emacs.1 | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/doc/man/ChangeLog b/doc/man/ChangeLog index 645f4a4031e..1898160220b 100644 --- a/doc/man/ChangeLog +++ b/doc/man/ChangeLog @@ -1,3 +1,7 @@ +2013-04-10 Petr Hracek (tiny change) + + * emacs.1: Add some more command-line options. (Bug#14165) + 2013-03-11 Glenn Morris * Version 24.3 released. diff --git a/doc/man/emacs.1 b/doc/man/emacs.1 index 4f7f8d28ada..b0f48f0176b 100644 --- a/doc/man/emacs.1 +++ b/doc/man/emacs.1 @@ -79,12 +79,22 @@ Go to the specified and .IR column . .TP +.BI \-\-chdir " directory" +Change to +.IR directory . +.TP .BR \-q ", " \-\-no\-init\-file Do not load an init file. .TP +.BR \-nl ", " \-\-no\-shared\-memory +Do not use shared memory. +.TP .B \-\-no\-site\-file Do not load the site-wide startup file. .TP +.BR \-nsl ", " \-\-no\-site\-lisp +Do not add site-lisp directories to load-path. +.TP .B \-\-no\-desktop Do not load a saved desktop. .TP @@ -325,6 +335,9 @@ in iconified state. .BR \-nbc ", " \-\-no\-blinking\-cursor Disable blinking cursor. .TP +.BI \-\-parent-id " xid" +Set parent window. +.TP .BR \-nw ", " \-\-no\-window\-system Tell .I Emacs From bcd7a0a4c55f8226e9322d1ef438040fed2dc57e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 20 Apr 2013 12:24:04 -0400 Subject: [PATCH 03/23] Use add/remove-function to manipulate process-filters. * lisp/emacs-lisp/nadvice.el (advice--where-alist): Add :override. (remove-function): Autoload. * lisp/comint.el (comint-redirect-original-filter-function): Remove. (comint-redirect-cleanup, comint-redirect-send-command-to-process): * lisp/vc/vc-cvs.el (vc-cvs-annotate-process-filter,vc-cvs-annotate-command): * lisp/progmodes/octave-inf.el (inferior-octave-send-list-and-digest): * lisp/progmodes/prolog.el (prolog-consult-compile): * lisp/progmodes/gdb-mi.el (gdb, gdb--check-interpreter): Use add/remove-function instead. * lisp/progmodes/gud.el (gud-tooltip-original-filter): Remove. (gud-tooltip-process-output, gud-tooltip-tips): Use add/remove-function instead. * lisp/progmodes/xscheme.el (xscheme-previous-process-state): Remove. (scheme-interaction-mode, exit-scheme-interaction-mode): Use add/remove-function instead. * lisp/vc/vc-dispatcher.el: Use lexical-binding. (vc--process-sentinel): Rename from vc-process-sentinel. Change last arg to be the code to run. Don't use vc-previous-sentinel and vc-sentinel-commands any more. (vc-exec-after): Allow code to be a function. Use add/remove-function. (compilation-error-regexp-alist, view-old-buffer-read-only): Declare. --- lisp/ChangeLog | 30 ++++++++++++++++++++++-- lisp/comint.el | 15 ++++-------- lisp/emacs-lisp/nadvice.el | 3 +++ lisp/progmodes/gdb-mi.el | 30 +++++++++++------------- lisp/progmodes/gud.el | 9 +++----- lisp/progmodes/octave-inf.el | 7 +++--- lisp/progmodes/prolog.el | 6 +++-- lisp/progmodes/xscheme.el | 39 ++++++++++++------------------- lisp/vc/vc-cvs.el | 12 ++++------ lisp/vc/vc-dispatcher.el | 45 +++++++++++++++++------------------- 10 files changed, 101 insertions(+), 95 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9bb155b74da..8758eb33e77 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,33 @@ +2013-04-20 Stefan Monnier + + * emacs-lisp/nadvice.el (advice--where-alist): Add :override. + (remove-function): Autoload. + + * comint.el (comint-redirect-original-filter-function): Remove. + (comint-redirect-cleanup, comint-redirect-send-command-to-process): + * vc/vc-cvs.el (vc-cvs-annotate-process-filter,vc-cvs-annotate-command): + * progmodes/octave-inf.el (inferior-octave-send-list-and-digest): + * progmodes/prolog.el (prolog-consult-compile): + * progmodes/gdb-mi.el (gdb, gdb--check-interpreter): + Use add/remove-function instead. + * progmodes/gud.el (gud-tooltip-original-filter): Remove. + (gud-tooltip-process-output, gud-tooltip-tips): + Use add/remove-function instead. + * progmodes/xscheme.el (xscheme-previous-process-state): Remove. + (scheme-interaction-mode, exit-scheme-interaction-mode): + Use add/remove-function instead. + + * vc/vc-dispatcher.el: Use lexical-binding. + (vc--process-sentinel): Rename from vc-process-sentinel. + Change last arg to be the code to run. Don't use vc-previous-sentinel + and vc-sentinel-commands any more. + (vc-exec-after): Allow code to be a function. Use add/remove-function. + (compilation-error-regexp-alist, view-old-buffer-read-only): Declare. + 2013-04-19 Masatake YAMATO - * progmodes/sh-script.el (sh-imenu-generic-expression): Handle - function names with a single character. (Bug#11182) + * progmodes/sh-script.el (sh-imenu-generic-expression): + Handle function names with a single character. (Bug#11182) 2013-04-19 Dima Kogan (tiny change) diff --git a/lisp/comint.el b/lisp/comint.el index 93db4e24f2a..13a38e6e16e 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -3491,11 +3491,6 @@ buffer. The idea is that this regular expression should match a prompt string, and that there ought to be at least one copy of your prompt string in the process buffer already.") -(defvar comint-redirect-original-filter-function nil - "The process filter that was in place when redirection is started. -When redirection is completed, the process filter is restored to -this value.") - (defvar comint-redirect-subvert-readonly nil "Non-nil means `comint-redirect' can insert into read-only buffers. This works by binding `inhibit-read-only' around the insertion. @@ -3558,8 +3553,8 @@ and does not normally need to be invoked by the end user or programmer." ;; Release the last redirected string (setq comint-redirect-previous-input-string nil) ;; Restore the process filter - (set-process-filter (get-buffer-process (current-buffer)) - comint-redirect-original-filter-function) + (remove-function (process-filter (get-buffer-process (current-buffer))) + #'comint-redirect-filter) ;; Restore the mode line (setq mode-line-process comint-redirect-original-mode-line-process) ;; Set the completed flag @@ -3701,10 +3696,8 @@ If NO-DISPLAY is non-nil, do not show the output buffer." comint-prompt-regexp ; Finished Regexp echo) ; Echo input - ;; Set the filter - (setq comint-redirect-original-filter-function ; Save the old filter - (process-filter proc)) - (set-process-filter proc 'comint-redirect-filter) + ;; Set the filter. + (add-function :override (process-filter proc) #'comint-redirect-filter) ;; Send the command (process-send-string (current-buffer) (concat command "\n")) diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index a3dfb0326e6..12166553a14 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -41,6 +41,7 @@ '((:around "\300\301\302\003#\207" 5) (:before "\300\301\002\"\210\300\302\002\"\207" 4) (:after "\300\302\002\"\300\301\003\"\210\207" 5) + (:override "\300\301\"\207" 4) (:after-until "\300\302\002\"\206\013\000\300\301\002\"\207" 4) (:after-while "\300\302\002\"\205\013\000\300\301\002\"\207" 4) (:before-until "\300\301\002\"\206\013\000\300\302\002\"\207" 4) @@ -228,6 +229,7 @@ call OLDFUN here: `:before' (lambda (&rest r) (apply FUNCTION r) (apply OLDFUN r)) `:after' (lambda (&rest r) (prog1 (apply OLDFUN r) (apply FUNCTION r))) `:around' (lambda (&rest r) (apply FUNCTION OLDFUN r)) +`:override' (lambda (&rest r) (apply FUNCTION r)) `:before-while' (lambda (&rest r) (and (apply FUNCTION r) (apply OLDFUN r))) `:before-until' (lambda (&rest r) (or (apply FUNCTION r) (apply OLDFUN r))) `:after-while' (lambda (&rest r) (and (apply OLDFUN r) (apply FUNCTION r))) @@ -263,6 +265,7 @@ is also interactive. There are 3 cases: (setf (gv-deref ref) (advice--make where function (gv-deref ref) props)))) +;;;###autoload (defmacro remove-function (place function) "Remove the FUNCTION piece of advice from PLACE. If FUNCTION was not added to PLACE, do nothing. diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index f5e1abdd546..8e15ec6584e 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -574,21 +574,20 @@ NOARG must be t when this macro is used outside `gud-def'" (concat (gdb-gud-context-command ,cmd1 ,noall) " " ,cmd2) ,(when (not noarg) 'arg))) -(defun gdb--check-interpreter (proc string) +(defun gdb--check-interpreter (filter proc string) (unless (zerop (length string)) - (let ((filter (process-get proc 'gud-normal-filter))) - (set-process-filter proc filter) - (unless (memq (aref string 0) '(?^ ?~ ?@ ?& ?* ?=)) - ;; Apparently we're not running with -i=mi. - (let ((msg "Error: you did not specify -i=mi on GDB's command line!")) - (message msg) - (setq string (concat (propertize msg 'font-lock-face 'error) - "\n" string))) - ;; Use the old gud-gbd filter, not because it works, but because it - ;; will properly display GDB's answers rather than hanging waiting for - ;; answers that aren't coming. - (set (make-local-variable 'gud-marker-filter) #'gud-gdb-marker-filter)) - (funcall filter proc string)))) + (remove-function (process-filter proc) #'gdb--check-interpreter) + (unless (memq (aref string 0) '(?^ ?~ ?@ ?& ?* ?=)) + ;; Apparently we're not running with -i=mi. + (let ((msg "Error: you did not specify -i=mi on GDB's command line!")) + (message msg) + (setq string (concat (propertize msg 'font-lock-face 'error) + "\n" string))) + ;; Use the old gud-gbd filter, not because it works, but because it + ;; will properly display GDB's answers rather than hanging waiting for + ;; answers that aren't coming. + (set (make-local-variable 'gud-marker-filter) #'gud-gdb-marker-filter)) + (funcall filter proc string))) (defvar gdb-control-level 0) @@ -662,8 +661,7 @@ detailed description of this mode. ;; Setup a temporary process filter to warn when GDB was not started ;; with -i=mi. (let ((proc (get-buffer-process gud-comint-buffer))) - (process-put proc 'gud-normal-filter (process-filter proc)) - (set-process-filter proc #'gdb--check-interpreter)) + (add-function :around (process-filter proc) #'gdb--check-interpreter)) (set (make-local-variable 'gud-minor-mode) 'gdbmi) (set (make-local-variable 'gdb-control-level) 0) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 4e31c5e827c..6076f88dea6 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -3387,9 +3387,6 @@ ACTIVATEP non-nil means activate mouse motion events." ;;; Tips for `gud' -(defvar gud-tooltip-original-filter nil - "Process filter to restore after GUD output has been received.") - (defvar gud-tooltip-dereference nil "Non-nil means print expressions with a `*' in front of them. For C this would dereference a pointer expression.") @@ -3423,7 +3420,7 @@ With arg, dereference expr if ARG is positive, otherwise do not dereference." ; gdb-mi.el gets round this problem. (defun gud-tooltip-process-output (process output) "Process debugger output and show it in a tooltip window." - (set-process-filter process gud-tooltip-original-filter) + (remove-function (process-filter process) #'gud-tooltip-process-output) (tooltip-show (tooltip-strip-prompt process output) (or gud-tooltip-echo-area tooltip-use-echo-area))) @@ -3490,8 +3487,8 @@ so they have been disabled.")) (gdb-input (concat cmd "\n") `(lambda () (gdb-tooltip-print ,expr)))) - (setq gud-tooltip-original-filter (process-filter process)) - (set-process-filter process 'gud-tooltip-process-output) + (add-function :override (process-filter process) + #'gud-tooltip-process-output) (gud-basic-call cmd)) expr)))))))) diff --git a/lisp/progmodes/octave-inf.el b/lisp/progmodes/octave-inf.el index de7ca32befe..4a227db7164 100644 --- a/lisp/progmodes/octave-inf.el +++ b/lisp/progmodes/octave-inf.el @@ -348,9 +348,9 @@ the rest to `inferior-octave-output-string'." The elements of LIST have to be strings and are sent one by one. All output is passed to the filter `inferior-octave-output-digest'." (let* ((proc inferior-octave-process) - (filter (process-filter proc)) string) - (set-process-filter proc 'inferior-octave-output-digest) + (add-function :override (process-filter proc) + #'inferior-octave-output-digest) (setq inferior-octave-output-list nil) (unwind-protect (while (setq string (car list)) @@ -360,7 +360,8 @@ output is passed to the filter `inferior-octave-output-digest'." (while inferior-octave-receive-in-progress (accept-process-output proc)) (setq list (cdr list))) - (set-process-filter proc filter)))) + (remove-function (process-filter proc) + #'inferior-octave-output-digest)))) (defun inferior-octave-directory-tracker (string) "Tracks `cd' commands issued to the inferior Octave process. diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 85e4172c8fe..8971e97a44e 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -1770,7 +1770,8 @@ This function must be called from the source code buffer." real-file)) (with-current-buffer buffer (goto-char (point-max)) - (set-process-filter process 'prolog-consult-compile-filter) + (add-function :override (process-filter process) + #'prolog-consult-compile-filter) (process-send-string "prolog" command-string) ;; (prolog-build-prolog-command compilep file real-file first-line)) (while (and prolog-process-flag @@ -1781,7 +1782,8 @@ This function must be called from the source code buffer." (insert (if compilep "\nCompilation finished.\n" "\nConsulted.\n")) - (set-process-filter process old-filter)))) + (remove-function (process-filter process) + #'prolog-consult-compile-filter)))) (defvar compilation-error-list) diff --git a/lisp/progmodes/xscheme.el b/lisp/progmodes/xscheme.el index 2ad44b4b1c8..37c3cd37a6c 100644 --- a/lisp/progmodes/xscheme.el +++ b/lisp/progmodes/xscheme.el @@ -35,7 +35,6 @@ ;;;; Internal Variables (defvar xscheme-previous-mode) -(defvar xscheme-previous-process-state) (defvar xscheme-last-input-end) (defvar xscheme-process-command-line nil @@ -388,8 +387,6 @@ with no args, if that value is non-nil. (if (not preserve) (let ((previous-mode major-mode)) (kill-all-local-variables) - (make-local-variable 'xscheme-process-name) - (make-local-variable 'xscheme-previous-process-state) (make-local-variable 'xscheme-runlight-string) (make-local-variable 'xscheme-runlight) (set (make-local-variable 'xscheme-previous-mode) previous-mode) @@ -397,35 +394,29 @@ with no args, if that value is non-nil. (set (make-local-variable 'xscheme-buffer-name) (buffer-name buffer)) (set (make-local-variable 'xscheme-last-input-end) (make-marker)) (let ((process (get-buffer-process buffer))) - (if process - (progn - (setq xscheme-process-name (process-name process)) - (setq xscheme-previous-process-state - (cons (process-filter process) - (process-sentinel process))) - (xscheme-process-filter-initialize t) - (xscheme-mode-line-initialize xscheme-buffer-name) - (set-process-sentinel process 'xscheme-process-sentinel) - (set-process-filter process 'xscheme-process-filter)) - (setq xscheme-previous-process-state (cons nil nil))))))) + (when process + (setq-local xscheme-process-name (process-name process)) + ;; FIXME: Use add-function! + (xscheme-process-filter-initialize t) + (xscheme-mode-line-initialize xscheme-buffer-name) + (add-function :override (process-sentinel process) + #'xscheme-process-sentinel) + (add-function :override (process-filter process) + #'xscheme-process-filter)))))) (scheme-interaction-mode-initialize) (scheme-mode-variables) (run-mode-hooks 'scheme-mode-hook 'scheme-interaction-mode-hook)) (defun exit-scheme-interaction-mode () - "Take buffer out of scheme interaction mode" + "Take buffer out of scheme interaction mode." (interactive) (if (not (derived-mode-p 'scheme-interaction-mode)) (error "Buffer not in scheme interaction mode")) - (let ((previous-state xscheme-previous-process-state)) - (funcall xscheme-previous-mode) - (let ((process (get-buffer-process (current-buffer)))) - (if process - (progn - (if (eq (process-filter process) 'xscheme-process-filter) - (set-process-filter process (car previous-state))) - (if (eq (process-sentinel process) 'xscheme-process-sentinel) - (set-process-sentinel process (cdr previous-state)))))))) + (funcall xscheme-previous-mode) + (let ((process (get-buffer-process (current-buffer)))) + (when process + (remove-function (process-sentinel process) #'xscheme-process-sentinel) + (remove-function (process-filter process) #'xscheme-process-filter)))) (defvar scheme-interaction-mode-commands-alist nil) (defvar scheme-interaction-mode-map nil) diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 407e691439b..334683898be 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -562,14 +562,13 @@ Will fail unless you have administrative privileges on the repo." (defconst vc-cvs-annotate-first-line-re "^[0-9]") -(defun vc-cvs-annotate-process-filter (process string) +(defun vc-cvs-annotate-process-filter (filter process string) (setq string (concat (process-get process 'output) string)) (if (not (string-match vc-cvs-annotate-first-line-re string)) ;; Still waiting for the first real line. (process-put process 'output string) - (let ((vc-filter (process-get process 'vc-filter))) - (set-process-filter process vc-filter) - (funcall vc-filter process (substring string (match-beginning 0)))))) + (remove-function (process-filter process) #'vc-cvs-annotate-process-filter) + (funcall filter process (substring string (match-beginning 0))))) (defun vc-cvs-annotate-command (file buffer &optional revision) "Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER. @@ -583,9 +582,8 @@ Optional arg REVISION is a revision to annotate from." (let ((proc (get-buffer-process buffer))) (if proc ;; If running asynchronously, use a process filter. - (progn - (process-put proc 'vc-filter (process-filter proc)) - (set-process-filter proc 'vc-cvs-annotate-process-filter)) + (add-function :around (process-filter proc) + #'vc-cvs-annotate-process-filter) (with-current-buffer buffer (goto-char (point-min)) (re-search-forward vc-cvs-annotate-first-line-re) diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index ed61adec1fe..309cf50404c 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -1,4 +1,4 @@ -;;; vc-dispatcher.el -- generic command-dispatcher facility. +;;; vc-dispatcher.el -- generic command-dispatcher facility. -*- lexical-binding: t -*- ;; Copyright (C) 2008-2013 Free Software Foundation, Inc. @@ -182,32 +182,29 @@ Another is that undo information is not kept." (defvar vc-sentinel-movepoint) ;Dynamically scoped. -(defun vc-process-sentinel (p s) - (let ((previous (process-get p 'vc-previous-sentinel)) - (buf (process-buffer p))) +(defun vc--process-sentinel (p code) + (let ((buf (process-buffer p))) ;; Impatient users sometime kill "slow" buffers; check liveness ;; to avoid "error in process sentinel: Selecting deleted buffer". (when (buffer-live-p buf) - (when previous (funcall previous p s)) (with-current-buffer buf (setq mode-line-process (let ((status (process-status p))) ;; Leave mode-line uncluttered, normally. (unless (eq 'exit status) (format " (%s)" status)))) - (let (vc-sentinel-movepoint) + (let (vc-sentinel-movepoint + (m (process-mark p))) ;; Normally, we want async code such as sentinels to not move point. (save-excursion - (goto-char (process-mark p)) - (let ((cmds (process-get p 'vc-sentinel-commands))) - (process-put p 'vc-sentinel-commands nil) - (dolist (cmd cmds) + (goto-char m) ;; Each sentinel may move point and the next one should be run ;; at that new point. We could get the same result by having ;; each sentinel read&set process-mark, but since `cmd' needs ;; to work both for async and sync processes, this would be ;; difficult to achieve. - (vc-exec-after cmd)))) + (vc-exec-after code) + (move-marker m (point))) ;; But sometimes the sentinels really want to move point. (when vc-sentinel-movepoint (let ((win (get-buffer-window (current-buffer) 0))) @@ -226,7 +223,9 @@ Another is that undo information is not kept." (defun vc-exec-after (code) "Eval CODE when the current buffer's process is done. If the current buffer has no process, just evaluate CODE. -Else, add CODE to the process' sentinel." +Else, add CODE to the process' sentinel. +CODE can be either a function of no arguments, or an expression +to evaluate." (let ((proc (get-buffer-process (current-buffer)))) (cond ;; If there's no background process, just execute the code. @@ -237,20 +236,14 @@ Else, add CODE to the process' sentinel." ((or (null proc) (eq (process-status proc) 'exit)) ;; Make sure we've read the process's output before going further. (when proc (accept-process-output proc)) - (eval code)) + (if (functionp code) (funcall code) (eval code))) ;; If a process is running, add CODE to the sentinel ((eq (process-status proc) 'run) (vc-set-mode-line-busy-indicator) - (let ((previous (process-sentinel proc))) - (unless (eq previous 'vc-process-sentinel) - (process-put proc 'vc-previous-sentinel previous)) - (set-process-sentinel proc 'vc-process-sentinel)) - (process-put proc 'vc-sentinel-commands - ;; We keep the code fragments in the order given - ;; so that vc-diff-finish's message shows up in - ;; the presence of non-nil vc-command-messages. - (append (process-get proc 'vc-sentinel-commands) - (list code)))) + (letrec ((fun (lambda (p _msg) + (remove-function (process-sentinel p) fun) + (vc--process-sentinel p code)))) + (add-function :after (process-sentinel proc) fun))) (t (error "Unexpected process state")))) nil) @@ -388,6 +381,8 @@ Display the buffer in some window, but don't select it." (set-window-start window new-window-start)) buffer)) +(defvar compilation-error-regexp-alist) + (defun vc-compilation-mode (backend) "Setup `compilation-mode' after with the appropriate `compilation-error-regexp-alist'." (let* ((error-regexp-alist @@ -479,7 +474,7 @@ Used by `vc-restore-buffer-context' to later restore the context." (vc-position-context (mark-marker)))) ;; Make the right thing happen in transient-mark-mode. (mark-active nil)) - (list point-context mark-context nil))) + (list point-context mark-context))) (defun vc-restore-buffer-context (context) "Restore point/mark, and reparse any affected compilation buffers. @@ -518,6 +513,8 @@ ARG and NO-CONFIRM are passed on to `revert-buffer'." (make-variable-buffer-local 'vc-mode-line-hook) (put 'vc-mode-line-hook 'permanent-local t) +(defvar view-old-buffer-read-only) + (defun vc-resynch-window (file &optional keep noquery reset-vc-info) "If FILE is in the current buffer, either revert or unvisit it. The choice between revert (to see expanded keywords) and unvisit From d7f5c16f47faa5764ae83a175e765066f55176f0 Mon Sep 17 00:00:00 2001 From: Roland Winkler Date: Sat, 20 Apr 2013 12:33:52 -0500 Subject: [PATCH 04/23] lisp/faces.el (read-face-name): Bug fix, return just one face if arg multiple is nil --- lisp/ChangeLog | 5 +++++ lisp/faces.el | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8758eb33e77..2f625deedc6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-20 Roland Winkler + + * faces.el (read-face-name): Bug fix, return just one face if arg + multiple is nil. (Bug#14209) + 2013-04-20 Stefan Monnier * emacs-lisp/nadvice.el (advice--where-alist): Add :override. diff --git a/lisp/faces.el b/lisp/faces.el index de6d36c7ae8..6179ed7dfa7 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -979,9 +979,8 @@ if the user entered more than one face name, return only the first one." ;; (for example, because DEFAULT was "all faces") (if (facep face) (push (intern face) faces))) ;; Return either a list of faces or just one face. - (if multiple - (nreverse faces) - (last faces)))) + (setq faces (nreverse faces)) + (if multiple faces (car faces)))) ;; Not defined without X, but behind window-system test. (defvar x-bitmap-file-path) From a6d63d97cd7f213a87630ab86119b469a89caeeb Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 20 Apr 2013 12:48:04 -0700 Subject: [PATCH 05/23] No longer include timestamp in header of .elc files This removes needless differences between files compiled at different times or by different people, or from sources in different locations. Ref: http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00187.html * lisp/emacs-lisp/bytecomp.el (byte-compile-insert-header): No longer include timestamp etc information. * etc/NEWS: Mention this. --- etc/NEWS | 2 ++ lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/bytecomp.el | 6 +----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 8f64aa6e7ee..83913bf88b8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -75,6 +75,8 @@ Available only on X, this option allows to control over-scrolling using the scroll bar (i.e. dragging the thumb down even when the end of the buffer is visible). +** In compiled Lisp files, the header no longer includes a timestamp. + * Editing Changes in Emacs 24.4 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2f625deedc6..07a5bb9231d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-20 Glenn Morris + + * emacs-lisp/bytecomp.el (byte-compile-insert-header): + No longer include timestamp etc information. + 2013-04-20 Roland Winkler * faces.el (read-face-name): Bug fix, return just one face if arg diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 5db1793a407..755d5f716d3 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1997,11 +1997,7 @@ Call from the source buffer." ;; >4 byte x version %d (insert ";ELC" 23 "\000\000\000\n" - ";;; Compiled by " - (or (and (boundp 'user-mail-address) user-mail-address) - (concat (user-login-name) "@" (system-name))) - " on " (current-time-string) "\n" - ";;; from file " filename "\n" + ";;; Compiled\n" ";;; in Emacs version " emacs-version "\n" ";;; with" (cond From 1b42ee4390648fa29ecc1243be6dbee4414d3d69 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 20 Apr 2013 17:37:54 -0700 Subject: [PATCH 06/23] vc.el doc fixes * lisp/vc/vc.el (vc-print-log-setup-buttons, vc-print-log-internal): Add doc strings. (vc-print-log): Clarify interactive prompt. --- lisp/ChangeLog | 6 ++++++ lisp/vc/vc.el | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07a5bb9231d..c791affe2f2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-04-21 Glenn Morris + + * vc/vc.el (vc-print-log-setup-buttons, vc-print-log-internal): + Add doc strings. + (vc-print-log): Clarify interactive prompt. + 2013-04-20 Glenn Morris * emacs-lisp/bytecomp.el (byte-compile-insert-header): diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index a0ef6f9d6d7..7f03affb6b7 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2084,6 +2084,11 @@ Not all VC backends support short logs!") (defvar log-view-vc-fileset) (defun vc-print-log-setup-buttons (working-revision is-start-revision limit pl-return) + "Insert at the end of the current buffer buttons to show more log entries. +In the new log, leave point at WORKING-REVISION (if non-nil). +LIMIT is the number of entries currently shown. +Does nothing if IS-START-REVISION is non-nil, or if LIMIT is nil, +or if PL-RETURN is 'limit-unsupported." (when (and limit (not (eq 'limit-unsupported pl-return)) (not is-start-revision)) (goto-char (point-max)) @@ -2104,6 +2109,17 @@ Not all VC backends support short logs!") (defun vc-print-log-internal (backend files working-revision &optional is-start-revision limit) + "For specified BACKEND and FILES, show the VC log. +Leave point at WORKING-REVISION, if it is non-nil. +If IS-START-REVISION is non-nil, start the log from WORKING-REVISION. +Show up to LIMIT entries (non-nil means unlimited). +\(IS-START-REVISION non-nil might not work correctly if LIMIT is not 1.)" + ;; The parenthetical remark is based on the commentary of vc.el for + ;; "print log": "At this point START-REVISION is only required to work + ;; in conjunction with LIMIT = 1." The only thing that passes + ;; IS-START-REVISION non-nil is vc-annotate-show-log-revision-at-line, + ;; which sets LIMIT = 1. + ;; Don't switch to the output buffer before running the command, ;; so that any buffer-local settings in the vc-controlled ;; buffer can be accessed by the command. @@ -2189,7 +2205,7 @@ WORKING-REVISION and LIMIT." (interactive (cond (current-prefix-arg - (let ((rev (read-from-minibuffer "Log from revision (default: last revision): " nil + (let ((rev (read-from-minibuffer "Leave point at revision (default: last revision): " nil nil nil nil)) (lim (string-to-number (read-from-minibuffer From cc641ee19e6f99b388f96405807ad22c793f48cf Mon Sep 17 00:00:00 2001 From: Xue Fuqiao Date: Sun, 21 Apr 2013 10:45:38 +0800 Subject: [PATCH 07/23] startup.el (normal-no-mouse-startup-screen): Bug fix, the default key binding for C-h C-o'. (Bug#13970) --- lisp/ChangeLog | 6 ++++++ lisp/startup.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c791affe2f2..2fda98c317d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-04-21 Xue Fuqiao + + * startup.el (normal-no-mouse-startup-screen): Bug fix, the + default key binding for `describe-distribution' has been moved to + `C-h C-o'. (Bug#13970) + 2013-04-21 Glenn Morris * vc/vc.el (vc-print-log-setup-buttons, vc-print-log-internal): diff --git a/lisp/startup.el b/lisp/startup.el index db84a5b11b2..dc21005ab94 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1940,7 +1940,7 @@ If you have no Meta key, you may instead type ESC followed by the character.)") (insert "\n" (emacs-version) "\n" emacs-copyright "\n") (if (and (eq (key-binding "\C-h\C-c") 'describe-copying) - (eq (key-binding "\C-h\C-d") 'describe-distribution) + (eq (key-binding "\C-h\C-o") 'describe-distribution) (eq (key-binding "\C-h\C-w") 'describe-no-warranty)) (progn (insert From 5d4e5c31792978649c98b82286ee631ae50a0337 Mon Sep 17 00:00:00 2001 From: Xue Fuqiao Date: Sun, 21 Apr 2013 11:13:04 +0800 Subject: [PATCH 08/23] comint.el: (comint-dynamic-complete-functions, comint-mode-map): `comint-dynamic-complete' is obsolete since 24.1, replaced by `completion-at-point'. (Bug#13774) --- lisp/ChangeLog | 4 ++++ lisp/comint.el | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2fda98c317d..afb1ffd06fe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2013-04-21 Xue Fuqiao + * comint.el: (comint-dynamic-complete-functions, comint-mode-map): + `comint-dynamic-complete' is obsolete since 24.1, replaced by + `completion-at-point'. (Bug#13774) + * startup.el (normal-no-mouse-startup-screen): Bug fix, the default key binding for `describe-distribution' has been moved to `C-h C-o'. (Bug#13970) diff --git a/lisp/comint.el b/lisp/comint.el index 13a38e6e16e..d5d95f8cbc0 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -213,7 +213,7 @@ This mirrors the optional behavior of tcsh (its autoexpand and histlist). If the value is `input', then the expansion is seen on input. If the value is `history', then the expansion is only when inserting into the buffer's input ring. See also `comint-magic-space' and -`comint-dynamic-complete'. +`completion-at-point'. This variable is buffer-local." :type '(choice (const :tag "off" nil) @@ -371,7 +371,7 @@ text matching `comint-prompt-regexp', depending on the value of '(comint-c-a-p-replace-by-expanded-history comint-filename-completion) "List of functions called to perform completion. Works like `completion-at-point-functions'. -See also `comint-dynamic-complete'. +See also `completion-at-point'. This is a good thing to set in mode hooks.") @@ -616,7 +616,7 @@ Input ring expansion is controlled by the variable `comint-input-autoexpand', and addition is controlled by the variable `comint-input-ignoredups'. Commands with no default key bindings include `send-invisible', -`comint-dynamic-complete', `comint-dynamic-list-filename-completions', and +`completion-at-point', `comint-dynamic-list-filename-completions', and `comint-magic-space'. Input to, and output from, the subprocess can cause the window to scroll to @@ -2892,7 +2892,7 @@ its response can be seen." ;; Useful completion functions, courtesy of the Ergo group. ;; Six commands: -;; comint-dynamic-complete Complete or expand command, filename, +;; completion-at-point Complete or expand command, filename, ;; history at point. ;; comint-dynamic-complete-filename Complete filename at point. ;; comint-dynamic-list-filename-completions List completions in help buffer. @@ -2901,7 +2901,7 @@ its response can be seen." ;; These are not installed in the comint-mode keymap. But they are ;; available for people who want them. Shell-mode installs them: -;; (define-key shell-mode-map "\t" 'comint-dynamic-complete) +;; (define-key shell-mode-map "\t" 'completion-at-point) ;; (define-key shell-mode-map "\M-?" ;; 'comint-dynamic-list-filename-completions))) ;; @@ -3805,7 +3805,7 @@ REGEXP-GROUP is the regular expression group in REGEXP to use." ;; (setq shell-mode-map (copy-keymap comint-mode-map)) ;; (define-key shell-mode-map "\C-c\C-f" 'shell-forward-command) ;; (define-key shell-mode-map "\C-c\C-b" 'shell-backward-command) -;; (define-key shell-mode-map "\t" 'comint-dynamic-complete) +;; (define-key shell-mode-map "\t" 'completion-at-point) ;; (define-key shell-mode-map "\M-?" ;; 'comint-dynamic-list-filename-completions))) ;; From f8152bcb327ef9a7b66974b029b617e06461ebab Mon Sep 17 00:00:00 2001 From: Xue Fuqiao Date: Sun, 21 Apr 2013 11:27:51 +0800 Subject: [PATCH 09/23] searching.texi (Regexp Backslash): Doc fix for backslash constructs in regular expressions. --- doc/lispref/ChangeLog | 5 +++++ doc/lispref/searching.texi | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 31e4f791350..36c8b8dbea7 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2013-04-21 Xue Fuqiao + + * searching.texi (Regexp Backslash): Doc fix for backslash + constructs in regular expressions. + 2013-04-15 Christopher Schmidt * tips.texi (Coding Conventions): Mention separation of package diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 87d4051d6f0..386d5bdde4c 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -589,10 +589,8 @@ through @samp{f} and @samp{A} through @samp{F}. For the most part, @samp{\} followed by any character matches only that character. However, there are several exceptions: certain -two-character sequences starting with @samp{\} that have special -meanings. (The character after the @samp{\} in such a sequence is -always ordinary when used on its own.) Here is a table of the special -@samp{\} constructs. +sequences starting with @samp{\} that have special meanings. Here is +a table of the special @samp{\} constructs. @table @samp @item \| From 84ebefe92fde8f636ceed2e51f6489876280be71 Mon Sep 17 00:00:00 2001 From: Xue Fuqiao Date: Sun, 21 Apr 2013 19:16:30 +0800 Subject: [PATCH 10/23] * doc/lispref/internals.texi (Writing Emacs Primitives): Remove unnecessary references to the sources. (Bug#13800) --- doc/lispref/ChangeLog | 3 +++ doc/lispref/internals.texi | 34 ++++++++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 36c8b8dbea7..f770fb3cada 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,5 +1,8 @@ 2013-04-21 Xue Fuqiao + * internals.texi (Writing Emacs Primitives): Remove unnecessary + references to the sources. (Bug#13800) + * searching.texi (Regexp Backslash): Doc fix for backslash constructs in regular expressions. diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 3269776b626..24440858b7e 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -661,15 +661,33 @@ equivalent of @code{&rest}). Both @code{UNEVALLED} and @code{MANY} are macros. If @var{max} is a number, it must be more than @var{min} but less than 8. +@cindex interactive specification in primitives @item interactive -This is an interactive specification, a string such as might be used as -the argument of @code{interactive} in a Lisp function. In the case of -@code{or}, it is 0 (a null pointer), indicating that @code{or} cannot be -called interactively. A value of @code{""} indicates a function that -should receive no arguments when called interactively. If the value -begins with a @samp{(}, the string is evaluated as a Lisp form. -For examples of the last two forms, see @code{widen} and -@code{narrow-to-region} in @file{editfns.c}. +This is an interactive specification, a string such as might be used +as the argument of @code{interactive} in a Lisp function. In the case +of @code{or}, it is 0 (a null pointer), indicating that @code{or} +cannot be called interactively. A value of @code{""} indicates a function that should receive no +arguments when called interactively. For example: + +@smallexample +@group +DEFUN ("baz", Fbaz, Sbaz, 0, 0, "", + doc: /* @dots{} */) +@end group +@end smallexample + +If the value begins with a @samp{"(}, the string is evaluated as a +Lisp form. For example: + +@smallexample +@group +DEFUN ("foo", Ffoo, Sfoo, 0, UNEVALLED, "(list + (read-char-by-name \"Insert character (Unicode name or hex): \")\ + (prefix-numeric-value current-prefix-arg)\ + t))", + doc: /* @dots{} /*) +@end group +@end smallexample @item doc This is the documentation string. It uses C comment syntax rather From 767b8eaef5f62b5f93ef62fd692523b7da7b0914 Mon Sep 17 00:00:00 2001 From: Xue Fuqiao Date: Sun, 21 Apr 2013 19:56:28 +0800 Subject: [PATCH 11/23] * emacs-lisp-intro.texi (defcustom, defun, simplified-beginning-of-buffer, defvar, Building Robots, Review, save-excursion): `defun' and `defcustom' are now macros rather than special forms. (Bug#13853) --- doc/lispintro/ChangeLog | 7 +++++ doc/lispintro/emacs-lisp-intro.texi | 47 ++++++++++++----------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog index 93084e76203..1f27775442c 100644 --- a/doc/lispintro/ChangeLog +++ b/doc/lispintro/ChangeLog @@ -1,3 +1,10 @@ +2013-04-21 Xue Fuqiao + + * emacs-lisp-intro.texi (defcustom, defun) + (simplified-beginning-of-buffer, defvar, Building Robots, Review) + (save-excursion): `defun' and `defcustom' are now macros rather + than special forms. (Bug#13853) + 2013-03-16 Glenn Morris * emacs-lisp-intro.texi: Add some stuff specific to www.gnu.org. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index c42ed210cbc..3147960fbc3 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -37,6 +37,7 @@ @set edition-number 3.10 @set update-date 28 October 2009 +@c FIXME can this be updated? -- xfq @ignore ## Summary of shell commands to create various output formats: @@ -3094,18 +3095,15 @@ unless you investigate, you won't know whether an already-written function is written in Emacs Lisp or C. @node defun -@section The @code{defun} Special Form +@section The @code{defun} Macro @findex defun -@cindex Special form of @code{defun} @cindex @samp{function definition} defined In Lisp, a symbol such as @code{mark-whole-buffer} has code attached to it that tells the computer what to do when the function is called. This code is called the @dfn{function definition} and is created by evaluating a Lisp expression that starts with the symbol @code{defun} -(which is an abbreviation for @emph{define function}). Because -@code{defun} does not evaluate its arguments in the usual way, it is -called a @dfn{special form}. +(which is an abbreviation for @emph{define function}). In subsequent sections, we will look at function definitions from the Emacs source code, such as @code{mark-whole-buffer}. In this section, @@ -4254,7 +4252,7 @@ On the other hand, this function returns @code{nil} if the test is false. @findex point @findex mark -The @code{save-excursion} function is the fourth and final special form +The @code{save-excursion} function is the third and final special form that we will discuss in this chapter. In Emacs Lisp programs used for editing, the @code{save-excursion} @@ -4381,9 +4379,9 @@ within the body of a @code{let} expression. It looks like this: @node Review @section Review -In the last few chapters we have introduced a fair number of functions -and special forms. Here they are described in brief, along with a few -similar functions that have not been mentioned yet. +In the last few chapters we have introduced a macro and a fair number +of functions and special forms. Here they are described in brief, +along with a few similar functions that have not been mentioned yet. @table @code @item eval-last-sexp @@ -4393,10 +4391,10 @@ invoked with an argument; in that case, the output is printed in the current buffer. This command is normally bound to @kbd{C-x C-e}. @item defun -Define function. This special form has up to five parts: the name, -a template for the arguments that will be passed to the function, -documentation, an optional interactive declaration, and the body of the -definition. +Define function. This macro has up to five parts: the name, a +template for the arguments that will be passed to the function, +documentation, an optional interactive declaration, and the body of +the definition. @need 1250 For example, in an early version of Emacs, the function definition was @@ -4803,7 +4801,7 @@ leave mark at previous position." @end smallexample Like all function definitions, this definition has five parts following -the special form @code{defun}: +the macro @code{defun}: @enumerate @item @@ -9293,10 +9291,6 @@ have a value. If the variable already has a value, @code{defvar} does not override the existing value. Second, @code{defvar} has a documentation string. -(Another special form, @code{defcustom}, is designed for variables -that people customize. It has more features than @code{defvar}. -(@xref{defcustom, , Setting Variables with @code{defcustom}}.) - @menu * See variable current value:: * defvar and asterisk:: @@ -11300,11 +11294,11 @@ Let's expand on the metaphor in which a computer program is a robot. A function definition provides the blueprints for a robot. When you install a function definition, that is, when you evaluate a -@code{defun} special form, you install the necessary equipment to -build robots. It is as if you were in a factory, setting up an -assembly line. Robots with the same name are built according to the -same blueprints. So they have, as it were, the same `model number', -but a different `serial number'. +@code{defun} macro, you install the necessary equipment to build +robots. It is as if you were in a factory, setting up an assembly +line. Robots with the same name are built according to the same +blueprints. So they have, as it were, the same `model number', but a +different `serial number'. We often say that a recursive function `calls itself'. What we mean is that the instructions in a recursive function cause the Lisp @@ -16971,10 +16965,9 @@ definitions; but you can write @code{defuns} in your @file{.emacs} file. Indeed, you can write any Lisp expression in your @file{.emacs} file.) -The @code{customize} feature depends on the @code{defcustom} special -form. Although you can use @code{defvar} or @code{setq} for variables -that users set, the @code{defcustom} special form is designed for the -job. +The @code{customize} feature depends on the @code{defcustom} macro. +Although you can use @code{defvar} or @code{setq} for variables that +users set, the @code{defcustom} macro is designed for the job. You can use your knowledge of @code{defvar} for writing the first three arguments for @code{defcustom}. The first argument to From 2ebed929d5d4ce7d364afe3f70afaa34357261f1 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 21 Apr 2013 18:47:58 -0700 Subject: [PATCH 12/23] ChangeLog fix --- lisp/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index afb1ffd06fe..5dc33bd804f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -53,7 +53,7 @@ 2013-04-19 Masatake YAMATO * progmodes/sh-script.el (sh-imenu-generic-expression): - Handle function names with a single character. (Bug#11182) + Handle function names with a single character. (Bug#14111) 2013-04-19 Dima Kogan (tiny change) From 38cc0210f3bed42829d6cea2dd512a53e581764f Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Mon, 22 Apr 2013 13:53:05 +0900 Subject: [PATCH 13/23] epg.el: support pinentry mode added in GnuPG 2.1 * epg.el (epg-context-pinentry-mode): New function. (epg-context-set-pinentry-mode): New function. (epg--start): Pass --pinentry-mode option to gpg command. --- lisp/ChangeLog | 6 ++++++ lisp/epg.el | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5dc33bd804f..9c3be36984b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-04-22 Daiki Ueno + + * epg.el (epg-context-pinentry-mode): New function. + (epg-context-set-pinentry-mode): New function. + (epg--start): Pass --pinentry-mode option to gpg command. + 2013-04-21 Xue Fuqiao * comint.el: (comint-dynamic-complete-functions, comint-mode-map): diff --git a/lisp/epg.el b/lisp/epg.el index 3f04aa2e07a..c36de7e4624 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -195,7 +195,7 @@ cipher-algorithm digest-algorithm compress-algorithm (list #'epg-passphrase-callback-function) nil - nil nil nil nil nil nil))) + nil nil nil nil nil nil nil))) (defun epg-context-protocol (context) "Return the protocol used within CONTEXT." @@ -289,6 +289,12 @@ This function is for internal use only." (signal 'wrong-type-argument (list 'epg-context-p context))) (aref (cdr context) 14)) +(defun epg-context-pinentry-mode (context) + "Return the mode of pinentry invocation." + (unless (eq (car-safe context) 'epg-context) + (signal 'wrong-type-argument (list 'epg-context-p context))) + (aref (cdr context) 15)) + (defun epg-context-set-protocol (context protocol) "Set the protocol used within CONTEXT." (unless (eq (car-safe context) 'epg-context) @@ -407,6 +413,14 @@ This function is for internal use only." (signal 'wrong-type-argument (list 'epg-context-p context))) (aset (cdr context) 14 operation)) +(defun epg-context-set-pinentry-mode (context mode) + "Set the mode of pinentry invocation." + (unless (eq (car-safe context) 'epg-context) + (signal 'wrong-type-argument (list 'epg-context-p context))) + (unless (memq mode '(nil ask cancel error loopback)) + (signal 'epg-error (list "Unknown pinentry mode" mode))) + (aset (cdr context) 15 mode)) + (defun epg-make-signature (status &optional key-id) "Return a signature object." (cons 'epg-signature (vector status key-id nil nil nil nil nil nil nil nil @@ -1152,6 +1166,10 @@ This function is for internal use only." (if (epg-context-textmode context) '("--textmode")) (if (epg-context-output-file context) (list "--output" (epg-context-output-file context))) + (if (epg-context-pinentry-mode context) + (list "--pinentry-mode" + (symbol-name (epg-context-pinentry-mode + context)))) args)) (coding-system-for-write 'binary) (coding-system-for-read 'binary) From c6cb2f53ac46155dbe7fc87681e3bfbd3dc9138b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 21 Apr 2013 22:01:33 -0700 Subject: [PATCH 14/23] * build-aux/update-subdirs: Don't leave subdirs.el~ behind. It messes up 'make distclean', and contains no useful information because it's a copy of subdirs.el. --- ChangeLog | 6 ++++++ build-aux/update-subdirs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc6c0bfc3ec..ad354100bc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-04-22 Paul Eggert + + * build-aux/update-subdirs: Don't leave subdirs.el~ behind. + It messes up 'make distclean', and contains no useful information + because it's a copy of subdirs.el. + 2013-04-18 John Marino (tiny change) * configure.ac: Add DragonFly BSD, mostly same as FreeBSD. (Bug#14068) diff --git a/build-aux/update-subdirs b/build-aux/update-subdirs index 8fdf1609e6f..3c429b8b5e4 100755 --- a/build-aux/update-subdirs +++ b/build-aux/update-subdirs @@ -49,8 +49,8 @@ else ;; no-byte-compile: t ;; End:" > subdirs.el~ if cmp "subdirs.el" "subdirs.el~" >/dev/null 2>&1; then - :; # echo "subdirs.el unchanged"; + rm subdirs.el~ else - mv subdirs.el~ subdirs.el + mv subdirs.el~ subdirs.el fi fi From 1e8589d3d40eaf44c352e2989c2244d94de88405 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 21 Apr 2013 22:08:36 -0700 Subject: [PATCH 15/23] * make-dist: Do not distribute admin/unidata/Makefile. It is generated by 'configure'. --- ChangeLog | 3 +++ make-dist | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index ad354100bc7..5f74726a743 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2013-04-22 Paul Eggert + * make-dist: Do not distribute admin/unidata/Makefile. + It is generated by 'configure'. + * build-aux/update-subdirs: Don't leave subdirs.el~ behind. It messes up 'make distclean', and contains no useful information because it's a copy of subdirs.el. diff --git a/make-dist b/make-dist index 283defe8a7d..e1e62c895c7 100755 --- a/make-dist +++ b/make-dist @@ -439,6 +439,9 @@ echo "Making links to \`lwlib'" echo "Making links to \`admin' and its subdirectories" for f in `find admin -type f`; do + case $f in + admin/unidata/Makefile) continue ;; + esac ln $f $tempdir/$f done From 84fc48e57a1008b4c047ff30f3a6101b84130671 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 21 Apr 2013 22:18:30 -0700 Subject: [PATCH 16/23] * Makefile.in (bootstrap-clean): Remove stamp-h1 too. Without this fix, "make distclean" leaves stamp-h1 behind. --- src/ChangeLog | 5 +++++ src/Makefile.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5164dc8ff8d..31764cad485 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-04-22 Paul Eggert + + * Makefile.in (bootstrap-clean): Remove stamp-h1 too. + Without this fix, "make distclean" leaves stamp-h1 behind. + 2013-04-20 Erik Charlebois * w32fns.c (w32_fullscreen_rect): New function to compute the diff --git a/src/Makefile.in b/src/Makefile.in index c6a067a1ade..cef58c55e68 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -532,7 +532,7 @@ clean: mostlyclean ## It should remove all files generated during a compilation/bootstrap, ## but not things like config.status or TAGS. bootstrap-clean: clean - rm -f epaths.h config.h config.stamp stamp-oldxmenu ../etc/DOC-* + rm -f epaths.h config.h config.stamp stamp-h1 stamp-oldxmenu ../etc/DOC-* if test -f ./.gdbinit; then \ mv ./.gdbinit ./.gdbinit.save; \ if test -f "$(srcdir)/.gdbinit"; then rm -f ./.gdbinit.save; \ From d08536296ce1c7c8145aa8aee554cbbf4d11d213 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 22 Apr 2013 12:26:09 +0200 Subject: [PATCH 17/23] * net/tramp-compat.el (tramp-compat-call-process): Move function ... * net/tramp.el (tramp-call-process): ... here (tramp-set-completion-function, tramp-parse-putty): * net/tramp-adb.el (tramp-adb-execute-adb-command): * net/tramp-gvfs.el (tramp-gvfs-send-command): * net/tramp-sh.el (tramp-sh-handle-set-file-times) (tramp-set-file-uid-gid, tramp-sh-handle-write-region) (tramp-call-local-coding-command): Use `tramp-call-process' instead of `tramp-compat-call-process'. * net/tramp-sh.el (tramp-perl-pack, tramp-perl-unpack): New defconst. (tramp-local-coding-commands, tramp-remote-coding-commands): Use them. (tramp-sh-handle-file-local-copy, tramp-sh-handle-write-region): (tramp-find-inline-compress):Improve traces. (tramp-maybe-send-script): Check for Perl binary. (tramp-get-inline-coding): Do not redirect STDOUT for local decoding. --- lisp/ChangeLog | 21 +++++++ lisp/net/tramp-adb.el | 7 +-- lisp/net/tramp-compat.el | 14 ----- lisp/net/tramp-gvfs.el | 2 +- lisp/net/tramp-sh.el | 132 ++++++++++++++++++++------------------- lisp/net/tramp.el | 22 ++++++- 6 files changed, 113 insertions(+), 85 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9c3be36984b..7f7757e750e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,24 @@ +2013-04-22 Michael Albinus + + Fix pack/unpack coding. Reported by David Smith . + + * net/tramp-compat.el (tramp-compat-call-process): Move function ... + * net/tramp.el (tramp-call-process): ... here + (tramp-set-completion-function, tramp-parse-putty): + * net/tramp-adb.el (tramp-adb-execute-adb-command): + * net/tramp-gvfs.el (tramp-gvfs-send-command): + * net/tramp-sh.el (tramp-sh-handle-set-file-times) + (tramp-set-file-uid-gid, tramp-sh-handle-write-region) + (tramp-call-local-coding-command): Use `tramp-call-process' + instead of `tramp-compat-call-process'. + + * net/tramp-sh.el (tramp-perl-pack, tramp-perl-unpack): New defconst. + (tramp-local-coding-commands, tramp-remote-coding-commands): Use them. + (tramp-sh-handle-file-local-copy, tramp-sh-handle-write-region): + (tramp-find-inline-compress):Improve traces. + (tramp-maybe-send-script): Check for Perl binary. + (tramp-get-inline-coding): Do not redirect STDOUT for local decoding. + 2013-04-22 Daiki Ueno * epg.el (epg-context-pinentry-mode): New function. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index a71df54db58..613b2067955 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -982,11 +982,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (setq args (append (list "-s" (tramp-file-name-host vec)) args))) (with-temp-buffer (prog1 - (unless (zerop (apply 'call-process tramp-adb-program nil t nil args)) + (unless + (zerop (apply 'tramp-call-process tramp-adb-program nil t nil args)) (buffer-string)) - (tramp-message - vec 6 "%s %s\n%s" - tramp-adb-program (mapconcat 'identity args " ") (buffer-string))))) + (tramp-message vec 6 "%s" (buffer-string))))) (defun tramp-adb-find-test-command (vec) "Checks, whether the ash has a builtin \"test\" command. diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index ed61fbcfa76..d4115352b34 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -438,20 +438,6 @@ This is, the first, empty, element is omitted. In XEmacs, the first element is not omitted." (delete "" (split-string string pattern))) -(defun tramp-compat-call-process - (program &optional infile destination display &rest args) - "Calls `call-process' on the local host. -This is needed because for some Emacs flavors Tramp has -defadvised `call-process' to behave like `process-file'. The -Lisp error raised when PROGRAM is nil is trapped also, returning 1." - (let ((default-directory - (if (file-remote-p default-directory) - (tramp-compat-temporary-file-directory) - default-directory))) - (if (executable-find program) - (apply 'call-process program infile destination display args) - 1))) - (defun tramp-compat-process-running-p (process-name) "Returns `t' if system process PROCESS-NAME is running for `user-login-name'." (when (stringp process-name) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 6f066f56a2b..7c3b393873c 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1572,7 +1572,7 @@ COMMAND is usually a command from the gvfs-* utilities. (tramp-gvfs-maybe-open-connection vec) (erase-buffer) (tramp-message vec 6 "%s %s" command (mapconcat 'identity args " ")) - (setq result (apply 'tramp-compat-call-process command nil t nil args)) + (setq result (apply 'tramp-call-process command nil t nil args)) (tramp-message vec 6 "\n%s" (buffer-string)) (zerop result)))) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index f28df1ce160..e45c2cf8511 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -767,6 +767,16 @@ while (my $data = ) { Escape sequence %s is replaced with name of Perl binary. This string is passed to `format', so percent characters need to be doubled.") +(defconst tramp-perl-pack + "%s -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'" + "Perl program to use for encoding a file. +Escape sequence %s is replaced with name of Perl binary.") + +(defconst tramp-perl-unpack + "%s -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'" + "Perl program to use for decoding a file. +Escape sequence %s is replaced with name of Perl binary.") + (defconst tramp-vc-registered-read-file-names "echo \"(\" while read file; do @@ -1309,7 +1319,7 @@ of." ;; without `set-file-times', this function is an alias for this. ;; We are local, so we don't need the UTC settings. (zerop - (tramp-compat-call-process + (tramp-call-process "touch" nil nil nil "-t" (format-time-string "%Y%m%d%H%M.%S" time) (tramp-shell-quote-argument filename))))) @@ -1343,7 +1353,7 @@ be non-negative integers." ;; `set-file-uid-gid'. On W32 "chown" might not work. (let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer))) (gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer)))) - (tramp-compat-call-process + (tramp-call-process "chown" nil nil nil (format "%d:%d" uid gid) (tramp-shell-quote-argument filename)))))) @@ -2891,40 +2901,39 @@ the result will be a local, non-Tramp, filename." (rem-enc (save-excursion (with-tramp-progress-reporter - v 3 (format "Encoding remote file %s" filename) + v 3 + (format "Encoding remote file `%s' with `%s'" filename rem-enc) (tramp-barf-unless-okay v (format rem-enc (tramp-shell-quote-argument localname)) "Encoding remote file failed")) - (if (functionp loc-dec) - ;; If local decoding is a function, we call it. We - ;; must disable multibyte, because - ;; `uudecode-decode-region' doesn't handle it - ;; correctly. - (with-temp-buffer - (set-buffer-multibyte nil) - (insert-buffer-substring (tramp-get-buffer v)) - (with-tramp-progress-reporter - v 3 (format "Decoding remote file %s with function %s" - filename loc-dec) + (with-tramp-progress-reporter + v 3 (format "Decoding local file `%s' with `%s'" + tmpfile loc-dec) + (if (functionp loc-dec) + ;; If local decoding is a function, we call it. + ;; We must disable multibyte, because + ;; `uudecode-decode-region' doesn't handle it + ;; correctly. + (with-temp-buffer + (set-buffer-multibyte nil) + (insert-buffer-substring (tramp-get-buffer v)) (funcall loc-dec (point-min) (point-max)) ;; Unset `file-name-handler-alist'. Otherwise, ;; epa-file gets confused. (let (file-name-handler-alist (coding-system-for-write 'binary)) - (write-region (point-min) (point-max) tmpfile)))) + (write-region (point-min) (point-max) tmpfile))) - ;; If tramp-decoding-function is not defined for this - ;; method, we invoke tramp-decoding-command instead. - (let ((tmpfile2 (tramp-compat-make-temp-file filename))) - ;; Unset `file-name-handler-alist'. Otherwise, - ;; epa-file gets confused. - (let (file-name-handler-alist - (coding-system-for-write 'binary)) - (write-region (point-min) (point-max) tmpfile2)) - (with-tramp-progress-reporter - v 3 (format "Decoding remote file %s with command %s" - filename loc-dec) + ;; If tramp-decoding-function is not defined for this + ;; method, we invoke tramp-decoding-command instead. + (let ((tmpfile2 (tramp-compat-make-temp-file filename))) + ;; Unset `file-name-handler-alist'. Otherwise, + ;; epa-file gets confused. + (let (file-name-handler-alist + (coding-system-for-write 'binary)) + (with-current-buffer (tramp-get-buffer v) + (write-region (point-min) (point-max) tmpfile2))) (unwind-protect (tramp-call-local-coding-command loc-dec tmpfile2 tmpfile) @@ -3149,28 +3158,25 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." (with-temp-buffer (set-buffer-multibyte nil) ;; Use encoding function or command. - (if (functionp loc-enc) - (with-tramp-progress-reporter - v 3 (format "Encoding region using function `%s'" - loc-enc) - (let ((coding-system-for-read 'binary)) - (insert-file-contents-literally tmpfile)) - ;; The following `let' is a workaround for the - ;; base64.el that comes with pgnus-0.84. If - ;; both of the following conditions are + (with-tramp-progress-reporter + v 3 (format "Encoding local file `%s' using `%s'" + tmpfile loc-enc) + (if (functionp loc-enc) + ;; The following `let' is a workaround for + ;; the base64.el that comes with pgnus-0.84. + ;; If both of the following conditions are ;; satisfied, it tries to write to a local ;; file in default-directory, but at this ;; point, default-directory is remote. ;; (`call-process-region' can't write to ;; remote files, it seems.) The file in ;; question is a tmp file anyway. - (let ((default-directory + (let ((coding-system-for-read 'binary) + (default-directory (tramp-compat-temporary-file-directory))) - (funcall loc-enc (point-min) (point-max)))) + (insert-file-contents-literally tmpfile) + (funcall loc-enc (point-min) (point-max))) - (with-tramp-progress-reporter - v 3 (format "Encoding region using command `%s'" - loc-enc) (unless (zerop (tramp-call-local-coding-command loc-enc tmpfile t)) (tramp-error @@ -3183,8 +3189,8 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." ;; writes to remote file. Because this happens on ;; the remote host, we cannot use the function. (with-tramp-progress-reporter - v 3 - (format "Decoding region into remote file %s" filename) + v 3 (format "Decoding remote file `%s' using `%s'" + filename rem-dec) (goto-char (point-max)) (unless (bolp) (newline)) (tramp-send-command @@ -3204,7 +3210,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." (erase-buffer) (and ;; cksum runs locally, if possible. - (zerop (tramp-compat-call-process "cksum" tmpfile t)) + (zerop (tramp-call-process "cksum" tmpfile t)) ;; cksum runs remotely. (tramp-send-command-and-check v @@ -3382,6 +3388,9 @@ Only send the definition if it has not already been done." (unless (member name scripts) (with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name) ;; The script could contain a call of Perl. This is masked with `%s'. + (when (and (string-match "%s" script) + (not (tramp-get-remote-perl vec))) + (tramp-error vec 'file-error "No Perl available on remote host")) (tramp-barf-unless-okay vec (format "%s () {\n%s\n}" name @@ -3811,11 +3820,6 @@ process to set up. VEC specifies the connection." (tramp-send-command vec (format "unset %s" (mapconcat 'identity unset " ")) t)))) -;; CCC: We should either implement a Perl version of base64 encoding -;; and decoding. Then we just use that in the last item. The other -;; alternative is to use the Perl version of UU encoding. But then -;; we need a Lisp version of uuencode. -;; ;; Old text from documentation of tramp-methods: ;; Using a uuencode/uudecode inline method is discouraged, please use one ;; of the base64 methods instead since base64 encoding is much more @@ -3832,11 +3836,9 @@ process to set up. VEC specifies the connection." (autoload 'uudecode-decode-region "uudecode") (defconst tramp-local-coding-commands - '((b64 base64-encode-region base64-decode-region) + `((b64 base64-encode-region base64-decode-region) (uu tramp-uuencode-region uudecode-decode-region) - (pack - "perl -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'" - "perl -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'")) + (pack ,(format tramp-perl-pack "perl") ,(format tramp-perl-unpack "perl"))) "List of local coding commands for inline transfer. Each item is a list that looks like this: @@ -3871,9 +3873,7 @@ with the encoded or decoded results, respectively.") (uu "uuencode xxx" "uudecode -o -") (uu "uuencode xxx" "uudecode -p") (uu "uuencode xxx" tramp-uudecode) - (pack - "perl -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'" - "perl -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'")) + (pack tramp-perl-pack tramp-perl-unpack)) "List of remote coding commands for inline transfer. Each item is a list that looks like this: @@ -4014,7 +4014,7 @@ INPUT can also be nil which means `/dev/null'. OUTPUT can be a string (which specifies a filename), or t (which means standard output and thus the current buffer), or nil (which means discard it)." - (tramp-compat-call-process + (tramp-call-process tramp-encoding-shell (when (and input (not (string-match "%s" cmd))) input) (if (eq output t) t nil) @@ -4022,7 +4022,7 @@ means discard it)." tramp-encoding-command-switch (concat (if (string-match "%s" cmd) (format cmd input) cmd) - (if (stringp output) (concat "> " output) "")))) + (if (stringp output) (concat " >" output) "")))) (defconst tramp-inline-compress-commands '(("gzip" "gzip -d") @@ -4051,7 +4051,7 @@ Goes through the list `tramp-inline-compress-commands'." decompress (nth 1 item)) (tramp-message vec 5 - "Checking local compress command `%s', `%s' for sanity" + "Checking local compress commands `%s', `%s' for sanity" compress decompress) (unless (zerop @@ -4067,7 +4067,7 @@ Goes through the list `tramp-inline-compress-commands'." (throw 'next nil)) (tramp-message vec 5 - "Checking remote compress command `%s', `%s' for sanity" + "Checking remote compress commands `%s', `%s' for sanity" compress decompress) (unless (tramp-send-command-and-check vec (format "echo %s | %s | %s" magic compress decompress) t) @@ -4981,10 +4981,12 @@ function cell is returned to be applied on a buffer." ;; Windows shells need the program file name after ;; the pipe symbol be quoted if they use forward ;; slashes as directory separators. - (if (and (string-match "local" prop) - (memq system-type '(windows-nt))) - "(%s | \"%s\" >%%s)" - "(%s | %s >%%s)") + (cond + ((and (string-match "local" prop) + (memq system-type '(windows-nt))) + "(%s | \"%s\")") + ((string-match "local" prop) "(%s | %s)") + (t "(%s | %s >%%s)")) coding compress)) (compress (format @@ -4997,7 +4999,9 @@ function cell is returned to be applied on a buffer." "(%s <%%s | %s)") compress coding)) ((string-match "decoding" prop) - (format "%s >%%s" coding)) + (cond + ((string-match "local" prop) (format "%s" coding)) + (t (format "%s >%%s" coding)))) (t (format "%s <%%s" coding))))))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 7795d9f808c..4ec3a4b7829 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1717,7 +1717,7 @@ Example: ;; Windows registry. (and (memq system-type '(cygwin windows-nt)) (zerop - (tramp-compat-call-process + (tramp-call-process "reg" nil nil nil "query" (nth 1 (car v))))) ;; Configuration file. (file-exists-p (nth 1 (car v))))) @@ -2769,7 +2769,7 @@ User may be nil." User is always nil." (if (memq system-type '(windows-nt)) (with-temp-buffer - (when (zerop (tramp-compat-call-process + (when (zerop (tramp-call-process "reg" nil t nil "query" registry-or-dirname)) (goto-char (point-min)) (loop while (not (eobp)) collect @@ -3897,6 +3897,24 @@ ALIST is of the form ((FROM . TO) ...)." ;;; Compatibility functions section: +(defun tramp-call-process + (program &optional infile destination display &rest args) + "Calls `call-process' on the local host. +This is needed because for some Emacs flavors Tramp has +defadvised `call-process' to behave like `process-file'. The +Lisp error raised when PROGRAM is nil is trapped also, returning 1. +Furthermore, traces are written with verbosity of 6." + (let ((default-directory + (if (file-remote-p default-directory) + (tramp-compat-temporary-file-directory) + default-directory))) + (tramp-message + (vector tramp-current-method tramp-current-user tramp-current-host nil nil) + 6 "%s %s %s" program infile args) + (if (executable-find program) + (apply 'call-process program infile destination display args) + 1))) + ;;;###tramp-autoload (defun tramp-read-passwd (proc &optional prompt) "Read a password from user (compat function). From 72d548a9d79e2069272e5d43392e1bdf366c3f02 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Mon, 22 Apr 2013 22:41:32 +0800 Subject: [PATCH 18/23] * info-look.el: Prefer latex2e.info. Fixes: debbugs:14240 --- lisp/ChangeLog | 4 ++++ lisp/info-look.el | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7f7757e750e..b0cad6454c3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2013-04-22 Leo Liu + + * info-look.el: Prefer latex2e.info. (Bug#14240) + 2013-04-22 Michael Albinus Fix pack/unpack coding. Reported by David Smith . diff --git a/lisp/info-look.el b/lisp/info-look.el index afe4301c659..e43cd731547 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -881,8 +881,11 @@ Return nil if there is nothing appropriate in the buffer near point." (info-lookup-maybe-add-help :mode 'latex-mode :regexp "\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)" - :doc-spec '(("(latex)Command Index" nil - "`" "\\({[^}]*}\\)?'"))) + :doc-spec `((,(if (Info-find-file "latex2e" t) + ;; From http://home.gna.org/latexrefman + "(latex2e)Command Index" + "(latex)Command Index") + nil "`" "\\({[^}]*}\\)?'"))) (info-lookup-maybe-add-help :mode 'emacs-lisp-mode From 2325c82f631e5432c3d00ff7781ffe145674163a Mon Sep 17 00:00:00 2001 From: Xue Fuqiao Date: Tue, 23 Apr 2013 08:43:07 +0800 Subject: [PATCH 19/23] emacs-lisp-intro.texi fixes. * doc/lispintro/emacs-lisp-intro.texi (Complications, defvar): Refine the doc about Lisp macros. (http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00618.html) --- doc/lispintro/ChangeLog | 5 +++++ doc/lispintro/emacs-lisp-intro.texi | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog index 1f27775442c..be9f9f963c0 100644 --- a/doc/lispintro/ChangeLog +++ b/doc/lispintro/ChangeLog @@ -1,3 +1,8 @@ +2013-04-23 Xue Fuqiao + + * emacs-lisp-intro.texi (Complications, defvar): Refine the doc + about Lisp macros. (http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00618.html) + 2013-04-21 Xue Fuqiao * emacs-lisp-intro.texi (defcustom, defun) diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 3147960fbc3..7831603124e 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -457,7 +457,7 @@ Practicing Evaluation How To Write Function Definitions * Primitive Functions:: -* defun:: The @code{defun} special form. +* defun:: The @code{defun} macro. * Install:: Install a function definition. * Interactive:: Making a function interactive. * Interactive Options:: Different options for @code{interactive}. @@ -1618,11 +1618,16 @@ the symbol's value as a @dfn{variable}. This situation is described in the section on variables. (@xref{Variables}.) @cindex Special form -The second complication occurs because some functions are unusual and do -not work in the usual manner. Those that don't are called @dfn{special -forms}. They are used for special jobs, like defining a function, and -there are not many of them. In the next few chapters, you will be -introduced to several of the more important special forms. +The second complication occurs because some functions are unusual and +do not work in the usual manner. Those that don't are called +@dfn{special forms}. They are used for special jobs, like defining a +function, and there are not many of them. In the next few chapters, +you will be introduced to several of the more important special forms. +And there are also @dfn{macros}. Macro is a construct defined in +Lisp, which differs from a function in that it translates a Lisp +expression into another expression which is to be evaluated instead of +the original expression. (@xref{Lisp macro}.) + The third and final complication is this: if the function that the Lisp interpreter is looking at is not a special form, and if it is part @@ -9291,6 +9296,10 @@ have a value. If the variable already has a value, @code{defvar} does not override the existing value. Second, @code{defvar} has a documentation string. +(There is a related macro, @code{defcustom}, designed for variables +that people customize. It has more features than @code{defvar}. +(@xref{defcustom, , Setting Variables with @code{defcustom}}.) + @menu * See variable current value:: * defvar and asterisk:: From 1d829c64d28693a09ca6ec7ddc188c6ae7ba0df0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Apr 2013 08:27:06 -0400 Subject: [PATCH 20/23] * lisp/minibuffer.el (minibuffer-completion-contents): Fix obsolescence info to avoid misleading the user. --- lisp/ChangeLog | 5 +++++ lisp/minibuffer.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0cad6454c3..f538764f909 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-22 Stefan Monnier + + * minibuffer.el (minibuffer-completion-contents): Fix obsolescence info + to avoid misleading the user. + 2013-04-22 Leo Liu * info-look.el: Prefer latex2e.info. (Bug#14240) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 978b3a5b130..ef949f7482e 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -638,8 +638,8 @@ If ARGS are provided, then pass MESSAGE through `format'." (defun minibuffer-completion-contents () "Return the user input in a minibuffer before point as a string. -That used to be what completion commands operate on." - (declare (obsolete minibuffer-contents "24.4")) +In Emacs-22, that was what completion commands operated on." + (declare (obsolete nil "24.4")) (buffer-substring (field-beginning) (point))) (defun delete-minibuffer-contents () From 117f94cf109728a2e6f1d506041a741481eeedff Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Apr 2013 08:29:14 -0400 Subject: [PATCH 21/23] * lisp/jit-lock.el: Fix signals in jit-lock-force-redisplay. Use lexical-binding. (jit-lock-force-redisplay): Use markers, check buffer's continued existence and beware narrowed buffers. (jit-lock-fontify-now): Adjust call accordingly. --- lisp/ChangeLog | 8 ++++++++ lisp/jit-lock.el | 25 ++++++++++++++----------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f538764f909..4307577950f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-04-23 Stefan Monnier + + * jit-lock.el: Fix signals in jit-lock-force-redisplay. + Use lexical-binding. + (jit-lock-force-redisplay): Use markers, check buffer's continued + existence and beware narrowed buffers. + (jit-lock-fontify-now): Adjust call accordingly. + 2013-04-22 Stefan Monnier * minibuffer.el (minibuffer-completion-contents): Fix obsolescence info diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index d879735c344..9359a65a1b8 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -1,4 +1,4 @@ -;;; jit-lock.el --- just-in-time fontification +;;; jit-lock.el --- just-in-time fontification -*- lexical-binding: t -*- ;; Copyright (C) 1998, 2000-2013 Free Software Foundation, Inc. @@ -412,21 +412,24 @@ Defaults to the whole buffer. END can be out of bounds." ;; eagerly extend the refontified region with ;; jit-lock-after-change-extend-region-functions. (when (< start orig-start) - (run-with-timer 0 nil 'jit-lock-force-redisplay - (current-buffer) start orig-start)) + (run-with-timer 0 nil #'jit-lock-force-redisplay + (copy-marker start) (copy-marker orig-start))) ;; Find the start of the next chunk, if any. (setq start (text-property-any next end 'fontified nil)))))))) -(defun jit-lock-force-redisplay (buf start end) +(defun jit-lock-force-redisplay (start end) "Force the display engine to re-render buffer BUF from START to END." - (with-current-buffer buf - (with-buffer-prepared-for-jit-lock - ;; Don't cause refontification (it's already been done), but just do - ;; some random buffer change, so as to force redisplay. - (put-text-property start end 'fontified t)))) - - + (when (marker-buffer start) + (with-current-buffer (marker-buffer start) + (with-buffer-prepared-for-jit-lock + (when (> end (point-max)) + (setq end (point-max) start (min start end))) + (when (< start (point-min)) + (setq start (point-min) end (max start end))) + ;; Don't cause refontification (it's already been done), but just do + ;; some random buffer change, so as to force redisplay. + (put-text-property start end 'fontified t))))) ;;; Stealth fontification. From 0aecf7187210975ca211b814752eab72d1ea1f6f Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Tue, 23 Apr 2013 17:18:58 +0200 Subject: [PATCH 22/23] * textmodes/reftex-vars.el (reftex-label-regexps): Call `reftex-compile-variables' after changes to this variable. --- lisp/ChangeLog | 5 +++++ lisp/textmodes/reftex-vars.el | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4307577950f..d299aeead49 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-23 Tassilo Horn + + * textmodes/reftex-vars.el (reftex-label-regexps): Call + `reftex-compile-variables' after changes to this variable. + 2013-04-23 Stefan Monnier * jit-lock.el: Fix signals in jit-lock-force-redisplay. diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index c00cf36c79e..a220002286e 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -873,7 +873,14 @@ DOWNCASE t: Downcase words before using them." The default value matches usual \\label{...} definitions and keyval style [..., label = {...}, ...] label definitions. It is assumed that the regexp group 1 matches the label text, so you -have to define it using \\(?1:...\\) when adding new regexps." +have to define it using \\(?1:...\\) when adding new regexps. + +When changed from Lisp, make sure to call +`reftex-compile-variables' afterwards to make the change +effective." + :set (lambda (symbol value) + (set symbol value) + (reftex-compile-variables)) :group 'reftex-defining-label-environments :type '(repeat (regexp :tag "Regular Expression"))) From 92c519507b81076beac37d01dd96c2c511dff810 Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Tue, 23 Apr 2013 17:23:59 +0200 Subject: [PATCH 23/23] * textmodes/reftex.el (reftex-compile-variables): Add autoload cookie. --- lisp/ChangeLog | 3 +++ lisp/textmodes/reftex.el | 1 + 2 files changed, 4 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d299aeead49..59e2a227e42 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-04-23 Tassilo Horn + * textmodes/reftex.el (reftex-compile-variables): Add autoload + cookie. + * textmodes/reftex-vars.el (reftex-label-regexps): Call `reftex-compile-variables' after changes to this variable. diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 21083fd188a..8b5dee5a037 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -811,6 +811,7 @@ This enforces rescanning the buffer on next use." (reftex-kill-buffer (reftex-make-index-buffer-name tag))) (cdr (assoc 'index-tags (symbol-value reftex-docstruct-symbol))))) +;;;###autoload (defun reftex-compile-variables () ;; Compile the information in reftex-label-alist & Co.