diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/bs.el | 4 | ||||
-rw-r--r-- | lisp/dired.el | 13 | ||||
-rw-r--r-- | lisp/eshell/em-unix.el | 3 | ||||
-rw-r--r-- | lisp/net/nsm.el | 51 | ||||
-rw-r--r-- | lisp/play/bubbles.el | 64 | ||||
-rw-r--r-- | lisp/progmodes/xref.el | 20 |
6 files changed, 81 insertions, 74 deletions
diff --git a/lisp/bs.el b/lisp/bs.el index 0d65da14c72..32431ba4466 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -1159,7 +1159,7 @@ and move point to current buffer." (bs-mode) (let* ((inhibit-read-only t) (map-fun (lambda (entry) - (length (buffer-name entry)))) + (string-width (buffer-name entry)))) (max-length-of-names (apply 'max (cons 0 (mapcar map-fun list)))) (name-entry-length (min bs-maximal-buffer-name-column @@ -1371,7 +1371,7 @@ normally *buffer-selection*." apply-args) (nth 3 column) ; align (- min to-much))) - (len (length new-string))) + (len (string-width new-string))) (setq string (concat string new-string)) (when (> len min) (setq to-much (- len min)))))) diff --git a/lisp/dired.el b/lisp/dired.el index 26a7449e039..0ed1a4f602d 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -88,9 +88,11 @@ If nil, `dired-listing-switches' is used." (defcustom dired-use-ls-dired 'unspecified "Non-nil means Dired should pass the \"--dired\" option to \"ls\". -The special value of `unspecified' means to check explicitly, and -save the result in this variable. This is performed the first -time `dired-insert-directory' is called. +If nil, don't pass \"--dired\" to \"ls\". +The special value of `unspecified' means to check whether \"ls\" +supports the \"--dired\" option, and save the result in this +variable. This is performed the first time `dired-insert-directory' +is invoked. Note that if you set this option to nil, either through choice or because your \"ls\" program does not support \"--dired\", Dired @@ -104,9 +106,10 @@ This is used by default on MS Windows, which does not have an \"ls\" program. Note that `ls-lisp' does not support as many options as GNU ls, though. For more details, see Info node `(emacs)ls in Lisp'." :group 'dired - :type '(choice (const :tag "Check for --dired support" unspecified) + :type '(choice (const :tag + "Use --dired only if 'ls' supports it" unspecified) (const :tag "Do not use --dired" nil) - (other :tag "Use --dired" t))) + (other :tag "Always use --dired" t))) (defcustom dired-chmod-program "chmod" "Name of chmod command (usually `chmod')." diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index c912c15ac75..9a99c53571c 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -656,7 +656,8 @@ Concatenate FILE(s), or standard input, to standard output.") ;; special front-end functions for compilation-mode buffers (defun eshell/make (&rest args) - "Use `compile' to do background makes." + "Use `compile' to do background makes. +Fallback to standard make when called synchronously." (if (and eshell-current-subjob-p (eshell-interactive-output-p)) (let ((compilation-process-setup-function diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el index 9eb914e107f..e857e64be84 100644 --- a/lisp/net/nsm.el +++ b/lisp/net/nsm.el @@ -365,29 +365,34 @@ HOST PORT STATUS OPTIONAL-PARAMETER.") t)))) (defun nsm-query-user (message args cert) - (let ((buffer (get-buffer-create "*Network Security Manager*"))) - (save-window-excursion - ;; First format the certificate and warnings. - (with-help-window buffer - (with-current-buffer buffer - (erase-buffer) - (when (> (length cert) 0) - (insert cert "\n")) - (let ((start (point))) - (insert (apply #'format-message message args)) - (goto-char start) - ;; Fill the first line of the message, which usually - ;; contains lots of explanatory text. - (fill-region (point) (line-end-position))))) - ;; Then ask the user what to do about it. - (unwind-protect - (cadr - (read-multiple-choice - "Continue connecting?" - '((?a "always" "Accept this certificate this session and for all future sessions.") - (?s "session only" "Accept this certificate this session only.") - (?n "no" "Refuse to use this certificate, and close the connection.")))) - (kill-buffer buffer))))) + (catch 'return + (while t + (let ((buffer (get-buffer-create "*Network Security Manager*"))) + (save-window-excursion + ;; First format the certificate and warnings. + (with-help-window buffer + (with-current-buffer buffer + (erase-buffer) + (when (> (length cert) 0) + (insert cert "\n")) + (let ((start (point))) + (insert (apply #'format-message message args)) + (goto-char start) + ;; Fill the first line of the message, which usually + ;; contains lots of explanatory text. + (fill-region (point) (line-end-position))))) + ;; Then ask the user what to do about it. + (pcase (unwind-protect + (cadr + (read-multiple-choice + "Continue connecting?" + '((?a "always" "Accept this certificate this session and for all future sessions.") + (?s "session only" "Accept this certificate this session only.") + (?n "no" "Refuse to use this certificate, and close the connection.") + (?r "reshow" "Reshow certificate information.")))) + (kill-buffer buffer)) + ("reshow") + (val (throw 'return val)))))))) (defun nsm-save-host (host port status what permanency) (let* ((id (nsm-id host port)) diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el index e30838dfca4..ee2135b9bbe 100644 --- a/lisp/play/bubbles.el +++ b/lisp/play/bubbles.el @@ -250,10 +250,10 @@ Available modes are `shift-default' and `shift-always'." "Indicate whether images have been created successfully.") (defvar bubbles--col-offset 0 - "Horizontal offset for centering the bubbles grid.") + "Horizontal offset for centering the bubbles grid, in pixels.") (defvar bubbles--row-offset 0 - "Vertical offset for centering the bubbles grid.") + "Vertical offset for centering the bubbles grid, in pixels.") (defvar bubbles--save-data nil "List containing bubbles save data (SCORE BUFFERCONTENTS).") @@ -960,33 +960,26 @@ columns on its right towards the left. (defun bubbles--compute-offsets () "Update horizontal and vertical offsets for centering the bubbles grid. Set `bubbles--col-offset' and `bubbles--row-offset'." - (cond ((and (display-images-p) - bubbles--images-ok - (not (eq bubbles-graphics-theme 'ascii)) - (fboundp 'window-inside-pixel-edges)) - ;; compute offset in units of pixels - (let ((bubbles--image-size - (car (image-size (car bubbles--images) t)))) - (setq bubbles--col-offset - (list - (max 0 (/ (- (nth 2 (window-inside-pixel-edges)) - (nth 0 (window-inside-pixel-edges)) - (* ( + bubbles--image-size 2) ;; margin - (bubbles--grid-width))) 2)))) - (setq bubbles--row-offset - (list - (max 0 (/ (- (nth 3 (window-inside-pixel-edges)) - (nth 1 (window-inside-pixel-edges)) - (* (+ bubbles--image-size 1) ;; margin - (bubbles--grid-height))) 2)))))) - (t - ;; compute offset in units of chars - (setq bubbles--col-offset - (max 0 (/ (- (window-width) - (bubbles--grid-width)) 2))) - (setq bubbles--row-offset - (max 0 (/ (- (window-height) - (bubbles--grid-height) 2) 2)))))) + (let* ((use-images-p (and (display-images-p) + bubbles--images-ok + (not (eq bubbles-graphics-theme 'ascii)))) + (bubbles--image-size + (if use-images-p (car (image-size (car bubbles--images) t)) 1)) + ;; In GUI mode, leave thin margins around the images. + (image-hor-size + (if use-images-p (+ bubbles--image-size 2) bubbles--image-size)) + (image-vert-size + (if use-images-p (1+ bubbles--image-size) bubbles--image-size))) + (setq bubbles--col-offset + (max 0 (/ (- (nth 2 (window-body-pixel-edges)) + (nth 0 (window-body-pixel-edges)) + (* image-hor-size (bubbles--grid-width))) + 2))) + (setq bubbles--row-offset + (max 0 (/ (- (nth 3 (window-body-pixel-edges)) + (nth 1 (window-body-pixel-edges)) + (* image-vert-size (bubbles--grid-height))) + 2))))) (defun bubbles--remove-overlays () "Remove all overlays." @@ -1007,7 +1000,8 @@ Set `bubbles--col-offset' and `bubbles--row-offset'." (insert " ") (put-text-property (point-min) (point) 'display - (cons 'space (list :height bubbles--row-offset))) + (cons 'space (list :height + (list bubbles--row-offset)))) (insert "\n") (let ((max-char (length (bubbles--colors)))) (dotimes (i (bubbles--grid-height)) @@ -1015,7 +1009,8 @@ Set `bubbles--col-offset' and `bubbles--row-offset'." (insert " ") (put-text-property p (point) 'display - (cons 'space (list :width bubbles--col-offset)))) + (cons 'space (list :width + (list bubbles--col-offset))))) (dotimes (j (bubbles--grid-width)) (let* ((index (random max-char)) (char (nth index bubbles-chars))) @@ -1025,7 +1020,8 @@ Set `bubbles--col-offset' and `bubbles--row-offset'." (insert "\n ") (put-text-property (1- (point)) (point) 'display - (cons 'space (list :width bubbles--col-offset)))) + (cons 'space (list :width + (list bubbles--col-offset))))) (put-text-property (point-min) (point-max) 'pointer 'arrow)) (bubbles-mode) (bubbles--reset-score) @@ -1177,7 +1173,7 @@ Use optional parameter POS instead of point if given." (insert " ") (put-text-property (1- (point)) (point) 'display - (cons 'space (list :width bubbles--col-offset))) + (cons 'space (list :width (list bubbles--col-offset)))) (insert (format "Score: %4d" bubbles--score)) (put-text-property pos (point) 'status t)))) @@ -1197,7 +1193,7 @@ Use optional parameter POS instead of point if given." (insert "\n ") (put-text-property (1- (point)) (point) 'display - (cons 'space (list :width bubbles--col-offset))) + (cons 'space (list :width (list bubbles--col-offset)))) (insert "Game Over!")) ;; save score (gamegrid-add-score (format "bubbles-%s-%d-%d-%d-scores" diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index c85fe676da2..c7ae40eb34e 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -323,21 +323,23 @@ backward." (defcustom xref-prompt-for-identifier '(not xref-find-definitions xref-find-definitions-other-window xref-find-definitions-other-frame) - "When t, always prompt for the identifier name. + "If non-nil, prompt for the identifier to find. + +When t, always prompt for the identifier name. When nil, prompt only when there's no value at point we can use, or when the command has been called with the prefix argument. -Otherwise, it's a list of xref commands which will prompt -anyway (the value at point, if any, will be used as the default). - +Otherwise, it's a list of xref commands which will always prompt, +with the identifier at point, if any, used as the default. If the list starts with `not', the meaning of the rest of the -elements is negated." - :type '(choice (const :tag "always" t) - (const :tag "auto" nil) - (set :menu-tag "command specific" :tag "commands" +elements is negated: these commands will NOT prompt." + :type '(choice (const :tag "Always prompt for identifier" t) + (const :tag "Prompt if no identifier at point" nil) + (set :menu-tag "Prompt according to command" + :tag "Prompt according to command" :value (not) - (const :tag "Except" not) + (const :tag "Except for commands listed below" not) (repeat :inline t (symbol :tag "command"))))) (defcustom xref-after-jump-hook '(recenter |