GNU bug report logs - #14509
Centerd calendar buffer

Previous Next

Package: emacs;

Reported by: E Sabof <esabof <at> gmail.com>

Date: Wed, 29 May 2013 23:14:02 UTC

Severity: wishlist

Tags: wontfix

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14509 in the body.
You can then email your comments to 14509 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14509; Package emacs. (Wed, 29 May 2013 23:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to E Sabof <esabof <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 29 May 2013 23:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: E Sabof <esabof <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Centerd calendar buffer
Date: Thu, 30 May 2013 00:11:41 +0100
[Message part 1 (text/plain, inline)]
The following snippet will center the content of the calendar window. If
there is interest in integrating this into emacs, I can reformat it as a
patch. A possible interface to enable it could be
(setq calendar-left-margin 'auto)

Evgeni

(require 'cl-lib)

(defun calendar-mode-options ()
  (setq calendar-left-margin 1)
  (add-hook 'window-configuration-change-hook
            'es-calendar-win-config-hook nil t))
(add-hook 'calendar-mode-hook 'calendar-mode-options)

(defun es-calendar-win-config-hook ()
  (catch 'exit
    (with-current-buffer
        (or (get-buffer calendar-buffer)
            (throw 'exit nil))
      (dolist (win (get-buffer-window-list nil nil t))
        (with-selected-window win
          (let* (( max (+ (* 7 3 3)
                          (* 2 calendar-intermonth-spacing)
                          -1))
                 ( left (max 0 (/ (- (window-body-width) max) 2))))
            (dolist (ov (overlays-in (point-min) (point-max)))
              (when (and (overlay-get ov 'left-center-margin)
                         (eq (selected-window)
                             (overlay-get ov 'window)))
                (delete-overlay ov)))
            (save-excursion
              (goto-char (point-min))
              (cl-loop for ov
                       = (make-overlay
                          (line-beginning-position)
                          (1+ (line-beginning-position)))
                       do (progn
                            (overlay-put ov 'window (selected-window))
                            (overlay-put ov 'display (make-string left ?\s
))
                            (overlay-put ov 'left-center-margin t)
                            )
                       while (zerop (forward-line))
                       ))))))))

(defadvice calendar-generate (after center-calendar activate)
  (es-calendar-win-config-hook))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14509; Package emacs. (Fri, 31 May 2013 18:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 14509 <at> debbugs.gnu.org (full text, mbox):

From: E Sabof <esabof <at> gmail.com>
To: 14509 <at> debbugs.gnu.org
Subject: Fwd: bug#14509: Centerd calendar buffer
Date: Fri, 31 May 2013 19:27:37 +0100
[Message part 1 (text/plain, inline)]
A better version:

(defun es-calendar-recenter (&optional all-frames)
  (let (( calendar-width
          (+ (* 7 3 3)
             (* 2 calendar-intermonth-spacing)
             -1)))
    (save-excursion
      (goto-char (point-min))
      (while (search-forward-regexp "^ +" nil t)
        (put-text-property
         (match-beginning 0)
         (match-end 0)
         'display
         `(space :align-to (+ center (,(/ calendar-width -2)
                                      . width))))))))
(defadvice calendar-generate (after center-calendar activate)
  (es-calendar-recenter t))

(eval-after-load 'calendar
  '(defun calendar-update-mode-line ()
     "Update the calendar mode line with the current date and date style."
     (if (bufferp (get-buffer calendar-buffer))
         (with-current-buffer calendar-buffer
           (let* ((start (- calendar-left-margin 2))
                  (date (condition-case nil
                            (calendar-cursor-to-nearest-date)
                          (error (calendar-current-date))))
                  (content-string (calendar-string-spread
                                   (mapcar 'eval calendar-mode-line-format)
                                   ?\s (- calendar-right-margin (1-
start)))))
             (setq mode-line-format
                   (concat (propertize
                            " "
                            'display
                            `(space :align-to (+ center (,(/ (length
content-string) -2) . width))))
                           content-string)))
           (force-mode-line-update)))))
[Message part 2 (text/html, inline)]

Removed tag(s) patch. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 29 May 2017 03:50:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14509; Package emacs. (Wed, 06 May 2020 23:34:03 GMT) Full text and rfc822 format available.

Message #13 received at 14509 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: E Sabof <esabof <at> gmail.com>
Cc: 14509 <at> debbugs.gnu.org
Subject: Re: bug#14509: Centerd calendar buffer
Date: Wed, 6 May 2020 19:32:58 -0400
E Sabof <esabof <at> gmail.com> writes:

> The following snippet will center the content of the calendar
> window. If there is interest in integrating this into emacs, I can
> reformat it as a patch. A possible interface to enable it could be
> (setq calendar-left-margin 'auto)

(This was filed in 2013 but never got a reply.)

Thanks for your interest in Emacs, and sorry you didn't get a reply
sooner.

I don't know if you're still interested in working on this.  If you
are, here are some questions:

Could you please explain a bit about the motivation for this feature.
Any particular reason you feel that the calendar buffer is better
centered?  Most other buffers just display text to the left.

And wouldn't it be better to have a general mode to center *any*
buffer?  I know there have been attempts in that direction, and quite
possibly there already exists functioning packages to do it.  That
would mean users could pick and choose where to apply this effect,
rather than having to write code to achieve it "manually" for every
mode.

If I don't hear back from you, I'm inclined to close this bug as
wontfix.  So please let us know what you think.  Thanks in advance.

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14509; Package emacs. (Wed, 22 Jul 2020 17:03:01 GMT) Full text and rfc822 format available.

Message #16 received at 14509 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: E Sabof <esabof <at> gmail.com>
Cc: 14509 <at> debbugs.gnu.org
Subject: Re: bug#14509: Centerd calendar buffer
Date: Wed, 22 Jul 2020 10:01:57 -0700
tags 14509 + wontfix
close 14509
thanks

Stefan Kangas <stefan <at> marxist.se> writes:

> If I don't hear back from you, I'm inclined to close this bug as
> wontfix.  So please let us know what you think.  Thanks in advance.

No reply within 10 weeks, so I'm closing this as wontfix now.

If you are still interested in working on this feature, please reply
back and we can reopen the bug.

Best regards,
Stefan Kangas




Added tag(s) wontfix. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 22 Jul 2020 17:03:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 14509 <at> debbugs.gnu.org and E Sabof <esabof <at> gmail.com> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Wed, 22 Jul 2020 17:03:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 20 Aug 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 221 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.