unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26331: numerical timezones require hardwiring
@ 2017-04-01 12:26 積丹尼 Dan Jacobson
  2017-04-01 19:29 ` John Mastro
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-04-01 12:26 UTC (permalink / raw)
  To: 26331

If the user wants numerical timezones in his timestamps, there is no
other way than hardwiring them in:

(add-hook 'before-save-hook 'time-stamp)
(eval-after-load 'sgml-mode
  '(add-hook
    'html-mode-hook
    (lambda ()
      (set (make-local-variable 'time-stamp-pattern)
	   "-8/>Last modified: %Y-%02m-%02d %02H:%02M:%02S \\+0800")
      (set (make-local-variable 'time-stamp-time-zone) "Asia/Taipei"))))

P.S., it is not clear how one can make
(add-hook 'before-save-hook 'time-stamp)
html-mode specific too.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#26331: numerical timezones require hardwiring
  2017-04-01 12:26 bug#26331: numerical timezones require hardwiring 積丹尼 Dan Jacobson
@ 2017-04-01 19:29 ` John Mastro
  2017-04-02  0:22 ` 積丹尼 Dan Jacobson
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: John Mastro @ 2017-04-01 19:29 UTC (permalink / raw)
  To: 26331; +Cc: 積丹尼 Dan Jacobson

積丹尼 Dan Jacobson <jidanni@jidanni.org> wrote:
> P.S., it is not clear how one can make
> (add-hook 'before-save-hook 'time-stamp)
> html-mode specific too.

Use the LOCAL argument to `add-hook'

        John





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#26331: numerical timezones require hardwiring
  2017-04-01 12:26 bug#26331: numerical timezones require hardwiring 積丹尼 Dan Jacobson
  2017-04-01 19:29 ` John Mastro
@ 2017-04-02  0:22 ` 積丹尼 Dan Jacobson
  2017-04-02  0:43   ` John Mastro
  2017-04-02  1:49 ` 積丹尼 Dan Jacobson
  2017-10-02  6:29 ` Paul Eggert
  3 siblings, 1 reply; 6+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-04-02  0:22 UTC (permalink / raw)
  To: John Mastro; +Cc: 26331

I mean how to make emacs only look for and change time stamps in HTML files.

>>>>> "JM" == John Mastro <john.b.mastro@gmail.com> writes:
JM> Use the LOCAL argument to `add-hook'





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#26331: numerical timezones require hardwiring
  2017-04-02  0:22 ` 積丹尼 Dan Jacobson
@ 2017-04-02  0:43   ` John Mastro
  0 siblings, 0 replies; 6+ messages in thread
From: John Mastro @ 2017-04-02  0:43 UTC (permalink / raw)
  To: 26331; +Cc: 積丹尼 Dan Jacobson

積丹尼 Dan Jacobson <jidanni@jidanni.org> wrote:
> I mean how to make emacs only look for and change time stamps in HTML files.

Right. Here's what I mean:

    (eval-after-load 'sgml-mode
      '(add-hook
        'html-mode-hook
        (lambda ()
          (set (make-local-variable 'time-stamp-pattern)
               "-8/>Last modified: %Y-%02m-%02d %02H:%02M:%02S \\+0800")
          (set (make-local-variable 'time-stamp-time-zone) "Asia/Taipei")
          (add-hook 'before-save-hook 'time-stamp nil t) ;; <- Here
          )))

It will add `time-stamp' to `before-save-hook' buffer-locally in all
`html-mode' buffers.

        John





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#26331: numerical timezones require hardwiring
  2017-04-01 12:26 bug#26331: numerical timezones require hardwiring 積丹尼 Dan Jacobson
  2017-04-01 19:29 ` John Mastro
  2017-04-02  0:22 ` 積丹尼 Dan Jacobson
@ 2017-04-02  1:49 ` 積丹尼 Dan Jacobson
  2017-10-02  6:29 ` Paul Eggert
  3 siblings, 0 replies; 6+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-04-02  1:49 UTC (permalink / raw)
  To: John Mastro; +Cc: 26331

>>>>> "JM" == John Mastro <john.b.mastro@gmail.com> writes:
JM> Right. Here's what I mean:
Thanks! I now use

;; html-helper-mode is no longer in Debian. Grandfather its timestamps:
(eval-after-load 'sgml-mode
  '(add-hook
    'html-mode-hook
    (lambda ()
      (set (make-local-variable 'time-stamp-line-limit) -8)
      (set (make-local-variable 'time-stamp-format)
	   "%:y-%02m-%02d %02H:%02M:%02S +0800") ;alas must hardwire to get '+0800'
      (set (make-local-variable 'time-stamp-start)
	   "<!-- hhmts start -->Last modified:[ \t\n]+")
      (set (make-local-variable 'time-stamp-end) "[ \t\n]*<!-- hhmts end -->")
      (set (make-local-variable 'time-stamp-time-zone) "Asia/Taipei")
      (add-hook 'before-save-hook 'time-stamp nil t)
      )))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#26331: numerical timezones require hardwiring
  2017-04-01 12:26 bug#26331: numerical timezones require hardwiring 積丹尼 Dan Jacobson
                   ` (2 preceding siblings ...)
  2017-04-02  1:49 ` 積丹尼 Dan Jacobson
@ 2017-10-02  6:29 ` Paul Eggert
  3 siblings, 0 replies; 6+ messages in thread
From: Paul Eggert @ 2017-10-02  6:29 UTC (permalink / raw)
  To: 26331-done

Since this problem seems to be solved, I am closing the bug report.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-02  6:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-01 12:26 bug#26331: numerical timezones require hardwiring 積丹尼 Dan Jacobson
2017-04-01 19:29 ` John Mastro
2017-04-02  0:22 ` 積丹尼 Dan Jacobson
2017-04-02  0:43   ` John Mastro
2017-04-02  1:49 ` 積丹尼 Dan Jacobson
2017-10-02  6:29 ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).