diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2019-11-21 21:01:53 +0100 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2019-11-21 21:01:53 +0100 |
commit | 86d8d9589370e8786c2cb245dad8527494009ac2 (patch) | |
tree | 7cee88add34b97cc12396528263db85490f025b2 /lisp | |
parent | 5a62c4b49ca1ac45d576f55d266750b7d1d6668a (diff) | |
parent | 6c9c45bfabaa06bd604c95e194102143b87f700e (diff) | |
download | emacs-86d8d9589370e8786c2cb245dad8527494009ac2.tar.gz emacs-86d8d9589370e8786c2cb245dad8527494009ac2.tar.bz2 emacs-86d8d9589370e8786c2cb245dad8527494009ac2.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/auth-source.el | 13 | ||||
-rw-r--r-- | lisp/emacs-lisp/pp.el | 1 | ||||
-rw-r--r-- | lisp/gnus/gnus-sum.el | 4 | ||||
-rw-r--r-- | lisp/gnus/message.el | 9 | ||||
-rw-r--r-- | lisp/image.el | 29 | ||||
-rw-r--r-- | lisp/image/image-converter.el | 16 | ||||
-rw-r--r-- | lisp/net/tramp.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/verilog-mode.el | 22 | ||||
-rw-r--r-- | lisp/vc/vc-git.el | 6 | ||||
-rw-r--r-- | lisp/vc/vc-hg.el | 49 |
10 files changed, 118 insertions, 33 deletions
diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 4926f67f0a1..89a468570ac 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -1000,13 +1000,18 @@ Note that the MAX parameter is used so we can exit the parse early." (forward-line 1) (skip-chars-forward "\t "))) +(defun auth-source-netrc-looking-at-token () + "Say whether the next think in the buffer is a token (password, etc). +Match data is altered to reflect the token." + (or (looking-at "'\\([^']*\\)'") + (looking-at "\"\\([^\"]*\\)\"") + (looking-at "\\([^ \t\n]+\\)"))) + (defun auth-source-netrc-parse-one () "Read one thing from the current buffer." (auth-source-netrc-parse-next-interesting) - (when (or (looking-at "'\\([^']*\\)'") - (looking-at "\"\\([^\"]*\\)\"") - (looking-at "\\([^ \t\n]+\\)")) + (when (auth-source-netrc-looking-at-token) (forward-char (length (match-string 0))) (prog1 (match-string-no-properties 1) @@ -2427,7 +2432,7 @@ passwords are revealed when point moved into the password. (while (re-search-forward (format "\\(\\s-\\|^\\)\\(%s\\)\\s-+" authinfo-hidden) nil t) - (when (looking-at "[^\n\t ]+") + (when (auth-source-netrc-looking-at-token) (let ((overlay (make-overlay (match-beginning 0) (match-end 0)))) (overlay-put overlay 'display (propertize "****" 'face 'warning)) diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index de4cbfc0e10..ca5114eddf9 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -53,6 +53,7 @@ to make output that `read' can handle, whenever this is possible." ;;;###autoload (defun pp-buffer () "Prettify the current buffer with printed representation of a Lisp object." + (interactive) (goto-char (point-min)) (while (not (eobp)) ;; (message "%06d" (- (point-max) (point))) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index b8859528d0b..6680254c8d4 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -1992,7 +1992,7 @@ increase the score of each group you read." "x" gnus-summary-limit-to-unread "s" gnus-summary-isearch-article "\t" gnus-summary-button-forward - [backtab] gnus-summary-widget-backward + [backtab] gnus-summary-button-backward "w" gnus-summary-browse-url "t" gnus-summary-toggle-header "g" gnus-summary-show-article @@ -2161,7 +2161,7 @@ increase the score of each group you read." "g" gnus-summary-show-article "s" gnus-summary-isearch-article "\t" gnus-summary-button-forward - [backtab] gnus-summary-widget-backward + [backtab] gnus-summary-button-backward "w" gnus-summary-browse-url "P" gnus-summary-print-article "S" gnus-sticky-article diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 9de35bd44c0..83ec211a7d1 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4123,6 +4123,7 @@ The usage of ARG is defined by the instance that called Message. It should typically alter the sending method in some way or other." (interactive "P") (let ((buf (current-buffer)) + (position (point-marker)) (actions message-exit-actions)) (when (and (message-send arg) (buffer-live-p buf)) @@ -4130,7 +4131,13 @@ It should typically alter the sending method in some way or other." (if message-kill-buffer-on-exit (kill-buffer buf)) (message-do-actions actions) - t))) + t) + ;; Restore the point in the message buffer. + (when (buffer-live-p buf) + (save-window-excursion + (switch-to-buffer buf) + (set-window-point nil position) + (set-marker position nil))))) (defun message-dont-send () "Don't send the message you have been editing. diff --git a/lisp/image.el b/lisp/image.el index 5f24475ce5b..6e19f17fd25 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -158,6 +158,10 @@ or \"ffmpeg\") is installed." (let ((map (make-sparse-keymap))) (define-key map "-" 'image-decrease-size) (define-key map "+" 'image-increase-size) + (define-key map [C-wheel-down] 'image-mouse-decrease-size) + (define-key map [C-mouse-5] 'image-mouse-decrease-size) + (define-key map [C-wheel-up] 'image-mouse-increase-size) + (define-key map [C-mouse-4] 'image-mouse-increase-size) (define-key map "r" 'image-rotate) (define-key map "o" 'image-save) map)) @@ -476,6 +480,7 @@ Image file names that are not absolute are searched for in the ;; If we have external image conversion switched on (for exotic, ;; non-native image formats), then we convert the file. (when (eq type 'image-convert) + (require 'image-converter) (setq file-or-data (image-convert file-or-data data-format) type 'png data-p t))) @@ -1007,24 +1012,40 @@ has no effect." (imagemagick-register-types) -(defun image-increase-size (n) +(defun image-increase-size (&optional n) "Increase the image size by a factor of N. If N is 3, then the image size will be increased by 30%. The default is 20%." (interactive "P") (image--change-size (if n - (1+ (/ n 10.0)) + (1+ (/ (prefix-numeric-value n) 10.0)) 1.2))) -(defun image-decrease-size (n) +(defun image-decrease-size (&optional n) "Decrease the image size by a factor of N. If N is 3, then the image size will be decreased by 30%. The default is 20%." (interactive "P") (image--change-size (if n - (- 1 (/ n 10.0)) + (- 1 (/ (prefix-numeric-value n) 10.0)) 0.8))) +(defun image-mouse-increase-size (&optional event) + "Increase the image size using the mouse." + (interactive "e") + (when (listp event) + (save-window-excursion + (posn-set-point (event-start event)) + (image-increase-size)))) + +(defun image-mouse-decrease-size (&optional event) + "Decrease the image size using the mouse." + (interactive "e") + (when (listp event) + (save-window-excursion + (posn-set-point (event-start event)) + (image-decrease-size)))) + (defun image--get-image () "Return the image at point." (let ((image (get-char-property (point) 'display))) diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el index dedccadcf46..b4d10c861b0 100644 --- a/lisp/image/image-converter.el +++ b/lisp/image/image-converter.el @@ -70,14 +70,18 @@ is a string, it should be a MIME format string like (defun image-convert (image &optional image-format) "Convert IMAGE file to the PNG format. -IMAGE can either be a file name, which will make the return value -a string with the image data. +IMAGE can either be a file name or image data. -If IMAGE-FORMAT is non-nil, IMAGE is a string containing the -image data, and IMAGE-FORMAT is a symbol with a MIME format name -like \"image/webp\". +To pass in image data, IMAGE should a string containing the image +data, and IMAGE-FORMAT should be a symbol with a MIME format name +like \"image/webp\". For instance: -IMAGE can also be an image object as returned by `create-image'." + (image-convert data-string 'image/bmp) + +IMAGE can also be an image object as returned by `create-image'. + +This function converts the image to PNG, and the converted image +data is returned as a string." ;; Find an installed image converter. (unless image-converter (image-converter--find-converter)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index cb40c71cfeb..e344990f7fc 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4958,8 +4958,6 @@ name of a process or buffer, or nil to default to the current buffer." (defun tramp-unload-tramp () "Discard Tramp from loading remote files." (interactive) - ;; ange-ftp settings must be re-enabled. - (tramp-compat-funcall 'tramp-ftp-enable-ange-ftp) ;; Maybe it's not loaded yet. (ignore-errors (unload-feature 'tramp 'force))) diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 85657b385d5..0afbdc3dd18 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -9,7 +9,7 @@ ;; Keywords: languages ;; The "Version" is the date followed by the decimal rendition of the Git ;; commit hex. -;; Version: 2019.11.11.038630457 +;; Version: 2019.11.21.248091482 ;; Yoni Rabkin <yoni@rabkins.net> contacted the maintainer of this ;; file on 19/3/2008, and the maintainer agreed that when a bug is @@ -124,7 +124,7 @@ ;; ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "2019-11-11-24d7439-vpo-GNU" +(defconst verilog-mode-version "2019-11-21-ec9935a-vpo-GNU" "Version of this Verilog mode.") (defconst verilog-mode-release-emacs t "If non-nil, this version of Verilog mode was released with Emacs itself.") @@ -809,9 +809,7 @@ The name of the function or case will be set between the braces." (defcustom verilog-auto-ignore-concat nil "Non-nil means ignore signals in {...} concatenations for AUTOWIRE etc. This will exclude signals referenced as pin connections in {...} -from AUTOWIRE, AUTOOUTPUT and friends. This flag should be set -for backward compatibility only and not set in new designs; it -may be removed in future versions." +or (...) from AUTOWIRE, AUTOOUTPUT and friends." :group 'verilog-mode-actions :type 'boolean) (put 'verilog-auto-ignore-concat 'safe-local-variable 'verilog-booleanp) @@ -8862,11 +8860,10 @@ Return an array of [outputs inouts inputs wire reg assign const]." ;; {..., a, b} requires us to recurse on a,b ;; To support {#{},{#{a,b}} we'll just split everything on [{},] ((string-match "^\\s-*{\\(.*\\)}\\s-*$" expr) - (unless verilog-auto-ignore-concat - (let ((mlst (split-string (match-string 1 expr) "[{},]")) - mstr) - (while (setq mstr (pop mlst)) - (verilog-read-sub-decls-expr submoddecls par-values comment port mstr))))) + (let ((mlst (split-string (match-string 1 expr) "[{},]")) + mstr) + (while (setq mstr (pop mlst)) + (verilog-read-sub-decls-expr submoddecls par-values comment port mstr)))) (t (let (sig vec multidim mem) ;; Remove leading reduction operators, etc @@ -8942,7 +8939,10 @@ Inserts the list of signals found, using submodi to look up each port." ;; We intentionally ignore (non-escaped) signals with .s in them ;; this prevents AUTOWIRE etc from noticing hierarchical sigs. (when port - (cond ((looking-at "\\([a-zA-Z_][a-zA-Z_0-9]*\\)\\s-*)") + (cond ((and verilog-auto-ignore-concat + (looking-at "[({]")) + nil) ; {...} or (...) historically ignored with auto-ignore-concat + ((looking-at "\\([a-zA-Z_][a-zA-Z_0-9]*\\)\\s-*)") (verilog-read-sub-decls-sig submoddecls par-values comment port (verilog-string-remove-spaces (match-string-no-properties 1)) ; sig diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 5ab8e7ec53e..ca4c66a06dc 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1295,9 +1295,9 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." ;; to the HEAD version of the file, not to the current state of the file. ;; So we need to look at all the local changes and adjust lfrom/lto ;; accordingly. - ;; FIXME: Maybe this should be done in vc.el (i.e. for all backends), but - ;; since Git is the only backend to support this operation so far, it's hard - ;; to tell. + ;; FIXME: Maybe this should be done in vc.el (i.e. for other backends), + ;; but since Git is one of the two backends that support this operation + ;; so far, it's hard to tell; hg doesn't need this. (with-temp-buffer (vc-call-backend 'git 'diff file "HEAD" nil (current-buffer)) (goto-char (point-min)) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 6ecf9fb41d7..17d38fa4005 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -483,6 +483,55 @@ If LIMIT is non-nil, show no more than this many entries." (autoload 'vc-switches "vc") +(defun vc-hg-region-history (file buffer lfrom lto) + "Insert into BUFFER the history of FILE for lines LFROM to LTO. +This requires hg 4.4 or later, for the \"-L\" option of \"hg log\"." + (vc-hg-command buffer 'async nil "log" "-f" "-p" "-L" + (format "%s,%d:%d" (file-relative-name file) lfrom lto))) + +(require 'diff-mode) + +(defvar vc-hg-region-history-mode-map + (let ((map (make-composed-keymap + nil (make-composed-keymap + (list diff-mode-map vc-hg-log-view-mode-map))))) + map)) + +(defvar vc-hg--log-view-long-font-lock-keywords nil) +(defvar font-lock-keywords) +(defvar vc-hg-region-history-font-lock-keywords + '((vc-hg-region-history-font-lock))) + +(defun vc-hg-region-history-font-lock (limit) + (let ((in-diff (save-excursion + (beginning-of-line) + (or (looking-at "^\\(?:diff\\|changeset\\)\\>") + (re-search-backward "^\\(?:diff\\|changeset\\)\\>" + nil t)) + (eq ?d (char-after (match-beginning 0)))))) + (while + (let ((end (save-excursion + (if (re-search-forward "\n\\(diff\\|changeset\\)\\>" + limit t) + (match-beginning 1) + limit)))) + (let ((font-lock-keywords (if in-diff diff-font-lock-keywords + vc-hg--log-view-long-font-lock-keywords))) + (font-lock-fontify-keywords-region (point) end)) + (goto-char end) + (prog1 (< (point) limit) + (setq in-diff (eq ?d (char-after)))))) + nil)) + +(define-derived-mode vc-hg-region-history-mode + vc-hg-log-view-mode "Hg-Region-History" + "Major mode to browse Hg's \"log -p\" output." + (setq-local vc-hg--log-view-long-font-lock-keywords + log-view-font-lock-keywords) + (setq-local font-lock-defaults + (cons 'vc-hg-region-history-font-lock-keywords + (cdr font-lock-defaults)))) + (defun vc-hg-diff (files &optional oldvers newvers buffer _async) "Get a difference report using hg between two revisions of FILES." (let* ((firstfile (car files)) |