]> code.delx.au - gnu-emacs/blobdiff - lisp/buff-menu.el
lisp/window.el (frame-auto-delete, window-deletable-p): Doc fix.
[gnu-emacs] / lisp / buff-menu.el
index 9886b30d122a29942525d020b87e1daa3fc43c99..2be74cf5efb87b856daadf600a861d392bbd0429 100644 (file)
@@ -266,7 +266,10 @@ Letters do not insert themselves; instead, they are commands.
   (set (make-local-variable 'buffer-stale-function)
        (lambda (&optional _noconfirm) 'fast))
   (setq truncate-lines t)
-  (setq buffer-read-only t))
+  (setq buffer-read-only t)
+  ;; Force L2R direction, to avoid messing the display if the first
+  ;; buffer in the list happens to begin with a strong R2L character.
+  (setq bidi-paragraph-direction 'left-to-right))
 
 (define-obsolete-variable-alias 'buffer-menu-mode-hook
   'Buffer-menu-mode-hook "23.1")
@@ -278,7 +281,7 @@ Letters do not insert themselves; instead, they are commands.
   (let ((opoint (point))
        (eobp (eobp))
        (ocol (current-column))
-       (oline (progn (move-to-column 4)
+       (oline (progn (move-to-column Buffer-menu-buffer-column)
                      (get-text-property (point) 'buffer)))
        (prop (point-min))
        ;; do not make undo records for the reversion.
@@ -688,7 +691,9 @@ For more information, see the function `buffer-menu'."
     (concat name
            (propertize (make-string (- name+space-width (string-width name))
                                     ?\s)
-                       'display `(space :align-to ,(+ 4 name+space-width)))
+                       'display `(space :align-to
+                                        ,(+ Buffer-menu-buffer-column
+                                            name+space-width)))
            size)))
 
 (defun Buffer-menu-sort (column)
@@ -703,7 +708,11 @@ For more information, see the function `buffer-menu'."
     (save-excursion
       (Buffer-menu-beginning)
       (while (not (eobp))
-       (when (buffer-live-p (setq buf (get-text-property (+ (point) 4) 'buffer)))
+       (when (buffer-live-p
+              (setq buf (get-text-property
+                         (+ (point)
+                            Buffer-menu-buffer-column)
+                         'buffer)))
          (setq m1 (char-after)
                m1 (if (memq m1 '(?> ?D)) m1)
                m2 (char-after (+ (point) 2))
@@ -715,7 +724,9 @@ For more information, see the function `buffer-menu'."
     (save-excursion
       (Buffer-menu-beginning)
       (while (not (eobp))
-       (when (setq buf (assq (get-text-property (+ (point) 4) 'buffer) l))
+       (when (setq buf (assq (get-text-property (+ (point)
+                                                   Buffer-menu-buffer-column)
+                                                'buffer) l))
          (setq m1 (cadr buf)
                m2 (cadr (cdr buf)))
          (when m1
@@ -805,6 +816,10 @@ For more information, see the function `buffer-menu'."
       (setq buffer-read-only nil)
       (erase-buffer)
       (setq standard-output (current-buffer))
+      ;; Force L2R direction, to avoid messing the display if the
+      ;; first buffer in the list happens to begin with a strong R2L
+      ;; character.
+      (setq bidi-paragraph-direction 'left-to-right)
       (unless Buffer-menu-use-header-line
         ;; Use U+2014 (EM DASH) to underline if possible, else use ASCII
         ;; (i.e. U+002D, HYPHEN-MINUS).