2

i have a config for minimalist mode line, its the next;

(setq column-number-mode t)
(setq mode-line-percent-position nil)
(setq mode-line-modes
      (mapcar (lambda (elem)
            (pcase elem
              (`(:propertize (,_ minor-mode-alist . ,_)
               . ,_)
               "")
              (t elem)))
          mode-line-modes))

and gets the next mode-line output example:

U:**- *scratch*      (13,25)    (Lisp Interaction)

and my question is how to remove the parentheses for get some:

U:**- *scratch*      13,25      Lisp Interaction

1 Answer 1

2

You'd need to modify mode-line-modes again. The parens are hard-coded in the default value. In 27.2 that is:

(defvar mode-line-modes
  (let ((recursive-edit-help-echo "Recursive edit, type C-M-c to get out"))
    (list (propertize "%[" 'help-echo recursive-edit-help-echo)
      "("
      `(:propertize ("" mode-name)
            help-echo "Major mode\n\
mouse-1: Display major mode menu\n\
mouse-2: Show help for major mode\n\
mouse-3: Toggle minor modes"
            mouse-face mode-line-highlight
            local-map ,mode-line-major-mode-keymap)
      '("" mode-line-process)
      `(:propertize ("" minor-mode-alist)
            mouse-face mode-line-highlight
            help-echo "Minor mode\n\
mouse-1: Display minor mode menu\n\
mouse-2: Show help for minor mode\n\
mouse-3: Toggle minor modes"
            local-map ,mode-line-minor-mode-keymap)
      (propertize "%n" 'help-echo "mouse-2: Remove narrowing from buffer"
              'mouse-face 'mode-line-highlight
              'local-map (make-mode-line-mouse-map
                  'mouse-2 #'mode-line-widen))
      ")"
      (propertize "%]" 'help-echo recursive-edit-help-echo)
      " "))
  "Mode line construct for displaying major and minor modes.")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.