Re: [longlines]

2021-06-24 Thread Haider Rizvi
Uwe Brauer  writes:

> In my experience the best I found was 
>
> (defun my-turn-on-longlines-in-auctex ()
>   "Turn on all three modes which support the display of long-lines."
>   (interactive)
>   (adaptive-wrap-prefix-mode 'toggle)
>   (visual-line-mode 'toggle)
>   (visual-fill-column-mode 'toggle)
>   (message "adaptive-wrap-prefix-mode; visual-line-mode and 
> visual-fill-column-mode are
> ON/OFF."))

Nice. Didn't know about adaptive-wrap mode. I had tried visual-fill-column-mode 
but it clobbered wide tables badly, adaptive-wrap fixes that problem.

Thanks for mentioning it :-) 
-- 




Re: org-custom-id-goto?

2019-12-06 Thread Haider Rizvi
John Kitchin  writes:

> If you like ivy, you might find this helpful:

Also see counsel-org-goto and counsel-org-goto-all, which provide
similar capability.

> Fraga, Eric  writes:
>
>> On Wednesday,  4 Dec 2019 at 10:26, Matt Price wrote:
>>> Is there a quasi-equivalent of ~org-id-goto~ or
>>> ~org-babel-goto-named-src-block~ which will jump to a header in the
>>> current buffer?
>>
>> If by header you mean headline or heading, I don't think there is
>> anything exactly how you might want it but you should maybe look at
>> "org-goto" and "org-occur" (or both in combination).
>
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>

-- 




Re: [O] org-mode export behavior change in 9.2?

2019-01-12 Thread Haider Rizvi
"Berry, Charles"  writes:

>> On Jan 11, 2019, at 5:03 PM, Haider Rizvi  wrote:
>> 
>> I've been using literate programming approach with org-babel for a
>> while. I just noticed that with 9.2, when I try to export (c-c c-e h
>> o) an org doc / section, any shell blocks with a named session are
>> executed as it is exporting to html!
>> 
>> I don't think it was this way before?
>
>  
> AFAICS, nothing has changed in the way :session is handled for shell src 
> blocks in a very
> long time.
>
> Perhaps, you had set `:eval never-export' previously, but not now. ??
>
>>  Is there a way to not have it
>> execute each shell block when trying to export.
>
> This seems to work as you would want:
>
> #+begin_src shell :session sh-pcnw3 :eval never-export
> /usr/bin/say something # say it out loud!
> #+end_src
>
>
> If you can identify a release in which the behavior was as you said, it might 
> be possible to
> dig deeper.

Chuck, thanks for responding.

I've never had the never-export set. I'll try to go back and pinpoint
when the change shows up if I can.

Is the difference between named session and without it expected? With
the named session, the block is executed on export, and without it, it
is not executed!

-- 




[O] org-mode export behavior change in 9.2?

2019-01-11 Thread Haider Rizvi
I've been using literate programming approach with org-babel for a
while. I just noticed that with 9.2, when I try to export (c-c c-e h
o) an org doc / section, any shell blocks with a named session are
executed as it is exporting to html!

I don't think it was this way before?  Is there a way to not have it
execute each shell block when trying to export.

I just tested it with this small .org document. On osx, /usr/bin/say
speaks out the arguments.

-
#+begin_src shell :session sh-pcnw3
/usr/bin/say something # say it out loud!
#+end_src
-

Without the :session, it doesn't!

-- 




Re: [O] Bug: org-capture-templates issues

2017-10-04 Thread Haider Rizvi
Kaushal Modi <kaushal.m...@gmail.com> writes:

> On Wed, Oct 4, 2017 at 3:13 PM Haider Rizvi <hari...@gmail.com> wrote:
>  I'm getting the following error, when trying to do an org-capture.
>
> Org 9.1 onwards, bare sexp's are now allowed in the template.
>
> From ORG-NEWS:
>
> *** ~org-capture-templates~ no longer accepts S-expressions as file names

Got it. I missed the news I guess :-)

Thanks for the quick response, Kaushal.

-- Haider




[O] Bug: org-capture-templates issues

2017-10-04 Thread Haider Rizvi
I'm getting the following error, when trying to do an org-capture. 

Debugger entered--Lisp error: (error "Invalid file location: nil")
  signal(error ("Invalid file location: nil"))
  error("Invalid file location: %S" nil)
  org-capture-expand-file((concat org-directory "inbox-gtd.org"))
  org-capture-target-buffer((concat org-directory "inbox-gtd.org"))
  org-capture-set-target-location()
  org-capture(nil)

My org-capture-templates is set as follows for ages: 
(setq org-capture-templates
  '(("t" "Todo" entry (file+headline  (concat org-directory 
"inbox-gtd.org") "Tasks")
 "* TODO %?\n  %i\n  %a")
 ))

org-directory: "/Users/hrizvi/Google Drive/MyDocs/org/"

With a fully qualified file-name, it works fine:

(setq org-capture-templates
  '(("t" "Todo" entry (file+headline  "/Users/hrizvi/Google 
Drive/MyDocs/org/inbox-gtd.org" "Tasks")
 "* TODO %?\n  %i\n  %a")
 ))

Reading up org-capture-expand-file, it seems org-directory is
prepended automatically, but it used to work fine in the
past. Flipping back to the older code for org-capture-expand-file
works fine. So I'd say this is a bug!

(emacs-version)
"GNU Emacs 26.0.50 (build 1, x86_64-apple-darwin16.7.0, NS appkit-1504.83 
Version 10.12.6 (Build 16G29))
 of 2017-09-13"

(org-version)
"9.1.2"

org is installed from melpa-stable. From packages info: 
org is an installed package.

 Status: Installed in ‘org-20171004/’,
 shadowing a built-in package (unsigned).
Version: 20171004
Summary: Outline-based notes management and organizer
Required by: elfeed-org-20170423.128
Other versions: 20171004 (org), 20171002 (gnu), builtin.


-- Haider




Re: [O] [OT] A new web browser‽

2016-04-14 Thread Haider Rizvi
Eric Abrahamsen  writes:

> Apart from that, though, this setup is fairly Conkeror like. Just
> faster, and with fewer mysterious silent crashes!

Faster!!  I guess I have to try it out. 

Regards,
-- 
Haider




Re: [O] [OT] A new web browser‽

2016-04-13 Thread Haider Rizvi
Ramon Diaz-Uriarte <rdia...@gmail.com> writes:

> For me Conkeror works just great most of the time. But the main problem
> (for me) is that some of the extensions of Firefox will not work with
> Conkeror.

Yes, well aware of the extensions issue. Since I had no solution, I
started looking at it as a blessing in disguise ;-) It makes me use
less extensions, only adblock and https-everywhere right now on
Conkeror. But then I have a lot of stuff in javascript!

> In particular, the connector with Zotero standalone just cannot
> work with it. And this has forced me to "use Conkeror always, except if I
> need to do reference-related work"

> KeySnail so far seems to be an alternative to avoid my schizoid
> behavior.

Glad keysnail is working, I may have to look at it as a backup
option.

I could never get into zotero, when I tried last. I use a combination
of Pocket, Evernote, and org files for research / notes taking.

> (problem being that sometimes, while browsing, I decide "let's add
> this to Zotero" and then I need to start firefox, copy the link,
> etc).

You probably know this, but  you can write a function and assign a
key for this to make life a bit easier.

//  open in Firefox 
function open_in_firefox (url, window) {
var cmd_str = 'open -a firefox '+url;
if (window != null) {
window.minibuffer.message('Issuing ' + cmd_str);
 }
shell_command_blind(cmd_str);
}

interactive("firefox", "Send url to Firefox",
  function (I) {
  open_in_firefox(I.buffer.display_uri_string, I.window);
  });
define_key(content_buffer_normal_keymap, "f5", "firefox");



>> I have tried out Vimium with Chrome, and liked it. You may want to
>> try it out if you haven't already.
>
> Thanks for the suggestion; I did not know it.
>
> I'll have to revisit it, because I just tried it and was unable to activate
> it in any page (get the icon on the bar to be colored). I must be doing
> something silly. However, I looked over the documentation quickly and I
> could not see how to mark stuff for downloading. Do I need more coffee?
>
>
> Best,
>
> R.
>
>
>>
>> Regards,

-- 

Regards,
--
Haider Rizvi




Re: [O] [OT] A new web browser‽

2016-04-12 Thread Haider Rizvi
Eric Abrahamsen  writes:

> I've been using Conkeror (based on Xulrunner/Firefox) for a while
> now, and like it enough to stick with it. It's completely keyboard
> driven, which I love. It's also not super stable, nor does it seem
> to be actively maintained, which I don't love. If anyone has
> recommendations for better keyboard-driven browsers, I'd love to
> hear them...

Eric, I use Conkeror as well. And worried that one day it'll go away.

I have tried out Vimium with Chrome, and liked it. You may want to try
it out if you haven't already.

Regards,
-- 
Haider




Re: [O] popup org capture window on linux?

2015-07-31 Thread Haider Rizvi
Xebar Saram zelt...@gmail.com writes:

 Hi. it seems like this :

 /usr/bin/emacsclient -c -e '(org-capture)' 

I have the following for similar purposes: 

(defadvice org-capture-finalize (after delete-org-capture-frame activate)  
  Advise org-capture-finalize to close the frame if it is the org-capture 
frame  
  (if (equal org-capture (frame-parameter nil 'name))  
  (delete-frame)))  

(defun make-orgcapture-frame ()  
  Create a new frame and run org-capture.  
  (interactive)  
  (make-frame '((name . org-capture) (width . 80) (height . 16)
(top . 400) (left . 300)
(font . Consolas-14)
))
  (select-frame-by-name org-capture)  
  (org-capture))

From a shell (or hotkey), you'll need to kick off:
 emacsclient -ne '(make-orgcapture-frame)'



- Haider




Re: [O] Structuring and (cross)linking information in org-mode

2015-07-04 Thread Haider Rizvi
Pascal Fleury pas...@telefleuries.com writes:

 I think properties can be used for this. 

I use a yasnippet for writing down my meeting minutes, that also
creates some properties. Daniel may find it useful.

# -*- mode: snippet -*-
# name : mtgmins
# key : mtgmins
# contributor: Haider Rizvi
# --
`(org-insert-heading nil)`[`(format-time-string %Y-%m-%d %a (current-time))`] 
${1:Meeting title}
Attendees: Haider, ${2:Attendees}
`(org-set-property STYLE Meeting minutes)` `(org-set-property STARTED 
(format-time-string [%Y-%m-%d %H:%M:%S] (current-time)))`


- Haider




Re: [O] open file link in dired?

2014-12-11 Thread Haider Rizvi
Alan Schmitt alan.schm...@polytechnique.org writes:

 My main motivation for using this is that I have some code to
 preview a file using Quicklook (I'm on OS X), and code to open a
 file in an external app when in dired, so it's quite useful for
 files that emacs cannot display:

Alan, fyi if you don't know, openwith package does a pretty good job
of opening with external apps. I've been using it on osx for a while.

;; openwith setup to help in find-file, dired, helm, etc. for common file types
(use-package openwith
  :ensure
  :commands openwith-mode
  :config
  (progn 
(openwith-mode t)
(setq openwith-associations
  (quote ((\\.pdf\\'  open (file))
  ;;  (\\.svg\\'  open (file))
  (\\.\\(?:mpe?g\\|avi\\|wmv\\)\\' open -a vlc (file))
  ;; change .jpg to be able to show inline in .org mode
  ;;  (\\.\\(?:jp?g\\|png\\)\\' open (file))
  (\\.ppt[x]*\\'  open (file))
  (\\.doc[x]*\\'  open (file))
  (\\.xls[x]*\\'  open (file))
  (\\.html\\'  open (file))
  (\\.vNotes.*\\' open (file)) ;spotlight searches for 
Notes open these files
  )



Regards, 
-- 
Haider




[O] Intermittent issues with hyperlinks in org docs

2014-09-10 Thread Haider Rizvi
Lately, I have a problem with hyperlinks in org-mode. Wondering if
anyone has seen this issue.

From time to time, some hyperlinks in an org document show up as if
they are regular text, instead of a collapsed hyperlink. So the
following just shows as plain text:

[[https://news.google.com/news][Google News]]

instead of showing up as a collapsed hyperlink as it should: 

Google News

At this time, only a few hyperlinks in the doc behave this way, and if
I go to the link above and edit something (e.g, add a space at the
end, etc.) it collapses immediately.

I am running org-mode from melpa-stable:
Org-mode version 8.2.7c (8.2.7c-57-g37bf05-elpa @ 
/usr/local/Cellar/emacs-mac/emacs-24.3-mac-4.8/share/emacs/24.3/lisp/org/)
GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2013-03-13 
on bob.porkrind.org

Anyone seen this, or have a hint on where can I look. It may very well
in something in my init, but I haven't changed much re: org settings
for a while.

I did a quick test with the base Emacs, no init files, and the default
org-mode drop:

Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ 
/Applications/Emacs.app/Contents/Resources/lisp/org/)

Didn't see the same issue immediately.


Regards, 
-- 
Haider




Re: [O] Get links from Firefox/Safari into orgmode

2014-06-21 Thread Haider Rizvi
Daniel Franke dan...@dfranke.com writes:

 emacs = firefox/safari
That's correct.

 browser = emacs

Probably the best is to use an Applescript like below, and save it in
~/Library/Scripts/Applications/Safari. You can kick off this
Applescript using a variety of methods (Quicksilver, menu bar, etc.)

http://www.tuaw.com/2006/08/08/tuaw-tip-enable-the-applescript-menu/


tell application Safari
set theUrl to URL of document 1
set theName to the name of the document 1
set theOrglink to [[  theUrl  ][  theName  ]]
set the clipboard to theOrglink
end tell

activate application Emacs

-- this last bit is iffy, since Emacs will not always have an org file
--  open in the frame that pops up. 
tell application System Events
keystroke y using control down
end tell

Hope this helps.

Regards, 
-- 
Haider




Re: [O] Get links from Firefox/Safari into orgmode

2014-06-20 Thread Haider Rizvi
Daniel Franke dan...@dfranke.com writes:

 as the subject says, I would like to get links from any browser (i almost 
 don’t care which
 one) into org mode. 

Since you mention Safari, assume you are running on a Mac. Here is what you are 
looking for. 

;;; setup org-mac-link-grabber
(require 'org-mac-link)
(add-hook 'org-mode-hook (lambda () 
  (define-key org-mode-map (kbd C-c g) 'org-mac-grab-link)
  ))


Regards, 
-- 
Haider




Re: [O] Emacs Mac Port

2014-02-13 Thread Haider Rizvi
Alan Schmitt alan.schm...@polytechnique.org writes:

 If you are on a Mac, you *should* start using this:

 https://github.com/railwaycat/emacs-mac-port

 I've been having some serious issues with the vanilla Cocoa Emacs lately
 on Mavericks, including a nasty memory leak that would somehow trigger
 distnoted and put the CPU usage at 100% every hour or so.

Interesting, because with the Emacs (from emacsforosx.com), I have
been hitting 100% cpu problem again and again lately. I had tried out
this port, but I hit 2 issues and put it aside:

- with the same theme (solarized-dark), the background with the
railwaycat port is darker!  minor issue, of course. 
- gnus (when trying to access nntps servers with gnutls) gets
stuck. I'll need to debug that, unless someone has a trick up their
sleeve.

I may just give it a try for my regular work, I run gnus in a
different Emacs, so that can continue to run on the other port.

Regards, 
-- 
Haider




Re: [O] Org-mode and Evernote

2013-10-16 Thread Haider Rizvi
Erik L. Arneson dyb...@lnouv.com writes:

 I've been hacking at it a little on Github and have created an
 org-evernote.el library that has an `org-evernote-pull' command that
 tries to work similarly to `org-mobile-pull'.  It's still a work in
 progress, but I'd love some feedback and contributions.

 My Github repository is located here:
 https://github.com/pymander/evernote-mode

Erik, looks interesting. 

I attempted to give it a whirl, do you want issues / discussion here
or in github.  My first problem seems to be an incomplete defun at
line:2327 of evernote-mode.el.

Regards, 
-- 
Haider




Re: [O] Alfred workflow for org-capture

2013-09-12 Thread Haider Rizvi
Robert P. Goldman rpgold...@sift.info writes:

 Does anyone have a workflow for the Alfred Mac app launcher that will
 interact with org-capture?

If Alfred can trigger an Applescript, I use the following with Quicksilver: 

Applescript: 

property eclient : /Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n 
-e 
do shell script eclient  '(make-orgcapture-frame)'

elisp in init.el or ...: 

(defun make-orgcapture-frame ()  
  Create a new frame and run org-capture.  
  (interactive)  
  (make-frame '((name . remember) (width . 80) (height . 16)
(top . 400) (left . 300)
(font . 
-apple-Monaco-medium-normal-normal-*-13-*-*-*-m-0-iso10646-1)
))
  (select-frame-by-name remember)  
  (org-capture))


Regards, 
-- 
Haider




Re: [O] RFQ - new contribution - org-screenshot.el

2013-05-21 Thread Haider Rizvi
Max Mikhanosha m...@openchat.com writes:

 Hi All,

 I've been writing some documentation in OrgMode with screenshots, and
 as with any screenshot taking, it takes a while to get one just right.

 A few tiny helper utilities, quickly snowballed into this :-) It may
 need some cleanup, but IMHO its too awesome not to share it with the
 list.

 To try it out, you'll need /usr/bin/scrot which is available as
 scrot package on most distributions.

Cool. Can you make this a bit portable. On Mac OSX, the utility is
called screencapture, and can be run with the same flags. Here is a
piece of code that was published earlier with a sample use.

http://thread.gmane.org/gmane.emacs.orgmode/69221/focus=69272

,
| #+BEGIN_SRC emacs-lisp
|   (defun paste-clipboard-to-file (optional filename temp-dir)
| Take a screenshot using the crosshairs and saveit to FILENAME,
| if it is given or to a temp file in the TEMP-DIR
| directory. Then add an orgmode style link at point.
| (interactive)
| (let* ((temporary-file-directory (or temp-dir images))
|(fname (or filename (make-temp-file img nil .jpg
|   (call-process-shell-command (concat 
| /usr/sbin/screencapture -s  fname))
|   (insert \n[[file: fname ]])
|   (org-display-inline-images)))  
|   ;;
|   (global-set-key (kbd C-c p) 'paste-clipboard-to-file)
|   
| #+END_SRC
`

Regards, 
-- 
Haider




Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil

2013-04-04 Thread Haider Rizvi
Bastien b...@altern.org writes:

 Hi François,

 François Pinard pin...@iro.umontreal.ca writes:

 It took me about one hour (my Gnus programming
 is rather rusty) for adding a Gnus command opening many tabs at once, in
 a graphical browser, for all articles I retain in Gnus for reading.

 That looks nice, is your hack public somewhere?

Not exactly the above, but I have the following my-gnus-browse bound
to ; in gnus-summary-mode-map, which opens up a browser with the right
links for gwene, gmane and nnrss groups. I think the browse-nnrss-url
is untouched from the gnus manual.

(defun browse-nnrss-url( arg )
  (interactive p)
  (let ((url (assq nnrss-url-field
   (mail-header-extra
(gnus-data-header
 (assq (gnus-summary-article-number)
   gnus-newsgroup-data))
(if url
(progn
  (browse-url (cdr url))
  (gnus-summary-mark-as-read-forward 1))
  (gnus-summary-scroll-up arg
(add-to-list 'nnmail-extra-headers nnrss-url-field)

(defun rs-gnus-browse-archived-at ()
  Browse \Archived-at\ URL of the current article.
  (interactive)
  (let (url)
(with-current-buffer gnus-original-article-buffer
  (setq url (gnus-fetch-field Archived-at)))
(if (not (stringp url))
(gnus-message 1 No \Archived-at\ header found.)
  (setq url (gnus-replace-in-string url ^\\|$ ))
  (browse-url url

(defun my-gnus-browse (arg)
  (interactive p)
  (cond ((string-match :\\(gwene\\|gmane\\)\\. gnus-newsgroup-name)
 (rs-gnus-browse-archived-at))
((string-match ^nnrss\. gnus-newsgroup-name)
 (browse-nnrss-url arg


Regards, 
-- 
Haider




Re: [O] file link from org-mode file

2012-12-06 Thread Haider Rizvi
ronaldo.merc...@diamond.ac.uk writes:

 It works wonderfully. Are there other magic combinations?

Of course :-) See http://orgmode.org/org.html#External-links for a
comprehensive list.

Also keep in mind the keyboard and mouse shortcuts for opening links,
described immediately below the list.

Regards, 
-- 
Haider